star-cloud/resources/views/admin/app/ui-bundles/index.blade.php
terrylee bfbe311503 feat(app-ui): APP UI元素設定 Phase 1 — 後台三頁(元素/組合/機台綁定)+ B014 UISet 下發
- 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>
2026-07-15 12:45:50 +08:00

76 lines
4.7 KiB
PHP

@extends('layouts.admin')
@section('content')
<div class="container mx-auto px-4 py-6" x-data="{ showCreate: false }">
@include('admin.app._tabs', ['active' => 'bundles'])
<div class="mb-4">
<button type="button" @click="showCreate = true"
class="bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded-lg">
+ {{ __('New') }}
</button>
</div>
<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 w-20">{{ __('ID') }}</th>
<th class="px-4 py-3">{{ __('Name') }}</th>
<th class="px-4 py-3 text-right">{{ __('Actions') }}</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($bundles as $bundle)
<tr x-data="{ editing: false }">
<td class="px-4 py-3 text-gray-500">{{ $bundle->id }}</td>
<td class="px-4 py-3">
<span x-show="!editing">{{ $bundle->name }}</span>
<form x-show="editing" x-cloak method="POST" action="{{ route('admin.app.ui-bundles.update', $bundle) }}" class="flex gap-2">
@csrf @method('PUT')
<input type="text" name="name" value="{{ $bundle->name }}"
class="rounded-md border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 py-1 px-2 text-sm">
<button type="submit" class="text-emerald-600 text-sm">{{ __('Save') }}</button>
<button type="button" @click="editing=false" class="text-gray-400 text-sm">{{ __('Cancel') }}</button>
</form>
</td>
<td class="px-4 py-3 text-right space-x-3">
<button type="button" @click="editing=!editing" class="text-gray-500 hover:text-gray-700 text-sm">{{ __('Rename') }}</button>
<a href="{{ route('admin.app.ui-bundles.content', $bundle) }}" class="text-blue-600 hover:text-blue-800 text-sm">{{ __('Content Settings') }}</a>
<form action="{{ route('admin.app.ui-bundles.destroy', $bundle) }}" method="POST"
onsubmit="return confirm('{{ __('Are you sure?') }}')" class="inline">
@csrf @method('DELETE')
<button type="submit" class="text-rose-600 hover:text-rose-800 text-sm">{{ __('Delete') }}</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>
{{-- 新增組合 Modal --}}
<div x-show="showCreate" x-cloak style="display:none"
class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4">
<div class="bg-white dark:bg-gray-800 rounded-xl shadow-xl w-full max-w-md p-6" @click.outside="showCreate = false">
<h4 class="text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4">{{ __('New') }} {{ __('UI Bundles') }}</h4>
<form action="{{ route('admin.app.ui-bundles.store') }}" method="POST" class="space-y-4">
@csrf
<div>
<label class="block text-sm font-medium text-gray-600 dark:text-gray-300 mb-1">{{ __('Name') }} <span class="text-rose-500">*</span></label>
<input type="text" name="name" required
class="block w-full rounded-md border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 py-2 px-3 text-sm">
</div>
<div class="flex justify-end gap-2 pt-2">
<button type="button" @click="showCreate = false"
class="px-4 py-2 rounded-md text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700">{{ __('Cancel') }}</button>
<button type="submit" class="px-4 py-2 rounded-md bg-blue-600 hover:bg-blue-700 text-white font-semibold">{{ __('Save') }}</button>
</div>
</form>
</div>
</div>
</div>
@endsection