feat: manage cms_type and WordPress credentials in Sites UI
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<th class="p-3">Name</th>
|
||||
<th class="p-3">URL</th>
|
||||
<th class="p-3">Description</th>
|
||||
<th class="p-3">CMS Type</th>
|
||||
<th class="p-3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -19,6 +20,22 @@
|
||||
<td class="p-3">{{ $site->name }}</td>
|
||||
<td class="p-3"><a href="{{ $site->url }}" target="_blank" class="text-blue-600">{{ $site->url }}</a></td>
|
||||
<td class="p-3">{{ $site->description }}</td>
|
||||
<td class="p-3">
|
||||
{{ ucfirst($site->cms_type) }}
|
||||
@if ($site->cms_type === 'wordpress')
|
||||
<div class="text-xs text-gray-500">
|
||||
{{ $site->wp_username }} /
|
||||
@if ($revealedId === $site->id)
|
||||
{{ $site->wp_app_password }}
|
||||
@else
|
||||
••••••••
|
||||
@endif
|
||||
<button wire:click="toggleReveal({{ $site->id }})" class="text-xs text-blue-600 ml-1">
|
||||
{{ $revealedId === $site->id ? 'Hide' : 'Show' }}
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="p-3 text-right space-x-2">
|
||||
<button wire:click="edit({{ $site->id }})" class="text-blue-600">Edit</button>
|
||||
<button wire:click="delete({{ $site->id }})" wire:confirm="Delete this site?" class="text-red-600">Delete</button>
|
||||
@@ -50,6 +67,30 @@
|
||||
<textarea wire:model="description" class="w-full border rounded p-2"></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium">CMS Type</label>
|
||||
<select wire:model.live="cmsType" class="w-full border rounded p-2">
|
||||
@foreach ($cmsTypes as $type)
|
||||
<option value="{{ $type }}">{{ ucfirst($type) }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('cmsType') <span class="text-red-600 text-sm">{{ $message }}</span> @enderror
|
||||
</div>
|
||||
|
||||
@if ($cmsType === 'wordpress')
|
||||
<div>
|
||||
<label class="block text-sm font-medium">WP Username</label>
|
||||
<input type="text" wire:model="wpUsername" class="w-full border rounded p-2">
|
||||
@error('wpUsername') <span class="text-red-600 text-sm">{{ $message }}</span> @enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium">WP Application Password</label>
|
||||
<input type="text" wire:model="wpAppPassword" class="w-full border rounded p-2">
|
||||
@error('wpAppPassword') <span class="text-red-600 text-sm">{{ $message }}</span> @enderror
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex justify-end gap-2">
|
||||
<button wire:click="$set('showForm', false)" class="px-4 py-2">Cancel</button>
|
||||
<button wire:click="save" class="bg-blue-600 text-white px-4 py-2 rounded">Save</button>
|
||||
|
||||
Reference in New Issue
Block a user