1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-03-02 03:40:21 +00:00

Show file sizes of artifacts (#53)

Show artifacts sizes in webui
This commit is contained in:
Vaclav Valicek
2018-06-01 09:14:59 +02:00
committed by Oliver Giles
parent bbbef11304
commit fba2d226ef
3 changed files with 9 additions and 1 deletions

View File

@@ -2,6 +2,13 @@
* frontend application for Laminar Continuous Integration
* https://laminar.ohwg.net
*/
Vue.filter('iecFileSize', function(bytes) {
var exp = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, exp)).toFixed(1) + ' ' +
['B', 'KiB', 'MiB', 'GiB', 'TiB'][exp];
});
const wsp = function(path) {
return new WebSocket((location.protocol === 'https:'?'wss://':'ws://')
+ location.host + path);