mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
add upload pause
This commit is contained in:
parent
0f09b98a39
commit
e15c8fd146
|
@ -619,8 +619,6 @@ roughly sorted by priority
|
|||
* ctrl-click overrides onclick (tree, ...)
|
||||
* indicate dropped queries in search ui
|
||||
* readme.md as epilogue
|
||||
* thx kip:
|
||||
* pause button for uploads
|
||||
* reduce up2k roundtrips
|
||||
* start from a chunk index and just go
|
||||
* terminate client on bad data
|
||||
|
|
|
@ -78,7 +78,7 @@ ebi('op_up2k').innerHTML = (
|
|||
' <tr>\n' +
|
||||
' <td>\n' +
|
||||
' <a href="#" id="nthread_sub">–</a><input\n' +
|
||||
' class="txtbox" id="nthread" value="2"/><a\n' +
|
||||
' class="txtbox" id="nthread" value="2" tt="pause uploads by setting it to 0"/><a\n' +
|
||||
' href="#" id="nthread_add">+</a><br /> \n' +
|
||||
' </td>\n' +
|
||||
' </tr>\n' +
|
||||
|
|
|
@ -1309,6 +1309,17 @@ function up2k_init(subtle) {
|
|||
}
|
||||
tt.init();
|
||||
|
||||
function bumpthread2(e) {
|
||||
if (e.ctrlKey || e.altKey || e.metaKey || e.isComposing)
|
||||
return;
|
||||
|
||||
if (e.code == 'ArrowUp')
|
||||
bumpthread(1);
|
||||
|
||||
if (e.code == 'ArrowDown')
|
||||
bumpthread(-1);
|
||||
}
|
||||
|
||||
function bumpthread(dir) {
|
||||
try {
|
||||
dir.stopPropagation();
|
||||
|
@ -1319,7 +1330,7 @@ function up2k_init(subtle) {
|
|||
if (dir.target) {
|
||||
clmod(obj, 'err', 1);
|
||||
var v = Math.floor(parseInt(obj.value));
|
||||
if (v < 1 || v > 64 || v !== v)
|
||||
if (v < 0 || v > 64 || v !== v)
|
||||
return;
|
||||
|
||||
parallel_uploads = v;
|
||||
|
@ -1330,8 +1341,8 @@ function up2k_init(subtle) {
|
|||
|
||||
parallel_uploads += dir;
|
||||
|
||||
if (parallel_uploads < 1)
|
||||
parallel_uploads = 1;
|
||||
if (parallel_uploads < 0)
|
||||
parallel_uploads = 0;
|
||||
|
||||
if (parallel_uploads > 16)
|
||||
parallel_uploads = 16;
|
||||
|
@ -1430,6 +1441,7 @@ function up2k_init(subtle) {
|
|||
bumpthread(-1);
|
||||
};
|
||||
|
||||
ebi('nthread').onkeydown = bumpthread2;
|
||||
ebi('nthread').addEventListener('input', bumpthread, false);
|
||||
ebi('multitask').addEventListener('click', tgl_multitask, false);
|
||||
ebi('ask_up').addEventListener('click', tgl_ask_up, false);
|
||||
|
@ -1443,7 +1455,10 @@ function up2k_init(subtle) {
|
|||
nodes[a].addEventListener('touchend', nop, false);
|
||||
|
||||
set_fsearch();
|
||||
bumpthread({ "target": 1 })
|
||||
bumpthread({ "target": 1 });
|
||||
if (parallel_uploads < 1)
|
||||
bumpthread(1);
|
||||
|
||||
return { "init_deps": init_deps, "set_fsearch": set_fsearch }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue