| index 18829ec..8a51b22 100644 | | index 18829ec..8a51b22 100644 |
| --- a/src/plugin_disks.c | | --- a/src/plugin_disks.c |
| +++ b/src/plugin_disks.c | | +++ b/src/plugin_disks.c |
| @@ -1159,11 +1159,22 @@ static int mode_html(int embed) | | @@ -1159,11 +1159,22 @@ static int mode_html(int embed) |
| 1159 | " d.scan_ms + ' ms' + (d.truncated ? ' \\u00b7 truncated' : ''));\n" | 1159 | " d.scan_ms + ' ms' + (d.truncated ? ' \\u00b7 truncated' : ''));\n" |
| 1160 | " }\n" | 1160 | " }\n" |
| 1161 | "\n" | 1161 | "\n" |
| 1162 | -" function loadDirs(){\n" | 1162 | +" function loadDirs(fallbackDone){\n" |
| 1163 | " var u = withCtx(base('dirs')) + '&root=' + encodeURIComponent(ROOT);\n" | 1163 | " var u = withCtx(base('dirs')) + '&root=' + encodeURIComponent(ROOT);\n" |
| 1164 | " return fetch(u, { headers: hdr(), cache: 'no-store' })\n" | 1164 | " return fetch(u, { headers: hdr(), cache: 'no-store' })\n" |
| 1165 | " .then(function(r){ return r.json(); })\n" | 1165 | " .then(function(r){ return r.json(); })\n" |
| 1166 | -" .then(function(d){ renderDirs(d, d && d.ok === true); })\n" | 1166 | +" .then(function(d){\n" |
| | 1167 | +" /* /workspace only exists on BotCloud containers. On a plain node the\n" |
| | 1168 | +" first request answers root_unavailable, so fall through to HOME\n" |
| | 1169 | +" once instead of showing an empty panel. */\n" |
| | 1170 | +" if (d && d.error === 'root_unavailable' && ROOT === 'workspace' && !fallbackDone){\n" |
| | 1171 | +" ROOT = 'home';\n" |
| | 1172 | +" Array.prototype.forEach.call(document.querySelectorAll('#segRoot button'),\n" |
| | 1173 | +" function(x){ x.classList.toggle('on', x.getAttribute('data-root') === 'home'); });\n" |
| | 1174 | +" return loadDirs(true);\n" |
| | 1175 | +" }\n" |
| | 1176 | +" renderDirs(d, d && d.ok === true);\n" |
| | 1177 | +" })\n" |
| 1167 | " .catch(function(e){ renderDirs({error: String(e)}, false); });\n" | 1178 | " .catch(function(e){ renderDirs({error: String(e)}, false); });\n" |
| 1168 | " }\n" | 1179 | " }\n" |
| 1169 | "\n" | 1180 | "\n" |