64 lines
3.7 KiB
HTML
64 lines
3.7 KiB
HTML
{{template "layout" .}}
|
|
|
|
{{define "content"}}
|
|
<div id="dashboard-page" class="max-w-7xl mx-auto">
|
|
<div class="grid grid-cols-3 gap-4 mb-6">
|
|
<div class="rounded-xl bg-white border border-outline-variant/30 p-4">
|
|
<div class="flex items-center gap-2 text-primary mb-1">
|
|
<span class="w-5 h-5 bg-primary/20 rounded flex items-center justify-center text-xs font-bold">⚡</span>
|
|
<span class="text-xs font-medium text-on-surface-variant uppercase tracking-wide">Active Connections</span>
|
|
</div>
|
|
<span class="text-2xl font-bold text-on-surface">{{.Active}}</span>
|
|
</div>
|
|
<div class="rounded-xl bg-white border border-outline-variant/30 p-4">
|
|
<div class="flex items-center gap-2 text-secondary mb-1">
|
|
<span class="w-5 h-5 bg-secondary/20 rounded flex items-center justify-center text-xs font-bold">✓</span>
|
|
<span class="text-xs font-medium text-on-surface-variant uppercase tracking-wide">Transfers Today</span>
|
|
</div>
|
|
<span class="text-2xl font-bold text-on-surface">0</span>
|
|
</div>
|
|
<div class="rounded-xl bg-white border border-outline-variant/30 p-4">
|
|
<div class="flex items-center gap-2 text-tertiary mb-1">
|
|
<span class="w-5 h-5 bg-tertiary/20 rounded flex items-center justify-center text-xs font-bold">#</span>
|
|
<span class="text-xs font-medium text-on-surface-variant uppercase tracking-wide">Saved Hosts</span>
|
|
</div>
|
|
<span class="text-2xl font-bold text-on-surface">{{len .Hosts}}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex items-center gap-3 mb-6" x-data="{ view: 'grid' }">
|
|
<div class="relative flex-1 max-w-md">
|
|
<input type="search" name="q" placeholder="Search hosts..."
|
|
hx-get="/hosts?q=..." hx-trigger="keyup delay:200ms"
|
|
hx-target="#host-list" hx-include="[name='filter']"
|
|
class="w-full pl-9 pr-3 py-2 rounded-lg border border-outline-variant/50
|
|
bg-white text-sm text-on-surface placeholder-on-surface-variant
|
|
focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary/50">
|
|
</div>
|
|
<select name="filter"
|
|
hx-get="/hosts?filter={value}" hx-trigger="change" hx-target="#host-list"
|
|
class="px-3 py-2 rounded-lg border border-outline-variant/50 bg-white text-sm text-on-surface
|
|
focus:outline-none focus:ring-2 focus:ring-primary/30">
|
|
<option value="all">All</option>
|
|
<option value="active">Active</option>
|
|
<option value="offline">Offline</option>
|
|
</select>
|
|
<div class="flex items-center bg-white rounded-lg border border-outline-variant/50 p-0.5">
|
|
<button @click="view = 'grid'"
|
|
:class="view === 'grid' ? 'bg-primary/10 text-primary' : 'text-on-surface-variant hover:text-on-surface'"
|
|
class="p-1.5 rounded transition-colors">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1V5zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"/></svg>
|
|
</button>
|
|
<button @click="view = 'list'"
|
|
:class="view === 'list' ? 'bg-primary/10 text-primary' : 'text-on-surface-variant hover:text-on-surface'"
|
|
class="p-1.5 rounded transition-colors">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16"/></svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
{{template "host_list" .}}
|
|
</div>
|
|
{{template "host_modal" .}}
|
|
{{end}}
|