45 lines
2.9 KiB
PHP
45 lines
2.9 KiB
PHP
<div class="flex flex-col">
|
|
<header class="flex items-center gap-3 px-5 py-4 border-b border-line-soft">
|
|
<span class="grid place-items-center w-9 h-9 rounded-lg bg-accent/10 text-accent shrink-0"><x-icon name="plus" :size="18" /></span>
|
|
<h2 class="text-[15px] font-bold text-ink">{{ __('discovery.assign_title') }}</h2>
|
|
<button type="button" wire:click="closeModal" class="ml-auto grid place-items-center w-9 h-9 rounded-lg text-ink-3 hover:bg-raised hover:text-ink transition-colors" aria-label="{{ __('common.close') }}">
|
|
<x-icon name="close" :size="18" />
|
|
</button>
|
|
</header>
|
|
|
|
<form wire:submit="assign" class="p-5 flex flex-col gap-4">
|
|
<dl class="grid grid-cols-2 gap-x-4 gap-y-2">
|
|
<x-detail :label="__('devices.vendor')">{{ $finding->vendor ?? '—' }}</x-detail>
|
|
<x-detail :label="__('discovery.source')" mono>{{ $finding->source }}</x-detail>
|
|
<x-detail :label="'IP'" mono>{{ $finding->ip ?? '—' }}</x-detail>
|
|
<x-detail :label="__('devices.uuid')" mono>{{ \Illuminate\Support\Str::limit($finding->identifier, 22, '…') }}</x-detail>
|
|
</dl>
|
|
|
|
<div class="flex flex-col gap-1.5">
|
|
<label for="a-name" class="text-[12px] font-semibold text-ink-2">{{ __('devices.name') }}</label>
|
|
<input wire:model="name" id="a-name" type="text"
|
|
class="w-full rounded-lg bg-raised border border-line px-3 py-2.5 text-sm text-ink outline-none focus:border-accent focus:ring-1 focus:ring-accent">
|
|
@error('name') <p class="text-[12px] text-offline">{{ $message }}</p> @enderror
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-1.5">
|
|
<label for="a-room" class="text-[12px] font-semibold text-ink-2">{{ __('devices.room') }}</label>
|
|
<select wire:model="roomId" id="a-room" class="w-full rounded-lg bg-raised border border-line px-3 py-2.5 text-sm text-ink outline-none focus:border-accent">
|
|
<option value="">{{ __('devices.no_room') }}</option>
|
|
@foreach ($rooms as $room)
|
|
<option value="{{ $room->id }}">{{ $room->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
|
|
@if ($finding->vendor === 'Shelly')
|
|
<p class="text-[11.5px] text-ink-3 leading-relaxed">{{ __('discovery.shelly_hint', ['prefix' => $finding->identifier]) }}</p>
|
|
@endif
|
|
|
|
<div class="flex items-center justify-end gap-2 pt-1">
|
|
<button type="button" wire:click="closeModal" class="rounded-lg border border-line px-3.5 py-2 text-[13px] font-semibold text-ink-2 hover:text-ink hover:bg-raised transition-colors">{{ __('common.cancel') }}</button>
|
|
<button type="submit" class="rounded-lg bg-accent px-3.5 py-2 text-[13px] font-bold text-base hover:brightness-110 transition-[filter]">{{ __('discovery.assign') }}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|