mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
Added duplicate feature for variable.
This commit is contained in:
parent
c66476f6b6
commit
28ef972c9f
@ -96,6 +96,14 @@ function (angular, _) {
|
||||
}
|
||||
};
|
||||
|
||||
$scope.duplicate = function(variable) {
|
||||
$scope.current = angular.copy(variable);
|
||||
$scope.variables.push($scope.current);
|
||||
$scope.current = $scope.variables[$scope.variables.length - 1];
|
||||
$scope.current.name = 'copy_of_'+variable.name;
|
||||
$scope.updateSubmenuVisibility();
|
||||
};
|
||||
|
||||
$scope.update = function() {
|
||||
if ($scope.isValid()) {
|
||||
$scope.runQuery().then(function() {
|
||||
|
@ -59,6 +59,11 @@
|
||||
Edit
|
||||
</a>
|
||||
</td>
|
||||
<td style="width: 1%">
|
||||
<a ng-click="duplicate(variable)" class="btn btn-inverse btn-small">
|
||||
Duplicate
|
||||
</a>
|
||||
</td>
|
||||
<td style="width: 1%"><i ng-click="_.move(variables,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
|
||||
<td style="width: 1%"><i ng-click="_.move(variables,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
|
||||
<td style="width: 1%">
|
||||
|
Loading…
Reference in New Issue
Block a user