diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 0ff02878e..7164ffcf8 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -6371,12 +6371,16 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { } }; - function getCreationStatus() { + $scope.fetchGitignore = function () { + + $scope.cyberpanelLoading = false; + + url = "/websites/fetchGitignore"; - url = "/websites/installWordpressStatus"; var data = { - statusFile: statusFile + domain: $("#domain").text(), + folder: $scope.folder }; var config = { @@ -6385,62 +6389,92 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { } }; - $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); - function ListInitialDatas(response) { - - - if (response.data.abort === 1) { - - if (response.data.installStatus === 1) { - - $scope.cyberpanelLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.goBackDisable = false; - - $("#installProgress").css("width", "100%"); - $scope.installPercentage = "100"; - $scope.currentStatus = response.data.currentStatus; - $timeout.cancel(); - - } else { - - $scope.cyberpanelLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.goBackDisable = false; - - $scope.currentStatus = response.data.error_message; - - $("#installProgress").css("width", "0%"); - $scope.installPercentage = "0"; - $scope.goBackDisable = false; - - } - + $scope.cyberpanelLoading = true; + if (response.data.status === 1) { + new PNotify({ + title: 'Success', + text: 'Successfully fetched.', + type: 'success' + }); + $scope.gitIgnoreContent = response.data.gitIgnoreContent; } else { - $("#installProgress").css("width", response.data.installationProgress + "%"); - $scope.installPercentage = response.data.installationProgress; - $scope.currentStatus = response.data.currentStatus; - $timeout(getCreationStatus, 1000); + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); } + } function cantLoadInitialDatas(response) { - $scope.cyberpanelLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.goBackDisable = false; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page.', + type: 'error' + }); + + + } + }; + + $scope.saveGitIgnore = function () { + + $scope.cyberpanelLoading = false; + + url = "/websites/saveGitIgnore"; + + + var data = { + domain: $("#domain").text(), + folder: $scope.folder, + gitIgnoreContent: $scope.gitIgnoreContent + + }; + + 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 */ diff --git a/websiteFunctions/templates/websiteFunctions/manageGIT.html b/websiteFunctions/templates/websiteFunctions/manageGIT.html index 9e95fadfe..faf95a03b 100755 --- a/websiteFunctions/templates/websiteFunctions/manageGIT.html +++ b/websiteFunctions/templates/websiteFunctions/manageGIT.html @@ -384,10 +384,56 @@ Push To Remote - + Edit .gitignore + + + Remove Git @@ -405,7 +451,7 @@