mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 00:52:16 -06:00
improve ux for relocating partial uploads
if someone accidentally starts uploading a file in the wrong folder, it was not obvious that you can forget that upload in the unpost tab this '(explain)' button in the upload-error hopefully explains that, and upload immediately commences when the initial attempt is aborted on the backend, cleanup the dupesched when an upload is aborted, and save some cpu by adding unique entries only
This commit is contained in:
parent
9163780000
commit
be6afe2d3a
|
@ -3093,7 +3093,8 @@ class Up2k(object):
|
|||
if cur:
|
||||
dupe = (cj["prel"], cj["name"], cj["lmod"])
|
||||
try:
|
||||
self.dupesched[src].append(dupe)
|
||||
if dupe not in self.dupesched[src]:
|
||||
self.dupesched[src].append(dupe)
|
||||
except:
|
||||
self.dupesched[src] = [dupe]
|
||||
|
||||
|
@ -4676,6 +4677,13 @@ class Up2k(object):
|
|||
t = "forgetting partial upload {} ({})"
|
||||
p = self._vis_job_progress(job)
|
||||
self.log(t.format(wark, p))
|
||||
|
||||
src = djoin(ptop, vrem)
|
||||
zi = len(self.dupesched.pop(src, []))
|
||||
if zi:
|
||||
t = "...and forgetting %d links in dupesched"
|
||||
self.log(t % (zi,))
|
||||
|
||||
assert wark
|
||||
del reg[wark]
|
||||
|
||||
|
|
|
@ -2785,6 +2785,7 @@ html.b #u2conf a.b:hover {
|
|||
padding-left: .2em;
|
||||
}
|
||||
.fsearch_explain {
|
||||
color: var(--a-dark);
|
||||
padding-left: .7em;
|
||||
font-size: 1.1em;
|
||||
line-height: 0;
|
||||
|
|
|
@ -542,6 +542,7 @@ var Ls = {
|
|||
"u_hashdone": 'hashing done',
|
||||
"u_hashing": 'hash',
|
||||
"u_hs": 'handshaking...',
|
||||
"u_started": "the files are now being uploaded; see [🚀]",
|
||||
"u_dupdefer": "duplicate; will be processed after all other files",
|
||||
"u_actx": "click this text to prevent loss of<br />performance when switching to other windows/tabs",
|
||||
"u_fixed": "OK! Fixed it 👍",
|
||||
|
@ -577,6 +578,7 @@ var Ls = {
|
|||
"ue_la": 'you are currently logged in as "{0}"',
|
||||
"ue_sr": 'you are currently in file-search mode\n\nswitch to upload-mode by clicking the magnifying glass 🔎 (next to the big SEARCH button), and try uploading again\n\nsorry',
|
||||
"ue_ta": 'try uploading again, it should work now',
|
||||
"ue_ab": "this file is already being uploaded into another folder, and that upload must be completed before the file can be uploaded elsewhere.\n\nYou can abort and forget the initial upload using the top-left 🧯",
|
||||
"ur_1uo": "OK: File uploaded successfully",
|
||||
"ur_auo": "OK: All {0} files uploaded successfully",
|
||||
"ur_1so": "OK: File found on server",
|
||||
|
@ -1129,6 +1131,7 @@ var Ls = {
|
|||
"u_hashdone": 'befaring ferdig',
|
||||
"u_hashing": 'les',
|
||||
"u_hs": 'serveren tenker...',
|
||||
"u_started": "filene blir nå lastet opp 🚀",
|
||||
"u_dupdefer": "duplikat; vil bli håndtert til slutt",
|
||||
"u_actx": "klikk her for å forhindre tap av<br />ytelse ved bytte til andre vinduer/faner",
|
||||
"u_fixed": "OK! Løste seg 👍",
|
||||
|
@ -1164,6 +1167,7 @@ var Ls = {
|
|||
"ue_la": 'du er logget inn som "{0}"',
|
||||
"ue_sr": 'du er i filsøk-modus\n\nbytt til opplastning ved å klikke på forstørrelsesglasset 🔎 (ved siden av den store FILSØK-knappen) og prøv igjen\n\nsorry',
|
||||
"ue_ta": 'prøv å laste opp igjen, det burde funke nå',
|
||||
"ue_ab": "den samme filen er allerede under opplastning til en annen mappe, og den må fullføres der før filen kan lastes opp andre steder.\n\nDu kan avbryte og glemme den påbegynte opplastningen ved hjelp av 🧯 oppe til venstre",
|
||||
"ur_1uo": "OK: Filen ble lastet opp",
|
||||
"ur_auo": "OK: Alle {0} filene ble lastet opp",
|
||||
"ur_1so": "OK: Filen ble funnet på serveren",
|
||||
|
@ -1716,6 +1720,7 @@ var Ls = {
|
|||
"u_hashdone": '哈希完成',
|
||||
"u_hashing": '哈希',
|
||||
"u_hs": '正在等待服务器...',
|
||||
"u_started": "文件现在正在上传 🚀", //m
|
||||
"u_dupdefer": "这是一个重复文件。它将在所有其他文件上传后进行处理",
|
||||
"u_actx": "单击此文本以防止切换到其他窗口/选项卡时性能下降",
|
||||
"u_fixed": "好! 已修复 👍",
|
||||
|
@ -1751,6 +1756,7 @@ var Ls = {
|
|||
"ue_la": '你当前以 "{0}" 登录',
|
||||
"ue_sr": '你当前处于文件搜索模式\n\n通过点击大搜索按钮旁边的放大镜 🔎 切换到上传模式,然后重试上传\n\n抱歉',
|
||||
"ue_ta": '尝试再次上传,现在应该能正常工作',
|
||||
"ue_ab": "这份文件正在上传到另一个文件夹,必须完成该上传后,才能将文件上传到其他位置。\n\n您可以通过左上角的🧯中止并忘记该上传。", //m
|
||||
"ur_1uo": "成功:文件上传成功",
|
||||
"ur_auo": "成功:所有 {0} 个文件上传成功",
|
||||
"ur_1so": "成功:文件在服务器上找到",
|
||||
|
@ -9465,7 +9471,23 @@ var unpost = (function () {
|
|||
toast.ok(5, this.responseText);
|
||||
|
||||
if (!QS('#op_unpost a[me]'))
|
||||
ebi(goto_unpost());
|
||||
goto_unpost();
|
||||
|
||||
var fi = window.up2k && up2k.st.files;
|
||||
if (fi && fi.length < 9) {
|
||||
for (var a = 0; a < fi.length; a++) {
|
||||
var f = fi[a];
|
||||
if (!f.done && (f.rechecks || f.want_recheck) &&
|
||||
!has(up2k.st.todo.handshake, f) &&
|
||||
!has(up2k.st.busy.handshake, f)
|
||||
) {
|
||||
up2k.st.todo.handshake.push(f);
|
||||
up2k.ui.seth(f.n, 2, L.u_hashdone);
|
||||
up2k.ui.seth(f.n, 1, '📦 wait');
|
||||
up2k.ui.move(f.n, 'bz');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ct.onclick = function (e) {
|
||||
|
|
|
@ -2408,6 +2408,9 @@ function up2k_init(subtle) {
|
|||
msg = 'done';
|
||||
|
||||
if (t.postlist.length) {
|
||||
if (t.rechecks && QS('#opa_del.act'))
|
||||
toast.inf(30, L.u_started, L.u_unpt);
|
||||
|
||||
var arr = st.todo.upload,
|
||||
sort = arr.length && arr[arr.length - 1].nfile > t.n;
|
||||
|
||||
|
@ -2518,8 +2521,13 @@ function up2k_init(subtle) {
|
|||
if (!t.rechecks && (err_pend || err_srcb)) {
|
||||
t.rechecks = 0;
|
||||
t.want_recheck = true;
|
||||
err = L.u_dupdefer;
|
||||
cls = 'defer';
|
||||
if (st.busy.upload.length || st.busy.handshake.length || st.bytes.uploaded) {
|
||||
err = L.u_dupdefer;
|
||||
cls = 'defer';
|
||||
}
|
||||
}
|
||||
if (err_pend) {
|
||||
err += ' <a href="#" onclick="toast.inf(60, L.ue_ab);" class="fsearch_explain">(' + L.u_expl + ')</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -627,6 +627,7 @@ var tl_browser = {
|
|||
"u_hashdone": 'hashing done',
|
||||
"u_hashing": 'hash',
|
||||
"u_hs": 'handshaking...',
|
||||
"u_started": "the files are now being uploaded; see [🚀]",
|
||||
"u_dupdefer": "duplicate; will be processed after all other files",
|
||||
"u_actx": "click this text to prevent loss of<br />performance when switching to other windows/tabs",
|
||||
"u_fixed": "OK! Fixed it 👍",
|
||||
|
@ -662,6 +663,7 @@ var tl_browser = {
|
|||
"ue_la": 'you are currently logged in as "{0}"',
|
||||
"ue_sr": 'you are currently in file-search mode\n\nswitch to upload-mode by clicking the magnifying glass 🔎 (next to the big SEARCH button), and try uploading again\n\nsorry',
|
||||
"ue_ta": 'try uploading again, it should work now',
|
||||
"ue_ab": "this file is already being uploaded into another folder, and that upload must be completed before the file can be uploaded elsewhere.\n\nYou can abort and forget the initial upload using the top-left 🧯",
|
||||
"ur_1uo": "OK: File uploaded successfully",
|
||||
"ur_auo": "OK: All {0} files uploaded successfully",
|
||||
"ur_1so": "OK: File found on server",
|
||||
|
|
Loading…
Reference in a new issue