bugfix: list builtin alerts and dashboards
This commit is contained in:
parent
9e8d9b44b1
commit
66bc023e51
|
@ -20,7 +20,7 @@ func alertRuleBuiltinList(c *gin.Context) {
|
||||||
fp = path.Join(runner.Cwd, "etc", "alerts")
|
fp = path.Join(runner.Cwd, "etc", "alerts")
|
||||||
}
|
}
|
||||||
|
|
||||||
files, err := file.DirsUnder(fp)
|
files, err := file.FilesUnder(fp)
|
||||||
ginx.Dangerous(err)
|
ginx.Dangerous(err)
|
||||||
|
|
||||||
names := make([]string, 0, len(files))
|
names := make([]string, 0, len(files))
|
||||||
|
@ -93,7 +93,7 @@ func dashboardBuiltinList(c *gin.Context) {
|
||||||
fp = path.Join(runner.Cwd, "etc", "dashboards")
|
fp = path.Join(runner.Cwd, "etc", "dashboards")
|
||||||
}
|
}
|
||||||
|
|
||||||
files, err := file.DirsUnder(fp)
|
files, err := file.FilesUnder(fp)
|
||||||
ginx.Dangerous(err)
|
ginx.Dangerous(err)
|
||||||
|
|
||||||
names := make([]string, 0, len(files))
|
names := make([]string, 0, len(files))
|
||||||
|
|
|
@ -67,6 +67,7 @@ func user() gin.HandlerFunc {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Set("user", user)
|
c.Set("user", user)
|
||||||
|
c.Set("isadmin", user.IsAdmin())
|
||||||
c.Next()
|
c.Next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue