mirror of
https://github.com/cuigh/swirl
synced 2024-12-30 15:53:24 +00:00
Fix #15
This commit is contained in:
parent
81c2439ea4
commit
f95b3be328
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
||||||
|
@ -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">
|
||||||
|
Loading…
Reference in New Issue
Block a user