feat: Host CRUD complete — edit, full form fields, connect, toast

- Add UpdateHost handler + PUT /hosts/:id route
- CreateHost now accepts all fields (port, username, auth, notes)
- host_modal.html: full form with port, username, auth type toggle, edit mode
- host_list.html: edit button dispatches edit-host event with host data
- Connect button links to /terminal?host={id} for pre-selection
- Terminal page reads selected host from query param
- Toast notification system via Alpine.js events
- Add default template function for fallback values
This commit is contained in:
swanadiva
2026-07-07 15:51:57 +07:00
parent 3df8416d9b
commit 301115b74d
8 changed files with 285 additions and 58 deletions
+10
View File
@@ -109,5 +109,15 @@
</main>
</div>
</div>
<!-- Toast -->
<div x-data="{ show: false, msg: '' }" x-cloak
@toast-message.window="msg = $event.detail.message; show = true; setTimeout(() => show = false, 3000)"
x-show="show" x-transition
class="fixed bottom-6 right-6 z-[200] bg-inverse-surface text-inverse-on-surface px-5 py-3 rounded-xl shadow-xl flex items-center gap-3 text-sm font-medium">
<svg class="w-4 h-4 text-secondary shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
<span x-text="msg"></span>
</div>
</body>
</html>