2025-11-21 17:15:27 +08:00
|
|
|
@extends('layouts.admin')
|
|
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
<div class="container mx-auto px-6 py-8">
|
2026-01-13 13:28:58 +08:00
|
|
|
<h3 class="text-gray-900 dark:text-gray-300 text-3xl font-medium">新增機台</h3>
|
2025-11-21 17:15:27 +08:00
|
|
|
|
|
|
|
|
<div class="mt-8">
|
2026-01-13 13:28:58 +08:00
|
|
|
<form action="{{ route('admin.machines.store') }}" method="POST" class="bg-white dark:bg-gray-800 rounded-lg shadow-xl overflow-hidden p-6 space-y-6">
|
2025-11-21 17:15:27 +08:00
|
|
|
@csrf
|
|
|
|
|
|
|
|
|
|
<div>
|
2026-01-13 13:28:58 +08:00
|
|
|
<label for="name" class="block text-sm font-medium text-gray-700 dark:text-gray-400">機台名稱</label>
|
|
|
|
|
<input type="text" name="name" id="name" class="mt-1 block w-full bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 text-gray-900 dark:text-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
2025-11-21 17:15:27 +08:00
|
|
|
@error('name') <span class="text-red-500 text-sm">{{ $message }}</span> @enderror
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
2026-01-13 13:28:58 +08:00
|
|
|
<label for="location" class="block text-sm font-medium text-gray-700 dark:text-gray-400">位置</label>
|
|
|
|
|
<input type="text" name="location" id="location" class="mt-1 block w-full bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 text-gray-900 dark:text-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
2025-11-21 17:15:27 +08:00
|
|
|
@error('location') <span class="text-red-500 text-sm">{{ $message }}</span> @enderror
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
2026-01-13 13:28:58 +08:00
|
|
|
<label for="status" class="block text-sm font-medium text-gray-700 dark:text-gray-400">狀態</label>
|
|
|
|
|
<select name="status" id="status" class="mt-1 block w-full bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 text-gray-900 dark:text-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
2025-11-21 17:15:27 +08:00
|
|
|
<option value="offline">離線</option>
|
|
|
|
|
<option value="online">連線中</option>
|
|
|
|
|
<option value="error">異常</option>
|
|
|
|
|
</select>
|
|
|
|
|
@error('status') <span class="text-red-500 text-sm">{{ $message }}</span> @enderror
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
2026-01-13 13:28:58 +08:00
|
|
|
<label for="temperature" class="block text-sm font-medium text-gray-700 dark:text-gray-400">溫度 (°C)</label>
|
|
|
|
|
<input type="number" step="0.1" name="temperature" id="temperature" class="mt-1 block w-full bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 text-gray-900 dark:text-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
2025-11-21 17:15:27 +08:00
|
|
|
@error('temperature') <span class="text-red-500 text-sm">{{ $message }}</span> @enderror
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
2026-01-13 13:28:58 +08:00
|
|
|
<label for="firmware_version" class="block text-sm font-medium text-gray-700 dark:text-gray-400">韌體版本</label>
|
|
|
|
|
<input type="text" name="firmware_version" id="firmware_version" class="mt-1 block w-full bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 text-gray-900 dark:text-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
2025-11-21 17:15:27 +08:00
|
|
|
@error('firmware_version') <span class="text-red-500 text-sm">{{ $message }}</span> @enderror
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex justify-end">
|
2026-01-13 13:28:58 +08:00
|
|
|
<a href="{{ route('admin.machines.index') }}" class="bg-gray-200 dark:bg-gray-600 hover:bg-gray-300 dark:hover:bg-gray-500 text-gray-800 dark:text-white font-bold py-2 px-4 rounded mr-2">取消</a>
|
2025-11-21 17:15:27 +08:00
|
|
|
<button type="submit" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded">建立</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endsection
|