Add initial Go server skeleton with HTTP handlers, middleware, job runner, and stubs
This commit is contained in:
18
internal/templates/base.html
Normal file
18
internal/templates/base.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{define "base"}}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script src="https://unpkg.com/htmx.org@1.9.2"></script>
|
||||
<title>{{.Title}}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
||||
<meta name="csrf-token" content="fake-csrf-token">
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
<main class="container mx-auto p-4">
|
||||
{{template "content" .}}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
18
internal/templates/dashboard.html
Normal file
18
internal/templates/dashboard.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{define "content"}}
|
||||
<div class="bg-white rounded shadow p-4">
|
||||
<h1 class="text-2xl font-bold">{{.Title}}</h1>
|
||||
<div class="mt-4">
|
||||
<button class="px-3 py-2 bg-blue-500 text-white rounded" hx-get="/api/pools" hx-swap="outerHTML" hx-trigger="click">Refresh pools</button>
|
||||
</div>
|
||||
<div id="pools" class="mt-4">
|
||||
<div class="text-sm text-gray-600">Pools: <span id="pools-count">1</span></div>
|
||||
<div class="mt-2 p-2 bg-gray-50 rounded">tank — ONLINE — 1TiB</div>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<h2 class="text-lg font-semibold">Jobs</h2>
|
||||
<div id="jobs">
|
||||
<div class="text-sm text-gray-500">No active jobs</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user