-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathcontroller.js
More file actions
24 lines (24 loc) · 813 Bytes
/
controller.js
File metadata and controls
24 lines (24 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
app.controller('SshDeployController', ['$scope', '$http', function ($scope, $http) {
var projectName = $scope.$parent.$parent.project.name;
$scope.paths = require('./remote_paths')(projectName.replace('/','_'));
$scope.$watch('configs[branch.name].ssh_deploy.config', function (value) {
$scope.config = value;
});
$scope.saving = false;
$scope.save = function () {
$scope.saving = true;
$scope.pluginConfig('ssh_deploy', $scope.config, function() {
$scope.saving = false;
});
};
$scope.removeHost = function (index) {
$scope.config.hosts.splice(index, 1);
$scope.save();
};
$scope.addHost = function () {
if (!$scope.config.hosts) $scope.config.hosts = [];
$scope.config.hosts.push($scope.new_host);
$scope.new_host = '';
$scope.save();
};
}]);