aboutsummaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2021-07-20 23:19:55 +0200
committercbdev <cb@cbcdn.com>2021-07-20 23:19:55 +0200
commitdad7fcafa4d4b2ab3fd59edb01c57a12155f0375 (patch)
tree66c60e78f6430048c47f540c2464b24606a050b0 /assets
parentfbcd1f22d63f6bac83fc3a87481e76808552972d (diff)
downloadcargohold-dad7fcafa4d4b2ab3fd59edb01c57a12155f0375.tar.gz
cargohold-dad7fcafa4d4b2ab3fd59edb01c57a12155f0375.tar.bz2
cargohold-dad7fcafa4d4b2ab3fd59edb01c57a12155f0375.zip
Add size calculation
Diffstat (limited to 'assets')
-rw-r--r--assets/cargohold.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/assets/cargohold.js b/assets/cargohold.js
index cd6cc34..2ba8cc0 100644
--- a/assets/cargohold.js
+++ b/assets/cargohold.js
@@ -100,9 +100,9 @@ function listing_clear(){
element("dirlisting").innerHTML = "";
}
-function listing_add(name){
- let link = node("a", "listing-entry", name);
- link.href = "file/" + encodeURIComponent(name);
+function listing_add(file){
+ let link = node("a", "listing-entry", file.name);
+ link.href = "file/" + encodeURIComponent(file.name);
element("dirlisting").appendChild(link);
}
@@ -111,8 +111,8 @@ function listing_update(){
let req = new XMLHttpRequest();
req.onload = function(evt){
let data = JSON.parse(req.response);
- for(let i = 0; i < data.length; i++){
- listing_add(data[i]);
+ for(let i = 0; i < data.files.length; i++){
+ listing_add(data.files[i]);
}
};
req.open("GET", "listing");