add progress bar to install and uninstall
This commit is contained in:
@@ -96,27 +96,32 @@
|
||||
|
||||
function installPackage() {
|
||||
vm.installState.status = "Installing";
|
||||
vm.installState.progress = "0";
|
||||
|
||||
//TODO: If any of these fail, will they keep calling the next one?
|
||||
packageResource
|
||||
.installFiles(vm.localPackage)
|
||||
.then(function(pack) {
|
||||
vm.installState.status = "Importing...";
|
||||
vm.installState.progress = "25";
|
||||
return packageResource.import(pack);
|
||||
},
|
||||
installError)
|
||||
.then(function(pack) {
|
||||
vm.installState.status = "Installing...";
|
||||
vm.installState.progress = "50";
|
||||
return packageResource.installFiles(pack);
|
||||
},
|
||||
installError)
|
||||
.then(function(pack) {
|
||||
vm.installState.status = "Restarting, please wait...";
|
||||
vm.installState.progress = "75";
|
||||
return packageResource.installData(pack);
|
||||
},
|
||||
installError)
|
||||
.then(function(pack) {
|
||||
vm.installState.status = "All done, your browser will now refresh";
|
||||
vm.installState.progress = "100";
|
||||
return packageResource.cleanUp(pack);
|
||||
},
|
||||
installError)
|
||||
|
||||
@@ -107,6 +107,14 @@
|
||||
Install package
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="umb-info-local-item">
|
||||
<umb-progress-bar
|
||||
ng-if="vm.installState.status !== ''"
|
||||
percentage="{{vm.installState.progress}}">
|
||||
</umb-progress-bar>
|
||||
</div>
|
||||
|
||||
<div class="umb-info-local-item text-error" ng-if="!vm.localPackage.isCompatible">
|
||||
This package cannot be installed, it requires a minimum Umbraco version of {{vm.localPackage.umbracoVersion}}
|
||||
</div>
|
||||
|
||||
@@ -29,16 +29,19 @@
|
||||
|
||||
function uninstallPackage(installedPackage) {
|
||||
vm.installState.status = "Uninstalling package...";
|
||||
vm.installState.progress = "0";
|
||||
|
||||
packageResource.uninstall(installedPackage.id)
|
||||
.then(function () {
|
||||
if (installedPackage.files.length > 0) {
|
||||
vm.installState.status = "All done, your browser will now refresh";
|
||||
vm.installState.progress = "100";
|
||||
|
||||
var url = window.location.href + "?uninstalled=" + vm.package.packageGuid;
|
||||
window.location.reload(true);
|
||||
}
|
||||
else {
|
||||
init();
|
||||
init();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -99,6 +99,14 @@
|
||||
Uninstall package
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="umb-info-local-item">
|
||||
<umb-progress-bar
|
||||
ng-if="vm.installState.status !== ''"
|
||||
percentage="{{vm.installState.progress}}">
|
||||
</umb-progress-bar>
|
||||
</div>
|
||||
|
||||
<div class="umb-info-local-item text-info">
|
||||
<p>{{vm.installState.status}}</p>
|
||||
</div>
|
||||
|
||||
@@ -165,21 +165,25 @@
|
||||
function installPackage(selectedPackage) {
|
||||
|
||||
vm.installState.status = "importing...";
|
||||
vm.installState.progress = "0";
|
||||
|
||||
packageResource
|
||||
.import(selectedPackage)
|
||||
.then(function(pack) {
|
||||
vm.installState.status = "Installing...";
|
||||
vm.installState.progress = "33";
|
||||
return packageResource.installFiles(pack);
|
||||
},
|
||||
error)
|
||||
.then(function(pack) {
|
||||
vm.installState.status = "Restarting, please wait...";
|
||||
vm.installState.progress = "66";
|
||||
return packageResource.installData(pack);
|
||||
},
|
||||
error)
|
||||
.then(function(pack) {
|
||||
vm.installState.status = "All done, your browser will now refresh";
|
||||
vm.installState.progress = "100";
|
||||
return packageResource.cleanUp(pack);
|
||||
},
|
||||
error)
|
||||
|
||||
@@ -317,9 +317,18 @@
|
||||
Install package
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="umb-info-local-item">
|
||||
<umb-progress-bar
|
||||
ng-if="vm.installState.status !== ''"
|
||||
percentage="{{vm.installState.progress}}">
|
||||
</umb-progress-bar>
|
||||
</div>
|
||||
|
||||
<div class="umb-info-local-item text-error" ng-if="!vm.localPackage.isCompatible">
|
||||
This package cannot be installed, it requires a minimum Umbraco version of {{vm.localPackage.umbracoVersion}}
|
||||
</div>
|
||||
|
||||
<div class="umb-info-local-item text-info">
|
||||
<p>{{vm.installState.status}}</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user