1
0
Fork 0

Gather status of services in About handler.

This commit is contained in:
Alexander Andreev 2023-02-05 05:13:58 +04:00
parent 9e2e490f4a
commit a545d2b2a2
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F
1 changed files with 16 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"time"
"git.arav.top/Arav/dwelling-home/pkg/mindflow"
"git.arav.top/Arav/dwelling-home/pkg/servicestat"
"git.arav.top/Arav/dwelling-home/web"
)
@ -44,7 +45,21 @@ func (h *Handlers) Mindflow(w http.ResponseWriter, r *http.Request) {
}
func (h *Handlers) About(w http.ResponseWriter, r *http.Request) {
web.About("/ About", "", nil, w)
var lst servicestat.ServiceList = make(servicestat.ServiceList)
reimu, err := servicestat.GatherStatus("http://reimu.arav.home.arpa:14882/processes")
if err == nil {
for k, v := range reimu {
lst[k] = v
}
}
sakuya, err := servicestat.GatherStatus("http://sakuya.arav.home.arpa:14882/processes")
if err == nil {
for k, v := range sakuya {
lst[k] = v
}
}
web.About("/ About", "", lst, w)
}
func (h *Handlers) Article(w http.ResponseWriter, r *http.Request) {