optimizations / cleanup

This commit is contained in:
ed 2022-09-15 01:18:19 +02:00
parent 868103a9c5
commit 6db72d7166
5 changed files with 27 additions and 15 deletions

View file

@ -104,7 +104,7 @@ def main():
if err: if err:
return err return err
if min(w, h) < 720: if max(w, h) < 1280 and min(w, h) < 720:
return "resolution too small" return "resolution too small"
zs = ( zs = (

View file

@ -88,10 +88,10 @@
--g-sel-fg: #fff; --g-sel-fg: #fff;
--g-sel-bg: #925; --g-sel-bg: #925;
--g-sel-b1: #c37; --g-sel-b1: #e39;
--g-sel-sh: #b36; --g-sel-sh: #b36;
--g-fsel-bg: #d39; --g-fsel-bg: #d39;
--g-fsel-b1: #d48; --g-fsel-b1: #f4a;
--g-fsel-ts: #804; --g-fsel-ts: #804;
--g-fg: var(--a-hil); --g-fg: var(--a-hil);
--g-bg: var(--bg-u2); --g-bg: var(--bg-u2);
@ -1261,7 +1261,9 @@ html.y #ops svg circle {
max-width: min(41em, calc(100% - 2.6em)); max-width: min(41em, calc(100% - 2.6em));
} }
.opbox input { .opbox input {
position: relative;
margin: .5em; margin: .5em;
top: -.3em;
} }
.opview input[type=text] { .opview input[type=text] {
color: var(--fg); color: var(--fg);
@ -1454,7 +1456,7 @@ html {
margin: .2em; margin: .2em;
white-space: pre; white-space: pre;
position: relative; position: relative;
top: -.2em; top: -.12em;
} }
html.c .btn, html.c .btn,
html.a .btn { html.a .btn {
@ -2903,6 +2905,11 @@ html.d #treepar {
gap: 1em; gap: 1em;
} }
html.b #ggrid {
padding: 0 2em 2em 0;
gap: .5em 3em;
}
#ggrid > a { #ggrid > a {
margin: unset; margin: unset;
padding: unset; padding: unset;

View file

@ -325,7 +325,8 @@ var Ls = {
"u_emtleak2": ' <a href="{0}">switch to https (recommended)</a> or ', "u_emtleak2": ' <a href="{0}">switch to https (recommended)</a> or ',
"u_emtleak3": ' ', "u_emtleak3": ' ',
"u_emtleak4": "try the following:\n<ul><li>hit <code>F5</code> to refresh the page</li><li>then disable the &nbsp;<code>mt</code>&nbsp; button in the &nbsp;<code>⚙️ settings</code></li><li>and try that upload again</li></ul>Uploads will be a bit slower, but oh well.\nSorry for the trouble !", "u_emtleak4": "try the following:\n<ul><li>hit <code>F5</code> to refresh the page</li><li>then disable the &nbsp;<code>mt</code>&nbsp; button in the &nbsp;<code>⚙️ settings</code></li><li>and try that upload again</li></ul>Uploads will be a bit slower, but oh well.\nSorry for the trouble !",
"u_emtleakc": "\n\nPS: chrome v107 has a bugfix for this", "u_emtleakc": '\n\nPS: chrome v107 <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1354816">has a bugfix</a> for this',
"u_emtleakf": '\n\nPS: firefox v106 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1790500">should have a bugfix</a> for this',
"u_s404": "not found on server", "u_s404": "not found on server",
"u_expl": "explain", "u_expl": "explain",
"u_tu": '<p class="warn">WARNING: turbo enabled, <span>&nbsp;client may not detect and resume incomplete uploads; see turbo-button tooltip</span></p>', "u_tu": '<p class="warn">WARNING: turbo enabled, <span>&nbsp;client may not detect and resume incomplete uploads; see turbo-button tooltip</span></p>',
@ -671,7 +672,8 @@ var Ls = {
"u_emtleak2": ' helst at du <a href="{0}">bytter til https</a>, eller ', "u_emtleak2": ' helst at du <a href="{0}">bytter til https</a>, eller ',
"u_emtleak3": ' at du ', "u_emtleak3": ' at du ',
"u_emtleak4": "prøver følgende:\n<ul><li>trykk F5 for å laste siden på nytt</li><li>så skru av &nbsp;<code>mt</code>&nbsp; bryteren under &nbsp;<code>⚙️ innstillinger</code></li><li>og forsøk den samme opplastningen igjen</li></ul>Opplastning vil gå litt tregere, men det får så være.\nBeklager bryderiet !", "u_emtleak4": "prøver følgende:\n<ul><li>trykk F5 for å laste siden på nytt</li><li>så skru av &nbsp;<code>mt</code>&nbsp; bryteren under &nbsp;<code>⚙️ innstillinger</code></li><li>og forsøk den samme opplastningen igjen</li></ul>Opplastning vil gå litt tregere, men det får så være.\nBeklager bryderiet !",
"u_emtleakc": "\n\nPS: feilen skal være fikset i chrome v107", "u_emtleakc": '\n\nPS: feilen <a href="<a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1354816">skal være fikset</a> i chrome v107',
"u_emtleakf": '\n\nPS: feilen <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1790500">skal være fikset</a> i firefox v106',
"u_s404": "ikke funnet på serveren", "u_s404": "ikke funnet på serveren",
"u_expl": "forklar", "u_expl": "forklar",
"u_tu": '<p class="warn">ADVARSEL: turbo er på, <span>&nbsp;avbrutte opplastninger vil muligens ikke oppdages og gjenopptas; hold musepekeren over turbo-knappen for mer info</span></p>', "u_tu": '<p class="warn">ADVARSEL: turbo er på, <span>&nbsp;avbrutte opplastninger vil muligens ikke oppdages og gjenopptas; hold musepekeren over turbo-knappen for mer info</span></p>',
@ -3265,7 +3267,7 @@ var showfile = (function () {
window.Prism = { 'manual': true }; window.Prism = { 'manual': true };
var em = QS('#bdoc>pre'); var em = QS('#bdoc>pre');
if (em) if (em)
em = [r.sname(window.location.search), window.location.hash, em.textContent]; em = [r.sname(window.location.search), location.hash, em.textContent];
else { else {
var m = /[?&]doc=([^&]+)/.exec(window.location.search); var m = /[?&]doc=([^&]+)/.exec(window.location.search);
if (m) { if (m) {
@ -4508,6 +4510,7 @@ function aligngriditems() {
ebi('ggrid').style.justifyContent = 'space-between'; ebi('ggrid').style.justifyContent = 'space-between';
} }
} }
window.addEventListener('resize', aligngriditems);
var treectl = (function () { var treectl = (function () {
var r = { var r = {
@ -4697,8 +4700,6 @@ var treectl = (function () {
timer.add(onscroll2, true); timer.add(onscroll2, true);
function onresize(e) { function onresize(e) {
aligngriditems();
if (!entreed || r.hidden) if (!entreed || r.hidden)
return; return;
@ -5038,7 +5039,6 @@ var treectl = (function () {
set_files_html(html); set_files_html(html);
function asdf() { function asdf() {
filecols.set_style();
showfile.mktree(); showfile.mktree();
mukey.render(); mukey.render();
reload_tree(); reload_tree();
@ -5158,7 +5158,7 @@ var treectl = (function () {
r.goto(url.pathname, false, true); r.goto(url.pathname, false, true);
}; };
hist_replace(get_evpath() + window.location.hash); hist_replace(get_evpath() + location.hash);
r.onscroll = onscroll; r.onscroll = onscroll;
return r; return r;
})(); })();
@ -5317,7 +5317,7 @@ var filecols = (function () {
var hidden = jread('filecols', []); var hidden = jread('filecols', []);
var add_btns = function () { var add_btns = function () {
var ths = QSA('#files th>span'); var ths = QSA('#files>thead th>span');
for (var a = 0, aa = ths.length; a < aa; a++) { for (var a = 0, aa = ths.length; a < aa; a++) {
var th = ths[a].parentElement, var th = ths[a].parentElement,
ttv = L.cols[ths[a].textContent]; ttv = L.cols[ths[a].textContent];
@ -5363,7 +5363,7 @@ var filecols = (function () {
add_btns(); add_btns();
var ohidden = [], var ohidden = [],
ths = QSA('#files th'), ths = QSA('#files>thead th'),
ncols = ths.length; ncols = ths.length;
for (var a = 0; a < ncols; a++) { for (var a = 0; a < ncols; a++) {
@ -5389,7 +5389,7 @@ var filecols = (function () {
} }
if (window['tt']) { if (window['tt']) {
tt.att(ebi('hcols')); tt.att(ebi('hcols'));
tt.att(QS('#files thead')); tt.att(QS('#files>thead'));
} }
}; };

View file

@ -1397,7 +1397,7 @@ function up2k_init(subtle) {
st.oserr = true; st.oserr = true;
var msg = HTTPS ? L.u_emtleak3 : L.u_emtleak2.format((window.location + '').replace(':', 's:')); var msg = HTTPS ? L.u_emtleak3 : L.u_emtleak2.format((window.location + '').replace(':', 's:'));
modal.alert(L.u_emtleak1 + msg + L.u_emtleak4 + (CHROME ? L.u_emtleakc : '')); modal.alert(L.u_emtleak1 + msg + L.u_emtleak4 + (CHROME ? L.u_emtleakc : FIREFOX ? L.u_emtleakf : ''));
} }
///// /////

View file

@ -54,6 +54,11 @@ cat log | awk '!/"purl"/{next} {s=$1;sub(/[^m]+m/,"");gsub(/:/," ");t=60*(60*$1+
cat log | awk '!/"purl"/{next} {s=$1;sub(/[^m]+m/,"");gsub(/:/," ");t=60*(60*$1+$2)+$3} t<p{t+=86400} !p{a=t;p=t;r=0;next} t-p>1{printf "%.3f += %.3f - %.3f (%.3f) # %.3f -> %.3f\n",r,p,a,p-a,p,t;r+=p-a;a=t} {p=t} END {print r+p-a}' cat log | awk '!/"purl"/{next} {s=$1;sub(/[^m]+m/,"");gsub(/:/," ");t=60*(60*$1+$2)+$3} t<p{t+=86400} !p{a=t;p=t;r=0;next} t-p>1{printf "%.3f += %.3f - %.3f (%.3f) # %.3f -> %.3f\n",r,p,a,p-a,p,t;r+=p-a;a=t} {p=t} END {print r+p-a}'
##
## find uploads blocked by slow i/o or maybe deadlocks
awk '/^.\+. opened logfile/{print;next} {sub(/.$/,"")} !/^..36m[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3} /{next} !/0m(POST|writing) /{next} {c=0;p=$3} /0mPOST/{c=1} {s=$1;sub(/[^m]+m/,"");gsub(/:/," ");s=60*(60*$1+$2)+$3} c{t[p]=s;next} {d=s-t[p]} d>10{print $0 " # " d}'
## ##
## bad filenames ## bad filenames