This commit is contained in:
cuigh 2018-06-25 18:38:34 +08:00
parent 81c2439ea4
commit f95b3be328
3 changed files with 8 additions and 8 deletions

View File

@ -338,6 +338,6 @@ func serviceStats(ctx web.Context) error {
period := cast.ToDuration(ctx.Q("time"), time.Hour) period := cast.ToDuration(ctx.Q("time"), time.Hour)
refresh := cast.ToBool(ctx.Q("refresh"), true) refresh := cast.ToBool(ctx.Q("refresh"), true)
m := newModel(ctx).Set("Service", service).Set("Tasks", tasks).Set("Time", period.String()). m := newModel(ctx).Set("Service", service).Set("Tasks", tasks).Set("Time", period.String()).
Set("Refresh", refresh).Set("Charts", charts) Set("Refresh", refresh).Set("Prometheus", setting.Metrics.Prometheus).Set("Charts", charts)
return ctx.Render("service/stats", m) return ctx.Render("service/stats", m)
} }

View File

@ -53,19 +53,19 @@ func (d *Dao) ChartDelete(name string) (err error) {
} }
func (d *Dao) DashboardGet(name, key string) (dashboard *model.ChartDashboard, err error) { func (d *Dao) DashboardGet(name, key string) (dashboard *model.ChartDashboard, err error) {
dashboard = &model.ChartDashboard{ cd := &model.ChartDashboard{
Name: name, Name: name,
Key: key, Key: key,
} }
var v Value var v Value
v, err = d.get("dashboard", dashboard.ID()) v, err = d.get("dashboard", cd.ID())
if err == nil { if v != nil {
if v != nil { if err = v.Unmarshal(cd); err == nil {
err = v.Unmarshal(dashboard) return cd, nil
} }
} }
return return nil, err
} }
func (d *Dao) DashboardUpdate(dashboard *model.ChartDashboard) (err error) { func (d *Dao) DashboardUpdate(dashboard *model.ChartDashboard) (err error) {

View File

@ -47,7 +47,7 @@
<section class="section"> <section class="section">
<div class="container"> <div class="container">
{{ if .Charts }} {{ if .Prometheus }}
<nav class="level is-mobile"> <nav class="level is-mobile">
<form> <form>
<div class="level-left"> <div class="level-left">