LoRA sheet updates
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -330,7 +330,7 @@ def generate_html(loras, sources=None):
|
|||||||
has_rest = len(rest) > 0
|
has_rest = len(rest) > 0
|
||||||
|
|
||||||
top8_html = ", ".join(
|
top8_html = ", ".join(
|
||||||
f"<code>{_e(t)}</code> <span class=\"c\">({c}x)</span>"
|
f"<span class=\"tg\"><code>{_e(t)}</code> <span class=\"c\">({c}x)</span></span>"
|
||||||
for t, c in top8
|
for t, c in top8
|
||||||
)
|
)
|
||||||
rest_html = ""
|
rest_html = ""
|
||||||
@@ -340,7 +340,7 @@ def generate_html(loras, sources=None):
|
|||||||
more_count = sum(c for _, c in rest)
|
more_count = sum(c for _, c in rest)
|
||||||
rest_html = " <span class=\"ml\" onclick=\"t('" + more_id + "',this)\" data-n=\"" + str(more_count) + "\">" + str(more_count) + " more…</span>"
|
rest_html = " <span class=\"ml\" onclick=\"t('" + more_id + "',this)\" data-n=\"" + str(more_count) + "\">" + str(more_count) + " more…</span>"
|
||||||
rest_list = ", ".join(
|
rest_list = ", ".join(
|
||||||
f"<code>{_e(t)}</code> <span class=\"c\">({c}x)</span>"
|
f"<span class=\"tg\"><code>{_e(t)}</code> <span class=\"c\">({c}x)</span></span>"
|
||||||
for t, c in rest
|
for t, c in rest
|
||||||
)
|
)
|
||||||
rest_html += "\n <span class=\"ht\" id=\"" + more_id + "\">" + rest_list + "</span>"
|
rest_html += "\n <span class=\"ht\" id=\"" + more_id + "\">" + rest_list + "</span>"
|
||||||
@@ -400,7 +400,8 @@ tr:hover td{{background:#161b22}}
|
|||||||
.ml:hover{{border-bottom:1px solid #58a6ff}}
|
.ml:hover{{border-bottom:1px solid #58a6ff}}
|
||||||
.ht{{display:none}}
|
.ht{{display:none}}
|
||||||
.dr td{{background:#161b22;padding:10px 14px;border-bottom:2px solid #30363d}}
|
.dr td{{background:#161b22;padding:10px 14px;border-bottom:2px solid #30363d}}
|
||||||
.dr code{{background:#1f2937;padding:1px 5px;border-radius:3px;font-size:0.78rem;color:#f0c674;white-space:nowrap}}
|
.dr code{{background:#1f2937;padding:1px 5px;border-radius:3px;font-size:0.78rem;color:#f0c674}}
|
||||||
|
.tg{{white-space:nowrap;display:inline-block;margin:1px 0}}
|
||||||
mark.hl{{background:#264f78;color:#f0f6fc;border-radius:2px;padding:0 2px}}
|
mark.hl{{background:#264f78;color:#f0f6fc;border-radius:2px;padding:0 2px}}
|
||||||
.sr a{{color:#58a6ff;text-decoration:none;font-size:0.78rem}}
|
.sr a{{color:#58a6ff;text-decoration:none;font-size:0.78rem}}
|
||||||
.c0{{width:24%}}.c1{{width:8%}}.c2{{width:12%}}.c3{{width:48%}}.c4{{width:8%}}
|
.c0{{width:24%}}.c1{{width:8%}}.c2{{width:12%}}.c3{{width:48%}}.c4{{width:8%}}
|
||||||
@@ -451,6 +452,24 @@ function s(i){{
|
|||||||
document.querySelectorAll('th')[col+1].querySelector('.ar').innerHTML = desc ? '▲' : '▼';
|
document.querySelectorAll('th')[col+1].querySelector('.ar').innerHTML = desc ? '▲' : '▼';
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
function filterTags(el, v) {{
|
||||||
|
let tgs = el.querySelectorAll('.tg');
|
||||||
|
if (!v || tgs.length === 0) {{
|
||||||
|
tgs.forEach(tg => tg.style.display = '');
|
||||||
|
return;
|
||||||
|
}}
|
||||||
|
let match = false;
|
||||||
|
tgs.forEach(tg => {{
|
||||||
|
if (tg.textContent.toLowerCase().includes(v)) {{
|
||||||
|
tg.style.display = '';
|
||||||
|
match = true;
|
||||||
|
}} else {{
|
||||||
|
tg.style.display = 'none';
|
||||||
|
}}
|
||||||
|
}});
|
||||||
|
if (!match) tgs.forEach(tg => tg.style.display = '');
|
||||||
|
}}
|
||||||
|
|
||||||
function t(id,el){{
|
function t(id,el){{
|
||||||
let sp = document.getElementById(id);
|
let sp = document.getElementById(id);
|
||||||
let tr = el.closest('tr');
|
let tr = el.closest('tr');
|
||||||
@@ -520,8 +539,12 @@ q.addEventListener('input', ()=>{{
|
|||||||
if (ht) txt += ' ' + ht.textContent.toLowerCase();
|
if (ht) txt += ' ' + ht.textContent.toLowerCase();
|
||||||
let ok = txt.includes(v);
|
let ok = txt.includes(v);
|
||||||
r.style.display = ok ? '' : 'none';
|
r.style.display = ok ? '' : 'none';
|
||||||
|
filterTags(r, v);
|
||||||
let nxt = r.nextElementSibling;
|
let nxt = r.nextElementSibling;
|
||||||
if (nxt && nxt.classList.contains('dr')) nxt.style.display = ok ? '' : 'none';
|
if (nxt && nxt.classList.contains('dr')) {{
|
||||||
|
nxt.style.display = ok ? '' : 'none';
|
||||||
|
filterTags(nxt, v);
|
||||||
|
}}
|
||||||
if (ok && v) highlight(r, v);
|
if (ok && v) highlight(r, v);
|
||||||
if (ok) vis++;
|
if (ok) vis++;
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user