diff --git a/docs/sources/reference/table_panel.md b/docs/sources/reference/table_panel.md index 381d16186a9..65437f85bd7 100644 --- a/docs/sources/reference/table_panel.md +++ b/docs/sources/reference/table_panel.md @@ -9,7 +9,7 @@ page_keywords: grafana, table, panel, documentation The new table panel is very flexible, supporting both multiple modes for time series as well as for -table, annotation and raw JSON data. It also provides date formating and value formating and coloring options. +table, annotation and raw JSON data. It also provides date formatting and value formatting and coloring options. To view table panels in action and test different configurations with sample data, check out the [Table Panel Showcase in the Grafana Playground](http://play.grafana.org/dashboard/db/table-panel-showcase). @@ -21,7 +21,7 @@ The table panel has many ways to manipulate your data for optimal presentation. 1. `Data`: Control how your query is transformed into a table. 2. `Table Display`: Table display options. -3. `Column Styles`: Column value formating and display options. +3. `Column Styles`: Column value formatting and display options. ## Data to Table diff --git a/public/app/core/utils/kbn.js b/public/app/core/utils/kbn.js index 123e8e16be1..cc296324eb5 100644 --- a/public/app/core/utils/kbn.js +++ b/public/app/core/utils/kbn.js @@ -399,6 +399,7 @@ function($, _) { // Volume kbn.valueFormats.litre = kbn.formatBuilders.decimalSIPrefix('L'); kbn.valueFormats.mlitre = kbn.formatBuilders.decimalSIPrefix('L', -1); + kbn.valueFormats.m3 = kbn.formatBuilders.decimalSIPrefix('m3'); // Time kbn.valueFormats.hertz = kbn.formatBuilders.decimalSIPrefix('Hz'); @@ -626,8 +627,9 @@ function($, _) { { text: 'volume', submenu: [ - {text: 'millilitre', value: 'mlitre'}, - {text: 'litre', value: 'litre' }, + {text: 'millilitre', value: 'mlitre'}, + {text: 'litre', value: 'litre' }, + {text: 'cubic metre', value: 'm3' }, ] }, { diff --git a/public/app/features/dashboard/dashboardSrv.js b/public/app/features/dashboard/dashboardSrv.js index 73919ce0e01..559adff5c54 100644 --- a/public/app/features/dashboard/dashboardSrv.js +++ b/public/app/features/dashboard/dashboardSrv.js @@ -214,10 +214,7 @@ function (angular, $, _, moment) { }; p.formatDate = function(date, format) { - if (!moment.isMoment(date)) { - date = moment(date); - } - + date = moment.isMoment(date) ? date : moment(date); format = format || 'YYYY-MM-DD HH:mm:ss'; return this.timezone === 'browser' ? @@ -225,6 +222,14 @@ function (angular, $, _, moment) { moment.utc(date).format(format); }; + p.getRelativeTime = function(date) { + date = moment.isMoment(date) ? date : moment(date); + + return this.timezone === 'browser' ? + moment(date).fromNow() : + moment.utc(date).fromNow(); + }; + p._updateSchema = function(old) { var i, j, k; var oldVersion = this.schemaVersion; diff --git a/public/app/features/dashboard/partials/settings.html b/public/app/features/dashboard/partials/settings.html index 347265afed4..9b0e5674fe0 100644 --- a/public/app/features/dashboard/partials/settings.html +++ b/public/app/features/dashboard/partials/settings.html @@ -117,7 +117,7 @@
-
Info
+
Dashboard info
  • diff --git a/public/app/features/panel/panel_helper.js b/public/app/features/panel/panel_helper.js index 4cc7a9c3415..7287acd7b44 100644 --- a/public/app/features/panel/panel_helper.js +++ b/public/app/features/panel/panel_helper.js @@ -59,7 +59,9 @@ function (angular, _, $, kbn, dateMath, rangeUtil) { scope.resolution = Math.ceil($(window).width() * (scope.panel.span / 12)); } - scope.interval = kbn.calculateInterval(scope.range, scope.resolution, scope.panel.interval); + var panelInterval = scope.panel.interval; + var datasourceInterval = (scope.datasource || {}).interval; + scope.interval = kbn.calculateInterval(scope.range, scope.resolution, panelInterval || datasourceInterval); }; this.applyPanelTimeOverrides = function(scope) { diff --git a/public/app/plugins/datasource/elasticsearch/datasource.js b/public/app/plugins/datasource/elasticsearch/datasource.js index 8a5dc0a0551..72eaa4fcfd6 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.js +++ b/public/app/plugins/datasource/elasticsearch/datasource.js @@ -26,6 +26,7 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes this.timeField = datasource.jsonData.timeField; this.esVersion = datasource.jsonData.esVersion; this.indexPattern = new IndexPattern(datasource.index, datasource.jsonData.interval); + this.interval = datasource.jsonData.timeInterval; this.queryBuilder = new ElasticQueryBuilder({ timeField: this.timeField, esVersion: this.esVersion, diff --git a/public/app/plugins/datasource/elasticsearch/partials/config.html b/public/app/plugins/datasource/elasticsearch/partials/config.html index 81acd03809c..595588c1be0 100644 --- a/public/app/plugins/datasource/elasticsearch/partials/config.html +++ b/public/app/plugins/datasource/elasticsearch/partials/config.html @@ -1,7 +1,7 @@

    -
    Elastic search details
    +
    Elasticsearch details
      @@ -42,3 +42,22 @@
    +
+ +
Default query settings
+ +
+
    +
  • + Group by time interval +
  • +
  • + +
  • +
  • + +
  • +
+
+
diff --git a/public/app/plugins/datasource/graphite/gfunc.js b/public/app/plugins/datasource/graphite/gfunc.js index c8fb6ab9918..de482598fc5 100644 --- a/public/app/plugins/datasource/graphite/gfunc.js +++ b/public/app/plugins/datasource/graphite/gfunc.js @@ -279,7 +279,9 @@ function (_, $) { addFuncDef({ name: 'sortByName', - category: categories.Special + category: categories.Special, + params: [{ name: "natural", type: "select", options: ["true", "false"], optional: true }], + defaultParams: ["false"] }); addFuncDef({ diff --git a/public/app/plugins/datasource/graphite/partials/query.editor.html b/public/app/plugins/datasource/graphite/partials/query.editor.html index fb1bbded598..4e671354079 100755 --- a/public/app/plugins/datasource/graphite/partials/query.editor.html +++ b/public/app/plugins/datasource/graphite/partials/query.editor.html @@ -8,6 +8,11 @@
  • {{target.datasource}}
  • +
  • + + + +
  • - + + +