mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
add git configurations
This commit is contained in:
@@ -5832,6 +5832,10 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) {
|
||||
$scope.remoteResult = response.data.remoteResult;
|
||||
$scope.totalCommits = response.data.totalCommits;
|
||||
$scope.home = response.data.home;
|
||||
$scope.webHookURL = response.data.webHookURL;
|
||||
$scope.autoCommitCurrent = response.data.autoCommitCurrent;
|
||||
$scope.autoPushCurrent = response.data.autoPushCurrent;
|
||||
$scope.emailLogsCurrent = response.data.emailLogsCurrent;
|
||||
} else {
|
||||
$scope.gitTracking = false;
|
||||
$scope.gitEnable = true;
|
||||
@@ -6658,5 +6662,57 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) {
|
||||
}
|
||||
};
|
||||
|
||||
$scope.saveGitConfigurations = function () {
|
||||
|
||||
$scope.cyberpanelLoading = false;
|
||||
|
||||
url = "/websites/saveGitConfigurations";
|
||||
|
||||
|
||||
var data = {
|
||||
domain: $("#domain").text(),
|
||||
folder: $scope.folder,
|
||||
autoCommit: $scope.autoCommit,
|
||||
autoPush: $scope.autoPush,
|
||||
emailLogs: $scope.emailLogs,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
$scope.cyberpanelLoading = true;
|
||||
if (response.data.status === 1) {
|
||||
new PNotify({
|
||||
title: 'Success',
|
||||
text: 'Successfully saved.',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.cyberpanelLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page.',
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
/* Java script code to git tracking ends here */
|
||||
|
||||
Reference in New Issue
Block a user