From 2e61794c502055dbfa567d2a936abe5cc807e077 Mon Sep 17 00:00:00 2001 From: Hassan Hashmi <75794688+habbi-hb@users.noreply.github.com> Date: Sun, 5 Jun 2022 17:55:49 +0500 Subject: [PATCH] wpstagingui --- .../websiteFunctions/websiteFunctions.js | 60 +++++ .../websiteFunctions/WPsiteHome.html | 72 ++++-- .../websiteFunctions/WPsitesList.html | 227 +++++++++--------- websiteFunctions/urls.py | 1 + websiteFunctions/views.py | 21 ++ websiteFunctions/website.py | 45 ++++ 6 files changed, 294 insertions(+), 132 deletions(-) diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index f0f238931..314bf7785 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -1321,8 +1321,68 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo } }; + + FinalDeployToProduction = function () { + $('#wordpresshomeloading').show(); + $('#DeployToProduction').modal('hide'); + var data = { + WPid: $('#WPid').html(), + StagingID: DeploytoProductionID + } + + var url = "/websites/DeploytoProduction"; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + function ListInitialDatas(response) { + + $('#wordpresshomeloading').hide(); + if (response.data.status === 1) { + new PNotify({ + title: 'Success!', + text: 'Deploy To Production start!.', + type: 'success' + }); + statusFile = response.data.tempStatusPath; + getCreationStatus(); + + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $('#wordpresshomeloading').hide(); + new PNotify({ + title: 'Operation Failed!', + text: response, + type: 'error' + }); + + } + + }; + }); +var DeploytoProductionID; +function DeployToProductionInitial(vall){ + DeploytoProductionID=vall; +} + function AddStagings(value, index, array) { var FinalMarkup = '
| Name | +Domain | +Path | +Action | +
|---|
| Name | -Domain | -Path | -Action | -
|---|
| WordPress Site Title + | +Domain + | +Action + | -
|---|
| WordPress Site Title - | -Domain - | -Action - | +
|---|---|---|
|
+
+ {{ sub.title }} + + |
+ + Visit + + | -- |
|
-
- {{ sub.title }} - - |
- - Visit - - | + +