diff --git a/pkg/cmd/web.go b/pkg/cmd/web.go index 40ef22d8024..897cfc4f3af 100644 --- a/pkg/cmd/web.go +++ b/pkg/cmd/web.go @@ -36,7 +36,6 @@ func newMacaron() *macaron.Macaron { } mapStatic(m, setting.StaticRootPath, "", "public") - mapStatic(m, setting.StaticRootPath, "app", "app") mapStatic(m, setting.StaticRootPath, "css", "css") mapStatic(m, setting.StaticRootPath, "img", "img") mapStatic(m, setting.StaticRootPath, "fonts", "fonts") diff --git a/public/app/core/components/navbar/navbar.ts b/public/app/core/components/navbar/navbar.ts index 874becbe4ee..82168f72c29 100644 --- a/public/app/core/components/navbar/navbar.ts +++ b/public/app/core/components/navbar/navbar.ts @@ -14,7 +14,7 @@ export class NavbarCtrl { export function navbarDirective() { return { restrict: 'E', - templateUrl: 'app/core/components/navbar/navbar.html', + templateUrl: 'public/app/core/components/navbar/navbar.html', controller: NavbarCtrl, bindToController: true, controllerAs: 'ctrl', diff --git a/public/app/core/components/search/search.ts b/public/app/core/components/search/search.ts index e28f80a9099..3f8cb495e71 100644 --- a/public/app/core/components/search/search.ts +++ b/public/app/core/components/search/search.ts @@ -137,7 +137,7 @@ export class SearchCtrl { export function searchDirective() { return { restrict: 'E', - templateUrl: 'app/core/components/search/search.html', + templateUrl: 'public/app/core/components/search/search.html', controller: SearchCtrl, bindToController: true, controllerAs: 'ctrl', diff --git a/public/app/core/components/sidemenu/sidemenu.ts b/public/app/core/components/sidemenu/sidemenu.ts index 503f3c81ac1..833bba1913f 100644 --- a/public/app/core/components/sidemenu/sidemenu.ts +++ b/public/app/core/components/sidemenu/sidemenu.ts @@ -148,7 +148,7 @@ export class SideMenuCtrl { export function sideMenuDirective() { return { restrict: 'E', - templateUrl: 'app/core/components/sidemenu/sidemenu.html', + templateUrl: 'public/app/core/components/sidemenu/sidemenu.html', controller: SideMenuCtrl, bindToController: true, controllerAs: 'ctrl', diff --git a/public/app/core/directives/dash_edit_link.js b/public/app/core/directives/dash_edit_link.js index 846eca6f1e4..35a90ecd262 100644 --- a/public/app/core/directives/dash_edit_link.js +++ b/public/app/core/directives/dash_edit_link.js @@ -6,9 +6,9 @@ function ($, coreModule) { 'use strict'; var editViewMap = { - 'settings': { src: 'app/features/dashboard/partials/settings.html', title: "Settings" }, - 'annotations': { src: 'app/features/annotations/partials/editor.html', title: "Annotations" }, - 'templating': { src: 'app/features/templating/partials/editor.html', title: "Templating" } + 'settings': { src: 'public/app/features/dashboard/partials/settings.html', title: "Settings" }, + 'annotations': { src: 'public/app/features/annotations/partials/editor.html', title: "Annotations" }, + 'templating': { src: 'public/app/features/templating/partials/editor.html', title: "Templating" } }; coreModule.default.directive('dashEditorLink', function($timeout) { diff --git a/public/app/core/directives/value_select_dropdown.js b/public/app/core/directives/value_select_dropdown.js index 1e82239ff87..656804a72d3 100644 --- a/public/app/core/directives/value_select_dropdown.js +++ b/public/app/core/directives/value_select_dropdown.js @@ -227,7 +227,7 @@ function (angular, _, coreModule) { coreModule.default.directive('valueSelectDropdown', function($compile, $window, $timeout, $rootScope) { return { scope: { variable: "=", onUpdated: "&", getValuesForTag: "&" }, - templateUrl: 'app/partials/valueSelectDropdown.html', + templateUrl: 'public/app/partials/valueSelectDropdown.html', controller: 'ValueSelectDropdownCtrl', controllerAs: 'vm', bindToController: true, diff --git a/public/app/core/routes/all.js b/public/app/core/routes/all.js index d9726ee782c..ab3bef61ed7 100644 --- a/public/app/core/routes/all.js +++ b/public/app/core/routes/all.js @@ -14,146 +14,146 @@ define([ $routeProvider .when('/', { - templateUrl: 'app/partials/dashboard.html', + templateUrl: 'public/app/partials/dashboard.html', controller : 'LoadDashboardCtrl', reloadOnSearch: false, }) .when('/dashboard/:type/:slug', { - templateUrl: 'app/partials/dashboard.html', + templateUrl: 'public/app/partials/dashboard.html', controller : 'LoadDashboardCtrl', reloadOnSearch: false, }) .when('/dashboard-solo/:type/:slug', { - templateUrl: 'app/features/panel/partials/soloPanel.html', + templateUrl: 'public/app/features/panel/partials/soloPanel.html', controller : 'SoloPanelCtrl', }) .when('/dashboard-import/:file', { - templateUrl: 'app/partials/dashboard.html', + templateUrl: 'public/app/partials/dashboard.html', controller : 'DashFromImportCtrl', reloadOnSearch: false, }) .when('/dashboard/new', { - templateUrl: 'app/partials/dashboard.html', + templateUrl: 'public/app/partials/dashboard.html', controller : 'NewDashboardCtrl', reloadOnSearch: false, }) .when('/import/dashboard', { - templateUrl: 'app/features/dashboard/partials/import.html', + templateUrl: 'public/app/features/dashboard/partials/import.html', controller : 'DashboardImportCtrl', }) .when('/datasources', { - templateUrl: 'app/features/datasources/partials/list.html', + templateUrl: 'public/app/features/datasources/partials/list.html', controller : 'DataSourcesCtrl', resolve: loadOrgBundle, }) .when('/datasources/edit/:id', { - templateUrl: 'app/features/datasources/partials/edit.html', + templateUrl: 'public/app/features/datasources/partials/edit.html', controller : 'DataSourceEditCtrl', resolve: loadOrgBundle, }) .when('/datasources/new', { - templateUrl: 'app/features/datasources/partials/edit.html', + templateUrl: 'public/app/features/datasources/partials/edit.html', controller : 'DataSourceEditCtrl', resolve: loadOrgBundle, }) .when('/org', { - templateUrl: 'app/features/org/partials/orgDetails.html', + templateUrl: 'public/app/features/org/partials/orgDetails.html', controller : 'OrgDetailsCtrl', resolve: loadOrgBundle, }) .when('/org/new', { - templateUrl: 'app/features/org/partials/newOrg.html', + templateUrl: 'public/app/features/org/partials/newOrg.html', controller : 'NewOrgCtrl', resolve: loadOrgBundle, }) .when('/org/users', { - templateUrl: 'app/features/org/partials/orgUsers.html', + templateUrl: 'public/app/features/org/partials/orgUsers.html', controller : 'OrgUsersCtrl', resolve: loadOrgBundle, }) .when('/org/apikeys', { - templateUrl: 'app/features/org/partials/orgApiKeys.html', + templateUrl: 'public/app/features/org/partials/orgApiKeys.html', controller : 'OrgApiKeysCtrl', resolve: loadOrgBundle, }) .when('/profile', { - templateUrl: 'app/features/profile/partials/profile.html', + templateUrl: 'public/app/features/profile/partials/profile.html', controller : 'ProfileCtrl', }) .when('/profile/password', { - templateUrl: 'app/features/profile/partials/password.html', + templateUrl: 'public/app/features/profile/partials/password.html', controller : 'ChangePasswordCtrl', }) .when('/profile/select-org', { - templateUrl: 'app/features/profile/partials/select_org.html', + templateUrl: 'public/app/features/profile/partials/select_org.html', controller : 'SelectOrgCtrl', }) .when('/admin/settings', { - templateUrl: 'app/features/admin/partials/settings.html', + templateUrl: 'public/app/features/admin/partials/settings.html', controller : 'AdminSettingsCtrl', }) .when('/admin/users', { - templateUrl: 'app/features/admin/partials/users.html', + templateUrl: 'public/app/features/admin/partials/users.html', controller : 'AdminListUsersCtrl', }) .when('/admin/users/create', { - templateUrl: 'app/features/admin/partials/new_user.html', + templateUrl: 'public/app/features/admin/partials/new_user.html', controller : 'AdminEditUserCtrl', }) .when('/admin/users/edit/:id', { - templateUrl: 'app/features/admin/partials/edit_user.html', + templateUrl: 'public/app/features/admin/partials/edit_user.html', controller : 'AdminEditUserCtrl', }) .when('/admin/orgs', { - templateUrl: 'app/features/admin/partials/orgs.html', + templateUrl: 'public/app/features/admin/partials/orgs.html', controller : 'AdminListOrgsCtrl', }) .when('/admin/orgs/edit/:id', { - templateUrl: 'app/features/admin/partials/edit_org.html', + templateUrl: 'public/app/features/admin/partials/edit_org.html', controller : 'AdminEditOrgCtrl', }) .when('/admin/stats', { - templateUrl: 'app/features/admin/partials/stats.html', + templateUrl: 'public/app/features/admin/partials/stats.html', controller : 'AdminStatsCtrl', controllerAs: 'ctrl', }) .when('/login', { - templateUrl: 'app/partials/login.html', + templateUrl: 'public/app/partials/login.html', controller : 'LoginCtrl', }) .when('/invite/:code', { - templateUrl: 'app/partials/signup_invited.html', + templateUrl: 'public/app/partials/signup_invited.html', controller : 'InvitedCtrl', }) .when('/signup', { - templateUrl: 'app/partials/signup_step2.html', + templateUrl: 'public/app/partials/signup_step2.html', controller : 'SignUpCtrl', }) .when('/user/password/send-reset-email', { - templateUrl: 'app/partials/reset_password.html', + templateUrl: 'public/app/partials/reset_password.html', controller : 'ResetPasswordCtrl', }) .when('/user/password/reset', { - templateUrl: 'app/partials/reset_password.html', + templateUrl: 'public/app/partials/reset_password.html', controller : 'ResetPasswordCtrl', }) .when('/apps', { - templateUrl: 'app/features/apps/partials/list.html', + templateUrl: 'public/app/features/apps/partials/list.html', controller: 'AppListCtrl', controllerAs: 'ctrl', resolve: loadAppsBundle, }) .when('/apps/edit/:appId', { - templateUrl: 'app/features/apps/partials/edit.html', + templateUrl: 'public/app/features/apps/partials/edit.html', controller: 'AppEditCtrl', controllerAs: 'ctrl', resolve: loadAppsBundle, }) .when('/global-alerts', { - templateUrl: 'app/features/dashboard/partials/globalAlerts.html', + templateUrl: 'public/app/features/dashboard/partials/globalAlerts.html', }) .otherwise({ - templateUrl: 'app/partials/error.html', + templateUrl: 'public/app/partials/error.html', controller: 'ErrorCtrl' }); }); diff --git a/public/app/features/dashboard/dashboardCtrl.js b/public/app/features/dashboard/dashboardCtrl.js index 2fe21afdc35..ea0d91019b8 100644 --- a/public/app/features/dashboard/dashboardCtrl.js +++ b/public/app/features/dashboard/dashboardCtrl.js @@ -102,7 +102,7 @@ function (angular, $, config, moment) { var editScope = $rootScope.$new(); editScope.object = options.object; editScope.updateHandler = options.updateHandler; - $scope.appEvent('show-dash-editor', { src: 'app/partials/edit_json.html', scope: editScope }); + $scope.appEvent('show-dash-editor', { src: 'public/app/partials/edit_json.html', scope: editScope }); }; $scope.onDrop = function(panelId, row, dropTarget) { diff --git a/public/app/features/dashboard/dashnav/dashnav.ts b/public/app/features/dashboard/dashnav/dashnav.ts index 9df3ea03eb2..39b6f34da8e 100644 --- a/public/app/features/dashboard/dashnav/dashnav.ts +++ b/public/app/features/dashboard/dashnav/dashnav.ts @@ -47,7 +47,7 @@ export class DashNavCtrl { modalScope.tabIndex = tabIndex; $scope.appEvent('show-modal', { - src: './app/features/dashboard/partials/shareModal.html', + src: 'public/app/features/dashboard/partials/shareModal.html', scope: modalScope }); }; @@ -152,7 +152,7 @@ export class DashNavCtrl { newScope.clone.hideControls = false; $scope.appEvent('show-modal', { - src: './app/features/dashboard/partials/saveDashboardAs.html', + src: 'public/app/features/dashboard/partials/saveDashboardAs.html', scope: newScope, }); }; @@ -192,7 +192,7 @@ export class DashNavCtrl { export function dashNavDirective() { return { restrict: 'E', - templateUrl: 'app/features/dashboard/dashnav/dashnav.html', + templateUrl: 'public/app/features/dashboard/dashnav/dashnav.html', controller: DashNavCtrl, transclude: true, }; diff --git a/public/app/features/dashboard/partials/import.html b/public/app/features/dashboard/partials/import.html index 5d1078e7e5d..a599d6a1797 100644 --- a/public/app/features/dashboard/partials/import.html +++ b/public/app/features/dashboard/partials/import.html @@ -59,7 +59,7 @@ -
+ diff --git a/public/app/features/dashboard/submenu/submenu.ts b/public/app/features/dashboard/submenu/submenu.ts index 75f0778b01f..a9899c3a4b8 100644 --- a/public/app/features/dashboard/submenu/submenu.ts +++ b/public/app/features/dashboard/submenu/submenu.ts @@ -34,7 +34,7 @@ export class SubmenuCtrl { export function submenuDirective() { return { restrict: 'E', - templateUrl: 'app/features/dashboard/submenu/submenu.html', + templateUrl: 'public/app/features/dashboard/submenu/submenu.html', controller: SubmenuCtrl, bindToController: true, controllerAs: 'ctrl', diff --git a/public/app/features/dashboard/timepicker/timepicker.ts b/public/app/features/dashboard/timepicker/timepicker.ts index 59d2e62e7ae..e662757cb97 100644 --- a/public/app/features/dashboard/timepicker/timepicker.ts +++ b/public/app/features/dashboard/timepicker/timepicker.ts @@ -101,7 +101,7 @@ export class TimePickerCtrl { this.refresh.options.unshift({text: 'off'}); this.$rootScope.appEvent('show-dash-editor', { - src: 'app/features/dashboard/timepicker/dropdown.html', + src: 'public/app/features/dashboard/timepicker/dropdown.html', scope: this.$scope, cssClass: 'gf-timepicker-dropdown', }); @@ -146,7 +146,7 @@ export class TimePickerCtrl { export function settingsDirective() { return { restrict: 'E', - templateUrl: 'app/features/dashboard/timepicker/settings.html', + templateUrl: 'public/app/features/dashboard/timepicker/settings.html', controller: TimePickerCtrl, bindToController: true, controllerAs: 'ctrl', @@ -159,7 +159,7 @@ export function settingsDirective() { export function timePickerDirective() { return { restrict: 'E', - templateUrl: 'app/features/dashboard/timepicker/timepicker.html', + templateUrl: 'public/app/features/dashboard/timepicker/timepicker.html', controller: TimePickerCtrl, bindToController: true, controllerAs: 'ctrl', diff --git a/public/app/features/dashboard/unsavedChangesSrv.js b/public/app/features/dashboard/unsavedChangesSrv.js index bbb38d745c7..0b9ef4e18f4 100644 --- a/public/app/features/dashboard/unsavedChangesSrv.js +++ b/public/app/features/dashboard/unsavedChangesSrv.js @@ -139,7 +139,7 @@ function(angular, _) { }; $rootScope.appEvent('show-modal', { - src: './app/partials/unsaved-changes.html', + src: 'public/app/partials/unsaved-changes.html', modalClass: 'modal-no-header confirm-modal', scope: modalScope, }); diff --git a/public/app/features/dashlinks/module.js b/public/app/features/dashlinks/module.js index f133290ceb2..1f014bdc0a3 100644 --- a/public/app/features/dashlinks/module.js +++ b/public/app/features/dashlinks/module.js @@ -21,7 +21,7 @@ function (angular, _) { return { restrict: 'E', controller: 'DashLinkEditorCtrl', - templateUrl: 'app/features/dashlinks/editor.html', + templateUrl: 'public/app/features/dashlinks/editor.html', link: function() { } }; diff --git a/public/app/features/datasources/edit_ctrl.js b/public/app/features/datasources/edit_ctrl.js index 468be95e24b..2bd86e5f385 100644 --- a/public/app/features/datasources/edit_ctrl.js +++ b/public/app/features/datasources/edit_ctrl.js @@ -10,7 +10,7 @@ function (angular, _, config) { var datasourceTypes = []; module.directive('datasourceHttpSettings', function() { - return {templateUrl: 'app/features/datasources/partials/http_settings.html'}; + return {templateUrl: 'public/app/features/datasources/partials/http_settings.html'}; }); module.controller('DataSourceEditCtrl', function($scope, $q, backendSrv, $routeParams, $location, datasourceSrv) { diff --git a/public/app/features/org/orgApiKeysCtrl.js b/public/app/features/org/orgApiKeysCtrl.js index 918f57b42e8..7d2bc4be1c6 100644 --- a/public/app/features/org/orgApiKeysCtrl.js +++ b/public/app/features/org/orgApiKeysCtrl.js @@ -32,7 +32,7 @@ function (angular) { modalScope.key = result.key; $scope.appEvent('show-modal', { - src: './app/features/org/partials/apikeyModal.html', + src: 'public/app/features/org/partials/apikeyModal.html', scope: modalScope }); diff --git a/public/app/features/org/orgUsersCtrl.js b/public/app/features/org/orgUsersCtrl.js index 3d3e4d26ec3..0419e4d4a3b 100644 --- a/public/app/features/org/orgUsersCtrl.js +++ b/public/app/features/org/orgUsersCtrl.js @@ -54,7 +54,7 @@ function (angular) { }; $scope.appEvent('show-modal', { - src: './app/features/org/partials/invite.html', + src: 'public/app/features/org/partials/invite.html', modalClass: 'modal-no-header invite-modal', scope: modalScope }); diff --git a/public/app/features/panel/all.js b/public/app/features/panel/all.js index ad635d83f07..c03089bbf9b 100644 --- a/public/app/features/panel/all.js +++ b/public/app/features/panel/all.js @@ -1,8 +1,6 @@ define([ './panel_menu', './panel_directive', - './panel_srv', - './panel_helper', './solo_panel_ctrl', './panel_loader', './query_editor', diff --git a/public/app/features/panel/metrics_panel_ctrl.ts b/public/app/features/panel/metrics_panel_ctrl.ts index 896babade6d..76b6a7688e4 100644 --- a/public/app/features/panel/metrics_panel_ctrl.ts +++ b/public/app/features/panel/metrics_panel_ctrl.ts @@ -49,7 +49,7 @@ class MetricsPanelCtrl extends PanelCtrl { initEditMode() { this.addEditorTab('Metrics', 'public/app/partials/metrics.html'); - this.addEditorTab('Time range', 'app/features/panel/partials/panelTime.html'); + this.addEditorTab('Time range', 'public/app/features/panel/partials/panelTime.html'); this.datasources = this.datasourceSrv.getMetricSources(); } diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index 1b4749fd1cf..fa1b8663f9c 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -172,7 +172,7 @@ export class PanelCtrl { shareScope.dashboard = this.dashboard; this.publishAppEvent('show-modal', { - src: './app/features/dashboard/partials/shareModal.html', + src: 'public/app/features/dashboard/partials/shareModal.html', scope: shareScope }); } diff --git a/public/app/features/panel/panel_directive.js b/public/app/features/panel/panel_directive.js index ffe978a55ad..da920094e97 100644 --- a/public/app/features/panel/panel_directive.js +++ b/public/app/features/panel/panel_directive.js @@ -10,7 +10,7 @@ function (angular, $) { module.directive('grafanaPanel', function() { return { restrict: 'E', - templateUrl: 'app/features/panel/partials/panel.html', + templateUrl: 'public/app/features/panel/partials/panel.html', transclude: true, scope: { ctrl: "=" }, link: function(scope, elem) { diff --git a/public/app/features/panel/panel_loader.ts b/public/app/features/panel/panel_loader.ts index 73b154e8840..f0b4dbca327 100644 --- a/public/app/features/panel/panel_loader.ts +++ b/public/app/features/panel/panel_loader.ts @@ -8,7 +8,7 @@ import {UnknownPanel} from '../../plugins/panel/unknown/module'; var directiveModule = angular.module('grafana.directives'); /** @ngInject */ -function panelLoader($compile, dynamicDirectiveSrv, $http, $q, $injector) { +function panelLoader($compile, dynamicDirectiveSrv, $http, $q, $injector, $templateCache) { return { restrict: 'E', scope: { @@ -22,6 +22,10 @@ function panelLoader($compile, dynamicDirectiveSrv, $http, $q, $injector) { if (directive.template) { return $q.when(directive.template); } + var cached = $templateCache.get(directive.templateUrl); + if (cached) { + return cached; + } return $http.get(directive.templateUrl).then(res => { return res.data; }); diff --git a/public/app/features/panel/panel_srv.js b/public/app/features/panel/panel_srv.js deleted file mode 100644 index 3fdb8d38974..00000000000 --- a/public/app/features/panel/panel_srv.js +++ /dev/null @@ -1,162 +0,0 @@ -define([ - 'angular', - 'lodash', - 'app/core/config', -], -function (angular, _, config) { - 'use strict'; - - var module = angular.module('grafana.services'); - - module.service('panelSrv', function($rootScope, $timeout, datasourceSrv, $q) { - - this.init = function($scope) { - - if (!$scope.panel.span) { $scope.panel.span = 12; } - - $scope.inspector = {}; - - $scope.editPanel = function() { - $scope.toggleFullscreen(true); - }; - - $scope.sharePanel = function() { - $scope.appEvent('show-modal', { - src: './app/features/dashboard/partials/shareModal.html', - scope: $scope.$new() - }); - }; - - $scope.editPanelJson = function() { - $scope.appEvent('show-json-editor', { object: $scope.panel, updateHandler: $scope.replacePanel }); - }; - - $scope.duplicatePanel = function() { - $scope.dashboard.duplicatePanel($scope.panel, $scope.row); - }; - - $scope.updateColumnSpan = function(span) { - $scope.updatePanelSpan($scope.panel, span); - - $timeout(function() { - $scope.$broadcast('render'); - }); - }; - - $scope.addDataQuery = function(datasource) { - $scope.dashboard.addDataQueryTo($scope.panel, datasource); - }; - - $scope.removeDataQuery = function (query) { - $scope.dashboard.removeDataQuery($scope.panel, query); - $scope.get_data(); - }; - - $scope.duplicateDataQuery = function(query) { - $scope.dashboard.duplicateDataQuery($scope.panel, query); - }; - - $scope.moveDataQuery = function(fromIndex, toIndex) { - $scope.dashboard.moveDataQuery($scope.panel, fromIndex, toIndex); - }; - - $scope.setDatasource = function(datasource) { - // switching to mixed - if (datasource.meta.mixed) { - _.each($scope.panel.targets, function(target) { - target.datasource = $scope.panel.datasource; - if (target.datasource === null) { - target.datasource = config.defaultDatasource; - } - }); - } - // switching from mixed - else if ($scope.datasource && $scope.datasource.meta.mixed) { - _.each($scope.panel.targets, function(target) { - delete target.datasource; - }); - } - - $scope.panel.datasource = datasource.value; - $scope.datasource = null; - $scope.get_data(); - }; - - $scope.toggleEditorHelp = function(index) { - if ($scope.editorHelpIndex === index) { - $scope.editorHelpIndex = null; - return; - } - $scope.editorHelpIndex = index; - }; - - $scope.isNewPanel = function() { - return $scope.panel.title === config.new_panel_title; - }; - - $scope.toggleFullscreen = function(edit) { - $scope.dashboardViewState.update({ fullscreen: true, edit: edit, panelId: $scope.panel.id }); - }; - - $scope.otherPanelInFullscreenMode = function() { - return $scope.dashboardViewState.fullscreen && !$scope.fullscreen; - }; - - $scope.getCurrentDatasource = function() { - if ($scope.datasource) { - return $q.when($scope.datasource); - } - - return datasourceSrv.get($scope.panel.datasource); - }; - - $scope.panelRenderingComplete = function() { - $rootScope.performance.panelsRendered++; - }; - - $scope.get_data = function() { - if ($scope.otherPanelInFullscreenMode()) { return; } - - if ($scope.panel.snapshotData) { - if ($scope.loadSnapshot) { - $scope.loadSnapshot($scope.panel.snapshotData); - } - return; - } - - delete $scope.panelMeta.error; - $scope.panelMeta.loading = true; - - $scope.getCurrentDatasource().then(function(datasource) { - $scope.datasource = datasource; - return $scope.refreshData($scope.datasource) || $q.when({}); - }).then(function() { - $scope.panelMeta.loading = false; - }, function(err) { - console.log('Panel data error:', err); - $scope.panelMeta.loading = false; - $scope.panelMeta.error = err.message || "Timeseries data request error"; - $scope.inspector.error = err; - }); - }; - - if ($scope.refreshData) { - $scope.$on("refresh", $scope.get_data); - } - - // Post init phase - $scope.fullscreen = false; - $scope.editor = { index: 1 }; - - $scope.dashboardViewState.registerPanel($scope); - $scope.datasources = datasourceSrv.getMetricSources(); - - if (!$scope.skipDataOnInit) { - $timeout(function() { - $scope.get_data(); - }, 30); - } - }; - }); - -}); diff --git a/public/app/features/panellinks/module.js b/public/app/features/panellinks/module.js index a4c93c397fa..bdb227547a0 100644 --- a/public/app/features/panellinks/module.js +++ b/public/app/features/panellinks/module.js @@ -15,7 +15,7 @@ function (angular, _) { }, restrict: 'E', controller: 'PanelLinksEditorCtrl', - templateUrl: 'app/features/panellinks/module.html', + templateUrl: 'public/app/features/panellinks/module.html', link: function() { } }; diff --git a/public/app/features/playlist/playlist_routes.js b/public/app/features/playlist/playlist_routes.js index a3f9cc26f8c..e61ed2d6527 100644 --- a/public/app/features/playlist/playlist_routes.js +++ b/public/app/features/playlist/playlist_routes.js @@ -11,17 +11,17 @@ function (angular) { module.config(function($routeProvider) { $routeProvider .when('/playlists', { - templateUrl: 'app/features/playlist/partials/playlists.html', + templateUrl: 'public/app/features/playlist/partials/playlists.html', controllerAs: 'ctrl', controller : 'PlaylistsCtrl' }) .when('/playlists/create', { - templateUrl: 'app/features/playlist/partials/playlist.html', + templateUrl: 'public/app/features/playlist/partials/playlist.html', controllerAs: 'ctrl', controller : 'PlaylistEditCtrl' }) .when('/playlists/edit/:id', { - templateUrl: 'app/features/playlist/partials/playlist.html', + templateUrl: 'public/app/features/playlist/partials/playlist.html', controllerAs: 'ctrl', controller : 'PlaylistEditCtrl' }) diff --git a/public/app/features/playlist/playlist_search.ts b/public/app/features/playlist/playlist_search.ts index 6663b106ab7..e00c2cb3a36 100644 --- a/public/app/features/playlist/playlist_search.ts +++ b/public/app/features/playlist/playlist_search.ts @@ -70,7 +70,7 @@ export class PlaylistSearchCtrl { export function playlistSearchDirective() { return { restrict: 'E', - templateUrl: 'app/features/playlist/partials/playlist_search.html', + templateUrl: 'public/app/features/playlist/partials/playlist_search.html', controller: PlaylistSearchCtrl, bindToController: true, controllerAs: 'ctrl', diff --git a/public/app/partials/dashboard.html b/public/app/partials/dashboard.html index 3e60b2542e9..97db5617a1c 100644 --- a/public/app/partials/dashboard.html +++ b/public/app/partials/dashboard.html @@ -107,8 +107,3 @@ - -