add progress
This commit is contained in:
parent
419fd60f75
commit
f057087d15
|
@ -1 +1 @@
|
|||
Subproject commit effee987beca6f0522a93533d65de1e7ed246987
|
||||
Subproject commit a5742d1a2aa42db0993081269beea695049d2805
|
|
@ -148,10 +148,18 @@ app.controller('websiteCtrl', [
|
|||
, sld: vm.domain.sld
|
||||
//, sub: vm.record.sub
|
||||
, multipart: { site: vm.currentFiles[0] }
|
||||
, progress: function (ev) {
|
||||
// TODO must digest
|
||||
vm.uploadPercent = Math.round((ev.loaded / ev.total) * 100);
|
||||
// TODO GiB, MiB, KiB, etc
|
||||
vm.uploadTotal = (ev.total / (1024 * 1024)).toFixed(2);
|
||||
vm.uploadProgress = (ev.loaded / (1024 * 1024)).toFixed(2);
|
||||
}
|
||||
, unzip: vm.unzip
|
||||
, strip: vm.stripZip
|
||||
, path: vm.webPath
|
||||
}).then(function (result) {
|
||||
vm.uploadTotal = 0;
|
||||
window.alert(JSON.stringify(result));
|
||||
});
|
||||
};
|
||||
|
|
|
@ -15,6 +15,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
|
|||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld/*, sub: opts.sub*/, unzip: opts.unzip, strip: opts.strip, path: opts.path })
|
||||
, session: session
|
||||
, multipart: opts.multipart // special property to be figured out by browser request code
|
||||
, progress: opts.progress
|
||||
}).then(function (result) {
|
||||
return result;
|
||||
});
|
||||
|
|
|
@ -60,7 +60,9 @@
|
|||
|
||||
<!-- div ng-if="vm.isZip" ><label>Unzip directory</label> <input type="text" ng-model="vm.unzipPath" /></div -->
|
||||
|
||||
<div><label>Web path</label> <input type="text" ng-model="vm.webPath" /></div>
|
||||
<div ng-if="vm.uploadTotal"><span ng-bind="vm.uploadPercent">99</span>% | <span ng-bind="vm.uploadProgress">1</span> MiB / <span ng-bind="vm.uploadTotal">100</span> MiB</div>
|
||||
|
||||
<div><label>Web path</label> <input type="text" ng-model="vm.webPath" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue