diff --git a/frontend/pages/index.vue b/frontend/pages/index.vue index befa0e7..14acdb1 100644 --- a/frontend/pages/index.vue +++ b/frontend/pages/index.vue @@ -26,6 +26,7 @@ onMounted(async () => { function openNewHost(groupId?: number) { editingHost.value = groupId ? { groupId } : null + inlineHost.value = { name: '', hostname: '', port: 22, protocol: 'ssh', groupId: groupId || null, tags: '' } showHostDialog.value = true } @@ -112,7 +113,7 @@ function dismissSavePrompt() { } // Inline modal state -const inlineHost = ref({ name: '', hostname: '', port: 22, protocol: 'ssh' as 'ssh' | 'rdp' }) +const inlineHost = ref({ name: '', hostname: '', port: 22, protocol: 'ssh' as 'ssh' | 'rdp', groupId: null as number | null, tags: '' }) async function createGroupInline() { const nameEl = document.getElementById('grp-name') as HTMLInputElement @@ -123,14 +124,21 @@ async function createGroupInline() { async function createHostInline() { if (!inlineHost.value.name || !inlineHost.value.hostname) return + const tags = inlineHost.value.tags + .split(',') + .map(t => t.trim()) + .filter(Boolean) await connections.createHost({ name: inlineHost.value.name, hostname: inlineHost.value.hostname, port: inlineHost.value.port, protocol: inlineHost.value.protocol, + groupId: inlineHost.value.groupId, + tags, }) showHostDialog.value = false - inlineHost.value = { name: '', hostname: '', port: 22, protocol: 'ssh' } + inlineHost.value = { name: '', hostname: '', port: 22, protocol: 'ssh', groupId: null, tags: '' } + await connections.fetchTree() } // Client-side search filtering @@ -383,6 +391,10 @@ async function deleteSelectedHost() {
+ +
+ Adding to: {{ connections.groups.find((g: any) => g.id === inlineHost.groupId)?.name || 'Group' }} +
RDP
+
+ + +