feat: open the file manager in the user's home directory
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5e5718b397
commit
201d63ee1e
2 files changed
+48
-1
No files matched your search
@@ -282,7 +282,15 @@
|
||||
['dragleave','drop'].forEach(x => drop.addEventListener(x, e => { e.preventDefault(); if(x!=='drop')drop.classList.remove('drag'); }));
|
||||
drop.addEventListener('drop', e => { drop.classList.remove('drag'); if (e.dataTransfer.files.length) uploadFiles(e.dataTransfer.files); });
|
||||
|
||||
load('/');
|
||||
// Start in the home directory of the machine's user; an agent too old to
|
||||
// know "~" fails that listing, so fall back to the root.
|
||||
(async () => {
|
||||
const r = await api('list', {path: '~' + {{.Agent.LoginUser}}});
|
||||
if (!r.ok) { load('/'); return; }
|
||||
cwd = r.data.path; entries = r.data.entries || []; selected.clear();
|
||||
$('path').value = cwd;
|
||||
render();
|
||||
})();
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in new issue
Block a user