improve admin user profile + image hosting

This commit is contained in:
xiaomlove
2024-12-29 22:16:41 +08:00
parent f146a654c2
commit 5a9f1f1017
40 changed files with 22110 additions and 456 deletions
+9
View File
@@ -40,6 +40,7 @@ return [
'city' => 'City',
'client' => 'Client',
'reason' => 'Reason',
'change' => 'Change',
'setting' => [
'nav_text' => 'Setting',
'backup' => [
@@ -111,6 +112,14 @@ return [
'alarm_email_receiver' => 'Alarm email receiver',
'alarm_email_receiver_help' => "Fill in the UID of the user, separated by space, and the alarm email will be sent to the corresponding user's email address. If you don't fill it in, it will be written to the runtime log, and the log level will be error",
],
'image_hosting' => [
'driver' => 'Storage location',
'driver_help' => 'If you choose local, the default is to save it locally on the server where the website is located, otherwise upload it to the corresponding image server',
'tab_header' => 'Image hosting',
'upload_api_endpoint' => 'Upload interface address',
'base_url' => 'Image URL prefix',
'upload_token' => 'Upload token',
]
],
'user' => [
'label' => 'User',
+9
View File
@@ -40,6 +40,7 @@ return [
'city' => '城市',
'client' => '客户端',
'reason' => '原因',
'change' => '修改',
'setting' => [
'nav_text' => '设置',
'backup' => [
@@ -111,6 +112,14 @@ return [
'alarm_email_receiver' => '告警邮件接收者',
'alarm_email_receiver_help' => '填写用户 UID,多个空格隔开,系统异常告警邮件将会发到对应用户的邮箱。如果不填会写到运行日志中,日志级别为 error',
],
'image_hosting' => [
'driver' => '存储位置',
'driver_help' => '若选择 local, 对应默认的保存在网站所在服务器本地, 否则上传到对应的图片服务器',
'tab_header' => '图床',
'upload_api_endpoint' => '上传接口地址',
'base_url' => '图片 URL 前缀',
'upload_token' => '上传令牌',
]
],
'user' => [
'label' => '用户',
+9
View File
@@ -40,6 +40,7 @@ return [
'city' => '城市',
'client' => '客戶端',
'reason' => '原因',
'change' => '修改',
'setting' => [
'nav_text' => '設置',
'backup' => [
@@ -111,6 +112,14 @@ return [
'alarm_email_receiver' => '告警郵件接收者',
'alarm_email_receiver_help' => '填寫用戶 UID,多個空格隔開,系統異常告警郵件將會發到對應用戶的郵箱。如果不填會寫到運行日誌中,日誌級別為 error',
],
'image_hosting' => [
'driver' => '存儲位置',
'driver_help' => '若選擇 local, 對應默認的保存在網站所在服務器本地, 否則上傳到對應的圖片服務器',
'tab_header' => '圖床',
'upload_api_endpoint' => '上傳接口地址',
'base_url' => '圖片 URL 前綴',
'upload_token' => '上傳令牌',
]
],
'user' => [
'label' => '用戶',
@@ -3,7 +3,7 @@
{{ $this->form }}
<div class="flex justify-center mt-10" style="margin-top: 20px;">
<button type="submit" class="inline-flex items-center justify-center gap-1 font-medium rounded-lg border transition-colors focus:outline-none focus:ring-offset-2 focus:ring-2 focus:ring-inset filament-button h-9 px-4 text-sm text-white shadow focus:ring-white border-transparent bg-primary-600 hover:bg-primary-500 focus:bg-primary-700 focus:ring-offset-primary-700 filament-page-button-action">
{{__('filament::resources/pages/edit-record.form.actions.save.label')}}
{{__('filament-actions::edit.single.modal.actions.save.label')}}
</button>
</div>
</form>
@@ -1,16 +1,21 @@
<x-filament::widget>
<x-filament::card>
@php
$user = \Filament\Facades\Filament::auth()->user();
@endphp
@php
$user = filament()->auth()->user();
@endphp
<div class="h-12 flex items-center space-x-4 rtl:space-x-reverse">
<div>
<h2 class="text-lg sm:text-xl font-bold tracking-tight">
{{ __('filament::widgets/account-widget.welcome', ['user' => \Filament\Facades\Filament::getUserName($user) . '(' . $user->classText . ')']) }}
<x-filament-widgets::widget class="fi-account-widget">
<x-filament::section>
<div class="flex items-center gap-x-3">
<div class="flex-1">
<h2
class="grid flex-1 text-base font-semibold leading-6 text-gray-950 dark:text-white"
>
{{ __('filament-panels::widgets/account-widget.welcome', ['app' => config('app.name')]) }},
{{ filament()->getUserName($user) . '(' . $user->classText . ')' }}
</h2>
</div>
</div>
</x-filament::card>
</x-filament::widget>
</x-filament::section>
</x-filament-widgets::widget>
@@ -1,36 +1,36 @@
<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"
<x-filament-widgets::widget class="fi-wi-table">
<div class="filament-widgets-card rounded-lg border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 shadow-sm p-6">
<!-- Header Section -->
<div class="fi-ta-header flex flex-col gap-3 p-4 sm:px-6 sm:flex-row sm:items-center">
<div class="grid gap-y-1">
<h3 class="fi-ta-header-heading text-base font-semibold leading-6 text-gray-950 dark:text-white">
{{ $header }}
</h3>
</div>
</div>
<!-- Table Section -->
<div class="fi-ta-content border-t relative divide-y divide-gray-200 overflow-x-auto dark:divide-white/10 dark:border-t-white/10">
<table class="fi-ta-table w-full table-auto divide-y divide-gray-200 text-start dark:divide-white/5">
<tbody class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
@foreach(array_chunk($data, 2) as $chunk)
<tr class="bg-white dark:bg-gray-800">
@foreach($chunk as $item)
<th class="fi-ta-header-cell px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 fi-table-header-cell-id">
{{$item['text']}}
</th>
<td class="fi-ta-cell p-0 first-of-type:ps-1 last-of-type:pe-1 sm:first-of-type:ps-3 sm:last-of-type:pe-3 fi-table-cell-id"
@if($loop->count == 1)
colspan="3"
@endif
>
<div class="px-4 py-3 filament-tables-text-column {{$item['class'] ?? ''}}"><span class="">{{$item['value']}}</span></div>
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
>
<div class="{{$item['class'] ?? ''}}">{{$item['value']}}</div>
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</x-filament::widget>
</x-filament-widgets::widget>