Merge branch 'oauth3' of git.daplie.com:Daplie/walnut_launchpad into jon/tokens

This commit is contained in:
Jon Lambson 2017-08-30 12:13:34 -06:00
commit 6a4d46b238
3 changed files with 12 additions and 1 deletions

View File

@ -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));
});
};

View File

@ -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;
});

View File

@ -60,6 +60,8 @@
<!-- div ng-if="vm.isZip" ><label>Unzip directory</label> <input type="text" ng-model="vm.unzipPath" /></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>