mark offline volumes in directory tree sidebar

This commit is contained in:
ed 2023-08-26 19:00:46 +00:00
parent 9f8edb7f32
commit 5a38311481
4 changed files with 18 additions and 4 deletions

View file

@ -3331,6 +3331,10 @@ class HttpCli(object):
for x in vfs_virt:
if x != excl:
try:
bos.stat(vn.nodes[x].realpath)
except:
x += "\n"
dirs.append(x)
ret["a"] = dirs

View file

@ -867,8 +867,11 @@ class Up2k(object):
if not HAVE_SQLITE3 or "e2d" not in flags or "d2d" in flags:
return None
if bos.makedirs(histpath):
hidedir(histpath)
try:
if bos.makedirs(histpath):
hidedir(histpath)
except:
return None
try:
cur = self._open_db(db_path)

View file

@ -1620,6 +1620,12 @@ html.cz .tgl.btn.on {
list-style: none;
border-top: 1px solid var(--bg-u5);
}
#tree li.offline>a:first-child:before {
content: '❌';
position: absolute;
margin-left: -.25em;
z-index: 3;
}
#tree ul a.sel {
background: #000;
background: var(--bg-d3);

View file

@ -6028,7 +6028,8 @@ var treectl = (function () {
for (var a = 0; a < keys.length; a++) {
var kk = keys[a],
ks = kk.slice(1),
k = uricom_sdec(ks),
ded = ks.endsWith('\n'),
k = uricom_sdec(ded ? ks.replace(/\n$/, '') : ks),
hek = esc(k[0]),
uek = k[1] ? uricom_enc(k[0], true) : k[0],
url = '/' + (top ? top + uek : uek) + '/',
@ -6041,7 +6042,7 @@ var treectl = (function () {
ret += '<li>' + link + '\n<ul>\n' + subtree + '</ul></li>\n';
}
else {
ret += '<li>' + link + '</li>\n';
ret += (ded ? '<li class="offline">' : '<li>') + link + '</li>\n';
}
}
return ret;