mirror of https://github.com/grafana/grafana
parent
e871e56522
commit
c8ead22722
@ -0,0 +1,27 @@ |
||||
<h2>Settings</h2> |
||||
|
||||
<div class="edit-tab-with-sidemenu"> |
||||
<aside class="edit-sidemenu-aside"> |
||||
<ul class="edit-sidemenu"> |
||||
<li ng-class="{active: ctrl.viewId === section.id}" ng-repeat="section in ctrl.sections"> |
||||
<a ng-click="ctrl.viewId = section.id"> |
||||
{{::section.title}} |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</aside> |
||||
|
||||
<div class="edit-tab-content" ng-if="ctrl.viewId === 'general'"> |
||||
general |
||||
</div> |
||||
|
||||
<div class="edit-tab-content" ng-if="ctrl.viewId === 'annotations'"> |
||||
annotations |
||||
</div> |
||||
|
||||
<div class="edit-tab-content" ng-if="ctrl.viewId === 'templating'"> |
||||
annotations |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
@ -0,0 +1,47 @@ |
||||
import {coreModule, appEvents} from 'app/core/core'; |
||||
import {DashboardModel} from '../dashboard_model'; |
||||
|
||||
export class SettingsCtrl { |
||||
dashboard: DashboardModel; |
||||
isOpen: boolean; |
||||
viewId: string; |
||||
|
||||
sections: any[] = [ |
||||
{title: 'General', id: 'general'}, |
||||
{title: 'Annotations', id: 'annotations'}, |
||||
{title: 'Templating', id: 'templating'}, |
||||
{title: 'Versions', id: 'versions'}, |
||||
]; |
||||
|
||||
/** @ngInject */ |
||||
constructor($scope, private $location, private $rootScope) { |
||||
appEvents.on('hide-dash-editor', this.hideSettings.bind(this), $scope); |
||||
|
||||
var urlParams = this.$location.search(); |
||||
this.viewId = urlParams.editview; |
||||
} |
||||
|
||||
hideSettings() { |
||||
var urlParams = this.$location.search(); |
||||
delete urlParams.editview; |
||||
setTimeout(() => { |
||||
this.$rootScope.$apply(() => { |
||||
this.$location.search(urlParams); |
||||
}); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
export function dashboardSettings() { |
||||
return { |
||||
restrict: 'E', |
||||
templateUrl: 'public/app/features/dashboard/settings/settings.html', |
||||
controller: SettingsCtrl, |
||||
bindToController: true, |
||||
controllerAs: 'ctrl', |
||||
transclude: true, |
||||
scope: { dashboard: "=" } |
||||
}; |
||||
} |
||||
|
||||
coreModule.directive('dashboardSettings', dashboardSettings); |
||||
Loading…
Reference in new issue