dsh-any-deepseek 0.0.29 → 0.0.31
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 +46 -77
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -118,27 +118,51 @@ window.__ModuleLoader__.load({
|
|
|
118
118
|
parts.push(`${window.name} ${Math.round(window.remainingPercent)}%${suffix}`);
|
|
119
119
|
}
|
|
120
120
|
if (available === false) parts.push("(余额不足)");
|
|
121
|
-
|
|
121
|
+
/**
|
|
122
|
+
* The note — but only when it adds something the line does not already say.
|
|
123
|
+
*
|
|
124
|
+
* 🔴 **This guard was missing in the first cut of 0.0.29, and the live payload caught it.**
|
|
125
|
+
* Rendering the note unconditionally made OpenCode Go's line
|
|
126
|
+
* `rolling 93%(还有 2 小时) · weekly 50%(还有 5 天) · monthly 23%(还有 2 天) ·
|
|
127
|
+
* subscription usage windows; the credit balance is not readable with an API key`
|
|
128
|
+
* — three windows that already answer the question, followed by a sentence explaining a
|
|
129
|
+
* limitation the reader did not ask about. The panel has ONE line per channel.
|
|
130
|
+
*
|
|
131
|
+
* The rule: a note that only *explains why a field is absent* is redundant once that field's
|
|
132
|
+
* absence is already visible (no amounts shown ⇒ obviously no amount). A note that carries a
|
|
133
|
+
* FACT — Ollama's `period … → …` is the only source of its cycle end — must be rendered.
|
|
134
|
+
* `describeNote` reports which kind it is, so the decision lives in one place rather than as a
|
|
135
|
+
* string comparison here.
|
|
136
|
+
*/
|
|
137
|
+
if (row.reading.note !== void 0 && row.reading.note !== "") {
|
|
138
|
+
const described = describeNote(row.reading.note, now);
|
|
139
|
+
if (described !== void 0) parts.push(described);
|
|
140
|
+
else if (parts.length === 0) parts.push(row.reading.note);
|
|
141
|
+
}
|
|
122
142
|
if (parts.length === 0) return "无可读数值";
|
|
123
143
|
return parts.join(" · ");
|
|
124
144
|
}
|
|
125
145
|
/**
|
|
126
|
-
* Turn a provider note into something
|
|
146
|
+
* Turn a provider note into something worth a place on the one-line balance cell — or nothing.
|
|
147
|
+
*
|
|
148
|
+
* Only one note shape carries a FACT the line cannot otherwise show: Ollama's
|
|
149
|
+
* `period <from> → <until>`, which is the sole source of that channel's cycle end. It is rewritten
|
|
150
|
+
* to 「周期至 <date>(还有 N 天)」.
|
|
127
151
|
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
152
|
+
* 🔴 Everything else returns `undefined`, i.e. is DROPPED. That is the measured correction from the
|
|
153
|
+
* first cut of 0.0.29: OpenCode Go's note is `subscription usage windows; the credit balance is not
|
|
154
|
+
* readable with an API key`, which explains why a field is missing — a fact the reader can already
|
|
155
|
+
* see (no amount is rendered). Appending it turned a clean three-window line into a wall of text in
|
|
156
|
+
* a 256px-wide panel. ⚠️ It is NOT lost: the same string still travels in `/balance`, and the
|
|
157
|
+
* panel's own documentation covers it, so a reader who wants the explanation can still find it.
|
|
130
158
|
*
|
|
131
|
-
* 🔴 Why rewrite rather than append: 「period 2026-10-19T13:07:35Z → 2026-11-19T13:07:35Z」 is two
|
|
132
|
-
* ISO timestamps. The reader wants "how long until it renews", not a diff to do in their head.
|
|
133
|
-
* The absolute dates stay, because a horizon without an anchor cannot be checked against a
|
|
134
|
-
* calendar.
|
|
135
159
|
* @param note - the reading's note, verbatim from the parser.
|
|
136
160
|
* @param now - clock, injectable for tests.
|
|
137
|
-
* @returns the
|
|
161
|
+
* @returns the rewritable sentence, or `undefined` when the note adds nothing to the line.
|
|
138
162
|
*/
|
|
139
163
|
function describeNote(note, now = /* @__PURE__ */ new Date()) {
|
|
140
164
|
const period = /^period\s+(\S+)\s+→\s+(\S+)$/.exec(note);
|
|
141
|
-
if (period === null) return
|
|
165
|
+
if (period === null) return void 0;
|
|
142
166
|
const from = period[1] ?? "";
|
|
143
167
|
const until = period[2] ?? "";
|
|
144
168
|
const untilText = formatTimeUntil(until, now);
|
|
@@ -294,7 +318,7 @@ window.__ModuleLoader__.load({
|
|
|
294
318
|
}
|
|
295
319
|
//#endregion
|
|
296
320
|
//#region \0ad-css:src/client/SettingsPage
|
|
297
|
-
const css$1 = "/* Panel styles.\n *\n * 🔴 There are NO `--dsw-alias-*` design tokens on this host (measured 2026-10-21: the document\n * declares 29 custom properties and not one is a colour). This file used to reference a dozen of\n * them, every one falling back to a hardcoded LIGHT value (`rgba(0,0,0,0.12)` and friends) — so\n * on the dark theme the borders and dividers were effectively invisible.\n *\n * ⇒ Derive everything from `currentColor`, which the host sets per theme. `color-mix` gives the\n * low-contrast borders and fills that a token would have provided, and it follows the theme\n * automatically instead of assuming one palette.\n */\n\n.ad-page {\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 4px 2px 12px;\n}\n\n/* One place to change the two theme-derived values the whole panel uses. */\n.ad-page {\n --ad-line: color-mix(in srgb, currentColor 18%, transparent);\n --ad-line-strong: color-mix(in srgb, currentColor 32%, transparent);\n --ad-fill-subtle: color-mix(in srgb, currentColor 7%, transparent);\n /*\n * 🔴 The ACTIVE channel is green (owner request 2026-10-25: 「激活的样式用绿色」).\n *\n * It used to be derived from `currentColor`, which made the live row look like every other\n * \"slightly emphasised\" row — the same neutral tint as a hover or a selected input. Green says\n * \"this one is ON\" in a way a grey tint cannot, and it matches the key-configured dot and the\n * 密钥已配置 text that were already green, so the panel now uses one colour for one meaning:\n * green = working / live. Red stays reserved for destructive and for failures.\n *\n * Kept as one token so the mark (border + bar + fill + badge) can never drift apart between\n * the four places it is applied.\n */\n --ad-active: #2f855a;\n --ad-active-fill: color-mix(in srgb, var(--ad-active) 12%, transparent);\n --ad-danger: #e5534b;\n}\n\n.ad-head {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.ad-title {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n}\n\n.ad-intro {\n margin: 0;\n font-size: 12px;\n line-height: 1.6;\n opacity: 0.72;\n}\n\n.ad-error {\n border: 1px solid var(--ad-danger);\n border-radius: 6px;\n padding: 8px 10px;\n font-size: 12px;\n}\n\n.ad-section {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.ad-sectionTitle {\n margin: 0;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n opacity: 0.6;\n}\n\n.ad-rows {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n/*\n * 🔴 Compact rows (owner request 2026-10-24: 「每个渠道高度希望小一些,紧凑些」).\n *\n * The row used to be a four-line stack — title / model·api·baseURL / key line / balance — and\n * with five channels that is most of the panel spent on air. The fix is layout, not information:\n * everything stays on screen, but the secondary facts move BESIDE the name instead of under it.\n *\n * What changed and why:\n * · padding 10px→7px and gap 6px→4px: the row now reads as one line of text plus a hairline of\n * metadata, instead of a card with its own interior spacing;\n * · `ad-rowMain` became a ROW (was a column): the title line and the meta line share one axis,\n * so the row is two text lines tall at most, not four;\n * · the meta line keeps `flex-wrap` — on a narrow panel it may wrap, and that is the correct\n * trade: a row that stays readable beats one that clips the endpoint URL.\n */\n.ad-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n border: 1px solid var(--ad-line);\n border-radius: 8px;\n padding: 7px 10px;\n /*\n * The left edge is reserved on EVERY row so the current one does not shift its content when\n * selected — a row that reindents on click makes the list feel like it moved.\n */\n border-left: 3px solid transparent;\n}\n\n/*\n * 🔴 The current channel is marked in GREEN (owner 2026-10-25: 「激活的样式用绿色」).\n *\n * Previously the marks were derived from `currentColor` — a neutral bar, a stronger border and a\n * grey tint. All three were so low-contrast that the live row read as \"merely hovered\", which is\n * exactly what the owner was reacting to.\n *\n * Green is also the coherent choice: the key dot and 密钥已配置 text were already green, so the\n * panel now uses ONE colour for ONE meaning (green = working / live), and red stays reserved for\n * destructive actions and failures.\n *\n * Four marks read from the same token so they cannot drift apart: left bar, border, fill, badge.\n */\n.ad-row-current {\n border-color: var(--ad-active);\n border-left-color: var(--ad-active);\n background: var(--ad-active-fill);\n}\n\n/* The 当前 badge is the textual confirmation, for when colour alone is not enough (colour-blind\n readers, screenshots, forced-colours mode). */\n.ad-row-current .ad-badge {\n border-color: var(--ad-active);\n color: var(--ad-active);\n opacity: 1;\n font-weight: 600;\n}\n\n/* The live row's NAME goes green too: the name is where the eye lands first, so marking only the\n border leaves the reader to connect two separate cues. */\n.ad-row-current .ad-rowTitle {\n color: var(--ad-active);\n}\n\n/*\n * The row's content is a COLUMN of at most two lines: (1) name + status, (2) everything else.\n * It was a four-line stack before the compactness pass — see the note on `.ad-row`.\n */\n.ad-rowMain {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n flex: 1 1 auto;\n}\n\n.ad-rowTitleLine {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 13px;\n font-weight: 500;\n min-width: 0;\n}\n\n.ad-rowTitle {\n white-space: nowrap;\n}\n\n.ad-badge {\n font-size: 10px;\n padding: 1px 6px;\n border-radius: 999px;\n border: 1px solid currentColor;\n opacity: 0.8;\n}\n\n.ad-warn {\n color: #b7791f;\n cursor: help;\n}\n\n/*\n * The live-state line under a channel's name: probe verdict and/or balance, nothing else.\n *\n * 🔴 It shrank twice at the owner's request, and the history matters:\n * 2026-10-24 「紧凑些」 — four stacked lines (endpoint identity / key state / verdict / balance)\n * became one wrapping line;\n * 2026-10-25 「这部分不要了」 — endpoint identity and key state were removed outright. What\n * remains is only what changes at runtime: did the probe pass, what is\n * the balance. Those two cannot be derived from anything else on screen,\n * which is why they survived while model/api/baseURL did not.\n *\n * The element is rendered ONLY when one of them exists, so an unprobed, unpriced channel shows a\n * single-line row with no orphan gap.\n */\n.ad-rowDetail {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n column-gap: 6px;\n row-gap: 2px;\n font-size: 11px;\n opacity: 0.66;\n min-width: 0;\n}\n\n.ad-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n word-break: break-all;\n}\n\n.ad-sep {\n opacity: 0.5;\n}\n\n.ad-rowActions {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n}\n\n/*\n * Buttons: sized to be hit, not guessed at.\n *\n * The previous 4px/10px padding made a 22px-tall target, which is below the comfortable\n * threshold and made the row actions (测试 / 移除) look like text rather than controls. 6px/12px\n * with a minimum width gives each one a real box while keeping the row compact — a row action is\n * secondary, so it should be easy to hit and easy to ignore.\n */\n.ad-btn {\n font-size: 11px;\n font-family: inherit;\n line-height: 1.5;\n padding: 5px 12px;\n min-width: 56px;\n min-height: 26px;\n border-radius: 6px;\n border: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n cursor: pointer;\n transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;\n}\n\n.ad-btn:hover:not(:disabled) {\n border-color: var(--ad-line-strong);\n background: var(--ad-fill-subtle);\n}\n\n.ad-btn:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n.ad-btn-quiet {\n opacity: 0.85;\n}\n\n.ad-probe {\n font-size: 11px;\n padding-top: 2px;\n}\n\n.ad-probe-ok {\n color: #2f855a;\n}\n\n.ad-probe-bad {\n color: #c53030;\n word-break: break-word;\n}\n\n.ad-hint,\n.ad-empty,\n.ad-note {\n margin: 0;\n font-size: 11px;\n line-height: 1.6;\n opacity: 0.66;\n}\n\n.ad-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex-shrink: 0;\n display: inline-block;\n}\n\n.ad-dot-on {\n background: #2f855a;\n}\n\n.ad-dot-off {\n border: 1px solid currentColor;\n opacity: 0.5;\n}\n\n.ad-dot-unknown {\n background: linear-gradient(90deg, currentColor 50%, transparent 50%);\n opacity: 0.5;\n}\n\n/* The channel row is a radio \"pick\" zone: the whole left side is clickable, and the radio sits\n at the start of the line so \"which one is live\" is readable down a single column. */\n.ad-rowPick {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n flex: 1;\n min-width: 0;\n cursor: pointer;\n}\n\n.ad-rowPick input[type='radio'] {\n flex: none;\n /* Optically centred against the first text line rather than the row box. */\n margin-top: 3px;\n accent-color: var(--ad-line-strong);\n cursor: pointer;\n}\n\n/* The switch is gone: selection is the only axis (see `channels.ts`). Keeping the rules would\n invite someone to bring the second axis back. */\n\n/* ── top-level tabs (渠道 / 用量) ──────────────────────────────────────────── */\n\n/*\n * The panel answers two questions asked at different moments: \"which relay serves me and does\n * its key work\" and \"what has each relay cost\". They used to be stacked on one scroll, so\n * reading the cost table meant scrolling past every channel row. As tabs, each answer gets the\n * whole panel and the reader never scrolls to reach the second one.\n *\n * The selected tab is marked by a bottom rule plus full opacity — not by colour alone, because\n * this host ships no colour tokens and a colour-only cue would vary with the theme.\n */\n.ad-tabs {\n display: flex;\n gap: 4px;\n border-bottom: 1px solid var(--ad-line);\n}\n\n.ad-tab {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n /* Comfortable click target: 28px tall is enough to hit without aiming, and still compact\n enough that two tabs do not dominate the panel. */\n padding: 6px 14px;\n font-size: 12px;\n font-family: inherit;\n border: none;\n border-bottom: 2px solid transparent;\n /* Pulled down over the container's rule so the selected tab's underline replaces it. */\n margin-bottom: -1px;\n background: transparent;\n color: inherit;\n opacity: 0.62;\n cursor: pointer;\n}\n\n.ad-tab:hover {\n opacity: 0.85;\n}\n\n.ad-tab-on {\n opacity: 1;\n font-weight: 600;\n border-bottom-color: currentColor;\n}\n\n/* A count on the channel tab, so \"how many do I have\" is answered without opening it. */\n.ad-tabCount {\n font-size: 10px;\n font-weight: 500;\n min-width: 16px;\n padding: 0 4px;\n border-radius: 999px;\n text-align: center;\n background: var(--ad-fill-subtle);\n opacity: 0.8;\n}\n\n/* ── segmented control (按渠道 / 按天 / 刷新) ─────────────────────────────── */\n\n/*\n * A segmented control rather than free-floating pill buttons: these three share one meaning\n * (\"how the table below is grouped, and re-read it\"), so they are drawn as one object. The\n * borders collapse to avoid double lines between neighbours.\n */\n.ad-segmented {\n display: inline-flex;\n align-items: stretch;\n border: 1px solid var(--ad-line);\n border-radius: 7px;\n overflow: hidden;\n}\n\n.ad-seg {\n padding: 4px 11px;\n font-size: 11px;\n font-family: inherit;\n border: none;\n border-right: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n opacity: 0.7;\n cursor: pointer;\n}\n\n.ad-seg:last-child {\n border-right: none;\n}\n\n.ad-seg:hover:not(:disabled) {\n opacity: 1;\n background: var(--ad-fill-subtle);\n}\n\n.ad-seg-on {\n opacity: 1;\n font-weight: 600;\n background: var(--ad-fill-subtle);\n}\n\n/* Refresh is an action, not a grouping — a gap separates it from the choice it refreshes. */\n.ad-seg-refresh {\n border-left: 1px solid var(--ad-line);\n}\n\n.ad-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11px;\n}\n\n.ad-table th,\n.ad-table td {\n padding: 5px 8px;\n border-bottom: 1px solid var(--ad-line);\n text-align: left;\n}\n\n.ad-table th {\n font-weight: 500;\n opacity: 0.6;\n}\n\n.ad-num {\n text-align: right;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n\n.ad-total td {\n font-weight: 600;\n border-bottom: none;\n}\n\n/* ── add-channel form ─────────────────────────────────────────────────────── */\n\n.ad-addForm {\n display: flex;\n flex-direction: column;\n gap: 14px;\n border: 1px dashed var(--ad-line);\n border-radius: 8px;\n padding: 14px;\n}\n\n.ad-field {\n display: flex;\n flex-direction: column;\n gap: 5px;\n font-size: 11px;\n}\n\n/* The label row: the field name, plus a required/optional marker that says which is which. */\n.ad-field > span:first-child {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 12px;\n font-weight: 500;\n opacity: 0.9;\n}\n\n/*\n * 必选 / 可空 as a small marker rather than a sentence.\n *\n * The add form used to leave the reader guessing which fields could be skipped — and the one\n * field that could not be skipped (the key) looked exactly like the two that could. The marker\n * is text, not colour, so it survives both themes and any colour-blindness.\n */\n.ad-req,\n.ad-opt {\n font-style: normal;\n font-size: 10px;\n font-weight: 400;\n padding: 1px 5px;\n border-radius: 4px;\n opacity: 0.7;\n}\n\n.ad-req {\n border: 1px solid var(--ad-line-strong);\n}\n\n.ad-opt {\n border: 1px dotted var(--ad-line);\n}\n\n/* Why this field exists, in one line — printed under the control, not hidden in a tooltip. */\n.ad-fieldHelp {\n font-size: 11px;\n line-height: 1.55;\n opacity: 0.6;\n}\n\n.ad-input {\n font-size: 12px;\n font-family: inherit;\n /* 6px/9px keeps the control the same height as a `.ad-btn` (26px), so a field and its button\n on one line align without a per-case override. */\n padding: 5px 9px;\n min-height: 26px;\n border-radius: 6px;\n border: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n}\n\n.ad-input:focus-visible {\n outline: 2px solid var(--ad-line-strong);\n outline-offset: 1px;\n border-color: var(--ad-line-strong);\n}\n\n/*\n * 🔴 A native `<select>` cannot be themed by leaving the background transparent.\n *\n * The popup list is drawn by the browser, not by the closed control's box: the options inherit\n * nothing from it, so `background: transparent` made them render in the platform default (light)\n * palette against this dark theme — reported by the owner and measured on the real host.\n *\n * 🔴 SECOND correction (measured 2026-10-21): this file used `var(--dsw-alias-color-*, #fallback)`\n * throughout, and **none of those variables exist**. The host declares only 29 custom properties\n * in total and not one is a colour token, so every `var()` here was falling back — and a fallback\n * that happens to be set inside a shorthand can be silently dropped (the select's background\n * computed to `rgba(0,0,0,0)`, i.e. still transparent, which is exactly the bug).\n *\n * ⇒ Use only values this file controls, derived from `currentColor` (the host sets a light text\n * colour on both themes) plus explicit translucent layers. No host token is assumed.\n */\nselect.ad-input {\n /* Tells the engine which palette to use for the popup. This part DID work. */\n color-scheme: dark light;\n /*\n * Paint the closed box with a layer that follows the surrounding text colour, so it matches\n * whichever theme is active instead of hardcoding a dark value into a light theme.\n */\n background-color: color-mix(in srgb, currentColor 8%, transparent);\n color: inherit;\n cursor: pointer;\n padding-right: 22px;\n /* Room for the chevron drawn below, so text never runs under it. */\n appearance: none;\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),\n linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: calc(100% - 12px) calc(50% + 1px), calc(100% - 8px) calc(50% + 1px);\n background-size: 4px 4px, 4px 4px;\n background-repeat: no-repeat;\n}\n\nselect.ad-input:hover:not(:disabled) {\n background-color: color-mix(in srgb, currentColor 14%, transparent);\n}\n\nselect.ad-input:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: 1px;\n}\n\n/*\n * The popup itself follows `color-scheme`; these keep the option rows explicit for engines that\n * honour per-option colours. `color-scheme: dark` above is what actually stops the light-on-dark\n * list, because the popup is native chrome rather than a styled element.\n */\nselect.ad-input option {\n background-color: Canvas;\n color: CanvasText;\n}\n\n.ad-fieldError {\n margin: 0;\n font-size: 11px;\n color: #c53030;\n}\n\n/* ── balance ──────────────────────────────────────────────────────────────── */\n\n/*\n * Remaining balance.\n *\n * A fact about this channel, not a control. The subtle fill marks it as a measurement rather than\n * a warning: the words themselves say whether it is fine (\"72.50 USD\") or not (\"(余额不足)\").\n */\n.ad-balance {\n font-variant-numeric: tabular-nums;\n font-size: 11px;\n padding: 1px 6px;\n border-radius: 4px;\n background: var(--ad-fill-subtle);\n}\n\n/* A section heading with one action on its right (currently: 查询余额). */\n.ad-sectionBar {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px;\n}\n\n/* The reference name, not a secret: monospace so it lines up and misreads as a name, not a value. */\n.ad-keyName {\n font-size: 10px;\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--ad-fill-subtle);\n opacity: 0.8;\n}\n\n/* A text-shaped action. Styled as a link because it opens an inline editor, not a dialog. */\n.ad-link {\n font-size: 11px;\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n text-decoration: underline;\n text-underline-offset: 2px;\n opacity: 0.75;\n cursor: pointer;\n}\n\n.ad-link:hover {\n opacity: 1;\n}\n\n/* The inline key editor: one masked field and one button, on the same line as the fact above. */\n.ad-keyForm {\n display: flex;\n align-items: center;\n gap: 6px;\n padding-top: 4px;\n}\n\n.ad-keyForm .ad-input {\n flex: 1;\n min-width: 0;\n}\n\n/* A destructive action is quiet until hovered: it should be findable, not inviting. */\n.ad-btn-danger {\n opacity: 0.6;\n}\n\n.ad-btn-danger:hover:not(:disabled) {\n opacity: 1;\n border-color: var(--ad-danger);\n color: var(--ad-danger);\n}\n\n/*\n * The one hint that must not be skimmed past: where the key ends up.\n *\n * It carries a left rule and slightly higher opacity than an ordinary hint, because a reader who\n * skips it has been told something false by omission — the key IS in the profile document.\n */\n.ad-hint-warn {\n padding: 8px 10px;\n border-left: 3px solid var(--ad-line-strong);\n background: var(--ad-fill-subtle);\n border-radius: 0 6px 6px 0;\n opacity: 0.82;\n}\n\n/*\n * The table can be wider than a narrow settings pane (ten columns of numbers). Scrolling it\n * inside its own box keeps the tab strip and the channel list reachable, instead of pushing the\n * whole panel sideways.\n */\n.ad-tableWrap {\n overflow-x: auto;\n /* A hint that there is more to the right, without a scrollbar competing with the borders. */\n scrollbar-width: thin;\n}\n\n.ad-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11px;\n}\n\n/* The first column is a name, not a number: keep it from being squeezed by the numeric columns. */\n.ad-table th:first-child,\n.ad-table td:first-child {\n white-space: nowrap;\n padding-right: 14px;\n}\n\n/* ── footer ───────────────────────────────────────────────────────────────── */\n\n/*\n * States what this thing is (MIT, open, improvable) and where it lives. A user deciding whether\n * to fork it or add a relay should not have to search for the source.\n */\n.ad-foot {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n gap: 8px;\n padding-top: 10px;\n border-top: 1px solid var(--ad-line);\n font-size: 11px;\n opacity: 0.6;\n}\n\n.ad-footLink {\n color: inherit;\n text-decoration: underline;\n text-underline-offset: 2px;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: 10px;\n}\n\n.ad-footLink:hover {\n opacity: 0.9;\n}\n";
|
|
321
|
+
const css$1 = "/* Panel styles.\n *\n * 🔴 There are NO `--dsw-alias-*` design tokens on this host (measured 2026-10-21: the document\n * declares 29 custom properties and not one is a colour). This file used to reference a dozen of\n * them, every one falling back to a hardcoded LIGHT value (`rgba(0,0,0,0.12)` and friends) — so\n * on the dark theme the borders and dividers were effectively invisible.\n *\n * ⇒ Derive everything from `currentColor`, which the host sets per theme. `color-mix` gives the\n * low-contrast borders and fills that a token would have provided, and it follows the theme\n * automatically instead of assuming one palette.\n */\n\n.ad-page {\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 4px 2px 12px;\n}\n\n/* One place to change the two theme-derived values the whole panel uses. */\n.ad-page {\n --ad-line: color-mix(in srgb, currentColor 18%, transparent);\n --ad-line-strong: color-mix(in srgb, currentColor 32%, transparent);\n --ad-fill-subtle: color-mix(in srgb, currentColor 7%, transparent);\n /*\n * 🔴 The ACTIVE channel is green (owner request 2026-10-25: 「激活的样式用绿色」).\n *\n * It used to be derived from `currentColor`, which made the live row look like every other\n * \"slightly emphasised\" row — the same neutral tint as a hover or a selected input. Green says\n * \"this one is ON\" in a way a grey tint cannot, and it matches the key-configured dot and the\n * 密钥已配置 text that were already green, so the panel now uses one colour for one meaning:\n * green = working / live. Red stays reserved for destructive and for failures.\n *\n * Kept as one token so the mark (border + bar + fill + badge) can never drift apart between\n * the four places it is applied.\n */\n --ad-active: #2f855a;\n --ad-active-fill: color-mix(in srgb, var(--ad-active) 12%, transparent);\n --ad-danger: #e5534b;\n}\n\n.ad-head {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.ad-title {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n}\n\n.ad-intro {\n margin: 0;\n font-size: 12px;\n line-height: 1.6;\n opacity: 0.72;\n}\n\n.ad-error {\n border: 1px solid var(--ad-danger);\n border-radius: 6px;\n padding: 8px 10px;\n font-size: 12px;\n}\n\n.ad-section {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.ad-sectionTitle {\n margin: 0;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n opacity: 0.6;\n}\n\n.ad-rows {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n/*\n * 🔴 Compact rows (owner request 2026-10-24: 「每个渠道高度希望小一些,紧凑些」).\n *\n * The row used to be a four-line stack — title / model·api·baseURL / key line / balance — and\n * with five channels that is most of the panel spent on air. The fix is layout, not information:\n * everything stays on screen, but the secondary facts move BESIDE the name instead of under it.\n *\n * What changed and why:\n * · padding 10px→7px and gap 6px→4px: the row now reads as one line of text plus a hairline of\n * metadata, instead of a card with its own interior spacing;\n * · `ad-rowMain` became a ROW (was a column): the title line and the meta line share one axis,\n * so the row is two text lines tall at most, not four;\n * · the meta line keeps `flex-wrap` — on a narrow panel it may wrap, and that is the correct\n * trade: a row that stays readable beats one that clips the endpoint URL.\n */\n.ad-row {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n border: 1px solid var(--ad-line);\n border-radius: 8px;\n padding: 7px 10px;\n /*\n * The left edge is reserved on EVERY row so the current one does not shift its content when\n * selected — a row that reindents on click makes the list feel like it moved.\n */\n border-left: 3px solid transparent;\n}\n\n/*\n * 🔴 The narrow-viewport layout: the action buttons get their own line.\n *\n * Measured on the owner's phone (2026-11-06 screenshot): 390px viewport, ~340px of content. Four\n * buttons at min-width 56px + 8px gaps need ~272px; together with a name column that cannot be\n * narrower than one word, they do not fit side by side. Below ~520px they now wrap below the\n * name instead of squeezing it into a vertical strip.\n *\n * Chosen as a media query rather than left to flex alone: without an explicit basis the group\n * wraps only when its CONTENT overflows, which leaves the name column at min-content width for a\n * long stretch before that happens — the exact state the screenshot was taken in.\n */\n@media (max-width: 520px) {\n .ad-rowActions {\n flex-basis: 100%;\n }\n .ad-btn {\n flex: 1 1 auto;\n min-width: 0;\n }\n}\n\n/*\n * 🔴 The current channel is marked in GREEN (owner 2026-10-25: 「激活的样式用绿色」).\n *\n * Previously the marks were derived from `currentColor` — a neutral bar, a stronger border and a\n * grey tint. All three were so low-contrast that the live row read as \"merely hovered\", which is\n * exactly what the owner was reacting to.\n *\n * Green is also the coherent choice: the key dot and 密钥已配置 text were already green, so the\n * panel now uses ONE colour for ONE meaning (green = working / live), and red stays reserved for\n * destructive actions and failures.\n *\n * Four marks read from the same token so they cannot drift apart: left bar, border, fill, badge.\n */\n.ad-row-current {\n border-color: var(--ad-active);\n border-left-color: var(--ad-active);\n background: var(--ad-active-fill);\n}\n\n/* The 当前 badge is the textual confirmation, for when colour alone is not enough (colour-blind\n readers, screenshots, forced-colours mode). */\n.ad-row-current .ad-badge {\n border-color: var(--ad-active);\n color: var(--ad-active);\n opacity: 1;\n font-weight: 600;\n}\n\n/* The live row's NAME goes green too: the name is where the eye lands first, so marking only the\n border leaves the reader to connect two separate cues. */\n.ad-row-current .ad-rowTitle {\n color: var(--ad-active);\n}\n\n/*\n * The row's content is a COLUMN of at most two lines: (1) name + status, (2) everything else.\n * It was a four-line stack before the compactness pass — see the note on `.ad-row`.\n */\n.ad-rowMain {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n flex: 1 1 auto;\n}\n\n.ad-rowTitleLine {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 13px;\n font-weight: 500;\n min-width: 0;\n}\n\n.ad-rowTitle {\n white-space: nowrap;\n}\n\n.ad-badge {\n font-size: 10px;\n padding: 1px 6px;\n border-radius: 999px;\n border: 1px solid currentColor;\n opacity: 0.8;\n}\n\n.ad-warn {\n color: #b7791f;\n cursor: help;\n}\n\n/*\n * The live-state line under a channel's name: probe verdict and/or balance, nothing else.\n *\n * 🔴 It shrank twice at the owner's request, and the history matters:\n * 2026-10-24 「紧凑些」 — four stacked lines (endpoint identity / key state / verdict / balance)\n * became one wrapping line;\n * 2026-10-25 「这部分不要了」 — endpoint identity and key state were removed outright. What\n * remains is only what changes at runtime: did the probe pass, what is\n * the balance. Those two cannot be derived from anything else on screen,\n * which is why they survived while model/api/baseURL did not.\n *\n * The element is rendered ONLY when one of them exists, so an unprobed, unpriced channel shows a\n * single-line row with no orphan gap.\n */\n.ad-rowDetail {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n column-gap: 6px;\n row-gap: 2px;\n font-size: 11px;\n opacity: 0.66;\n min-width: 0;\n}\n\n.ad-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n word-break: break-all;\n}\n\n.ad-sep {\n opacity: 0.5;\n}\n\n/*\n * 🔴 Every control that acts on a channel lives here — and it MUST be allowed to shrink/wrap.\n *\n * This block is what made the panel unusable on a phone (owner 2026-11-06, screenshot from a\n * 390px-wide viewport). The row itself was already `flex-wrap: wrap`, so the actions SHOULD have\n * dropped to their own line; `flex-shrink: 0` here kept the group at its full intrinsic width\n * (~4 buttons ≈ 272px) inside a ~340px content box, and `.ad-rowMain` — which then had only about\n * 60px left — collapsed to its min-content width, printing `deepseek-v4.1-flash` and the balance\n * one fragment per line. Every control stayed on screen; none of them was readable.\n *\n * Three properties, each doing a different job:\n * · flex-basis 100% + the wrap rule below ⇒ the group takes its own line on narrow screens;\n * · flex-wrap + no flex-shrink:0 ⇒ it may wrap again rather than overflow if the width shrinks\n * further, and on a wide panel it stays on the title line exactly as before;\n * · it keeps `margin-left: auto` so that, once wrapped, the buttons stay right-aligned under the\n * row instead of drifting back under the name.\n */\n.ad-rowActions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n margin-left: auto;\n min-width: 0;\n}\n\n/*\n * Buttons: sized to be hit, not guessed at.\n *\n * The previous 4px/10px padding made a 22px-tall target, which is below the comfortable\n * threshold and made the row actions (测试 / 移除) look like text rather than controls. 6px/12px\n * with a minimum width gives each one a real box while keeping the row compact — a row action is\n * secondary, so it should be easy to hit and easy to ignore.\n */\n.ad-btn {\n font-size: 11px;\n font-family: inherit;\n line-height: 1.5;\n padding: 5px 12px;\n min-width: 56px;\n min-height: 26px;\n border-radius: 6px;\n border: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n cursor: pointer;\n transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;\n}\n\n.ad-btn:hover:not(:disabled) {\n border-color: var(--ad-line-strong);\n background: var(--ad-fill-subtle);\n}\n\n.ad-btn:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n.ad-btn-quiet {\n opacity: 0.85;\n}\n\n.ad-probe {\n font-size: 11px;\n padding-top: 2px;\n}\n\n.ad-probe-ok {\n color: #2f855a;\n}\n\n.ad-probe-bad {\n color: #c53030;\n word-break: break-word;\n}\n\n.ad-hint,\n.ad-empty,\n.ad-note {\n margin: 0;\n font-size: 11px;\n line-height: 1.6;\n opacity: 0.66;\n}\n\n.ad-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex-shrink: 0;\n display: inline-block;\n}\n\n.ad-dot-on {\n background: #2f855a;\n}\n\n.ad-dot-off {\n border: 1px solid currentColor;\n opacity: 0.5;\n}\n\n.ad-dot-unknown {\n background: linear-gradient(90deg, currentColor 50%, transparent 50%);\n opacity: 0.5;\n}\n\n/* The channel row is a radio \"pick\" zone: the whole left side is clickable, and the radio sits\n at the start of the line so \"which one is live\" is readable down a single column. */\n.ad-rowPick {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n flex: 1;\n min-width: 0;\n cursor: pointer;\n}\n\n.ad-rowPick input[type='radio'] {\n flex: none;\n /* Optically centred against the first text line rather than the row box. */\n margin-top: 3px;\n accent-color: var(--ad-line-strong);\n cursor: pointer;\n}\n\n/* The switch is gone: selection is the only axis (see `channels.ts`). Keeping the rules would\n invite someone to bring the second axis back. */\n\n/* ── top-level tabs (渠道 / 用量) ──────────────────────────────────────────── */\n\n/*\n * The panel answers two questions asked at different moments: \"which relay serves me and does\n * its key work\" and \"what has each relay cost\". They used to be stacked on one scroll, so\n * reading the cost table meant scrolling past every channel row. As tabs, each answer gets the\n * whole panel and the reader never scrolls to reach the second one.\n *\n * The selected tab is marked by a bottom rule plus full opacity — not by colour alone, because\n * this host ships no colour tokens and a colour-only cue would vary with the theme.\n */\n.ad-tabs {\n display: flex;\n gap: 4px;\n border-bottom: 1px solid var(--ad-line);\n}\n\n.ad-tab {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n /* Comfortable click target: 28px tall is enough to hit without aiming, and still compact\n enough that two tabs do not dominate the panel. */\n padding: 6px 14px;\n font-size: 12px;\n font-family: inherit;\n border: none;\n border-bottom: 2px solid transparent;\n /* Pulled down over the container's rule so the selected tab's underline replaces it. */\n margin-bottom: -1px;\n background: transparent;\n color: inherit;\n opacity: 0.62;\n cursor: pointer;\n}\n\n.ad-tab:hover {\n opacity: 0.85;\n}\n\n.ad-tab-on {\n opacity: 1;\n font-weight: 600;\n border-bottom-color: currentColor;\n}\n\n/* A count on the channel tab, so \"how many do I have\" is answered without opening it. */\n.ad-tabCount {\n font-size: 10px;\n font-weight: 500;\n min-width: 16px;\n padding: 0 4px;\n border-radius: 999px;\n text-align: center;\n background: var(--ad-fill-subtle);\n opacity: 0.8;\n}\n\n/* ── segmented control (按渠道 / 按天 / 刷新) ─────────────────────────────── */\n\n/*\n * A segmented control rather than free-floating pill buttons: these three share one meaning\n * (\"how the table below is grouped, and re-read it\"), so they are drawn as one object. The\n * borders collapse to avoid double lines between neighbours.\n */\n.ad-segmented {\n display: inline-flex;\n align-items: stretch;\n border: 1px solid var(--ad-line);\n border-radius: 7px;\n overflow: hidden;\n}\n\n.ad-seg {\n padding: 4px 11px;\n font-size: 11px;\n font-family: inherit;\n border: none;\n border-right: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n opacity: 0.7;\n cursor: pointer;\n}\n\n.ad-seg:last-child {\n border-right: none;\n}\n\n.ad-seg:hover:not(:disabled) {\n opacity: 1;\n background: var(--ad-fill-subtle);\n}\n\n.ad-seg-on {\n opacity: 1;\n font-weight: 600;\n background: var(--ad-fill-subtle);\n}\n\n/* Refresh is an action, not a grouping — a gap separates it from the choice it refreshes. */\n.ad-seg-refresh {\n border-left: 1px solid var(--ad-line);\n}\n\n.ad-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11px;\n}\n\n.ad-table th,\n.ad-table td {\n padding: 5px 8px;\n border-bottom: 1px solid var(--ad-line);\n text-align: left;\n}\n\n.ad-table th {\n font-weight: 500;\n opacity: 0.6;\n}\n\n.ad-num {\n text-align: right;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n\n.ad-total td {\n font-weight: 600;\n border-bottom: none;\n}\n\n/* ── add-channel form ─────────────────────────────────────────────────────── */\n\n.ad-addForm {\n display: flex;\n flex-direction: column;\n gap: 14px;\n border: 1px dashed var(--ad-line);\n border-radius: 8px;\n padding: 14px;\n}\n\n.ad-field {\n display: flex;\n flex-direction: column;\n gap: 5px;\n font-size: 11px;\n}\n\n/* The label row: the field name, plus a required/optional marker that says which is which. */\n.ad-field > span:first-child {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 12px;\n font-weight: 500;\n opacity: 0.9;\n}\n\n/*\n * 必选 / 可空 as a small marker rather than a sentence.\n *\n * The add form used to leave the reader guessing which fields could be skipped — and the one\n * field that could not be skipped (the key) looked exactly like the two that could. The marker\n * is text, not colour, so it survives both themes and any colour-blindness.\n */\n.ad-req,\n.ad-opt {\n font-style: normal;\n font-size: 10px;\n font-weight: 400;\n padding: 1px 5px;\n border-radius: 4px;\n opacity: 0.7;\n}\n\n.ad-req {\n border: 1px solid var(--ad-line-strong);\n}\n\n.ad-opt {\n border: 1px dotted var(--ad-line);\n}\n\n/* Why this field exists, in one line — printed under the control, not hidden in a tooltip. */\n.ad-fieldHelp {\n font-size: 11px;\n line-height: 1.55;\n opacity: 0.6;\n}\n\n.ad-input {\n font-size: 12px;\n font-family: inherit;\n /* 6px/9px keeps the control the same height as a `.ad-btn` (26px), so a field and its button\n on one line align without a per-case override. */\n padding: 5px 9px;\n min-height: 26px;\n border-radius: 6px;\n border: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n}\n\n.ad-input:focus-visible {\n outline: 2px solid var(--ad-line-strong);\n outline-offset: 1px;\n border-color: var(--ad-line-strong);\n}\n\n/*\n * 🔴 A native `<select>` cannot be themed by leaving the background transparent.\n *\n * The popup list is drawn by the browser, not by the closed control's box: the options inherit\n * nothing from it, so `background: transparent` made them render in the platform default (light)\n * palette against this dark theme — reported by the owner and measured on the real host.\n *\n * 🔴 SECOND correction (measured 2026-10-21): this file used `var(--dsw-alias-color-*, #fallback)`\n * throughout, and **none of those variables exist**. The host declares only 29 custom properties\n * in total and not one is a colour token, so every `var()` here was falling back — and a fallback\n * that happens to be set inside a shorthand can be silently dropped (the select's background\n * computed to `rgba(0,0,0,0)`, i.e. still transparent, which is exactly the bug).\n *\n * ⇒ Use only values this file controls, derived from `currentColor` (the host sets a light text\n * colour on both themes) plus explicit translucent layers. No host token is assumed.\n */\nselect.ad-input {\n /* Tells the engine which palette to use for the popup. This part DID work. */\n color-scheme: dark light;\n /*\n * Paint the closed box with a layer that follows the surrounding text colour, so it matches\n * whichever theme is active instead of hardcoding a dark value into a light theme.\n */\n background-color: color-mix(in srgb, currentColor 8%, transparent);\n color: inherit;\n cursor: pointer;\n padding-right: 22px;\n /* Room for the chevron drawn below, so text never runs under it. */\n appearance: none;\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),\n linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: calc(100% - 12px) calc(50% + 1px), calc(100% - 8px) calc(50% + 1px);\n background-size: 4px 4px, 4px 4px;\n background-repeat: no-repeat;\n}\n\nselect.ad-input:hover:not(:disabled) {\n background-color: color-mix(in srgb, currentColor 14%, transparent);\n}\n\nselect.ad-input:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: 1px;\n}\n\n/*\n * The popup itself follows `color-scheme`; these keep the option rows explicit for engines that\n * honour per-option colours. `color-scheme: dark` above is what actually stops the light-on-dark\n * list, because the popup is native chrome rather than a styled element.\n */\nselect.ad-input option {\n background-color: Canvas;\n color: CanvasText;\n}\n\n.ad-fieldError {\n margin: 0;\n font-size: 11px;\n color: #c53030;\n}\n\n/* ── balance ──────────────────────────────────────────────────────────────── */\n\n/*\n * Remaining balance.\n *\n * A fact about this channel, not a control. The subtle fill marks it as a measurement rather than\n * a warning: the words themselves say whether it is fine (\"72.50 USD\") or not (\"(余额不足)\").\n */\n.ad-balance {\n font-variant-numeric: tabular-nums;\n font-size: 11px;\n padding: 1px 6px;\n border-radius: 4px;\n background: var(--ad-fill-subtle);\n}\n\n/* A section heading with one action on its right (currently: 查询余额). */\n.ad-sectionBar {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px;\n}\n\n/* The reference name, not a secret: monospace so it lines up and misreads as a name, not a value. */\n.ad-keyName {\n font-size: 10px;\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--ad-fill-subtle);\n opacity: 0.8;\n}\n\n/* A text-shaped action. Styled as a link because it opens an inline editor, not a dialog. */\n.ad-link {\n font-size: 11px;\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n text-decoration: underline;\n text-underline-offset: 2px;\n opacity: 0.75;\n cursor: pointer;\n}\n\n.ad-link:hover {\n opacity: 1;\n}\n\n/* The inline key editor: one masked field and one button, on the same line as the fact above. */\n.ad-keyForm {\n display: flex;\n align-items: center;\n gap: 6px;\n padding-top: 4px;\n}\n\n.ad-keyForm .ad-input {\n flex: 1;\n min-width: 0;\n}\n\n/* A destructive action is quiet until hovered: it should be findable, not inviting. */\n.ad-btn-danger {\n opacity: 0.6;\n}\n\n.ad-btn-danger:hover:not(:disabled) {\n opacity: 1;\n border-color: var(--ad-danger);\n color: var(--ad-danger);\n}\n\n/*\n * The one hint that must not be skimmed past: where the key ends up.\n *\n * It carries a left rule and slightly higher opacity than an ordinary hint, because a reader who\n * skips it has been told something false by omission — the key IS in the profile document.\n */\n.ad-hint-warn {\n padding: 8px 10px;\n border-left: 3px solid var(--ad-line-strong);\n background: var(--ad-fill-subtle);\n border-radius: 0 6px 6px 0;\n opacity: 0.82;\n}\n\n/*\n * The table can be wider than a narrow settings pane (ten columns of numbers). Scrolling it\n * inside its own box keeps the tab strip and the channel list reachable, instead of pushing the\n * whole panel sideways.\n */\n.ad-tableWrap {\n overflow-x: auto;\n /* A hint that there is more to the right, without a scrollbar competing with the borders. */\n scrollbar-width: thin;\n}\n\n.ad-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11px;\n}\n\n/* The first column is a name, not a number: keep it from being squeezed by the numeric columns. */\n.ad-table th:first-child,\n.ad-table td:first-child {\n white-space: nowrap;\n padding-right: 14px;\n}\n\n/* ── footer ───────────────────────────────────────────────────────────────── */\n\n/*\n * States what this thing is (MIT, open, improvable) and where it lives. A user deciding whether\n * to fork it or add a relay should not have to search for the source.\n */\n.ad-foot {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n gap: 8px;\n padding-top: 10px;\n border-top: 1px solid var(--ad-line);\n font-size: 11px;\n opacity: 0.6;\n}\n\n.ad-footLink {\n color: inherit;\n text-decoration: underline;\n text-underline-offset: 2px;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: 10px;\n}\n\n.ad-footLink:hover {\n opacity: 0.9;\n}\n";
|
|
298
322
|
if (typeof document !== "undefined" && document.querySelector("style[data-ad-css=\"SettingsPage\"]") === null) {
|
|
299
323
|
const tag = document.createElement("style");
|
|
300
324
|
tag.setAttribute("data-ad-css", "SettingsPage");
|
|
@@ -419,9 +443,12 @@ window.__ModuleLoader__.load({
|
|
|
419
443
|
const [keying, setKeying] = (0, react.useState)(null);
|
|
420
444
|
const [keyDraft, setKeyDraft] = (0, react.useState)("");
|
|
421
445
|
const [keySaving, setKeySaving] = (0, react.useState)(false);
|
|
422
|
-
/**
|
|
423
|
-
|
|
424
|
-
|
|
446
|
+
/**
|
|
447
|
+
* 🔴 There is no rename state any more (owner 2026-11-06). The per-row 改名 button was removed
|
|
448
|
+
* together with its inline field; renaming now happens through the add form's 显示名 field. The
|
|
449
|
+
* `channels.<id>.label` setting it wrote is unchanged, so bringing the button back needs nothing
|
|
450
|
+
* from this file beyond the button itself.
|
|
451
|
+
*/
|
|
425
452
|
/** The channel id and the label the form last derived from a preset (see the select). */
|
|
426
453
|
const lastSuggestedId = (0, react.useRef)("");
|
|
427
454
|
const lastSuggestedLabel = (0, react.useRef)("");
|
|
@@ -597,32 +624,6 @@ window.__ModuleLoader__.load({
|
|
|
597
624
|
}
|
|
598
625
|
};
|
|
599
626
|
/**
|
|
600
|
-
* Rename one channel.
|
|
601
|
-
*
|
|
602
|
-
* `label` is the display name and nothing else: the channel's identity is its id (the
|
|
603
|
-
* configuration key), which renaming must never touch — a renamed key would be a different
|
|
604
|
-
* channel, with a different key and a different `current` target.
|
|
605
|
-
*
|
|
606
|
-
* Clearing the name removes the field, which restores the preset's name rather than leaving an
|
|
607
|
-
* empty label in the document.
|
|
608
|
-
* @param row - the channel being renamed.
|
|
609
|
-
*/
|
|
610
|
-
const renameChannel = (row) => {
|
|
611
|
-
const next = renameDraft.trim();
|
|
612
|
-
if (next === "") write(() => removeField([
|
|
613
|
-
"channels",
|
|
614
|
-
row.id,
|
|
615
|
-
"label"
|
|
616
|
-
]), "恢复默认名失败");
|
|
617
|
-
else write(() => setField([
|
|
618
|
-
"channels",
|
|
619
|
-
row.id,
|
|
620
|
-
"label"
|
|
621
|
-
], next), "重命名失败");
|
|
622
|
-
setRenaming(null);
|
|
623
|
-
setRenameDraft("");
|
|
624
|
-
};
|
|
625
|
-
/**
|
|
626
627
|
* The usage rows actually rendered.
|
|
627
628
|
*
|
|
628
629
|
* Truncation happens HERE, in the component, and not in `/stats` — the server keeps returning
|
|
@@ -753,30 +754,6 @@ window.__ModuleLoader__.load({
|
|
|
753
754
|
})
|
|
754
755
|
]
|
|
755
756
|
}),
|
|
756
|
-
renaming === row.id && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
757
|
-
className: "ad-keyForm",
|
|
758
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
759
|
-
className: "ad-input",
|
|
760
|
-
value: renameDraft,
|
|
761
|
-
placeholder: "显示名(留空则用预设默认名)",
|
|
762
|
-
onClick: (event) => event.preventDefault(),
|
|
763
|
-
onChange: (event) => setRenameDraft(event.target.value),
|
|
764
|
-
onKeyDown: (event) => {
|
|
765
|
-
if (event.key === "Enter") {
|
|
766
|
-
event.preventDefault();
|
|
767
|
-
renameChannel(row);
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
771
|
-
type: "button",
|
|
772
|
-
className: "ad-btn",
|
|
773
|
-
onClick: (event) => {
|
|
774
|
-
event.preventDefault();
|
|
775
|
-
renameChannel(row);
|
|
776
|
-
},
|
|
777
|
-
children: "保存名字"
|
|
778
|
-
})]
|
|
779
|
-
}),
|
|
780
757
|
(probeResult !== void 0 || balances[row.id] !== void 0) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
781
758
|
className: "ad-rowDetail",
|
|
782
759
|
children: [probeResult !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -811,16 +788,6 @@ window.__ModuleLoader__.load({
|
|
|
811
788
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
812
789
|
className: "ad-rowActions",
|
|
813
790
|
children: [
|
|
814
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
815
|
-
type: "button",
|
|
816
|
-
className: "ad-btn ad-btn-quiet",
|
|
817
|
-
title: "改显示名(渠道 id 不变)",
|
|
818
|
-
onClick: () => {
|
|
819
|
-
setRenaming(renaming === row.id ? null : row.id);
|
|
820
|
-
setRenameDraft(renaming === row.id ? "" : row.label);
|
|
821
|
-
},
|
|
822
|
-
children: renaming === row.id ? "取消" : "改名"
|
|
823
|
-
}),
|
|
824
791
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
825
792
|
type: "button",
|
|
826
793
|
className: "ad-btn ad-btn-quiet",
|
|
@@ -941,9 +908,11 @@ window.__ModuleLoader__.load({
|
|
|
941
908
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
942
909
|
className: "ad-fieldHelp",
|
|
943
910
|
children: [
|
|
944
|
-
"
|
|
945
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "
|
|
946
|
-
"
|
|
911
|
+
"这一格也是",
|
|
912
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "改名" }),
|
|
913
|
+
"的唯一入口:选回同一个规格、名字照写、粘上门已有 key 的",
|
|
914
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "占位值" }),
|
|
915
|
+
"(确认那几个字符的点,不会覆盖原有 key),保存即可。 留空或原样提交,它就保持现在的名字。"
|
|
947
916
|
]
|
|
948
917
|
})
|
|
949
918
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-any-deepseek",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "One DeepSeek V4.1 Flash provider for DeepSeek Harness: paste a key per channel, switch channels manually, token usage booked per real upstream.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|