- ui_elements/ui_bundles/ui_bundle_items 三表 + Models(TenantScoped) - config/ui_parts.php 部位定義(Phase 1 啟用 A1/A2/A3 滿版) - UiElementController 三頁 CRUD + 圖片上傳(ImageHandler storeAsWebp) - 機台綁定存 machines.settings['ui_bundle_id'] - B014 getSettings 新增 UISet(部位→絕對圖URL,mirror B005) - 解除 sidebar APP管理 註解 + can:menu.app + 權限白名單 - zh_TW/en 翻譯 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
56 lines
2.9 KiB
PHP
56 lines
2.9 KiB
PHP
@extends('layouts.admin')
|
|
|
|
@section('content')
|
|
<div class="container mx-auto px-4 py-6">
|
|
@include('admin.app._tabs', ['active' => 'machines'])
|
|
|
|
<div class="bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden">
|
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
<thead class="bg-gray-50 dark:bg-gray-900/40">
|
|
<tr class="text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">
|
|
<th class="px-4 py-3">{{ __('Machine') }}</th>
|
|
<th class="px-4 py-3">{{ __('Current Bundle') }}</th>
|
|
<th class="px-4 py-3 w-96">{{ __('Bind UI Bundle') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100 dark:divide-gray-700/60 text-sm text-gray-700 dark:text-gray-200">
|
|
@forelse($machines as $machine)
|
|
@php
|
|
$currentId = data_get($machine->settings, 'ui_bundle_id');
|
|
$currentName = $currentId ? ($bundleNames[$currentId] ?? __('(deleted)')) : '—';
|
|
@endphp
|
|
<tr>
|
|
<td class="px-4 py-3">
|
|
<div class="font-medium">{{ $machine->name }}</div>
|
|
<div class="text-xs text-gray-400">{{ $machine->serial_no }}</div>
|
|
</td>
|
|
<td class="px-4 py-3">{{ $currentName }}</td>
|
|
<td class="px-4 py-3">
|
|
<form action="{{ route('admin.app.ui-machines.update', $machine) }}" method="POST" class="flex gap-2">
|
|
@csrf @method('PUT')
|
|
<select name="ui_bundle_id"
|
|
class="flex-1 rounded-md border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 py-1.5 px-2 text-sm">
|
|
<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="px-3 py-1.5 rounded-md bg-emerald-600 hover:bg-emerald-700 text-white text-sm">{{ __('Save') }}</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="3" class="px-4 py-10 text-center text-gray-400">{{ __('No data') }}</td></tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="mt-4">
|
|
{{ $machines->links() }}
|
|
</div>
|
|
</div>
|
|
@endsection
|