From d1f496d56389bd32e216b265424222332a7470d7 Mon Sep 17 00:00:00 2001 From: Adam Nierzad Date: Wed, 13 Feb 2019 09:48:41 +0000 Subject: [PATCH 1/4] Remove left over console.log(). --- .../Clients/Deploy/src/js/controllers/ResultController.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/PolyDeploy/Clients/Deploy/src/js/controllers/ResultController.js b/PolyDeploy/Clients/Deploy/src/js/controllers/ResultController.js index 3bf6d7e..72c51ba 100644 --- a/PolyDeploy/Clients/Deploy/src/js/controllers/ResultController.js +++ b/PolyDeploy/Clients/Deploy/src/js/controllers/ResultController.js @@ -80,8 +80,6 @@ panelClass = modPackage.Success ? 'panel-success' : 'panel-danger'; } - console.log(panelClass); - return panelClass; }; From 7acaeabc2f9221057fc19d24c5934dc86247825a Mon Sep 17 00:00:00 2001 From: Adam Nierzad Date: Wed, 13 Feb 2019 10:41:46 +0000 Subject: [PATCH 2/4] Stop refreshing status after the session is complete. --- .../Deploy/src/js/services/SessionService.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/PolyDeploy/Clients/Deploy/src/js/services/SessionService.js b/PolyDeploy/Clients/Deploy/src/js/services/SessionService.js index 8d6d32e..a3c20cd 100644 --- a/PolyDeploy/Clients/Deploy/src/js/services/SessionService.js +++ b/PolyDeploy/Clients/Deploy/src/js/services/SessionService.js @@ -12,6 +12,13 @@ // Gets a new session from the API. function newSession() { + // Is there an interval promise? + if (sessionRefreshInterval) { + + // Cancel it. + $interval.cancel(sessionRefreshInterval); + } + // Get a session from the API. sessionPromise = SessionDataService.create().then( function (session) { @@ -36,6 +43,16 @@ return SessionDataService.get(session.Guid).then( function (sessionUpdate) { + // Do we need to stop refreshing? + if (sessionUpdate + && sessionUpdate.Status + && sessionUpdate.Status === 2) { + + // Complete, no need to continue refreshing. + $interval.cancel(sessionRefreshInterval); + } + + // Replace current session data. replace(sessionObject, sessionUpdate); return sessionObject; From 4cb3e44e3aa4dbfe1b5f3f73cb0dc9b525b298ae Mon Sep 17 00:00:00 2001 From: Adam Nierzad Date: Wed, 13 Feb 2019 10:43:58 +0000 Subject: [PATCH 3/4] Added new session button to result page. --- .../src/js/controllers/ResultController.js | 27 +++++++++++++++++-- .../Deploy/src/js/templates/result.html | 6 +++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/PolyDeploy/Clients/Deploy/src/js/controllers/ResultController.js b/PolyDeploy/Clients/Deploy/src/js/controllers/ResultController.js index 72c51ba..66ab8f5 100644 --- a/PolyDeploy/Clients/Deploy/src/js/controllers/ResultController.js +++ b/PolyDeploy/Clients/Deploy/src/js/controllers/ResultController.js @@ -1,5 +1,5 @@ -module.exports = ['$scope', 'SessionService', - function ($scope, SessionService) { +module.exports = ['$scope', '$state','SessionService', + function ($scope, $state, SessionService) { // Wait for session. SessionService.sessionPromise.then( @@ -18,6 +18,29 @@ } }); + // Start a new deploy. + $scope.restart = function () { + + // Create a new session. + SessionService.newSession() + .then(function () { + + // Navigate back to beginning. + $state.go('install.upload'); + }); + }; + + // Is the install complete? + $scope.isComplete = function () { + + var session = $scope.session; + + // Is the session complete? + return session + && session.Status + && session.Status === 2; + }; + // Current status. $scope.currentStatus = function (session) { diff --git a/PolyDeploy/Clients/Deploy/src/js/templates/result.html b/PolyDeploy/Clients/Deploy/src/js/templates/result.html index 1f24d0d..1354a05 100644 --- a/PolyDeploy/Clients/Deploy/src/js/templates/result.html +++ b/PolyDeploy/Clients/Deploy/src/js/templates/result.html @@ -19,6 +19,12 @@

Installing

{{ currentStatus(session) }}

+ +
From b0525e2fd01436aca214f1cdad87506b3bfd2157 Mon Sep 17 00:00:00 2001 From: Adam Nierzad Date: Wed, 13 Feb 2019 10:44:17 +0000 Subject: [PATCH 4/4] Removed old console.log(). --- PolyDeploy/Clients/Deploy/src/js/services/SessionService.js | 1 - 1 file changed, 1 deletion(-) diff --git a/PolyDeploy/Clients/Deploy/src/js/services/SessionService.js b/PolyDeploy/Clients/Deploy/src/js/services/SessionService.js index a3c20cd..8d388a9 100644 --- a/PolyDeploy/Clients/Deploy/src/js/services/SessionService.js +++ b/PolyDeploy/Clients/Deploy/src/js/services/SessionService.js @@ -68,7 +68,6 @@ function (session) { // Get session summary. - console.log('GetSummary: ' + session.Guid); return SessionDataService.summary(session.Guid); }); }