[FEAT] 補全機台與金流設定多語系,並調整帳號管理表格佈局
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 44s

This commit is contained in:
2026-03-18 13:52:54 +08:00
parent cd34724c76
commit 3f41896532
19 changed files with 990 additions and 398 deletions

View File

@@ -2,7 +2,7 @@
@section('header')
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('機台管理') }}
{{ __('Machine Management') }}
</h2>
@endsection
@@ -12,7 +12,7 @@
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg border border-gray-200">
<div class="p-6 text-gray-900">
<div class="flex justify-between items-center mb-6">
<h3 class="text-lg font-medium">機台列表</h3>
<h3 class="text-lg font-medium">{{ __('Machine List') }}</h3>
<div class="flex items-center gap-x-4">
<form method="GET" action="{{ route('admin.machines.index') }}" class="flex items-center gap-x-2">
@if(request('status'))
@@ -25,9 +25,9 @@
</select>
</form>
<div class="flex space-x-2">
<a href="{{ route('admin.machines.index') }}" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-md text-sm transition">全部</a>
<a href="{{ route('admin.machines.index', ['status' => 'online']) }}" class="px-4 py-2 bg-green-100 text-green-700 hover:bg-green-200 rounded-md text-sm transition">線上</a>
<a href="{{ route('admin.machines.index', ['status' => 'error']) }}" class="px-4 py-2 bg-red-100 text-red-700 hover:bg-red-200 rounded-md text-sm transition">異常</a>
<a href="{{ route('admin.machines.index') }}" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-md text-sm transition">{{ __('All') }}</a>
<a href="{{ route('admin.machines.index', ['status' => 'online']) }}" class="px-4 py-2 bg-green-100 text-green-700 hover:bg-green-200 rounded-md text-sm transition">{{ __('Online') }}</a>
<a href="{{ route('admin.machines.index', ['status' => 'error']) }}" class="px-4 py-2 bg-red-100 text-red-700 hover:bg-red-200 rounded-md text-sm transition">{{ __('Error') }}</a>
</div>
</div>
</div>
@@ -36,12 +36,12 @@
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">名稱</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">位置</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">狀態</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">溫度</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">最後心跳</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{{ __('Name') }}</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{{ __('Location') }}</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{{ __('Status') }}</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{{ __('Temperature') }}</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{{ __('Last Heartbeat') }}</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">{{ __('Actions') }}</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@@ -64,17 +64,17 @@
$class = $statusClasses[$machine->status] ?? 'bg-blue-100 text-blue-800';
@endphp
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full {{ $class }}">
{{ strtoupper($machine->status) }}
{{ __($machine->status === 'online' ? 'Online' : ($machine->status === 'error' ? 'Error' : 'Offline')) }}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ $machine->temperature ?? '--' }} °C
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ $machine->last_heartbeat_at ? $machine->last_heartbeat_at->diffForHumans() : '從未連線' }}
{{ $machine->last_heartbeat_at ? $machine->last_heartbeat_at->diffForHumans() : __('Never Connected') }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<a href="{{ route('admin.machines.show', $machine->id) }}" class="text-indigo-600 hover:text-indigo-900 bg-indigo-50 px-3 py-1 rounded-md transition border border-indigo-100">查看日誌</a>
<a href="{{ route('admin.machines.show', $machine->id) }}" class="text-indigo-600 hover:text-indigo-900 bg-indigo-50 px-3 py-1 rounded-md transition border border-indigo-100">{{ __('View Logs') }}</a>
</td>
</tr>
@endforeach