Files
swanadiva 8357d9d76e fix: UI overhaul — align all HTMX views with Lumina Design System (46 fixes)
- All 7 pages rewritten: Dashboard, Terminal, Snippets, Keychain, SFTP, Settings, Brief
- Apply consistent Lumina glassmorphic theme (rounded-2xl, shadows, borders, tracking)
- Fix SVG icons not rendering — return template.HTML instead of string
- Fix Alpine x-data scoping: terminal tabs, SFTP modals, snippet tag buttons
- Fix dashboard search sending literal ?q=...
- Rebuild CSS with all new Tailwind classes (62KB)
- Add .air.toml with hot-reload config, docs/PERBAIKANUI.md checklist
- Remove unused backup partials
2026-07-07 14:55:42 +07:00

45 lines
1.0 KiB
Go

package handler
import (
"github.com/gofiber/fiber/v2"
"git.tukangketik.id/swanadiva/hostkeeper/v2/internal/store"
)
var keyStore = store.NewKeyStore()
func Keychain(c *fiber.Ctx) error {
if c.Get("HX-Request") != "" {
return KeyGrid(c)
}
keys := keyStore.All()
return c.Render("keychain", fiber.Map{
"View": "keychain",
"Title": "Keychain",
"Keys": keys,
"NavItems": navItems,
})
}
func KeyGrid(c *fiber.Ctx) error {
q := c.Query("q", "")
keys := keyStore.Search(q)
return c.Render("credential_grid", fiber.Map{"Keys": keys})
}
func CreateKey(c *fiber.Ctx) error {
name := c.FormValue("name")
username := c.FormValue("username")
url := c.FormValue("url")
passphrase := c.FormValue("passphrase")
keyStore.Add(name, username, url, passphrase)
keys := keyStore.All()
return c.Render("credential_grid", fiber.Map{"Keys": keys})
}
func DeleteKey(c *fiber.Ctx) error {
id := c.Params("id")
keyStore.Delete(id)
keys := keyStore.All()
return c.Render("credential_grid", fiber.Map{"Keys": keys})
}