|
|
|
@ -15,11 +15,11 @@ function (angular, _) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
restrict: 'E', |
|
|
|
restrict: 'E', |
|
|
|
controller: 'PanelLinkEditorCtrl', |
|
|
|
controller: 'PanelLinkEditorCtrl', |
|
|
|
templateUrl: 'app/components/panellinkeditor/module.html', |
|
|
|
templateUrl: 'app/features/panellinkeditor/module.html', |
|
|
|
link: function() { |
|
|
|
link: function() { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
}).controller('PanelLinkEditorCtrl', function($scope) { |
|
|
|
}).controller('PanelLinkEditorCtrl', function($scope, datasourceSrv) { |
|
|
|
|
|
|
|
|
|
|
|
$scope.panel.links = $scope.panel.links || []; |
|
|
|
$scope.panel.links = $scope.panel.links || []; |
|
|
|
|
|
|
|
|
|
|
|
@ -30,6 +30,19 @@ function (angular, _) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.searchDashboards = function(query, callback) { |
|
|
|
|
|
|
|
var ds = datasourceSrv.getGrafanaDB(); |
|
|
|
|
|
|
|
if (ds === null) { return; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ds.searchDashboards(query).then(function(result) { |
|
|
|
|
|
|
|
var dashboards = _.map(result.dashboards, function(dash) { |
|
|
|
|
|
|
|
return dash.title; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
callback(dashboards); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
$scope.deleteLink = function(link) { |
|
|
|
$scope.deleteLink = function(link) { |
|
|
|
$scope.panel.links = _.without($scope.panel.links, link); |
|
|
|
$scope.panel.links = _.without($scope.panel.links, link); |
|
|
|
}; |
|
|
|
}; |