package web
// All HTML templates and CSS are embedded as Go strings.
// Compiled into the binary — zero external file dependencies at runtime.
// As the UI grows, switch to go:embed for easier editing.
const allTemplates = layoutTmpl + dashboardTmpl + stacksTmpl + loginTmpl + logsTmpl + deployTmpl
const layoutTmpl = `
{{define "layout_start"}}
{{.Meta.DisplayName}}
{{if .Meta.Description}}
{{.Meta.Description}}
{{end}}
{{if .Meta.Resources.MemRequest}}~{{.Meta.Resources.MemRequest}}{{end}}
{{if .Meta.Resources.PiCompatible}}Pi kompatibilis{{end}}
{{if .Meta.Resources.NeedsHDD}}HDD szükséges{{end}}
Részletes leírás, képernyőképek
{{if .AlreadyDeployed}}
Ez az alkalmazás már telepítve van. Az alábbi beállítások csak olvashatók.
{{end}}
{{if and (not .AlreadyDeployed) .MemoryInfo}}
{{with .MemoryInfo}}
{{if .Available}}
{{if .Blocked}}
Nincs elég memória! Foglalás telepítés után: {{.AfterMB}} MB / {{.UsableMB}} MB
{{else}}
Jelenlegi foglalás ({{.CommittedMB}} MB)
{{$.Meta.DisplayName}} (+{{.NewRequestMB}} MB)
{{if .OvercommitWarn}}
Az alkalmazások csúcsterhelése meghaladhatja a rendelkezésre álló memóriát.
Normál használat mellett ez nem okoz problémát.
{{end}}
{{end}}
{{end}}
{{end}}
{{end}}
{{template "layout_end" .}}
{{end}}
`
const loginTmpl = `
{{define "login"}}