mirror of
https://github.com/cuigh/swirl
synced 2024-12-28 23:02:02 +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)
|
||||
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)
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -47,7 +47,7 @@
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
{{ if .Charts }}
|
||||
{{ if .Prometheus }}
|
||||
<nav class="level is-mobile">
|
||||
<form>
|
||||
<div class="level-left">
|
||||
|
Loading…
Reference in New Issue
Block a user