feat(plugins): more refactoring

pull/3712/head
Torkel Ödegaard 10 years ago
parent 1ffcea1952
commit d83e24572a
  1. 8
      public/app/features/dashboard/dashboardCtrl.js
  2. 0
      public/app/plugins/panel/dashlist/editor.html
  3. 0
      public/app/plugins/panel/dashlist/module.html
  4. 4
      public/app/plugins/panel/dashlist/module.js
  5. 5
      public/app/plugins/panel/dashlist/plugin.json
  6. 0
      public/app/plugins/panel/graph/axisEditor.html
  7. 0
      public/app/plugins/panel/graph/graph.js
  8. 0
      public/app/plugins/panel/graph/graph.tooltip.js
  9. 0
      public/app/plugins/panel/graph/legend.js
  10. 0
      public/app/plugins/panel/graph/legend.popover.html
  11. 0
      public/app/plugins/panel/graph/module.html
  12. 6
      public/app/plugins/panel/graph/module.js
  13. 5
      public/app/plugins/panel/graph/plugin.json
  14. 0
      public/app/plugins/panel/graph/seriesOverridesCtrl.js
  15. 0
      public/app/plugins/panel/graph/styleEditor.html
  16. 0
      public/app/plugins/panel/singlestat/editor.html
  17. 0
      public/app/plugins/panel/singlestat/module.html
  18. 4
      public/app/plugins/panel/singlestat/module.js
  19. 5
      public/app/plugins/panel/singlestat/plugin.json
  20. 0
      public/app/plugins/panel/singlestat/singleStatPanel.js
  21. 0
      public/app/plugins/panel/table/controller.ts
  22. 0
      public/app/plugins/panel/table/editor.html
  23. 0
      public/app/plugins/panel/table/editor.ts
  24. 0
      public/app/plugins/panel/table/module.html
  25. 2
      public/app/plugins/panel/table/module.ts
  26. 0
      public/app/plugins/panel/table/options.html
  27. 5
      public/app/plugins/panel/table/plugin.json
  28. 0
      public/app/plugins/panel/table/renderer.ts
  29. 0
      public/app/plugins/panel/table/specs/renderer_specs.ts
  30. 0
      public/app/plugins/panel/table/specs/transformers_specs.ts
  31. 0
      public/app/plugins/panel/table/transformers.ts
  32. 0
      public/app/plugins/panel/text/editor.html
  33. 0
      public/app/plugins/panel/text/module.html
  34. 4
      public/app/plugins/panel/text/module.js
  35. 5
      public/app/plugins/panel/text/plugin.json
  36. 7
      public/app/plugins/panels/dashlist/plugin.json
  37. 7
      public/app/plugins/panels/graph/plugin.json
  38. 7
      public/app/plugins/panels/singlestat/plugin.json
  39. 7
      public/app/plugins/panels/table/plugin.json
  40. 7
      public/app/plugins/panels/text/plugin.json
  41. 2
      public/test/specs/graph-ctrl-specs.js
  42. 2
      public/test/specs/graph-specs.js
  43. 2
      public/test/specs/graph-tooltip-specs.js
  44. 2
      public/test/specs/seriesOverridesCtrl-specs.js
  45. 2
      public/test/specs/singlestat-specs.js
  46. 2
      tasks/options/jscs.js
  47. 6
      tasks/options/requirejs.js
  48. 2
      tasks/systemjs_task.js

@ -106,14 +106,6 @@ function (angular, $, config, moment) {
};
};
$scope.panelEditorPath = function(type) {
return 'app/' + config.panels[type].path + '/editor.html';
};
$scope.pulldownEditorPath = function(type) {
return 'app/panels/'+type+'/editor.html';
};
$scope.showJsonEditor = function(evt, options) {
var editScope = $rootScope.$new();
editScope.object = options.object;

@ -14,7 +14,7 @@ function (angular, app, _, config, PanelMeta) {
module.directive('grafanaPanelDashlist', function() {
return {
controller: 'DashListPanelCtrl',
templateUrl: 'app/plugins/panels/dashlist/module.html',
templateUrl: 'app/plugins/panel/dashlist/module.html',
};
});
@ -26,7 +26,7 @@ function (angular, app, _, config, PanelMeta) {
fullscreen: true,
});
$scope.panelMeta.addEditorTab('Options', 'app/plugins/panels/dashlist/editor.html');
$scope.panelMeta.addEditorTab('Options', 'app/plugins/panel/dashlist/editor.html');
var defaults = {
mode: 'starred',

@ -0,0 +1,5 @@
{
"type": "panel",
"name": "Dashboard list",
"id": "dashlist"
}

@ -17,7 +17,7 @@ function (angular, _, moment, kbn, TimeSeries, PanelMeta) {
module.directive('grafanaPanelGraph', function() {
return {
controller: 'GraphCtrl',
templateUrl: 'app/plugins/panels/graph/module.html',
templateUrl: 'app/plugins/panel/graph/module.html',
};
});
@ -30,8 +30,8 @@ function (angular, _, moment, kbn, TimeSeries, PanelMeta) {
metricsEditor: true,
});
$scope.panelMeta.addEditorTab('Axes & Grid', 'app/plugins/panels/graph/axisEditor.html');
$scope.panelMeta.addEditorTab('Display Styles', 'app/plugins/panels/graph/styleEditor.html');
$scope.panelMeta.addEditorTab('Axes & Grid', 'app/plugins/panel/graph/axisEditor.html');
$scope.panelMeta.addEditorTab('Display Styles', 'app/plugins/panel/graph/styleEditor.html');
$scope.panelMeta.addEditorTab('Time range', 'app/features/panel/partials/panelTime.html');
$scope.panelMeta.addExtendedMenuItem('Export CSV', '', 'exportCsv()');

@ -0,0 +1,5 @@
{
"type": "panel",
"name": "Graph",
"id": "graph"
}

@ -16,7 +16,7 @@ function (angular, app, _, kbn, TimeSeries, PanelMeta) {
module.directive('grafanaPanelSinglestat', function() {
return {
controller: 'SingleStatCtrl',
templateUrl: 'app/plugins/panels/singlestat/module.html',
templateUrl: 'app/plugins/panel/singlestat/module.html',
};
});
@ -31,7 +31,7 @@ function (angular, app, _, kbn, TimeSeries, PanelMeta) {
$scope.fontSizes = ['20%', '30%','50%','70%','80%','100%', '110%', '120%', '150%', '170%', '200%'];
$scope.panelMeta.addEditorTab('Options', 'app/plugins/panels/singlestat/editor.html');
$scope.panelMeta.addEditorTab('Options', 'app/plugins/panel/singlestat/editor.html');
$scope.panelMeta.addEditorTab('Time range', 'app/features/panel/partials/panelTime.html');
// Set and populate defaults

@ -0,0 +1,5 @@
{
"type": "panel",
"name": "Singlestat",
"id": "singlestat"
}

@ -14,7 +14,7 @@ export function tablePanel() {
'use strict';
return {
restrict: 'E',
templateUrl: 'app/plugins/panels/table/module.html',
templateUrl: 'app/plugins/panel/table/module.html',
controller: TablePanelCtrl,
link: function(scope, elem) {
var data;

@ -0,0 +1,5 @@
{
"type": "panel",
"name": "Table",
"id": "table"
}

@ -16,7 +16,7 @@ function (angular, app, _, require, PanelMeta) {
module.directive('grafanaPanelText', function() {
return {
controller: 'TextPanelCtrl',
templateUrl: 'app/plugins/panels/text/module.html',
templateUrl: 'app/plugins/panel/text/module.html',
};
});
@ -28,7 +28,7 @@ function (angular, app, _, require, PanelMeta) {
fullscreen: true,
});
$scope.panelMeta.addEditorTab('Edit text', 'app/plugins/panels/text/editor.html');
$scope.panelMeta.addEditorTab('Edit text', 'app/plugins/panel/text/editor.html');
// Set and populate defaults
var _d = {

@ -0,0 +1,5 @@
{
"type": "panel",
"name": "Text",
"id": "text"
}

@ -1,7 +0,0 @@
{
"type": "panel",
"name": "Dashboard list",
"id": "dashlist",
"module": "app/plugins/panels/dashlist/module"
}

@ -1,7 +0,0 @@
{
"type": "panel",
"name": "Graph",
"id": "graph",
"module": "app/plugins/panels/graph/module"
}

@ -1,7 +0,0 @@
{
"type": "panel",
"name": "Singlestat",
"id": "singlestat",
"module": "app/plugins/panels/singlestat/module"
}

@ -1,7 +0,0 @@
{
"type": "panel",
"name": "Table",
"id": "table",
"module": "app/plugins/panels/table/module"
}

@ -1,7 +0,0 @@
{
"type": "panel",
"name": "Text",
"id": "text",
"module": "app/plugins/panels/text/module"
}

@ -2,7 +2,7 @@ define([
'./helpers',
'app/features/panel/panel_srv',
'app/features/panel/panel_helper',
'app/plugins/panels/graph/module'
'app/plugins/panel/graph/module'
], function(helpers) {
'use strict';

@ -3,7 +3,7 @@ define([
'angular',
'jquery',
'app/core/time_series',
'app/plugins/panels/graph/graph'
'app/plugins/panel/graph/graph'
], function(helpers, angular, $, TimeSeries) {
'use strict';

@ -1,6 +1,6 @@
define([
'jquery',
'app/plugins/panels/graph/graph.tooltip'
'app/plugins/panel/graph/graph.tooltip'
], function($, GraphTooltip) {
'use strict';

@ -1,6 +1,6 @@
define([
'./helpers',
'app/plugins/panels/graph/seriesOverridesCtrl'
'app/plugins/panel/graph/seriesOverridesCtrl'
], function(helpers) {
'use strict';

@ -2,7 +2,7 @@ define([
'./helpers',
'app/features/panel/panel_srv',
'app/features/panel/panel_helper',
'app/plugins/panels/singlestat/module'
'app/plugins/panel/singlestat/module'
], function(helpers) {
'use strict';

@ -3,7 +3,7 @@ module.exports = function(config) {
src: [
'Gruntfile.js',
'<%= srcDir %>/app/**/*.js',
'<%= srcDir %>/plugins/**/*.js',
'<%= srcDir %>/plugin/**/*.js',
'!<%= srcDir %>/app/dashboards/*'
],
options: {

@ -62,11 +62,11 @@ module.exports = function(config,grunt) {
];
var fs = require('fs');
var panelPath = config.srcDir + '/app/plugins/panels';
var panelPath = config.srcDir + '/app/plugins/panel';
// create a module for each directory in public/app/panels/
// create a module for each directory in public/app/panel/
fs.readdirSync(panelPath).forEach(function (panelName) {
requireModules[0].include.push('app/plugins/panels/'+panelName+'/module');
requireModules[0].include.push('app/plugins/panel/'+panelName+'/module');
});
return { options: options };

@ -13,7 +13,7 @@ module.exports = function(grunt) {
var modules = [
'app/app',
'app/features/all',
'app/plugins/panels/**/module',
'app/plugins/panel/**/module',
'app/plugins/datasource/graphite/datasource',
'app/plugins/datasource/influxdb/datasource',
'app/plugins/datasource/elasticsearch/datasource',

Loading…
Cancel
Save