star-cloud/resources/views/admin/app/ui-machines/index.blade.php
terrylee a326283d17 style(app-ui): APP管理三頁改用站上設計系統(luxury按鈕/標準表格/膠囊tabs/標準modal/刪除確認)
- btn-luxury-primary/secondary + x-delete-confirm-modal
- 膠囊式頁籤(對齊 x-tab-nav 外觀)
- 「新增」改用 __('Create')=新增(不動全域 New=新值,那是 products 變更紀錄用)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 11:06:43 +08:00

53 lines
2.9 KiB
PHP

@extends('layouts.admin')
@section('content')
<div class="px-6 py-8">
@include('admin.app._tabs', ['active' => 'machines'])
<div class="overflow-x-auto">
<table class="min-w-full bg-white dark:bg-gray-800 rounded-lg overflow-hidden">
<thead class="bg-gray-100 dark:bg-gray-700">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-400 uppercase">{{ __('Machine') }}</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-400 uppercase">{{ __('Current Bundle') }}</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-400 uppercase">{{ __('Bind UI Bundle') }}</th>
</tr>
</thead>
<tbody class="divide-y border-gray-200 dark:border-gray-700">
@forelse($machines as $machine)
@php
$currentId = data_get($machine->settings, 'ui_bundle_id');
$currentName = $currentId ? ($bundleNames[$currentId] ?? __('(deleted)')) : '—';
@endphp
<tr>
<td class="px-6 py-4">
<div class="font-medium text-gray-900 dark:text-gray-200">{{ $machine->name }}</div>
<div class="text-xs text-gray-400">{{ $machine->serial_no }}</div>
</td>
<td class="px-6 py-4 text-gray-900 dark:text-gray-200">{{ $currentName }}</td>
<td class="px-6 py-4">
<form action="{{ route('admin.app.ui-machines.update', $machine) }}" method="POST" class="flex gap-2 items-center max-w-md">
@csrf @method('PUT')
<select name="ui_bundle_id" class="flex-1 px-3 py-2 bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 border rounded-md text-gray-900 dark:text-gray-200 text-sm focus:ring-2 focus:ring-cyan-500">
<option value="">{{ __('Not set') }}</option>
@foreach($bundles as $bundle)
<option value="{{ $bundle->id }}" {{ (string)$currentId === (string)$bundle->id ? 'selected' : '' }}>{{ $bundle->name }}</option>
@endforeach
</select>
<button type="submit" class="btn-luxury-primary">{{ __('Save') }}</button>
</form>
</td>
</tr>
@empty
<tr><td colspan="3" class="px-6 py-4 text-center text-gray-600 dark:text-gray-400">{{ __('No data') }}</td></tr>
@endforelse
</tbody>
</table>
</div>
<div class="mt-4">
{{ $machines->links() }}
</div>
</div>
@endsection