Commit d83e2457 by Torkel Ödegaard

feat(plugins): more refactoring

parent 1ffcea19
......@@ -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',
......
{
"type": "panel",
"name": "Dashboard list",
"id": "dashlist",
"module": "app/plugins/panels/dashlist/module"
"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()');
......
{
"type": "panel",
"name": "Graph",
"id": "graph",
"module": "app/plugins/panels/graph/module"
"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
......
{
"type": "panel",
"name": "Singlestat",
"id": "singlestat",
"module": "app/plugins/panels/singlestat/module"
"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;
......
{
"type": "panel",
"name": "Table",
"id": "table",
"module": "app/plugins/panels/table/module"
"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 = {
......
{
"type": "panel",
"name": "Text",
"id": "text",
"module": "app/plugins/panels/text/module"
"id": "text"
}
......@@ -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';
......
define([
'jquery',
'app/plugins/panels/graph/graph.tooltip'
'app/plugins/panel/graph/graph.tooltip'
], function($, GraphTooltip) {
'use strict';
......
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',
......
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