Files
HostKeeper/app/backend/views/index.html
T
swanadiva e70b133073 fix: add missing _content partial templates for HTMX nav (terminal, sftp, settings, brief)
- Create terminal_content.html, sftp_content.html, settings_content.html, brief_content.html
- Update full page templates to use partial templates via {{template}}
- Handlers already rendered these templates on HX-Request, but files were missing → 500
- All pages now return 200 for both full page and HTMX nav requests
2026-07-07 15:36:12 +07:00

114 lines
8.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hosts · Hostkeeper V2</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/static/css/output.css">
<link rel="stylesheet" href="/static/css/custom.css">
<script src="/static/js/htmx.min.js"></script>
<script src="/static/js/alpine.min.js" defer></script>
<script src="/static/js/clipboard.js"></script>
<script src="/static/js/utils.js"></script>
</head>
<body class="bg-surface text-on-surface antialiased dot-grid min-h-screen">
<div class="flex min-h-screen">
{{template "nav" .}}
<div class="flex-1 flex flex-col overflow-hidden">
<header class="h-14 border-b border-outline-variant/30 flex items-center px-6 bg-white/70 backdrop-blur-md">
<h1 class="text-lg font-semibold text-on-surface">Hosts</h1>
</header>
<main id="main-content" class="flex-1 overflow-auto p-6">
<div id="dashboard-page" class="max-w-7xl mx-auto space-y-8">
<div class="border-b border-outline-variant/30 pb-4">
<h2 class="text-xl font-bold text-on-surface tracking-tight">Hosts</h2>
<p class="text-xs text-on-surface-variant mt-0.5">Manage connections, monitor uptime, and deploy</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-12 gap-6">
<div class="md:col-span-8 p-6 rounded-2xl bg-white border border-outline-variant shadow-sm flex items-center justify-between overflow-hidden relative group">
<div class="relative z-10 space-y-2">
<h3 class="text-on-surface-variant font-bold text-xs uppercase tracking-wider">Active Connections</h3>
<div class="flex items-end gap-3">
<span class="text-4xl font-black text-primary">{{.Active}}</span>
<span class="text-secondary font-bold text-sm mb-1 flex items-center bg-secondary-container/20 px-2 py-0.5 rounded-full">
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.25 18L9 11.25l4.306 4.307a11.95 11.95 0 015.814-5.519l2.74-1.22m0 0l-5.94-2.28m5.94 2.28l-2.28 5.941"/></svg>
+2 today
</span>
</div>
<p class="text-xs text-on-surface-variant">Global performance metrics sync integrity active.</p>
</div>
<div class="absolute right-0 top-0 w-1/3 h-full bg-gradient-to-l from-primary/5 to-transparent pointer-events-none"></div>
<div class="flex gap-2 items-end h-16 shrink-0">
<div class="w-2.5 h-10 bg-primary/20 rounded-full animate-pulse"></div>
<div class="w-2.5 h-14 bg-primary/40 rounded-full animate-pulse delay-75"></div>
<div class="w-2.5 h-8 bg-primary/10 rounded-full animate-pulse delay-150"></div>
<div class="w-2.5 h-16 bg-primary/60 rounded-full animate-pulse delay-200"></div>
</div>
</div>
<div class="md:col-span-4 p-6 rounded-2xl bg-primary text-on-primary shadow-xl shadow-primary/15 flex flex-col justify-between relative overflow-hidden">
<div class="relative z-10">
<svg class="w-8 h-8 opacity-90 text-white mb-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"/></svg>
<p class="font-bold text-lg leading-tight">Fastest Access Enabled</p>
</div>
<p class="text-xs opacity-85 mt-2 relative z-10">Smart routing engine successfully reduces terminal latency by <span class="font-bold">24ms</span> across European and Asian clusters.</p>
<div class="absolute -right-6 -bottom-6 opacity-10">
<svg class="w-32 h-32 rotate-12" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"/></svg>
</div>
</div>
</div>
<div x-data="{ view: 'grid' }">
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-outline-variant/30 pb-4 mb-6">
<div class="flex items-center gap-3">
<h3 class="text-lg font-bold text-on-surface">Recent Hosts</h3>
<div class="flex bg-surface-container rounded-lg p-0.5 text-xs font-semibold border border-outline-variant/20"
x-data="{ filter: 'all' }">
<button @click="filter = 'all'"
:class="filter === 'all' ? 'bg-white text-primary shadow-sm' : 'text-on-surface-variant hover:text-on-surface'"
class="px-2.5 py-1 rounded-md transition-all"
hx-get="/hosts?filter=all" hx-target="#host-list">All</button>
<button @click="filter = 'active'"
:class="filter === 'active' ? 'bg-white text-primary shadow-sm' : 'text-on-surface-variant hover:text-on-surface'"
class="px-2.5 py-1 rounded-md transition-all"
hx-get="/hosts?filter=active" hx-target="#host-list">Active</button>
<button @click="filter = 'offline'"
:class="filter === 'offline' ? 'bg-white text-primary shadow-sm' : 'text-on-surface-variant hover:text-on-surface'"
class="px-2.5 py-1 rounded-md transition-all"
hx-get="/hosts?filter=offline" hx-target="#host-list">Offline</button>
</div>
</div>
<div class="flex items-center gap-3">
<div class="relative">
<svg class="absolute left-3 top-1/2 -translate-y-1/2 text-outline w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>
<input type="search" name="q" placeholder="Search hosts..."
hx-get="/hosts" hx-trigger="keyup delay:200ms"
hx-target="#host-list"
class="pl-9 pr-4 py-1.5 rounded-full bg-surface-container-low border border-outline-variant/30 text-sm focus:border-primary focus:bg-white focus:outline-none focus:ring-1 focus:ring-primary w-48 sm:w-60 transition-all text-on-surface placeholder-on-surface-variant">
</div>
<div class="flex border border-outline-variant/50 rounded-lg p-0.5 bg-white">
<button @click="view = 'grid'"
:class="view === 'grid' ? 'bg-surface-container text-primary' : 'text-on-surface-variant'"
class="p-1.5 rounded transition-colors" title="Grid View">
<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-surface-container text-primary' : 'text-on-surface-variant'"
class="p-1.5 rounded transition-colors" title="List View">
<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>
</div>
{{template "host_list" .}}
</div>
</div>
{{template "host_modal" .}}
</main>
</div>
</div>
</body>
</html>