dsh-remote-panel 0.3.9 → 0.4.0
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/lib/client.js +22 -7
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1178,15 +1178,17 @@ window.__ModuleLoader__.load({
|
|
|
1178
1178
|
由 installStatsTray() 读它的文本、精简后放到顶部右上角 */
|
|
1179
1179
|
.uV2eYG_dock { display: none !important; }
|
|
1180
1180
|
|
|
1181
|
+
/* 顶部状态条:左边分支、右边统计,两端对齐(像手机状态栏的左右两组) */
|
|
1181
1182
|
.dsh-stats-tray {
|
|
1182
1183
|
position: fixed;
|
|
1183
1184
|
top: max(2px, calc(var(--dsh-safe-top, 0px) - 24px));
|
|
1185
|
+
left: 14px;
|
|
1184
1186
|
right: 14px;
|
|
1185
1187
|
z-index: 57;
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1188
|
+
display: flex;
|
|
1189
|
+
align-items: center;
|
|
1190
|
+
justify-content: space-between;
|
|
1191
|
+
gap: 16px;
|
|
1190
1192
|
font-size: 10px;
|
|
1191
1193
|
line-height: 16px;
|
|
1192
1194
|
font-variant-numeric: tabular-nums;
|
|
@@ -1194,6 +1196,13 @@ window.__ModuleLoader__.load({
|
|
|
1194
1196
|
pointer-events: none;
|
|
1195
1197
|
letter-spacing: .01em;
|
|
1196
1198
|
}
|
|
1199
|
+
.dsh-stats-tray > span {
|
|
1200
|
+
overflow: hidden;
|
|
1201
|
+
text-overflow: ellipsis;
|
|
1202
|
+
white-space: nowrap;
|
|
1203
|
+
min-width: 0;
|
|
1204
|
+
}
|
|
1205
|
+
.dsh-stats-tray > span:last-child { text-align: right; flex: 0 0 auto; }
|
|
1197
1206
|
|
|
1198
1207
|
/* 输入条座位顶部有一段渐隐(DSH 原本渐到 #151517),在纯黑底上会显出一条灰带,
|
|
1199
1208
|
这里把终点色换成纯黑,观感才对得上;底部那行状态(轮次/token/缓存)同理 */
|
|
@@ -1692,6 +1701,9 @@ window.__ModuleLoader__.load({
|
|
|
1692
1701
|
const tray = document.createElement('div')
|
|
1693
1702
|
tray.className = 'dsh-stats-tray'
|
|
1694
1703
|
tray.setAttribute('aria-hidden', 'true')
|
|
1704
|
+
const left = document.createElement('span')
|
|
1705
|
+
const right = document.createElement('span')
|
|
1706
|
+
tray.append(left, right)
|
|
1695
1707
|
document.body.appendChild(tray)
|
|
1696
1708
|
|
|
1697
1709
|
let frame = 0
|
|
@@ -1710,11 +1722,14 @@ window.__ModuleLoader__.load({
|
|
|
1710
1722
|
frame = 0
|
|
1711
1723
|
const dock = document.querySelector('.uV2eYG_dock')
|
|
1712
1724
|
const raw = dock?.textContent ?? ''
|
|
1713
|
-
const
|
|
1725
|
+
const branch = dock?.querySelector('[data-composer-stat="git-branch"]')?.textContent?.trim() ?? ''
|
|
1726
|
+
const stats = raw.trim() === '' ? '' : format(raw)
|
|
1727
|
+
const next = `${branch}|${stats}`
|
|
1714
1728
|
if (next === shown) return
|
|
1715
1729
|
shown = next
|
|
1716
|
-
|
|
1717
|
-
|
|
1730
|
+
left.textContent = branch
|
|
1731
|
+
right.textContent = stats
|
|
1732
|
+
tray.style.display = branch === '' && stats === '' ? 'none' : 'flex'
|
|
1718
1733
|
}
|
|
1719
1734
|
const schedule = () => {
|
|
1720
1735
|
if (frame !== 0) return
|