-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathconfig.js
41 lines (38 loc) · 1.12 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
app.controller('GitLabCtrl', [
'$scope',
function ($scope) {
$scope.config = $scope.providerConfig();
$scope.config.cache = $scope.config.cache || false;
$scope.addWebhooks = function () {
$scope.loadingWebhooks = true;
$.ajax($scope.api_root + 'gitlab/hook', {
type: 'POST',
success: function () {
$scope.loadingWebhooks = false;
$scope.success('Set gitlab webhooks', true);
},
error: function () {
$scope.loadingWebhooks = false;
$scope.error('Failed to set gitlab webhooks', true);
},
});
};
$scope.deleteWebhooks = function () {
$scope.loadingWebhooks = true;
$.ajax($scope.api_root + 'gitlab/hook', {
type: 'DELETE',
success: function (data) {
$scope.loadingWebhooks = false;
$scope.success(data, true);
},
error: function () {
$scope.loadingWebhooks = false;
$scope.error('Failed to remove gitlab webhooks', true);
},
});
};
$scope.save = function () {
this.providerConfig(this.config);
};
},
]);