admin add claim

This commit is contained in:
xiaomlove
2022-07-02 15:08:23 +08:00
parent 579351c0eb
commit 5191a1ba9a
48 changed files with 992 additions and 293 deletions
+12
View File
@@ -11,6 +11,8 @@ return [
'exams_list' => 'Exams',
'medals_list' => 'Medals',
'settings' => 'Settings',
'users_medals' => 'User medals',
'claims' => 'User claims',
],
'resources' => [
'agent_allow' => [
@@ -51,6 +53,16 @@ return [
],
'exam_user' => [
'bulk_action_avoid_label' => 'Bulk avoid',
'action_avoid' => 'Avoid',
'result_passed' => 'Passed!',
'result_not_passed' => 'Not passed!',
],
'exam' => [
'index_duplicate' => 'Index:index duplicate !',
],
'hit_and_run' => [
'bulk_action_pardon' => 'Bulk pardon',
'action_pardon' => 'Pardon',
],
]
];
+5
View File
@@ -8,6 +8,11 @@ return [
'index_text_' . \App\Models\Exam::INDEX_SEED_TIME_AVERAGE => 'Seed time average',
'index_text_' . \App\Models\Exam::INDEX_DOWNLOADED => 'Download increment',
'index_text_' . \App\Models\Exam::INDEX_SEED_BONUS => 'Bonus increment',
'filters' => [
\App\Models\Exam::FILTER_USER_CLASS => 'User class',
\App\Models\Exam::FILTER_USER_REGISTER_TIME_RANGE => 'Register time range',
\App\Models\Exam::FILTER_USER_DONATE => 'Donated',
],
'require_value' => 'Require',
'current_value' => 'Current',
'result' => 'Result',
+49
View File
@@ -1,6 +1,30 @@
<?php
return [
'name' => 'Name',
'email' => 'Email',
'image' => 'Image',
'expire_at' => 'Expire at',
'username' => 'User',
'status' => 'Status',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'created_at' => 'Created at',
'updated_at' => 'Updated at',
'begin' => 'Begin time',
'end' => 'End time',
'uploaded' => 'Uploaded',
'downloaded' => 'Downloaded',
'ratio' => 'Share ratio',
'seed_time_required' => 'Seed time required',
'inspect_time_left' => 'Inspect time left',
'added' => 'Add time',
'last_access' => 'Last access time',
'priority' => 'Priority',
'comment' => 'Comment',
'duration' => 'Duration',
'description' => 'Description',
'price' => 'Price',
'setting' => [
'nav_text' => 'Setting',
'backup' => [
@@ -36,6 +60,7 @@ return [
]
],
'user' => [
'label' => 'User',
'uploaded' => 'Uploaded',
'downloaded' => 'Downloaded',
'invites' => 'Invites',
@@ -45,6 +70,9 @@ return [
'status' => 'Status',
'enabled' => 'Enabled',
'username' => 'Username',
'invite_by' => 'Inviter',
'two_step_authentication' => 'Two-step authentication',
'seed_points' => 'Seed points',
],
'medal' => [
'label' => 'Medal',
@@ -65,9 +93,24 @@ return [
'donated' => 'Donated',
'index_formatted' => 'Exam indexes',
'filter_formatted' => 'Target users',
'section_base_info' => 'Base info',
'priority_help' => 'The higher the value, the higher the priority, and when multiple exam match the same user, the one with the highest priority is assigned.',
'section_time' => 'Time',
'duration_help' => 'Unit: days. When assign to user, begin and end are used if they are specified. Otherwise begin time is the time at assignment, and the end time is the time at assignment plus the duration.',
'section_target_user' => 'Target user',
'index_required_value' => 'Require value',
'index_required_label' => 'Index',
'index_placeholder' => 'Upload/Download increment in GB and seed time average in hour',
'index_current_value' => 'Current value',
'index_result' => 'Result',
],
'exam_user' => [
'is_done' => 'Is done',
],
'torrent' => [
'label' => 'Torrent',
'size' => 'Size',
'ttl' => 'TTL',
],
'hit_and_run' => [
@@ -98,4 +141,10 @@ return [
'peer_id' => 'Peer ID',
'agent' => 'Agent',
],
'claim' => [
'last_settle_at' => 'Last settle at',
'seed_time_this_month' => 'St. this month',
'uploaded_this_month' => 'Up. this month',
'is_reached_this_month' => 'Reached',
],
];
+12 -1
View File
@@ -11,7 +11,8 @@ return [
'exams_list' => '考核',
'medals_list' => '勋章',
'settings' => '设置',
'users_medal' => '用户勋章',
'users_medals' => '用户勋章',
'claims' => '用户认领',
],
'resources' => [
'agent_allow' => [
@@ -52,6 +53,16 @@ return [
],
'exam_user' => [
'bulk_action_avoid_label' => '批量免除',
'action_avoid' => '免除',
'result_passed' => '通过!',
'result_not_passed' => '未通过!',
],
'exam' => [
'index_duplicate' => '指标::index 重复!',
],
'hit_and_run' => [
'bulk_action_pardon' => '批量免罪',
'action_pardon' => '免罪',
],
]
];
+5
View File
@@ -8,6 +8,11 @@ return [
'index_text_' . \App\Models\Exam::INDEX_SEED_TIME_AVERAGE => '平均做种时间',
'index_text_' . \App\Models\Exam::INDEX_DOWNLOADED => '下载增量',
'index_text_' . \App\Models\Exam::INDEX_SEED_BONUS => '魔力增量',
'filters' => [
\App\Models\Exam::FILTER_USER_CLASS => '用户等级',
\App\Models\Exam::FILTER_USER_REGISTER_TIME_RANGE => '注册时间范围',
\App\Models\Exam::FILTER_USER_DONATE => '是否捐赠',
],
'require_value' => '要求',
'current_value' => '当前',
'result' => '结果',
+27 -1
View File
@@ -7,6 +7,8 @@ return [
'expire_at' => '过期时间',
'username' => '用户',
'status' => '状态',
'enabled' => '启用',
'disabled' => '禁用',
'created_at' => '创建时间',
'updated_at' => '更新时间',
'begin' => '开始时间',
@@ -58,6 +60,7 @@ return [
]
],
'user' => [
'label' => '用户',
'uploaded' => '上传量',
'downloaded' => '下载量',
'invites' => '邀请',
@@ -67,6 +70,9 @@ return [
'status' => '状态',
'enabled' => '启用',
'username' => '用户名',
'invite_by' => '邀请人',
'two_step_authentication' => '两步验证',
'seed_points' => '做种积分',
],
'medal' => [
'label' => '勋章',
@@ -78,7 +84,6 @@ return [
],
'exam' => [
'label' => '考核',
'is_done' => '是否完成',
'is_discovered' => '自动发现',
'register_time_range' => [
'begin' => '注册时间开始',
@@ -87,9 +92,24 @@ return [
'donated' => '是否捐赠',
'index_formatted' => '考核指标',
'filter_formatted' => '目标用户',
'section_base_info' => '基本信息',
'priority_help' => '值越大,优先级越高。当用户匹配多个考核时,优先级高的优先分配。',
'section_time' => '时间',
'duration_help' => '单位:天。分配给用户时,如果指定了开始/结束时间,用户考核的时间范围就是这个范围。否则,用户考核的开始时间是分配时间,结束时间是开始时间加上时长。',
'section_target_user' => '目标用户',
'index_required_value' => '要求量',
'index_required_label' => '指标',
'index_placeholder' => '上传增量/下载增量单位为:GB,平均做种时间单位为:小时',
'index_current_value' => '当前量',
'index_result' => '结果',
],
'exam_user' => [
'is_done' => '是否完成',
],
'torrent' => [
'label' => '种子',
'size' => '体积',
'ttl' => '存活时间',
],
'hit_and_run' => [
@@ -120,4 +140,10 @@ return [
'peer_id' => 'Peer ID',
'agent' => 'Agent',
],
'claim' => [
'last_settle_at' => '上次结算时间',
'seed_time_this_month' => '本月做种时间',
'uploaded_this_month' => '本月上传量',
'is_reached_this_month' => '本月是否达标',
],
];
+12 -1
View File
@@ -11,7 +11,8 @@ return [
'exams_list' => '考核',
'medals_list' => '勛章',
'settings' => '設置',
'users_medal' => '用戶勛章',
'users_medals' => '用戶勛章',
'claims' => '用戶認領',
],
'resources' => [
'agent_allow' => [
@@ -52,6 +53,16 @@ return [
],
'exam_user' => [
'bulk_action_avoid_label' => '批量免除',
'action_avoid' => '免除',
'result_passed' => '通過!',
'result_not_passed' => '未通過!',
],
'exam' => [
'index_duplicate' => '指標::index 重復!',
],
'hit_and_run' => [
'bulk_action_pardon' => '批量免罪',
'action_pardon' => '免罪',
],
]
];
+5
View File
@@ -8,6 +8,11 @@ return [
'index_text_' . \App\Models\Exam::INDEX_SEED_TIME_AVERAGE => '平均做種時間',
'index_text_' . \App\Models\Exam::INDEX_DOWNLOADED => '下載增量',
'index_text_' . \App\Models\Exam::INDEX_SEED_BONUS => '魔力增量',
'filters' => [
\App\Models\Exam::FILTER_USER_CLASS => '用戶等級',
\App\Models\Exam::FILTER_USER_REGISTER_TIME_RANGE => '註冊時間範圍',
\App\Models\Exam::FILTER_USER_DONATE => '是否捐贈',
],
'require_value' => '要求',
'current_value' => '當前',
'result' => '結果',
+27
View File
@@ -7,6 +7,8 @@ return [
'expire_at' => '過期時間',
'username' => '用戶',
'status' => '狀態',
'enabled' => '啟用',
'disabled' => '禁用',
'created_at' => '創建時間',
'updated_at' => '更新時間',
'begin' => '開始時間',
@@ -58,6 +60,7 @@ return [
]
],
'user' => [
'label' => '用戶',
'uploaded' => '上傳量',
'downloaded' => '下載量',
'invites' => '邀請',
@@ -67,6 +70,9 @@ return [
'status' => '狀態',
'enabled' => '啟用',
'username' => '用戶名',
'invite_by' => '邀請人',
'two_step_authentication' => '兩步驗證',
'seed_points' => '做種積分',
],
'medal' => [
'label' => '勛章',
@@ -87,9 +93,24 @@ return [
'donated' => '是否捐贈',
'index_formatted' => '考核指標',
'filter_formatted' => '目標用戶',
'section_base_info' => '基本信息',
'priority_help' => '值越大,優先級越高。當用戶匹配多個考核時,優先級高的優先分配。',
'section_time' => '時間',
'duration_help' => '單位:天。分配給用戶時,如果指定了開始/結束時間,用戶考核的時間範圍就是這個範圍。否則,用戶考核的開始時間是分配時間,結束時間是開始時間加上時長。',
'section_target_user' => '目標用戶',
'index_required_value' => '要求量',
'index_required_label' => '指標',
'index_placeholder' => '上傳增量/下載增量單位為:GB,平均做種時間單位為:小時',
'index_current_value' => '當前量',
'index_result' => '結果',
],
'exam_user' => [
'is_done' => '是否完成',
],
'torrent' => [
'label' => '種子',
'size' => '體積',
'ttl' => '存活時間',
],
'hit_and_run' => [
@@ -120,4 +141,10 @@ return [
'peer_id' => 'Peer ID',
'agent' => 'Agent',
],
'claim' => [
'last_settle_at' => '上次結算時間',
'seed_time_this_month' => '本月做種時間',
'uploaded_this_month' => '本月上傳量',
'is_reached_this_month' => '本月是否達標',
],
];
@@ -0,0 +1,20 @@
<x-filament::page :widget-data="['record' => $record]" class="filament-resources-view-record-page">
<div class="">
<table class="table table-fixed text-left border-spacing-y-2 border-collapse divide-y w-full">
<tbody>
@foreach($cardData as $value)
<tr class="">
<th class="border-spacing-3">{{ $value['label'] }}</th>
<td class="border-spacing-3">{!! $value['value'] !!}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@if (count($relationManagers = $this->getRelationManagers()))
<x-filament::hr />
<x-filament::resources.relation-managers :active-manager="$activeRelationManager" :managers="$relationManagers" :owner-record="$record" />
@endif
</x-filament::page>
@@ -0,0 +1,40 @@
<x-filament::page :widget-data="['record' => $record]" class="filament-resources-view-record-page">
<div class="flex flex-col md:flex-row justify-between">
<table class="table text-left border-spacing-y-2 border-collapse divide-y w-full">
<tbody>
@foreach($cardData as $value)
<tr class="">
<th class="border-spacing-3">{{ $value['label'] }}</th>
<td class="border-spacing-3">{!! $value['value'] !!}</td>
</tr>
@endforeach
</tbody>
</table>
<table class="table text-left border-spacing-y-2 border-collapse divide-y w-full">
<thead>
<tr>
<th>{{ __('label.exam.index_required_label') }}</th>
<th>{{ __('label.exam.index_required_value') }}</th>
<th>{{ __('label.exam.index_current_value') }}</th>
<th>{{ __('label.exam.index_result') }}</th>
</tr>
</thead>
<tbody>
@foreach($record->progressFormatted as $index)
<tr>
<td>{{ $index['index_formatted'] }}</td>
<td>{{ $index['require_value_formatted'] }}</td>
<td>{{ $index['current_value_formatted'] }}</td>
<td>{{ $index['passed'] ? __('admin.resources.exam_user.result_passed') : __('admin.resources.exam_user.result_not_passed') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@if (count($relationManagers = $this->getRelationManagers()))
<x-filament::hr />
<x-filament::resources.relation-managers :active-manager="$activeRelationManager" :managers="$relationManagers" :owner-record="$record" />
@endif
</x-filament::page>
@@ -1,95 +1,89 @@
<x-filament::page>
<div class="flex">
<div class="w-full">
<table class="table w-full text-left border-spacing-y-2 border-collapse divide-y">
<tbody>
<tr>
<th>UID</th>
<td>{{$record->id}}</td>
<td></td>
</tr>
<tr>
<th>Username</th>
<td>{{$record->username}}</td>
<td></td>
</tr>
<tr>
<th>Email</th>
<td>{{$record->email}}</td>
<td></td>
</tr>
<tr>
<th>Status</th>
<td>{{$record->status}}</td>
<td></td>
</tr>
<tr>
<th>Enabled</th>
<td>{{$record->enabled}}</td>
<td></td>
</tr>
<tr>
<th>Added</th>
<td>{{$record->added}}</td>
<td></td>
</tr>
<tr>
<th>Last access</th>
<td>{{$record->last_access}}</td>
<td></td>
</tr>
<tr>
<th>Class</th>
<td>{{$record->classText}}</td>
<td></td>
</tr>
<tr>
<th>Invite by</th>
<td>{{$record->inviter->username ?? ''}}</td>
<td></td>
</tr>
<tr>
<th>Tow-step authentication</th>
<td>{{$record->two_step_secret ? 'Enabled' : 'Disabled'}}</td>
<td></td>
</tr>
<tr>
<th>Seed points</th>
<td>{{$record->seed_points}}</td>
<td></td>
</tr>
<tr>
<th>Attendance card</th>
<td>{{$record->attendance_card}}</td>
<td></td>
</tr>
<tr>
<th>Invites</th>
<td>{{$record->invites}}</td>
<td></td>
</tr>
<tr>
<th>Uploaded</th>
<td>{{$record->uploadedText}}</td>
<td></td>
</tr>
<tr>
<th>Downloaded</th>
<td>{{$record->downloadedText}}</td>
<td></td>
</tr>
<tr>
<th>Bonus</th>
<td>{{$record->seedbonus}}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="w-full">
</div>
<table class="table w-full text-left border-spacing-y-2 border-collapse divide-y w-full">
<tbody>
<tr>
<th>UID</th>
<td>{{$record->id}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.user.username')}}</th>
<td>{{$record->username}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.email')}}</th>
<td>{{$record->email}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.status')}}</th>
<td>{{$record->status}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.enabled')}}</th>
<td>{{$record->enabled}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.added')}}</th>
<td>{{$record->added}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.last_access')}}</th>
<td>{{$record->last_access}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.user.class')}}</th>
<td>{{$record->classText}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.user.invite_by')}}</th>
<td>{{$record->inviter->username ?? ''}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.user.two_step_authentication')}}</th>
<td>{{$record->two_step_secret ? 'Enabled' : 'Disabled'}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.user.seed_points')}}</th>
<td>{{$record->seed_points}}</td>
<td></td>
</tr>
<tr>
<th>{{ __('label.user.attendance_card') }}</th>
<td>{{$record->attendance_card}}</td>
<td></td>
</tr>
<tr>
<th>{{ __('label.user.invites') }}</th>
<td>{{$record->invites}}</td>
<td></td>
</tr>
<tr>
<th>{{ __('label.uploaded') }}</th>
<td>{{$record->uploadedText}}</td>
<td></td>
</tr>
<tr>
<th>{{ __('label.downloaded') }}</th>
<td>{{$record->downloadedText}}</td>
<td></td>
</tr>
<tr>
<th>{{ __('label.user.seedbonus') }}</th>
<td>{{$record->seedbonus}}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
@if (count($relationManagers = $this->getRelationManagers()))