change timescaledb to checkbox instead of select

This commit is contained in:
Sven Klemm
2018-08-09 09:19:16 +02:00
parent b987aee7cf
commit c3aad10047
4 changed files with 4 additions and 28 deletions

View File

@ -131,7 +131,7 @@ func (m *postgresMacroEngine) evaluateMacro(name string, args []string) (string,
}
}
if m.query.DataSource.JsonData.Get("timescaledb").MustString("auto") == "enabled" {
if m.query.DataSource.JsonData.Get("timescaledb").MustBool() {
return fmt.Sprintf("time_bucket('%vs',%s) AS time", interval.Seconds(), args[0]), nil
} else {
return fmt.Sprintf("floor(extract(epoch from %s)/%v)*%v AS time", args[0], interval.Seconds(), interval.Seconds()), nil