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)
refresh := cast.ToBool(ctx.Q("refresh"), true)
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)
}

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) {
dashboard = &model.ChartDashboard{
cd := &model.ChartDashboard{
Name: name,
Key: key,
}
var v Value
v, err = d.get("dashboard", dashboard.ID())
if err == nil {
if v != nil {
err = v.Unmarshal(dashboard)
v, err = d.get("dashboard", cd.ID())
if v != nil {
if err = v.Unmarshal(cd); err == nil {
return cd, nil
}
}
return
return nil, err
}
func (d *Dao) DashboardUpdate(dashboard *model.ChartDashboard) (err error) {

View File

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