diff --git a/src/laminar.cpp b/src/laminar.cpp
index 4aa3ae6..aec1950 100644
--- a/src/laminar.cpp
+++ b/src/laminar.cpp
@@ -133,6 +133,7 @@ void Laminar::populateArtifacts(Json &j, std::string job, uint num) const {
j.StartObject();
j.set("url", archiveUrl + it->path().string().substr(prefixLen));
j.set("filename", it->path().string().substr(scopeLen+1));
+ j.set("size", fs::file_size(it->path()));
j.EndObject();
}
}
diff --git a/src/resources/index.html b/src/resources/index.html
index ad3134e..0ed94f3 100644
--- a/src/resources/index.html
+++ b/src/resources/index.html
@@ -222,7 +222,7 @@
Artifacts
diff --git a/src/resources/js/app.js b/src/resources/js/app.js
index a9a7da4..13eb2b1 100644
--- a/src/resources/js/app.js
+++ b/src/resources/js/app.js
@@ -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);