Commit 1e425244 by Jeff Klukas

Refactor timspan default in scripted examples.

parent 0c6618d2
...@@ -23,7 +23,7 @@ var dashboard, timspan; ...@@ -23,7 +23,7 @@ var dashboard, timspan;
var ARGS; var ARGS;
// Set a default timespan if one isn't specified // Set a default timespan if one isn't specified
timspan = '1d'; timspan = ARGS.from || 'now-1d';
// Intialize a skeleton with nothing but a rows array and service object // Intialize a skeleton with nothing but a rows array and service object
dashboard = { dashboard = {
...@@ -33,7 +33,7 @@ dashboard = { ...@@ -33,7 +33,7 @@ dashboard = {
// Set a title // Set a title
dashboard.title = 'Scripted dash'; dashboard.title = 'Scripted dash';
dashboard.time = { dashboard.time = {
from: "now-" + (ARGS.from || timspan), from: timspan,
to: "now" to: "now"
}; };
......
...@@ -25,7 +25,7 @@ return function(callback) { ...@@ -25,7 +25,7 @@ return function(callback) {
var dashboard, timspan; var dashboard, timspan;
// Set a default timespan if one isn't specified // Set a default timespan if one isn't specified
timspan = '1d'; timspan = ARGS.from || 'now-1d';
// Intialize a skeleton with nothing but a rows array and service object // Intialize a skeleton with nothing but a rows array and service object
dashboard = { dashboard = {
...@@ -36,7 +36,7 @@ return function(callback) { ...@@ -36,7 +36,7 @@ return function(callback) {
// Set a title // Set a title
dashboard.title = 'Scripted dash'; dashboard.title = 'Scripted dash';
dashboard.time = { dashboard.time = {
from: "now-" + (ARGS.from || timspan), from: timspan,
to: "now" to: "now"
}; };
......
...@@ -23,7 +23,7 @@ var dashboard, timspan; ...@@ -23,7 +23,7 @@ var dashboard, timspan;
var ARGS; var ARGS;
// Set a default timespan if one isn't specified // Set a default timespan if one isn't specified
timspan = '1d'; timspan = ARGS.from || 'now-1d';
// Intialize a skeleton with nothing but a rows array and service object // Intialize a skeleton with nothing but a rows array and service object
dashboard = { dashboard = {
...@@ -33,7 +33,7 @@ dashboard = { ...@@ -33,7 +33,7 @@ dashboard = {
// Set a title // Set a title
dashboard.title = 'Scripted dash'; dashboard.title = 'Scripted dash';
dashboard.time = { dashboard.time = {
from: "now-" + (ARGS.from || timspan), from: timspan,
to: "now" to: "now"
}; };
dashboard.templating = { dashboard.templating = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment