improve filament trans + user profile actions

This commit is contained in:
xiaomlove
2022-06-30 21:08:25 +08:00
parent 459d7462de
commit 579351c0eb
27 changed files with 966 additions and 178 deletions

View File

@@ -12,4 +12,45 @@ return [
'medals_list' => 'Medals',
'settings' => 'Settings',
],
'resources' => [
'agent_allow' => [
'check_modal_btn' => 'Check',
'check_modal_header' => 'Detect if the client is allowed',
'check_pass_msg' => 'Congratulations, this client was passed by rule :id!',
],
'user' => [
'actions' => [
'enable_modal_btn' => 'Enable',
'enable_modal_title' => 'Enable user',
'enable_disable_reason' => 'Reason',
'enable_disable_reason_placeholder' => 'Optional',
'disable_modal_btn' => 'Disable',
'disable_modal_title' => 'Disable user',
'disable_two_step_authentication' => 'Cancel two-step authentication',
'change_bonus_etc_btn' => 'Change Uploaded etc.',
'change_bonus_etc_action_increment' => 'Increment',
'change_bonus_etc_action_decrement' => 'Decrement',
'change_bonus_etc_field_label' => 'Field',
'change_bonus_etc_action_label' => 'Action',
'change_bonus_etc_value_label' => 'Value',
'change_bonus_etc_value_help' => 'If the type is Uploaded/Download, the unit is: GB',
'change_bonus_etc_reason_label' => 'Reason',
'reset_password_btn' => 'Reset password',
'reset_password_label' => 'New password',
'reset_password_confirmation_label' => 'Confirm new password',
'assign_exam_btn' => 'Assign exam',
'assign_exam_exam_label' => 'Select exam',
'assign_exam_begin_label' => 'Begin time',
'assign_exam_end_label' => 'End time',
'assign_exam_end_help' => 'If you do not specify a begin/end time, the time range set by the exam itself will be used',
'grant_medal_btn' => 'Grant medal',
'grant_medal_medal_label' => 'Select medal',
'grant_medal_duration_label' => 'Duration',
'grant_medal_duration_help' => 'Unit: days. If left blank, the user has permanent possession',
]
],
'exam_user' => [
'bulk_action_avoid_label' => 'Bulk avoid',
],
]
];

View File

@@ -36,6 +36,66 @@ return [
]
],
'user' => [
'uploaded' => 'Uploaded',
'downloaded' => 'Downloaded',
'invites' => 'Invites',
'seedbonus' => 'Bonus',
'attendance_card' => 'Attendance ard',
'class' => 'Class',
'status' => 'Status',
'enabled' => 'Enabled',
'username' => 'Username',
],
'medal' => [
'label' => 'Medal',
'image_large' => 'Image large',
'image_small' => 'Image small',
'get_type' => 'Get type',
'duration' => 'Duration',
'duration_help' => 'Unit: days. If left blank, the user has permanent possession',
],
'exam' => [
'label' => 'Exam',
'is_done' => 'Is done',
'is_discovered' => 'Discovered',
'register_time_range' => [
'begin' => 'Register time begin',
'end' => 'Register time end',
],
'donated' => 'Donated',
'index_formatted' => 'Exam indexes',
'filter_formatted' => 'Target users',
],
'torrent' => [
'label' => 'Torrent',
],
'hit_and_run' => [
]
],
'tag' => [
'color' => 'Background color',
'font_color' => 'Font color',
'font_size' => 'Font size',
'margin' => 'Margin',
'padding' => 'Padding',
'border_radius' => 'Border radius',
],
'agent_allow' => [
'family' => 'Family',
'start_name' => 'Start name',
'peer_id_start' => 'Peer ID start',
'peer_id_pattern' => 'Peer ID pattern',
'peer_id_matchtype' => 'Peer ID match type',
'peer_id_match_num' => 'Peer ID match num',
'agent_start' => 'Agent start',
'agent_pattern' => 'Agent pattern',
'agent_matchtype' => 'Agent match type',
'agent_match_num' => 'Agent match num',
'exception' => 'Exception',
'allowhttps' => 'Allow https',
],
'agent_deny' => [
'peer_id' => 'Peer ID',
'agent' => 'Agent',
],
];

View File

@@ -11,5 +11,47 @@ return [
'exams_list' => '考核',
'medals_list' => '勋章',
'settings' => '设置',
'users_medal' => '用户勋章',
],
'resources' => [
'agent_allow' => [
'check_modal_btn' => '检测',
'check_modal_header' => '检测客户端是否被允许',
'check_pass_msg' => '恭喜,此客户端被规则 :id 通过!',
],
'user' => [
'actions' => [
'enable_modal_btn' => '启用',
'enable_modal_title' => '启用用户',
'enable_disable_reason' => '原因',
'enable_disable_reason_placeholder' => '可选',
'disable_modal_btn' => '禁用',
'disable_modal_title' => '禁用用户',
'disable_two_step_authentication' => '取消两步登录验证',
'change_bonus_etc_btn' => '修改上传量等',
'change_bonus_etc_action_increment' => '增加',
'change_bonus_etc_action_decrement' => '减少',
'change_bonus_etc_field_label' => '类别',
'change_bonus_etc_action_label' => '动作',
'change_bonus_etc_value_label' => '数量',
'change_bonus_etc_value_help' => '如果类别是上传量/下载量单位为GB',
'change_bonus_etc_reason_label' => '原因',
'reset_password_btn' => '重置密码',
'reset_password_label' => '新密码',
'reset_password_confirmation_label' => '确认新密码',
'assign_exam_btn' => '分配考核',
'assign_exam_exam_label' => '选择考核',
'assign_exam_begin_label' => '开始时间',
'assign_exam_end_label' => '结束时间',
'assign_exam_end_help' => '如果不指定开始/结束时间,将使用考核本身设定的时间范围',
'grant_medal_btn' => '授予勋章',
'grant_medal_medal_label' => '选择勋章',
'grant_medal_duration_label' => '有效时长',
'grant_medal_duration_help' => '单位:天。如果留空,用户永久拥有',
]
],
'exam_user' => [
'bulk_action_avoid_label' => '批量免除',
],
]
];

View File

@@ -1,6 +1,28 @@
<?php
return [
'name' => '名称',
'email' => '邮箱',
'image' => '图片',
'expire_at' => '过期时间',
'username' => '用户',
'status' => '状态',
'created_at' => '创建时间',
'updated_at' => '更新时间',
'begin' => '开始时间',
'end' => '结束时间',
'uploaded' => '上传量',
'downloaded' => '下载量',
'ratio' => '分享率',
'seed_time_required' => '还需做种时间',
'inspect_time_left' => '考察剩余时间',
'added' => '添加时间',
'last_access' => '最后访问时间',
'priority' => '优先级',
'comment' => '备注',
'duration' => '时长',
'description' => '描述',
'price' => '价格',
'setting' => [
'nav_text' => '设置',
'backup' => [
@@ -36,6 +58,66 @@ return [
]
],
'user' => [
'uploaded' => '上传量',
'downloaded' => '下载量',
'invites' => '邀请',
'seedbonus' => '魔力',
'attendance_card' => '补签卡',
'class' => '等级',
'status' => '状态',
'enabled' => '启用',
'username' => '用户名',
],
'medal' => [
'label' => '勋章',
'image_large' => '大图',
'image_small' => '小图',
'get_type' => '获取方式',
'duration' => '有效时长',
'duration_help' => '单位:天。如果留空,用户永久拥有',
],
'exam' => [
'label' => '考核',
'is_done' => '是否完成',
'is_discovered' => '自动发现',
'register_time_range' => [
'begin' => '注册时间开始',
'end' => '注册时间结束',
],
'donated' => '是否捐赠',
'index_formatted' => '考核指标',
'filter_formatted' => '目标用户',
],
'torrent' => [
'label' => '种子',
],
'hit_and_run' => [
]
],
'tag' => [
'color' => '背景颜色',
'font_color' => '字体颜色',
'font_size' => '字体大小',
'margin' => '外边距',
'padding' => '内边距',
'border_radius' => '边框圆角',
],
'agent_allow' => [
'family' => '系列',
'start_name' => '起始名称',
'peer_id_start' => 'Peer ID 超始',
'peer_id_pattern' => 'Peer ID 正则',
'peer_id_matchtype' => 'Peer ID 匹配类型',
'peer_id_match_num' => 'Peer ID 匹配次数',
'agent_start' => 'Agent 起始',
'agent_pattern' => 'Agent 正则',
'agent_matchtype' => 'Agent 匹配类型',
'agent_match_num' => 'Agent 匹配次数',
'exception' => '排除',
'allowhttps' => '允许 https',
],
'agent_deny' => [
'peer_id' => 'Peer ID',
'agent' => 'Agent',
],
];

View File

@@ -11,5 +11,47 @@ return [
'exams_list' => '考核',
'medals_list' => '勛章',
'settings' => '設置',
'users_medal' => '用戶勛章',
],
'resources' => [
'agent_allow' => [
'check_modal_btn' => '檢測',
'check_modal_header' => '檢測客戶端是否被允許',
'check_pass_msg' => '恭喜,此客戶端被規則 :id 通過!',
],
'user' => [
'actions' => [
'enable_modal_btn' => '啟用',
'enable_modal_title' => '啟用用戶',
'enable_disable_reason' => '原因',
'enable_disable_reason_placeholder' => '可選',
'disable_modal_btn' => '禁用',
'disable_modal_title' => '禁用用戶',
'disable_two_step_authentication' => '取消兩步登錄驗證',
'change_bonus_etc_btn' => '修改上傳量等',
'change_bonus_etc_action_increment' => '增加',
'change_bonus_etc_action_decrement' => '減少',
'change_bonus_etc_field_label' => '類別',
'change_bonus_etc_action_label' => '動作',
'change_bonus_etc_value_label' => '數量',
'change_bonus_etc_value_help' => '如果類別是上傳量/下載量單位為GB',
'change_bonus_etc_reason_label' => '原因',
'reset_password_btn' => '重置密碼',
'reset_password_label' => '新密碼',
'reset_password_confirmation_label' => '確認新密碼',
'assign_exam_btn' => '分配考核',
'assign_exam_exam_label' => '選擇考核',
'assign_exam_begin_label' => '開始時間',
'assign_exam_end_label' => '結束時間',
'assign_exam_end_help' => '如果不指定開始/結束時間,將使用考核本身設定的時間範圍',
'grant_medal_btn' => '授予勛章',
'grant_medal_medal_label' => '選擇勛章',
'grant_medal_duration_label' => '有效時長',
'grant_medal_duration_help' => '單位:天。如果留空,用戶永久擁有',
]
],
'exam_user' => [
'bulk_action_avoid_label' => '批量免除',
],
]
];

View File

@@ -1,6 +1,28 @@
<?php
return [
'name' => '名稱',
'email' => '郵箱',
'image' => '圖片',
'expire_at' => '過期時間',
'username' => '用戶',
'status' => '狀態',
'created_at' => '創建時間',
'updated_at' => '更新時間',
'begin' => '開始時間',
'end' => '結束時間',
'uploaded' => '上傳量',
'downloaded' => '下載量',
'ratio' => '分享率',
'seed_time_required' => '還需做種時間',
'inspect_time_left' => '考察剩余時間',
'added' => '添加時間',
'last_access' => '最後訪問時間',
'priority' => '優先級',
'comment' => '備註',
'duration' => '時長',
'description' => '描述',
'price' => '價格',
'setting' => [
'nav_text' => '設置',
'backup' => [
@@ -36,6 +58,66 @@ return [
]
],
'user' => [
'uploaded' => '上傳量',
'downloaded' => '下載量',
'invites' => '邀請',
'seedbonus' => '魔力',
'attendance_card' => '補簽卡',
'class' => '等級',
'status' => '狀態',
'enabled' => '啟用',
'username' => '用戶名',
],
'medal' => [
'label' => '勛章',
'image_large' => '大圖',
'image_small' => '小圖',
'get_type' => '獲取方式',
'duration' => '有效時長',
'duration_help' => '單位:天。如果留空,用戶永久擁有',
],
'exam' => [
'label' => '考核',
'is_done' => '是否完成',
'is_discovered' => '自動發現',
'register_time_range' => [
'begin' => '註冊時間開始',
'end' => '註冊時間結束',
],
'donated' => '是否捐贈',
'index_formatted' => '考核指標',
'filter_formatted' => '目標用戶',
],
'torrent' => [
'label' => '種子',
],
'hit_and_run' => [
]
],
'tag' => [
'color' => '背景顏色',
'font_color' => '字體顏色',
'font_size' => '字體大小',
'margin' => '外邊距',
'padding' => '內邊距',
'border_radius' => '邊框圓角',
],
'agent_allow' => [
'family' => '系列',
'start_name' => '起始名稱',
'peer_id_start' => 'Peer ID 超始',
'peer_id_pattern' => 'Peer ID 正則',
'peer_id_matchtype' => 'Peer ID 匹配類型',
'peer_id_match_num' => 'Peer ID 匹配次數',
'agent_start' => 'Agent 起始',
'agent_pattern' => 'Agent 正則',
'agent_matchtype' => 'Agent 匹配類型',
'agent_match_num' => 'Agent 匹配次數',
'exception' => '排除',
'allowhttps' => '允許 https',
],
'agent_deny' => [
'peer_id' => 'Peer ID',
'agent' => 'Agent',
],
];

View File

@@ -5,83 +5,83 @@
<tbody>
<tr>
<th>UID</th>
<td>{{$user->id}}</td>
<td>{{$record->id}}</td>
<td></td>
</tr>
<tr>
<th>Username</th>
<td>{{$user->username}}</td>
<td>{{$record->username}}</td>
<td></td>
</tr>
<tr>
<th>Email</th>
<td>{{$user->email}}</td>
<td>{{$record->email}}</td>
<td></td>
</tr>
<tr>
<th>Status</th>
<td>{{$user->status}}</td>
<td>{{$record->status}}</td>
<td></td>
</tr>
<tr>
<th>Enabled</th>
<td>{{$user->enabled}}</td>
<td><button class="border px-1 rounded">Disable</button></td>
<td>{{$record->enabled}}</td>
<td></td>
</tr>
<tr>
<th>Added</th>
<td>{{$user->added}}</td>
<td>{{$record->added}}</td>
<td></td>
</tr>
<tr>
<th>Last access</th>
<td>{{$user->last_access}}</td>
<td>{{$record->last_access}}</td>
<td></td>
</tr>
<tr>
<th>Class</th>
<td>{{$user->classText}}</td>
<td>{{$record->classText}}</td>
<td></td>
</tr>
<tr>
<th>Invite by</th>
<td>{{$user->inviter->username ?? ''}}</td>
<td><button class="border px-1 rounded">View</button></td>
<td>{{$record->inviter->username ?? ''}}</td>
<td></td>
</tr>
<tr>
<th>Tow-step authentication</th>
<td>{{$user->two_step_secret ? 'Enabled' : 'Disabled'}}</td>
<td><button class="border px-1 rounded">Disable</button></td>
<td>{{$record->two_step_secret ? 'Enabled' : 'Disabled'}}</td>
<td></td>
</tr>
<tr>
<th>Seed points</th>
<td>{{$user->seed_points}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->seed_points}}</td>
<td></td>
</tr>
<tr>
<th>Attendance card</th>
<td>{{$user->attendance_card}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->attendance_card}}</td>
<td></td>
</tr>
<tr>
<th>Invites</th>
<td>{{$user->invites}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->invites}}</td>
<td></td>
</tr>
<tr>
<th>Uploaded</th>
<td>{{$user->uploadedText}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->uploadedText}}</td>
<td></td>
</tr>
<tr>
<th>Downloaded</th>
<td>{{$user->downloadedText}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->downloadedText}}</td>
<td></td>
</tr>
<tr>
<th>Bonus</th>
<td>{{$user->seedbonus}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->seedbonus}}</td>
<td></td>
</tr>
</tbody>
</table>
@@ -91,4 +91,10 @@
</div>
</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>

View File

@@ -1,40 +1,36 @@
<x-filament::widget>
<x-filament::card>
<div class="p-2 space-y-2 bg-white rounded-xl shadow">
<div class="space-y-2">
<div class="px-4 py-2 space-y-4">
<div class="flex items-center justify-between gap-8">
<h2 class="text-xl font-semibold tracking-tight filament-card-heading">
{{$header}}
</h2>
</div>
<div aria-hidden="true" class="border-t filament-hr"></div>
<div>
<table class="w-full text-left rtl:text-right divide-y table-auto filament-tables-table">
<tbody class="divide-y whitespace-nowrap">
@foreach(array_chunk($data, 2) as $chunk)
<tr class="filament-tables-row">
@foreach($chunk as $item)
<th class="filament-tables-cell"><div class="px-4 py-3 filament-tables-text-column">{{$item['text']}}</div></th>
<td class="filament-tables-cell"
@if($loop->count == 1)
colspan="3"
@endif
>
<div class="px-4 py-3 filament-tables-text-column">{{$item['value']}}</div>
</td>
@endforeach
</tr>
<x-filament::widget class="filament-widgets-table-widget">
<div class="p-2 space-y-2 bg-white rounded-xl shadow">
<div class="space-y-2">
<div class="px-4 py-2 space-y-4">
<div class="flex items-center justify-between gap-8">
<h2 class="text-xl font-semibold tracking-tight filament-card-heading">
{{$header}}
</h2>
</div>
<div aria-hidden="true" class="border-t filament-hr"></div>
<div class="overflow-y-auto relative">
<table class="w-full text-left rtl:text-right divide-y table-auto filament-tables-table">
<tbody class="divide-y whitespace-nowrap">
@foreach(array_chunk($data, 2) as $chunk)
<tr class="filament-tables-row">
@foreach($chunk as $item)
<th class="filament-tables-cell"><div class="px-4 py-3 filament-tables-text-column">{{$item['text']}}</div></th>
<td class="filament-tables-cell"
@if($loop->count == 1)
colspan="3"
@endif
>
<div class="px-4 py-3 filament-tables-text-column">{{$item['value']}}</div>
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
</tbody>
</table>
</div>
</div>
</div>
</div>
</x-filament::card>
</div>
</x-filament::widget>