@wendongfly/myhi 1.3.97 → 1.3.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat.html +3826 -3743
- package/dist/index.html +88 -41
- package/package.json +1 -1
package/dist/index.html
CHANGED
|
@@ -11,19 +11,27 @@
|
|
|
11
11
|
<link rel="apple-touch-icon" href="/icon.png">
|
|
12
12
|
<title>myhi</title>
|
|
13
13
|
<script src="/sio-client/socket.io.min.js"></script>
|
|
14
|
+
<script>
|
|
15
|
+
(function(){try{var t=localStorage.getItem('myhi_theme')||'dark',f=localStorage.getItem('myhi_font')||'medium',r=document.documentElement;if(t&&t!=='dark')r.setAttribute('data-theme',t);r.setAttribute('data-font',f);}catch(e){}})();
|
|
16
|
+
</script>
|
|
14
17
|
<style>
|
|
15
18
|
:root {
|
|
16
|
-
--bg
|
|
17
|
-
--
|
|
18
|
-
--
|
|
19
|
-
--
|
|
20
|
-
--accent2: #9d5cf5;
|
|
21
|
-
--text: #e6edf3;
|
|
22
|
-
--muted: #8b949e;
|
|
23
|
-
--green: #3fb950;
|
|
24
|
-
--red: #f85149;
|
|
25
|
-
--yellow: #d29922;
|
|
19
|
+
--bg:#0d1117; --surface:#161b22; --border:#21262d; --border2:#30363d;
|
|
20
|
+
--text:#e6edf3; --text2:#b1bac4; --muted:#8b949e; --dim:#6e7681;
|
|
21
|
+
--accent:#7c3aed; --accent2:#9d5cf5; --red:#f85149; --redbg:#3d1515;
|
|
22
|
+
--green:#3fb950; --yellow:#d29922; --orange:#f0883e;
|
|
26
23
|
}
|
|
24
|
+
:root[data-theme="light"] { --bg:#ffffff; --surface:#f6f8fa; --border:#d0d7de; --border2:#d0d7de;
|
|
25
|
+
--text:#1f2328; --text2:#57606a; --muted:#656d76; --dim:#818b98;
|
|
26
|
+
--accent:#8250df; --accent2:#8250df; --red:#cf222e; --redbg:#ffebe9;
|
|
27
|
+
--green:#1a7f37; --yellow:#9a6700; --orange:#bc4c00; }
|
|
28
|
+
:root[data-theme="black"] { --bg:#000000; --surface:#0a0a0a; --border:#161616; --border2:#262626; }
|
|
29
|
+
@media (prefers-color-scheme: light) { :root[data-theme="system"] { --bg:#ffffff; --surface:#f6f8fa; --border:#d0d7de; --border2:#d0d7de;
|
|
30
|
+
--text:#1f2328; --text2:#57606a; --muted:#656d76; --dim:#818b98;
|
|
31
|
+
--accent:#8250df; --accent2:#8250df; --red:#cf222e; --redbg:#ffebe9;
|
|
32
|
+
--green:#1a7f37; --yellow:#9a6700; --orange:#bc4c00; } }
|
|
33
|
+
html { font-size: 16px; }
|
|
34
|
+
html[data-font="small"]{font-size:15px;} html[data-font="medium"]{font-size:17px;} html[data-font="large"]{font-size:19.5px;}
|
|
27
35
|
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
|
|
28
36
|
|
|
29
37
|
html, body {
|
|
@@ -143,7 +151,7 @@
|
|
|
143
151
|
.tag-chip {
|
|
144
152
|
display: inline-block;
|
|
145
153
|
font-size: 0.66rem;
|
|
146
|
-
color:
|
|
154
|
+
color: var(--text2);
|
|
147
155
|
background: rgba(124,58,237,0.14);
|
|
148
156
|
border: 1px solid rgba(124,58,237,0.35);
|
|
149
157
|
border-radius: 999px;
|
|
@@ -292,7 +300,7 @@
|
|
|
292
300
|
transition: border-color 0.15s;
|
|
293
301
|
}
|
|
294
302
|
.field input:focus { border-color: var(--accent); }
|
|
295
|
-
.field input::placeholder { color:
|
|
303
|
+
.field input::placeholder { color: var(--dim); }
|
|
296
304
|
|
|
297
305
|
#btn-create {
|
|
298
306
|
width: 100%;
|
|
@@ -384,7 +392,7 @@
|
|
|
384
392
|
border: none; font-size: 0.95rem; font-weight: 600;
|
|
385
393
|
cursor: pointer; margin-bottom: 0.5rem;
|
|
386
394
|
}
|
|
387
|
-
.kill-btn.danger { background:
|
|
395
|
+
.kill-btn.danger { background: var(--redbg); color: var(--red); }
|
|
388
396
|
.kill-btn.cancel { background: var(--bg); color: var(--text); }
|
|
389
397
|
|
|
390
398
|
/* ── 导入会话 ── */
|
|
@@ -428,6 +436,7 @@
|
|
|
428
436
|
<div class="logo">my<span>hi</span></div>
|
|
429
437
|
<div style="display:flex;align-items:center;gap:0.6rem">
|
|
430
438
|
<span id="user-name" style="font-size:0.8rem;color:var(--muted)"></span>
|
|
439
|
+
<button id="appearance-btn" onclick="openAppearance()" title="外观" style="background:none;border:1px solid var(--border);color:var(--muted);font-size:0.75rem;padding:0.3rem 0.55rem;border-radius:6px;cursor:pointer;width:auto">🎨</button>
|
|
431
440
|
<button id="doctor-btn" onclick="openDoctor()" style="background:none;border:1px solid var(--border);color:var(--muted);font-size:0.75rem;padding:0.3rem 0.6rem;border-radius:6px;cursor:pointer;width:auto">🩺 体检</button>
|
|
432
441
|
<button id="usage-btn" onclick="showUsage()" style="background:none;border:1px solid var(--border);color:var(--muted);font-size:0.75rem;padding:0.3rem 0.6rem;border-radius:6px;cursor:pointer;width:auto">用量</button>
|
|
433
442
|
<button id="logout-btn" onclick="doLogout()" style="display:none;background:none;border:1px solid var(--border);color:var(--muted);font-size:0.75rem;padding:0.3rem 0.6rem;border-radius:6px;cursor:pointer;width:auto">退出</button>
|
|
@@ -438,10 +447,10 @@
|
|
|
438
447
|
<!-- 升级管理已移至 /admin -->
|
|
439
448
|
|
|
440
449
|
<div id="view-controls" style="display:flex;flex-direction:column;gap:0.5rem;margin-bottom:0.75rem">
|
|
441
|
-
<div id="group-seg" style="display:inline-flex;align-self:flex-start;background:var(--bg
|
|
442
|
-
<button class="grp-btn" data-group="time" style="background:none;border:none;color:var(--muted
|
|
443
|
-
<button class="grp-btn" data-group="project" style="background:none;border:none;color:var(--muted
|
|
444
|
-
<button class="grp-btn" data-group="tag" style="background:none;border:none;color:var(--muted
|
|
450
|
+
<div id="group-seg" style="display:inline-flex;align-self:flex-start;background:var(--bg,var(--bg));border:1px solid var(--border,var(--border));border-radius:8px;overflow:hidden">
|
|
451
|
+
<button class="grp-btn" data-group="time" style="background:none;border:none;color:var(--muted,var(--muted));font-size:0.78rem;padding:0.35rem 0.8rem;cursor:pointer">最近</button>
|
|
452
|
+
<button class="grp-btn" data-group="project" style="background:none;border:none;color:var(--muted,var(--muted));font-size:0.78rem;padding:0.35rem 0.8rem;cursor:pointer;border-left:1px solid var(--border,var(--border))">项目</button>
|
|
453
|
+
<button class="grp-btn" data-group="tag" style="background:none;border:none;color:var(--muted,var(--muted));font-size:0.78rem;padding:0.35rem 0.8rem;cursor:pointer;border-left:1px solid var(--border,var(--border))">标签</button>
|
|
445
454
|
</div>
|
|
446
455
|
<div id="tag-filter" style="display:none;flex-wrap:wrap;gap:0.35rem"></div>
|
|
447
456
|
</div>
|
|
@@ -470,7 +479,7 @@
|
|
|
470
479
|
<div class="presets" id="presets"></div>
|
|
471
480
|
|
|
472
481
|
<div class="field">
|
|
473
|
-
<label>名称 <span style="font-weight:400;text-transform:none;color:var(--red
|
|
482
|
+
<label>名称 <span style="font-weight:400;text-transform:none;color:var(--red,var(--red))">必填</span></label>
|
|
474
483
|
<input id="inp-title" type="text" placeholder="请输入任务名称" autocomplete="off" spellcheck="false">
|
|
475
484
|
</div>
|
|
476
485
|
<div class="field">
|
|
@@ -576,8 +585,8 @@
|
|
|
576
585
|
const res = await fetch('/api/usage');
|
|
577
586
|
const data = await res.json();
|
|
578
587
|
const C = 'style="margin-bottom:1rem;padding:0.8rem 1rem;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.1);border-radius:10px"';
|
|
579
|
-
const H = 'style="font-size:0.9rem;font-weight:700;margin-bottom:0.5rem;color
|
|
580
|
-
const T = 'style="font-size:0.82rem;color
|
|
588
|
+
const H = 'style="font-size:0.9rem;font-weight:700;margin-bottom:0.5rem;color:var(--text)"';
|
|
589
|
+
const T = 'style="font-size:0.82rem;color:var(--text2);line-height:1.6"';
|
|
581
590
|
let html = '<div style="padding:1.5rem">';
|
|
582
591
|
html += '<h3 style="margin:0 0 1.2rem;font-size:1.1rem;color:#fff;text-align:center">Claude 用量</h3>';
|
|
583
592
|
if (data.rateLimit) {
|
|
@@ -587,12 +596,12 @@
|
|
|
587
596
|
const hours = Math.floor(remaining / 60);
|
|
588
597
|
const mins = remaining % 60;
|
|
589
598
|
const timeStr = hours > 0 ? `${hours}小时${mins}分钟` : `${mins}分钟`;
|
|
590
|
-
const statusColor = rl.status === 'allowed' ? '
|
|
599
|
+
const statusColor = rl.status === 'allowed' ? 'var(--green)' : 'var(--red)';
|
|
591
600
|
const statusText = rl.status === 'allowed' ? '正常可用' : '已达上限';
|
|
592
601
|
html += `<div ${C}>`;
|
|
593
602
|
html += `<div ${H}>5 小时配额窗口</div>`;
|
|
594
603
|
html += `<div ${T}><span style="color:${statusColor};font-weight:700;font-size:0.95rem">● ${statusText}</span></div>`;
|
|
595
|
-
html += `<div ${T}>窗口重置: <b style="color
|
|
604
|
+
html += `<div ${T}>窗口重置: <b style="color:var(--text)">${timeStr}后</b>(${resetTime.toLocaleTimeString('zh-CN', {hour:'2-digit',minute:'2-digit'})})</div>`;
|
|
596
605
|
html += '</div>';
|
|
597
606
|
} else {
|
|
598
607
|
html += `<div ${C}><div ${H}>5 小时配额窗口</div><div ${T}>发送一条 Agent 消息后可查看</div></div>`;
|
|
@@ -602,19 +611,19 @@
|
|
|
602
611
|
for (const s of data.activeSessions) {
|
|
603
612
|
if (!s.usage) continue;
|
|
604
613
|
const u = s.usage;
|
|
605
|
-
html += `<div ${T}><b style="color
|
|
606
|
-
html += `<div style="font-size:0.78rem;color
|
|
607
|
-
if (u.modelUsage) { for (const [m, mu] of Object.entries(u.modelUsage)) { html += `<div style="font-size:0.72rem;color
|
|
614
|
+
html += `<div ${T}><b style="color:var(--text)">${s.title}</b> (${s.owner || '管理员'})</div>`;
|
|
615
|
+
html += `<div style="font-size:0.78rem;color:var(--muted);margin:0.2rem 0 0.3rem;line-height:1.5">查询 <b style="color:var(--text2)">${u.queryCount}</b>次 输入 <b style="color:var(--text2)">${((u.totalInputTokens+u.totalCacheReadTokens)/1000).toFixed(0)}K</b> 输出 <b style="color:var(--text2)">${(u.totalOutputTokens/1000).toFixed(0)}K</b> 费用 <b style="color:var(--text2)">$${u.totalCostUSD.toFixed(4)}</b></div>`;
|
|
616
|
+
if (u.modelUsage) { for (const [m, mu] of Object.entries(u.modelUsage)) { html += `<div style="font-size:0.72rem;color:var(--dim);line-height:1.4"> ${m.replace(/claude-/,'').replace(/-\d{8}$/,'').replace(/\[.*\]/,'')} ${(mu.inputTokens/1000).toFixed(0)}K/${(mu.outputTokens/1000).toFixed(0)}K $${mu.costUSD.toFixed(4)}</div>`; } }
|
|
608
617
|
}
|
|
609
618
|
html += '</div>';
|
|
610
619
|
}
|
|
611
|
-
html += '<button onclick="this.closest(\'[data-usage-overlay]\').remove()" style="margin-top:0.8rem;width:100%;padding:0.7rem;background
|
|
620
|
+
html += '<button onclick="this.closest(\'[data-usage-overlay]\').remove()" style="margin-top:0.8rem;width:100%;padding:0.7rem;background:var(--accent);color:#fff;border:none;border-radius:10px;cursor:pointer;font-size:0.9rem;font-weight:600">关闭</button></div>';
|
|
612
621
|
const overlay = document.createElement('div');
|
|
613
622
|
overlay.setAttribute('data-usage-overlay', '');
|
|
614
623
|
overlay.style.cssText = 'position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.6);z-index:999;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(4px)';
|
|
615
624
|
overlay.onclick = (e) => { if (e.target === overlay) overlay.remove(); };
|
|
616
625
|
const box = document.createElement('div');
|
|
617
|
-
box.style.cssText = 'background
|
|
626
|
+
box.style.cssText = 'background:var(--surface);border:1px solid rgba(255,255,255,0.12);border-radius:16px;max-height:80vh;overflow-y:auto;width:90%;max-width:420px;box-shadow:0 16px 48px rgba(0,0,0,0.4)';
|
|
618
627
|
box.innerHTML = html;
|
|
619
628
|
overlay.appendChild(box);
|
|
620
629
|
document.body.appendChild(overlay);
|
|
@@ -631,6 +640,44 @@
|
|
|
631
640
|
});
|
|
632
641
|
}
|
|
633
642
|
|
|
643
|
+
// ── 外观:主题 & 字号(与会话页共用 localStorage myhi_theme / myhi_font)──
|
|
644
|
+
const THEME_META = { dark: '#0d1117', light: '#ffffff', black: '#000000', system: '#0d1117' };
|
|
645
|
+
function applyAppearance() {
|
|
646
|
+
const t = localStorage.getItem('myhi_theme') || 'dark';
|
|
647
|
+
const f = localStorage.getItem('myhi_font') || 'medium';
|
|
648
|
+
const r = document.documentElement;
|
|
649
|
+
if (!t || t === 'dark') r.removeAttribute('data-theme'); else r.setAttribute('data-theme', t);
|
|
650
|
+
r.setAttribute('data-font', f);
|
|
651
|
+
const meta = document.querySelector('meta[name="theme-color"]');
|
|
652
|
+
if (meta) meta.setAttribute('content', THEME_META[t] || '#0d1117');
|
|
653
|
+
}
|
|
654
|
+
window.openAppearance = function() {
|
|
655
|
+
const t = localStorage.getItem('myhi_theme') || 'dark';
|
|
656
|
+
const f = localStorage.getItem('myhi_font') || 'medium';
|
|
657
|
+
const overlay = document.createElement('div');
|
|
658
|
+
overlay.style.cssText = 'position:fixed;inset:0;z-index:80;background:rgba(0,0,0,0.55);display:flex;align-items:flex-end;justify-content:center';
|
|
659
|
+
const seg = (group, val, cur, label) => `<button data-g="${group}" data-v="${val}" style="flex:1;min-width:3rem;background:${val===cur?'var(--accent)':'var(--bg)'};color:${val===cur?'#fff':'var(--muted)'};border:1px solid ${val===cur?'var(--accent)':'var(--border)'};border-radius:8px;padding:0.5rem 0.3rem;font-size:0.82rem;cursor:pointer;white-space:nowrap">${label}</button>`;
|
|
660
|
+
const box = document.createElement('div');
|
|
661
|
+
box.style.cssText = 'background:var(--surface);border-radius:18px 18px 0 0;width:100%;max-width:640px;padding:0.5rem 1.1rem max(1rem,env(safe-area-inset-bottom))';
|
|
662
|
+
box.innerHTML = `<div class="sheet-handle"></div>
|
|
663
|
+
<div style="font-size:0.95rem;font-weight:600;margin-bottom:0.6rem">外观</div>
|
|
664
|
+
<div style="font-size:0.8rem;color:var(--text2);margin-bottom:0.35rem">主题</div>
|
|
665
|
+
<div style="display:flex;gap:0.35rem;flex-wrap:wrap">${seg('theme','system',t,'跟随系统')}${seg('theme','dark',t,'深色')}${seg('theme','light',t,'浅色')}${seg('theme','black',t,'纯黑')}</div>
|
|
666
|
+
<div style="font-size:0.8rem;color:var(--text2);margin:0.7rem 0 0.35rem">字号</div>
|
|
667
|
+
<div style="display:flex;gap:0.35rem">${seg('font','small',f,'小')}${seg('font','medium',f,'中')}${seg('font','large',f,'大')}</div>
|
|
668
|
+
<button id="ap-close" style="margin-top:0.9rem;width:100%;background:var(--bg);border:1px solid var(--border);color:var(--muted);font-size:0.85rem;padding:0.6rem;border-radius:10px;cursor:pointer">完成</button>`;
|
|
669
|
+
overlay.appendChild(box);
|
|
670
|
+
const close = () => overlay.remove();
|
|
671
|
+
overlay.addEventListener('click', (e) => { if (e.target === overlay) close(); });
|
|
672
|
+
box.querySelector('#ap-close').onclick = close;
|
|
673
|
+
box.querySelectorAll('button[data-g]').forEach(b => b.onclick = () => {
|
|
674
|
+
localStorage.setItem(b.dataset.g === 'theme' ? 'myhi_theme' : 'myhi_font', b.dataset.v);
|
|
675
|
+
applyAppearance();
|
|
676
|
+
close(); openAppearance();
|
|
677
|
+
});
|
|
678
|
+
document.body.appendChild(overlay);
|
|
679
|
+
};
|
|
680
|
+
|
|
634
681
|
// HTML 转义,防止 XSS
|
|
635
682
|
function esc(s) {
|
|
636
683
|
const d = document.createElement('div');
|
|
@@ -744,9 +791,9 @@
|
|
|
744
791
|
}
|
|
745
792
|
|
|
746
793
|
function groupHeaderHTML(label, count) {
|
|
747
|
-
return `<div class="group-header" style="display:flex;align-items:center;gap:0.5rem;margin:0.85rem 0.2rem 0.4rem;color:var(--muted
|
|
794
|
+
return `<div class="group-header" style="display:flex;align-items:center;gap:0.5rem;margin:0.85rem 0.2rem 0.4rem;color:var(--muted,var(--muted));font-size:0.75rem;font-weight:600">
|
|
748
795
|
<span>${esc(label)}</span>
|
|
749
|
-
<span style="color:var(--border
|
|
796
|
+
<span style="color:var(--border,var(--border2))">·</span>
|
|
750
797
|
<span style="font-weight:400">${count}</span>
|
|
751
798
|
</div>`;
|
|
752
799
|
}
|
|
@@ -822,7 +869,7 @@
|
|
|
822
869
|
if (!allTags.length) { bar.style.display = 'none'; return; }
|
|
823
870
|
bar.style.display = 'flex';
|
|
824
871
|
const mk = (label, val, active) =>
|
|
825
|
-
`<button class="tagf-btn" data-tag="${val === null ? '' : esc(val)}" style="background:${active ? 'var(--accent
|
|
872
|
+
`<button class="tagf-btn" data-tag="${val === null ? '' : esc(val)}" style="background:${active ? 'var(--accent,var(--accent))' : 'var(--bg,var(--bg))'};color:${active ? '#fff' : 'var(--muted,var(--muted))'};border:1px solid ${active ? 'var(--accent,var(--accent))' : 'var(--border,var(--border))'};border-radius:999px;font-size:0.72rem;padding:0.2rem 0.6rem;cursor:pointer">${esc(label)}</button>`;
|
|
826
873
|
bar.innerHTML = mk('全部', null, !_tagFilter) + allTags.map(t => mk(t, t, _tagFilter === t)).join('');
|
|
827
874
|
bar.querySelectorAll('.tagf-btn').forEach(b => b.addEventListener('click', () => {
|
|
828
875
|
_tagFilter = b.dataset.tag || null;
|
|
@@ -833,8 +880,8 @@
|
|
|
833
880
|
function updateGroupSeg() {
|
|
834
881
|
document.querySelectorAll('.grp-btn').forEach(b => {
|
|
835
882
|
const on = b.dataset.group === _groupMode;
|
|
836
|
-
b.style.background = on ? 'var(--accent
|
|
837
|
-
b.style.color = on ? '#fff' : 'var(--muted
|
|
883
|
+
b.style.background = on ? 'var(--accent,var(--accent))' : 'none';
|
|
884
|
+
b.style.color = on ? '#fff' : 'var(--muted,var(--muted))';
|
|
838
885
|
});
|
|
839
886
|
}
|
|
840
887
|
|
|
@@ -886,8 +933,8 @@
|
|
|
886
933
|
const badges = [];
|
|
887
934
|
if (poisoned) badges.push(pill('⚠ 中毒 · ' + esc(h.persistedMode || '非bypass'), '#fff', '#a11'));
|
|
888
935
|
else if (h.persistedMode) badges.push(pill(esc(h.persistedMode), 'var(--muted)', 'var(--bg)'));
|
|
889
|
-
badges.push(pill(s.alive ? '运行中' : '已停', s.alive ? '
|
|
890
|
-
if (s.busy) badges.push(pill('忙', '
|
|
936
|
+
badges.push(pill(s.alive ? '运行中' : '已停', s.alive ? 'var(--green)' : 'var(--muted)', 'var(--bg)'));
|
|
937
|
+
if (s.busy) badges.push(pill('忙', 'var(--orange)', 'var(--bg)'));
|
|
891
938
|
if (h.transcriptKB) badges.push(pill(h.transcriptKB + 'KB', 'var(--muted)', 'var(--bg)'));
|
|
892
939
|
if (h.imageCount) badges.push(pill('🖼 ' + h.imageCount, 'var(--muted)', 'var(--bg)'));
|
|
893
940
|
const border = poisoned ? '#a11' : 'var(--border)';
|
|
@@ -900,8 +947,8 @@
|
|
|
900
947
|
<div style="font-size:0.68rem;color:var(--muted);margin-bottom:0.5rem;word-break:break-all">${esc(s.cwd || '')}</div>
|
|
901
948
|
<div style="display:flex;gap:0.4rem">
|
|
902
949
|
<button onclick="openSession('${esc(s.id)}')" style="flex:1;background:var(--bg);border:1px solid var(--border);color:var(--text);font-size:0.72rem;padding:0.35rem;border-radius:6px;cursor:pointer">打开</button>
|
|
903
|
-
<button onclick="doctorReset('${esc(s.id)}','${esc(s.title || '')}')" style="flex:1;background:${poisoned ? '#1c3a2b' : 'var(--bg)'};border:1px solid ${poisoned ? '
|
|
904
|
-
<button onclick="doctorDelete('${esc(s.id)}','${esc(s.title || '')}')" style="background
|
|
950
|
+
<button onclick="doctorReset('${esc(s.id)}','${esc(s.title || '')}')" style="flex:1;background:${poisoned ? '#1c3a2b' : 'var(--bg)'};border:1px solid ${poisoned ? 'var(--green)' : 'var(--border)'};color:${poisoned ? 'var(--green)' : 'var(--text)'};font-size:0.72rem;padding:0.35rem;border-radius:6px;cursor:pointer">重开为干净会话</button>
|
|
951
|
+
<button onclick="doctorDelete('${esc(s.id)}','${esc(s.title || '')}')" style="background:var(--redbg);border:none;color:var(--red);font-size:0.72rem;padding:0.35rem 0.6rem;border-radius:6px;cursor:pointer">删除</button>
|
|
905
952
|
</div>
|
|
906
953
|
</div>`;
|
|
907
954
|
}).join('');
|
|
@@ -1197,12 +1244,12 @@
|
|
|
1197
1244
|
const overlay = document.createElement('div');
|
|
1198
1245
|
overlay.style.cssText = 'position:fixed;inset:0;z-index:80;background:rgba(0,0,0,0.55);display:flex;align-items:flex-end;justify-content:center';
|
|
1199
1246
|
const box = document.createElement('div');
|
|
1200
|
-
box.style.cssText = 'background:var(--surface
|
|
1201
|
-
const mkBtn = (label, color) => `<button style="display:block;width:100%;text-align:left;background:none;border:none;border-top:1px solid var(--border
|
|
1247
|
+
box.style.cssText = 'background:var(--surface,var(--surface));border-radius:18px 18px 0 0;width:100%;max-width:640px;padding:0.5rem 0 max(1rem,env(safe-area-inset-bottom))';
|
|
1248
|
+
const mkBtn = (label, color) => `<button style="display:block;width:100%;text-align:left;background:none;border:none;border-top:1px solid var(--border,var(--border));color:${color || 'var(--text,var(--text))'};font-size:0.95rem;padding:0.9rem 1.25rem;cursor:pointer">${label}</button>`;
|
|
1202
1249
|
box.innerHTML =
|
|
1203
|
-
`<div style="padding:0.6rem 1.25rem 0.4rem;color:var(--muted
|
|
1204
|
-
mkBtn('打开') + mkBtn('重命名') + mkBtn('设置标签') + mkBtn('终止会话', 'var(--red
|
|
1205
|
-
`<button style="display:block;width:100%;background:none;border:none;border-top:6px solid var(--bg
|
|
1250
|
+
`<div style="padding:0.6rem 1.25rem 0.4rem;color:var(--muted,var(--muted));font-size:0.8rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${esc(title)}</div>` +
|
|
1251
|
+
mkBtn('打开') + mkBtn('重命名') + mkBtn('设置标签') + mkBtn('终止会话', 'var(--red,var(--red))') +
|
|
1252
|
+
`<button style="display:block;width:100%;background:none;border:none;border-top:6px solid var(--bg,var(--bg));color:var(--muted,var(--muted));font-size:0.9rem;padding:0.85rem;cursor:pointer">取消</button>`;
|
|
1206
1253
|
overlay.appendChild(box);
|
|
1207
1254
|
const close = () => overlay.remove();
|
|
1208
1255
|
overlay.addEventListener('click', (ev) => { if (ev.target === overlay) close(); });
|