0d6c8c7989
CI / test (push) Failing after 13m11s
This is the complete fix for the missing /admin/ route and frontend serving: Backend: - internal/web/web.go: new package with go:embed for web/dist/ - internal/api/router.go: add routes for /admin/, /admin/*, /assets/* - internal/db/db.go: fix SQLite DSN parsing (sqlite:///path -> path) Build system: - Makefile: new 'embed-prep' target copies web/dist to internal/web/dist - make build now runs embed-prep -> frontend/build automatically Deployment: - deploy/llamalink.service: remove invalid --host/--port flags, add EnvironmentFile=/etc/llamalink/env Verified: - /health returns 200 - /admin/ serves Vue SPA HTML - /assets/* serves CSS and JS files from embedded FS - sqlite:///./llamalink.db works correctly
2 lines
1.6 KiB
JavaScript
2 lines
1.6 KiB
JavaScript
import{d as p,u as f,c as r,a as e,b as v,e as i,w as _,f as b,v as g,t as x,g as h,r as l,o as a,h as y}from"./index-r2SG-Kf3.js";import{K as k}from"./key-D7ygKuN6.js";import"./createLucideIcon-CUrbWv4G.js";const w={class:"min-h-screen bg-background flex items-center justify-center"},L={class:"w-full max-w-md"},A={class:"card"},S={class:"flex items-center gap-3 mb-6"},V={class:"w-12 h-12 bg-primary/10 rounded-xl flex items-center justify-center"},B={key:0,class:"p-3 bg-error/10 border border-error/20 rounded-lg text-error text-sm"},N=["disabled"],T={key:0},j={key:1},M=p({__name:"Login",setup(C){const d=y(),s=f(),o=l(""),n=l("");async function u(){if(!o.value.trim()){n.value="Admin token is required";return}await s.login(o.value)?d.push("/admin/"):n.value=s.error||"Login failed"}return(c,t)=>(a(),r("div",w,[e("div",L,[e("div",A,[e("div",S,[e("div",V,[v(i(k),{class:"w-6 h-6 text-primary"})]),t[1]||(t[1]=e("div",null,[e("h1",{class:"text-2xl font-bold"},"LlamaLink"),e("p",{class:"text-text-muted text-sm"},"Admin Login")],-1))]),e("form",{onSubmit:_(u,["prevent"]),class:"space-y-4"},[e("div",null,[t[2]||(t[2]=e("label",{class:"block text-sm font-medium mb-2"},"Admin Token",-1)),b(e("input",{"onUpdate:modelValue":t[0]||(t[0]=m=>o.value=m),type:"password",class:"input",placeholder:"Enter your admin token",autocomplete:"current-password"},null,512),[[g,o.value]])]),n.value?(a(),r("div",B,x(n.value),1)):h("",!0),e("button",{type:"submit",class:"btn btn-primary w-full",disabled:i(s).loading},[i(s).loading?(a(),r("span",T,"Logging in...")):(a(),r("span",j,"Login"))],8,N)],32)])])]))}});export{M as default};
|