2022-10-15 17:58:44 +00:00
< h1 > Admin Panel< / h1 >
2023-03-04 22:21:31 +00:00
< p >
Here you can edit all the configurations for EcoDash.< br >
< a href = "https://ecodash.xyz/docs/setup/admin-panel" > Documentation< / a >
< / p >
2022-10-15 17:58:44 +00:00
2023-10-31 22:59:09 +00:00
{{if .Message}}
< article class = "card {{.Message.Style}}" >
< header >
< h3 > {{.Message.Title}}< / h3 >
< / header >
< footer >
< p > {{.Message.Content}}< / p >
< / footer >
< / article >
2022-10-15 17:58:44 +00:00
{{end}}
< form action = "./admin" method = "POST" >
< h3 > HomeAssistant< / h3 >
< label > HomeAssistant's base URL < input type = "text" name = "base_url" value = "{{.Config.HomeAssistant.BaseURL}}" required > < / label >
2023-05-01 20:07:50 +00:00
< label > HomeAssistant's API Key < input type = "text" name = "api_key" value = "{{.Config.HomeAssistant.APIKey}}" required > < / label >
2022-12-04 11:50:11 +00:00
< lablel > Installation date< input type = "date" name = "installation_date" value = "{{HTMLDateFormat .Config.HomeAssistant.InstallationDate}}" required > < / lablel >
2022-10-15 17:58:44 +00:00
< h3 > Sensors< / h3 >
< label > Polled Smart Energy Summation entity ID < input type = "text" name = "polled_smart_energy_summation" value = "{{.Config.Sensors.PolledSmartEnergySummation}}" required > < / label >
< label > CO2 signal Grid fossil fuel percentage entity ID < input type = "text" name = "fossil_percentage" value = "{{.Config.Sensors.FossilPercentage}}" required > < / label >
< h3 > Admin account< / h3 >
< label > Username < input type = "text" name = "username" value = "{{.Config.Administrator.Username}}" required > < / label >
{{if .Config.Administrator.PasswordHash}}
< label >
< input type = "checkbox" name = "keep_old_password" onchange = "toggle_password_edit()" >
< p class = "checkable" > Keep the old password< / p >
< / label >
{{end}}
< label > Password < input type = "password" name = "password" id = "password" required > < / label >
< h3 > Personalization< / h3 >
< label > Theme
< select name = "theme" >
{{range .Themes}}
< option value = "{{.Name}}" > {{.Name}}< / option >
{{end}}
< / select >
< / label >
< label > Dashboard name < input type = "text" name = "name" value = "{{.Config.Dashboard.Name}}" > < / label >
2023-10-31 22:59:09 +00:00
< label > MOTD title < input type = "text" name = "motd_title" value = "{{if .Config.Dashboard.MOTD}}{{.Config.Dashboard.MOTD.Title}}{{end}}" > < / label >
< label > MOTD content < input type = "text" name = "motd_content" value = "{{if .Config.Dashboard.MOTD}}{{.Config.Dashboard.MOTD.Content}}{{end}}" > < / label >
< label > MOTD style
< select name = "motd_style" >
< option value = "" { { if . Config . Dashboard . MOTD } } { { if eq . Config . Dashboard . MOTD . Style " " } } selected { { end } } { { end } } > Default< / option >
< option value = "success" { { if . Config . Dashboard . MOTD } } { { if eq . Config . Dashboard . MOTD . Style " success " } } selected { { end } } { { end } } > Success< / option >
< option value = "warning" { { if . Config . Dashboard . MOTD } } { { if eq . Config . Dashboard . MOTD . Style " warning " } } selected { { end } } { { end } } > Warning< / option >
< option value = "error" { { if . Config . Dashboard . MOTD } } { { if eq . Config . Dashboard . MOTD . Style " error " } } selected { { end } } { { end } } > Error< / option >
< / select >
< / label >
2022-10-15 17:58:44 +00:00
< input type = "submit" placeholder = "Submit" style = "margin-top: 2em; width: 100%" >
< / form >
< script >
function toggle_password_edit() {
const psw_field = document.getElementById('password');
psw_field.disabled = !psw_field.disabled;
}
< / script >