From 27cce086c6b480a78159551ac6de560f2d5c9923 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 25 Jul 2021 01:09:14 +0200 Subject: [PATCH] fileman ui --- README.md | 11 +++ copyparty/up2k.py | 17 +++- copyparty/web/browser.css | 21 +++++ copyparty/web/browser.js | 192 ++++++++++++++++++++++++++++++++++---- 4 files changed, 219 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index c1061920..b8b2a603 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ this is the readme for v0.12 (unreleased) which has a different expression for v * [zip downloads](#zip-downloads) * [uploading](#uploading) * [file-search](#file-search) + * [file manager](#file-manager) * [markdown viewer](#markdown-viewer) * [other tricks](#other-tricks) * [searching](#searching) @@ -230,6 +231,9 @@ the browser has the following hotkeys (assumes qwerty, ignores actual layout) * `M` parent folder (or unexpand current) * `G` toggle list / grid view * `T` toggle thumbnails / icons +* `ctrl-X` cut selected files/folders +* `ctrl-V` paste +* `F2` rename selected file/folder * when playing audio: * `J/L` prev/next song * `U/O` skip 10sec back/forward @@ -352,6 +356,13 @@ note that since up2k has to read the file twice, `[🎈 bup]` can be up to 2x fa up2k has saved a few uploads from becoming corrupted in-transfer already; caught an android phone on wifi redhanded in wireshark with a bitflip, however bup with https would *probably* have noticed as well (thanks to tls also functioning as an integrity check) +## file manager + +if you have the required permissions, you can cut/paste, rename, and delete files/folders + +you can move files across browser tabs (cut in one tab, paste in another) + + ## markdown viewer ![copyparty-md-read-fs8](https://user-images.githubusercontent.com/241032/115978057-66419080-a57d-11eb-8539-d2be843991aa.png) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 16328a81..98b5646b 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -1357,14 +1357,21 @@ class Up2k(object): self._forget_file(svn.realpath, srem, c1, w) return "k" - # not found in dst vol; copy info - self.log("mv: plain move") + # not found in dst db; copy info + self.log("mv: plain move") + st = bos.stat(sabs) + + if c1 and c2: self._copy_tags(c1, c2, w) + + if c1: self._forget_file(svn.realpath, srem, c1, w) - st = bos.stat(sabs) + + if c2: self.db_add(c2, w, drd, dfn, st.st_mtime, st.st_size) - bos.rename(sabs, dabs) - return "k" + + bos.rename(sabs, dabs) + return "k" def _copy_tags(self, csrc, cdst, wark): """copy all tags for wark from src-db to dst-db""" diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 2c9e5091..aeebdb24 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -432,6 +432,27 @@ html.light #ggrid a.sel { font-size: .6em; display: block; } +#wfm a:not(.en) { + opacity: .3; + color: #f6c; +} +html.light #wfm a:not(.en) { + color: #c4a; +} +#files tbody td.c1 { + animation: fcut1 .5s ease-out; +} +#files tbody td.c2 { + animation: fcut2 .5s ease-out; +} +@keyframes fcut1 { + 0% {opacity:0} + 100% {opacity:1} +} +@keyframes fcut2 { + 0% {opacity:0} + 100% {opacity:1} +} #wzip a { font-size: .4em; margin: -.3em .3em; diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 73e62dbc..253a3545 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -31,10 +31,9 @@ ebi('widget').innerHTML = ( '
' + '✎name⌫delete✂cut⧉copy📋paste' + + ' href="#" id="fdel" tt="delete selected items$NHotkey: ctrl-K">⌫delete✂cut📋paste' + 'sel.
allsel.
inv.