mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 09:33:34 -06:00
39 lines
832 B
JavaScript
39 lines
832 B
JavaScript
|
define([
|
||
|
'angular',
|
||
|
'lodash',
|
||
|
'./linkSrv',
|
||
|
],
|
||
|
function (angular, _) {
|
||
|
'use strict';
|
||
|
|
||
|
angular
|
||
|
.module('grafana.directives')
|
||
|
.directive('panelLinkEditor', function() {
|
||
|
return {
|
||
|
scope: {
|
||
|
panel: "="
|
||
|
},
|
||
|
restrict: 'E',
|
||
|
controller: 'PanelLinkEditorCtrl',
|
||
|
templateUrl: 'app/components/panellinkeditor/module.html',
|
||
|
link: function() {
|
||
|
}
|
||
|
};
|
||
|
}).controller('PanelLinkEditorCtrl', function($scope) {
|
||
|
|
||
|
$scope.panel.links = $scope.panel.links || [];
|
||
|
|
||
|
$scope.addLink = function() {
|
||
|
$scope.panel.links.push({
|
||
|
type: 'dashboard',
|
||
|
name: 'Drilldown dashboard'
|
||
|
});
|
||
|
};
|
||
|
|
||
|
$scope.deleteLink = function(link) {
|
||
|
$scope.panel.links = _.without($scope.panel.links, link);
|
||
|
};
|
||
|
|
||
|
});
|
||
|
});
|