From 127c921f585582ddaaeec4ea3026d6c89ff500fc Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 11 Mar 2020 15:00:20 +0500 Subject: [PATCH] bug fixes to git manager --- .../websiteFunctions/websiteFunctions.js | 115 ++++++++ .../templates/websiteFunctions/manageGIT.html | 278 +++++++++++++++++- websiteFunctions/urls.py | 2 + websiteFunctions/views.py | 16 + websiteFunctions/website.py | 160 +++++++++- 5 files changed, 557 insertions(+), 14 deletions(-) diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 0ea33fe52..0ff02878e 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -5830,9 +5830,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,6 +6259,118 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { } }; + $scope.attachRepoGIT = function () { + $scope.cyberpanelLoading = false; + $scope.commandStatus = ""; + $scope.statusBox = false; + + url = "/websites/attachRepoGIT"; + + + var data = { + domain: $("#domain").text(), + folder: $scope.folder, + gitHost: $scope.gitHost, + gitUsername: $scope.gitUsername, + gitReponame: $scope.gitReponame, + overrideData: $scope.overrideData + }; + + 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: 'Changes applied.', + type: 'success' + }); + $scope.commandStatus = response.data.commandStatus; + $scope.fetchFolderDetails(); + } else { + 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; + 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' + }); + + + } + }; + function getCreationStatus() { url = "/websites/installWordpressStatus"; diff --git a/websiteFunctions/templates/websiteFunctions/manageGIT.html b/websiteFunctions/templates/websiteFunctions/manageGIT.html index 34111da12..9e95fadfe 100755 --- a/websiteFunctions/templates/websiteFunctions/manageGIT.html +++ b/websiteFunctions/templates/websiteFunctions/manageGIT.html @@ -40,7 +40,231 @@ Init Repo + + + +
+ + + + Attach Existing Repo + + + + Create New Branch @@ -83,9 +307,10 @@ + + +
+ + @@ -290,7 +554,7 @@