diff --git a/static/websiteFunctions/websiteFunctions.js b/static/websiteFunctions/websiteFunctions.js index 0ea33fe52..ced6742d8 100644 --- a/static/websiteFunctions/websiteFunctions.js +++ b/static/websiteFunctions/websiteFunctions.js @@ -5794,6 +5794,7 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { $scope.gitTracking = true; $scope.gitEnable = true; $scope.statusBox = true; + $scope.gitCommitsTable = true; var statusFile; @@ -5830,9 +5831,12 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { $scope.remote = response.data.remote; $scope.remoteResult = response.data.remoteResult; $scope.totalCommits = response.data.totalCommits; + $scope.home = response.data.home; } else { $scope.gitTracking = false; $scope.gitEnable = true; + $scope.home = response.data.home; + $scope.deploymentKey = response.data.deploymentKey; } } else { new PNotify({ @@ -6256,12 +6260,21 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { } }; - function getCreationStatus() { + $scope.attachRepoGIT = function () { + $scope.cyberpanelLoading = false; + $scope.commandStatus = ""; + $scope.statusBox = false; + + url = "/websites/attachRepoGIT"; - url = "/websites/installWordpressStatus"; var data = { - statusFile: statusFile + domain: $("#domain").text(), + folder: $scope.folder, + gitHost: $scope.gitHost, + gitUsername: $scope.gitUsername, + gitReponame: $scope.gitReponame, + overrideData: $scope.overrideData }; var config = { @@ -6270,62 +6283,199 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { } }; - $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); - function ListInitialDatas(response) { + $scope.cyberpanelLoading = true; - - 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; - - } - + if (response.data.status === 1) { + new PNotify({ + title: 'Success', + text: 'Changes applied.', + type: 'success' + }); + $scope.commandStatus = response.data.commandStatus; + $scope.fetchFolderDetails(); } 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' + }); + $scope.commandStatus = response.data.commandStatus; } + } function cantLoadInitialDatas(response) { + $scope.cyberpanelLoading = false; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page.', + type: 'error' + }); + + } + }; + + $scope.removeTracking = function () { + + $scope.cyberpanelLoading = false; + + url = "/websites/removeTracking"; + + + var data = { + domain: $("#domain").text(), + folder: $scope.folder + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + function ListInitialDatas(response) { $scope.cyberpanelLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.goBackDisable = false; + if (response.data.status === 1) { + new PNotify({ + title: 'Success', + text: 'Changes applied.', + type: 'success' + }); + $scope.fetchFolderDetails(); + } 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' + }); - } + + } + }; + + $scope.fetchGitignore = function () { + + $scope.cyberpanelLoading = false; + + url = "/websites/fetchGitignore"; + + + var data = { + domain: $("#domain").text(), + folder: $scope.folder + }; + + 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 fetched.', + type: 'success' + }); + $scope.gitIgnoreContent = response.data.gitIgnoreContent; + } 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' + }); + + + } + }; + + $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/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 7164ffcf8..ced6742d8 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -5794,6 +5794,7 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { $scope.gitTracking = true; $scope.gitEnable = true; $scope.statusBox = true; + $scope.gitCommitsTable = true; var statusFile; diff --git a/websiteFunctions/templates/websiteFunctions/manageGIT.html b/websiteFunctions/templates/websiteFunctions/manageGIT.html index faf95a03b..4361b0b40 100755 --- a/websiteFunctions/templates/websiteFunctions/manageGIT.html +++ b/websiteFunctions/templates/websiteFunctions/manageGIT.html @@ -625,6 +625,8 @@ +