@goodandready/dsh-subscriptions 0.6.71 โ 0.6.72
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/README.md +6 -0
- package/README.ru.md +6 -0
- package/README.zh.md +6 -0
- package/lib/accounts-view.js +4 -0
- package/lib/accounts.js +13 -0
- package/lib/client.js +609 -820
- package/lib/doctor.js +163 -0
- package/lib/instructions.js +138 -0
- package/lib/routes/accounts.js +72 -0
- package/lib/routes/status.js +99 -5
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -4,6 +4,7 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} }
|
|
5
5
|
var exports = module.exports
|
|
6
6
|
const React = require('react')
|
|
7
|
+
const h = React.createElement
|
|
7
8
|
|
|
8
9
|
// Modular translator: shared by component subscriptions and helpers.
|
|
9
10
|
let t = (key) => key
|
|
@@ -22,12 +23,12 @@ window.__ModuleLoader__.load({
|
|
|
22
23
|
}
|
|
23
24
|
render() {
|
|
24
25
|
if (this.state.hasError) {
|
|
25
|
-
return
|
|
26
|
+
return h(
|
|
26
27
|
"div",
|
|
27
28
|
{ style: { padding: "12px", border: "1px solid var(--dsw-alias-state-error-primary)", borderRadius: "8px", background: "var(--dsw-alias-bg-layer-2)", margin: "8px 0", fontSize: "13px" } },
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
h("div", { style: { fontWeight: 600, color: "var(--dsw-alias-state-error-primary)", marginBottom: "4px" } }, "Subscriptions UI error"),
|
|
30
|
+
h("div", { style: { color: "var(--dsw-alias-label-secondary)", fontSize: "12px", marginBottom: "8px" } }, String(this.state.error && this.state.error.message || this.state.error || "Unknown error")),
|
|
31
|
+
h("button", {
|
|
31
32
|
className: "dsub-mini",
|
|
32
33
|
onClick: () => this.setState({ hasError: false, error: null })
|
|
33
34
|
}, "Retry")
|
|
@@ -39,168 +40,8 @@ window.__ModuleLoader__.load({
|
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
const CSS =
|
|
42
|
-
'.dsub-card{list-style:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;transition:border-color .16s,background .16s}' +
|
|
43
|
-
'.
|
|
44
|
-
'.dsub-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}' +
|
|
45
|
-
'.dsub-header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}' +
|
|
46
|
-
'.dsub-header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}' +
|
|
47
|
-
'.dsub-headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}' +
|
|
48
|
-
'.dsub-name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}' +
|
|
49
|
-
'.dsub-description{color:var(--dsw-alias-label-secondary);font-size:13px}' +
|
|
50
|
-
'.dsub-chev{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}' +
|
|
51
|
-
'.dsub-chevOpen{transform:rotate(180deg)}' +
|
|
52
|
-
'.dsub-body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:12px}' +
|
|
53
|
-
'.dsub-block{margin-top:10px}' +
|
|
54
|
-
'.dsub-group{margin-top:12px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:0 14px}' +
|
|
55
|
-
'.dsub-group[open]{padding-bottom:6px}' +
|
|
56
|
-
'.dsub-groupHead{cursor:pointer;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);padding:10px 0;list-style:none}' +
|
|
57
|
-
'.dsub-groupHead::-webkit-details-marker{display:none}' +
|
|
58
|
-
'.dsub-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}' +
|
|
59
|
-
'.dsub-grow{flex:1 1 180px;min-width:140px}' +
|
|
60
|
-
'.dsub-helpBox{margin-top:8px;padding:12px 14px;border-radius:8px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);font-size:12px;line-height:1.6}' +
|
|
61
|
-
'.dsub-helpHead{display:flex;align-items:center;justify-content:space-between;font-weight:600;margin-bottom:8px;color:var(--dsw-alias-brand-primary)}' +
|
|
62
|
-
'.dsub-helpStep{margin-bottom:6px;color:var(--dsw-alias-label-primary)}' +
|
|
63
|
-
'.dsub-btnActive{background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-label-primary-foreground);border-color:var(--dsw-alias-brand-primary)}' +
|
|
64
|
-
'.dsub-h{font-size:13.5px;font-weight:600;color:var(--dsw-alias-label-primary)}' +
|
|
65
|
-
'.dsub-sub{font-size:12px;color:var(--dsw-alias-label-secondary)}' +
|
|
66
|
-
'.dsub-dim{font-size:11.5px;color:var(--dsw-alias-label-tertiary)}' +
|
|
67
|
-
'.dsub-mini{appearance:none;font:inherit;font-size:12px;cursor:pointer;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:3px 8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);transition:all .15s}' +
|
|
68
|
-
'.dsub-mini:hover{background:var(--dsw-alias-bg-layer-1);border-color:var(--dsw-alias-label-dimmed)}' +
|
|
69
|
-
'.dsub-ok{font-size:12px;color:var(--dsw-alias-state-success-primary)}' +
|
|
70
|
-
'.dsub-bad{font-size:12px;color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;word-break:break-word;max-width:100%}' +
|
|
71
|
-
'.dsub-hint{overflow-wrap:anywhere;word-break:break-word;max-width:100%}' +
|
|
72
|
-
'.dsub-btn{appearance:none;font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:5px 12px;font-size:12.5px;font-weight:500;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);transition:all .15s}' +
|
|
73
|
-
'.dsub-btn:hover{background:var(--dsw-alias-bg-layer-1);border-color:var(--dsw-alias-label-dimmed)}' +
|
|
74
|
-
'.dsub-inp{height:30px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);border-radius:6px;padding:0 8px;font-size:12px;min-width:180px}' +
|
|
75
|
-
'.dsub-inp:focus{outline:none;border-color:var(--dsw-alias-brand-primary)}' +
|
|
76
|
-
'.dsub-box{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:10px;margin-top:8px;background:var(--dsw-alias-bg-layer-2)}' +
|
|
77
|
-
'.dsub-cooldown{display:inline-block;padding:2px 6px;border-radius:4px;background:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-bg-layer-1);font-size:11px;font-weight:600}' +
|
|
78
|
-
'.dsub-bar{position:relative;height:6px;border-radius:3px;background:var(--dsw-alias-bg-layer-1);overflow:hidden;flex:1;min-width:80px}' +
|
|
79
|
-
'.dsub-barFill{height:100%;border-radius:3px;background:var(--dsw-alias-state-success-primary);transition:width .2s}' +
|
|
80
|
-
'.dsub-barWarn .dsub-barFill{background:var(--dsw-alias-state-warn-primary)}' +
|
|
81
|
-
'.dsub-barFull .dsub-barFill{background:var(--dsw-alias-state-error-primary)}' +
|
|
82
|
-
'.dsub-barRow{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--dsw-alias-label-secondary)}' +
|
|
83
|
-
'.dsub-manual{display:flex;flex-direction:column;gap:6px;margin-top:4px;padding-top:10px;border-top:1px solid var(--dsw-alias-border-l2)}' +
|
|
84
|
-
'.dsub-verify{font-size:12px;color:var(--dsw-alias-state-warn-primary)}' +
|
|
85
|
-
'.dsub-verify a{color:var(--dsw-alias-brand-primary)}' +
|
|
86
|
-
'.dsub-pill{display:inline-flex;align-items:center;gap:7px;height:28px;padding:0 11px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600;cursor:pointer;box-shadow:0 1px 3px color-mix(in srgb, black 15%, transparent),inset 0 1px 0 color-mix(in srgb, white 6%, transparent);transition:all .16s ease;user-select:none}' +
|
|
87
|
-
'.dsub-pill:hover{background:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-tertiary);transform:translateY(-1px);box-shadow:0 3px 8px color-mix(in srgb, black 25%, transparent),inset 0 1px 0 color-mix(in srgb, white 10%, transparent)}' +
|
|
88
|
-
'.dsub-pill:active{transform:translateY(0)}' +
|
|
89
|
-
'.dsub-pillTag{padding:1px 5px;border-radius:4px;font-size:10.5px;font-weight:700;letter-spacing:.02em;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary)}' +
|
|
90
|
-
'.dsub-led{width:7px;height:7px;border-radius:50%;flex:none;transition:all .2s ease}' +
|
|
91
|
-
'.dsub-ledOk{background:var(--dsw-alias-state-success-primary);box-shadow:0 0 6px color-mix(in srgb,var(--dsw-alias-state-success-primary) 70%,transparent)}' +
|
|
92
|
-
'.dsub-ledWarn{background:var(--dsw-alias-state-warn-primary);box-shadow:0 0 6px color-mix(in srgb,var(--dsw-alias-state-warn-primary) 70%,transparent)}' +
|
|
93
|
-
'.dsub-ledBad{background:var(--dsw-alias-state-error-primary);box-shadow:0 0 6px color-mix(in srgb,var(--dsw-alias-state-error-primary) 70%,transparent)}' +
|
|
94
|
-
'.dsub-ledOff{background:var(--dsw-alias-label-tertiary)}' +
|
|
95
|
-
'.dsub-toast-container{position:fixed;top:16px;right:16px;z-index:10030;display:flex;flex-direction:column;gap:8px;pointer-events:none}' +'.dsub-toast{pointer-events:auto;min-width:280px;max-width:400px;padding:10px 14px;border-radius:10px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l1);box-shadow:0 8px 24px color-mix(in srgb,black 40%,transparent);display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;line-height:1.4;animation:dsubFadeIn .2s ease-out}' +'.dsub-toast-warn{border-color:var(--dsw-alias-state-warn-primary)}' +'.dsub-toast-bad{border-color:var(--dsw-alias-state-error-primary)}' +'.dsub-toast-ok{border-color:var(--dsw-alias-state-success-primary)}' +'.dsub-toast-close{background:none;border:none;color:var(--dsw-alias-label-tertiary);cursor:pointer;font-size:14px;padding:0 2px}' +'.dsub-toast-close:hover{color:var(--dsw-alias-label-primary)}' +
|
|
96
|
-
'.dsub-modalWrap{position:fixed;inset:0;z-index:10020;display:grid;place-items:center;background:color-mix(in srgb, black 65%, transparent);backdrop-filter:blur(10px);animation:dsubFadeIn .16s ease-out}' +
|
|
97
|
-
'.dsub-modal{width:min(520px,94vw);max-height:min(85vh,720px);overflow-y:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:16px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);box-shadow:0 24px 64px color-mix(in srgb, black 60%, transparent),0 0 0 1px color-mix(in srgb, white 7%, transparent);padding:20px;animation:dsubScaleIn .18s cubic-bezier(.16,1,.3,1)}' +
|
|
98
|
-
'@keyframes dsubFadeIn{from{opacity:0}to{opacity:1}}' +
|
|
99
|
-
'@keyframes dsubScaleIn{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}' +
|
|
100
|
-
'.dsub-modalHead{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--dsw-alias-border-l2)}' +
|
|
101
|
-
'.dsub-modalTitleWrap{display:flex;align-items:center;gap:10px}' +
|
|
102
|
-
'.dsub-modalIcon{width:30px;height:30px;border-radius:8px;background:var(--dsw-alias-bg-layer-1);display:grid;place-items:center;color:var(--dsw-alias-brand-primary);font-size:14px}' +
|
|
103
|
-
'.dsub-modalBadge{font-size:11px;font-weight:600;padding:2px 7px;border-radius:10px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary)}' +
|
|
104
|
-
'.dsub-heroCard{margin-top:14px;padding:14px 16px;border-radius:12px;background:linear-gradient(135deg,var(--dsw-alias-bg-layer-2) 0%,var(--dsw-alias-bg-layer-3) 100%);border:1px solid var(--dsw-alias-border-l1);box-shadow:inset 0 1px 0 color-mix(in srgb, white 5%, transparent)}' +
|
|
105
|
-
'.dsub-heroHead{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}' +
|
|
106
|
-
'.dsub-heroTitle{font-size:14px;font-weight:700;display:flex;align-items:center;gap:6px}' +
|
|
107
|
-
'.dsub-heroModel{font-size:11.5px;color:var(--dsw-alias-label-secondary);font-family:ui-monospace,monospace}' +
|
|
108
|
-
'.dsub-select{appearance:none;height:30px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);border-radius:6px;padding:0 24px 0 8px;font-size:12px;cursor:pointer}' +
|
|
109
|
-
'.dsub-details{margin-top:12px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:8px 12px;background:var(--dsw-alias-bg-layer-2)}' +
|
|
110
|
-
'.dsub-summary{cursor:pointer;font-weight:600;font-size:12.5px;color:var(--dsw-alias-label-secondary);user-select:none}' +
|
|
111
|
-
'.dsub-summary:hover{color:var(--dsw-alias-label-primary)}' +
|
|
112
|
-
'.dsub-header-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:8px 0 12px;margin-bottom:8px;border-bottom:1px solid var(--dsw-alias-border-l2)}' +
|
|
113
|
-
'.dsub-badge{font-size:12px;padding:3px 10px;border-radius:999px;border:1px solid var(--dsw-alias-border-l2);display:inline-flex;align-items:center;gap:5px;font-weight:500}' +
|
|
114
|
-
'.dsub-badge-ok{border-color:var(--dsw-alias-state-success-primary);color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 10%,transparent)}' +
|
|
115
|
-
'.dsub-badge-warn{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 10%,transparent)}' +
|
|
116
|
-
'.dsub-badge-bad{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent)}' +
|
|
117
|
-
'.dsub-badge-neutral{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2)}' +
|
|
118
|
-
'.dsub-section-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:10px;margin-top:12px}' +
|
|
119
|
-
'.dsub-section-title{font-size:14.5px;font-weight:600;color:var(--dsw-alias-label-primary);display:flex;align-items:center;justify-content:space-between;gap:8px}' +
|
|
120
|
-
'.dsub-section-desc{font-size:12px;color:var(--dsw-alias-label-secondary);margin-top:-4px;line-height:1.4}' +
|
|
121
|
-
'.dsub-grid-2{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));gap:10px}' +
|
|
122
|
-
'.dsub-stat-box{padding:10px 12px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2);display:flex;flex-direction:column;gap:3px}' +
|
|
123
|
-
'.dsub-stat-val{font-size:16.5px;font-weight:700;color:var(--dsw-alias-label-primary)}' +
|
|
124
|
-
'.dsub-stat-lbl{font-size:11.5px;color:var(--dsw-alias-label-secondary)}' +
|
|
125
|
-
'.dsub-chart-wrap{display:flex;align-items:flex-end;gap:3px;height:52px;padding:6px 0;margin-top:8px;border-bottom:1px solid var(--dsw-alias-border-l3)}' +
|
|
126
|
-
'.dsub-chart-bar{flex:1;background:var(--dsw-alias-brand-primary);border-radius:2px 2px 0 0;min-height:3px;transition:height .2s ease;opacity:0.85;cursor:pointer}' +
|
|
127
|
-
'.dsub-chart-bar:hover{opacity:1;background:var(--dsw-alias-state-success-primary)}' +
|
|
128
|
-
'.dsub-chart-labels{display:flex;justify-content:space-between;font-size:10px;color:var(--dsw-alias-label-secondary);margin-top:3px}' +
|
|
129
|
-
'.dsub-alert-ok{padding:8px 12px;border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 10%,transparent);color:var(--dsw-alias-state-success-primary);font-size:12.5px;border:1px solid color-mix(in srgb,var(--dsw-alias-state-success-primary) 25%,transparent)}' +
|
|
130
|
-
'.dsub-alert-bad{padding:8px 12px;border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);color:var(--dsw-alias-state-error-primary);font-size:12.5px;border:1px solid color-mix(in srgb,var(--dsw-alias-state-error-primary) 25%,transparent)}' +
|
|
131
|
-
'.dsub-btn-primary{background:var(--dsw-alias-label-primary) !important;color:var(--dsw-alias-bg-layer-3) !important;border-color:transparent !important;font-weight:600}' +
|
|
132
|
-
'.dsub-btn-primary:hover:not(:disabled){opacity:0.9}' +
|
|
133
|
-
'.dsub-model-grid{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}' +
|
|
134
|
-
'.dsub-model-chip{display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border-radius:6px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);font-size:11.5px;color:var(--dsw-alias-label-primary)}' +
|
|
135
|
-
'.dsub-model-chip code{font-family:ui-monospace,monospace;font-weight:600}' +
|
|
136
|
-
'.dsub-model-tag{font-size:10px;padding:1px 4px;border-radius:3px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font-weight:600}' +
|
|
137
|
-
'.dsub-trace-box{padding:8px 12px;border-radius:8px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);margin-top:8px;font-size:12px}' +
|
|
138
|
-
'.dsub-trace-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0;border-bottom:1px solid var(--dsw-alias-border-l3)}' +
|
|
139
|
-
'.dsub-trace-row:last-child{border-bottom:none}' +
|
|
140
|
-
'.dsub-model-status-available{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 12%,transparent)}' +
|
|
141
|
-
'.dsub-model-status-degraded{color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 12%,transparent)}' +
|
|
142
|
-
'.dsub-model-status-quarantined{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent)}' +
|
|
143
|
-
'.dsub-model-status-cooldown{color:var(--dsw-alias-state-business-primary);background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 12%,transparent)}' +
|
|
144
|
-
'.dsub-model-status-exhausted{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent)}' +
|
|
145
|
-
'.dsub-model-status-unconfigured{color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-3)}' +
|
|
146
|
-
'.dsub-heroBars{display:flex;flex-direction:column;gap:8px;margin-top:10px}' +
|
|
147
|
-
'.dsub-barLabelRow{display:flex;justify-content:space-between;font-size:11.5px;color:var(--dsw-alias-label-secondary);margin-bottom:3px}' +
|
|
148
|
-
'.dsub-barTrack{height:6px;border-radius:3px;background:var(--dsw-alias-bg-layer-1);overflow:hidden}' +
|
|
149
|
-
'.dsub-barFillGrad{height:100%;border-radius:3px;transition:width .3s ease}' +
|
|
150
|
-
'.dsub-panel-box{margin-top:10px;padding:12px 14px;border-radius:10px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);display:flex;flex-direction:column;gap:8px}' +
|
|
151
|
-
'.dsub-panel-warn{border-color:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 40%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 5%,transparent)}' +
|
|
152
|
-
'.dsub-panel-title{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);display:flex;align-items:center;justify-content:space-between}' +
|
|
153
|
-
'.dsub-panel-desc{font-size:12px;color:var(--dsw-alias-label-secondary);line-height:1.4}' +
|
|
154
|
-
'.dsub-usage-grid{display:flex;flex-direction:column;gap:8px;margin-top:4px}' +
|
|
155
|
-
'.dsub-usage-card{display:flex;flex-direction:column;gap:5px;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1)}' +
|
|
156
|
-
'.dsub-usage-head{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:500;color:var(--dsw-alias-label-primary)}' +
|
|
157
|
-
'.dsub-usage-track{width:100%;height:8px;border-radius:999px;background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-border-l2);overflow:hidden}' +
|
|
158
|
-
'.dsub-usage-fill{height:100%;border-radius:999px;transition:width .3s ease}' +
|
|
159
|
-
'.dsub-usage-meta{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--dsw-alias-label-secondary)}' +
|
|
160
|
-
'.dsub-tag-ok{border-color:color-mix(in srgb,var(--dsw-alias-state-success-primary) 30%,transparent);color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,transparent);padding:1px 7px;border-radius:999px;font-size:11px;font-weight:600;border-style:solid;border-width:1px}' +
|
|
161
|
-
'.dsub-tag-warn{border-color:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 40%,transparent);color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 8%,transparent);padding:1px 7px;border-radius:999px;font-size:11px;font-weight:600;border-style:solid;border-width:1px}' +
|
|
162
|
-
'.dsub-tag-bad{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 40%,transparent);color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent);padding:1px 7px;border-radius:999px;font-size:11px;font-weight:600;border-style:solid;border-width:1px}' +
|
|
163
|
-
'.dsub-slot-meta-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:12px;padding-top:10px;border-top:1px solid var(--dsw-alias-border-l2);font-size:12px}' +
|
|
164
|
-
'.dsub-ref-tag{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;color:var(--dsw-alias-label-secondary)}' +
|
|
165
|
-
'.dsub-ref-tag code{padding:2px 6px;border-radius:4px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);font-family:ui-monospace,monospace;color:var(--dsw-alias-label-primary);font-size:11px}' +
|
|
166
|
-
'.dsub-speed-tag{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;color:var(--dsw-alias-brand-primary);background:color-mix(in srgb,var(--dsw-alias-brand-primary) 8%,transparent);padding:2px 8px;border-radius:6px;font-weight:500;border:1px solid color-mix(in srgb,var(--dsw-alias-brand-primary) 20%,transparent)}' +
|
|
167
|
-
'.dsub-btn-danger{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 40%,transparent)!important;color:var(--dsw-alias-state-error-primary)!important}' +
|
|
168
|
-
'.dsub-btn-danger:hover:not(:disabled){background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent)!important}' +
|
|
169
|
-
'.dsub-poolTitle{margin-top:16px;margin-bottom:8px;font-size:11.5px;font-weight:700;color:var(--dsw-alias-label-secondary);text-transform:uppercase;letter-spacing:.05em}' +
|
|
170
|
-
'.dsub-accountCard{display:flex;align-items:center;gap:12px;padding:10px 14px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2);margin-top:6px;transition:border-color .15s,background .15s}' +
|
|
171
|
-
'.dsub-accountCard:hover{background:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-tertiary)}' +
|
|
172
|
-
'.dsub-brandBadge{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;font-size:12px;font-weight:700;flex-shrink:0}' +
|
|
173
|
-
'.dsub-brandCodex{background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 15%,transparent);color:var(--dsw-alias-state-success-primary);border:1px solid color-mix(in srgb,var(--dsw-alias-state-success-primary) 30%,transparent)}' +
|
|
174
|
-
'.dsub-brandClaude{background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 15%,transparent);color:var(--dsw-alias-state-warn-primary);border:1px solid color-mix(in srgb,var(--dsw-alias-state-warn-primary) 30%,transparent)}' +
|
|
175
|
-
'.dsub-brandGrok{background:color-mix(in srgb,var(--dsw-alias-state-business-primary, var(--dsw-alias-brand-primary)) 15%,transparent);color:var(--dsw-alias-state-business-primary, var(--dsw-alias-brand-primary));border:1px solid color-mix(in srgb,var(--dsw-alias-state-business-primary, var(--dsw-alias-brand-primary)) 30%,transparent)}' +
|
|
176
|
-
'.dsub-brandAgy{background:color-mix(in srgb,var(--dsw-alias-brand-primary) 15%,transparent);color:var(--dsw-alias-brand-primary);border:1px solid color-mix(in srgb,var(--dsw-alias-brand-primary) 30%,transparent)}' +
|
|
177
|
-
'.dsub-brandOllama{background:color-mix(in srgb,var(--dsw-alias-label-tertiary) 15%,transparent);color:var(--dsw-alias-label-secondary);border:1px solid color-mix(in srgb,var(--dsw-alias-label-tertiary) 30%,transparent)}' +
|
|
178
|
-
'.dsub-brandKimi{background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 15%,transparent);color:var(--dsw-alias-state-warn-primary);border:1px solid color-mix(in srgb,var(--dsw-alias-state-warn-primary) 30%,transparent)}' +
|
|
179
|
-
'.dsub-brandGlm{background:color-mix(in srgb,var(--dsw-alias-state-business-primary, var(--dsw-alias-brand-primary)) 15%,transparent);color:var(--dsw-alias-state-business-primary, var(--dsw-alias-brand-primary));border:1px solid color-mix(in srgb,var(--dsw-alias-state-business-primary, var(--dsw-alias-brand-primary)) 30%,transparent)}' +
|
|
180
|
-
'.dsub-planBadge{display:inline-flex;align-items:center;padding:1px 6px;border-radius:4px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.5px;background:color-mix(in srgb,var(--dsw-alias-brand-primary) 15%,transparent);color:var(--dsw-alias-brand-primary);border:1px solid color-mix(in srgb,var(--dsw-alias-brand-primary) 30%,transparent);margin-left:6px}' +
|
|
181
|
-
|
|
182
|
-
'.dsub-accInfo{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}' +
|
|
183
|
-
'.dsub-accNameRow{display:flex;align-items:center;justify-content:space-between;gap:8px}' +
|
|
184
|
-
'.dsub-accName{font-size:13px;font-weight:600}' +
|
|
185
|
-
'.dsub-accStatusTag{font-size:10.5px;font-weight:600;padding:1px 6px;border-radius:4px}' +
|
|
186
|
-
'.dsub-statusOk{background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 15%,transparent);color:var(--dsw-alias-state-success-primary)}' +
|
|
187
|
-
'.dsub-statusWarn{background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 15%,transparent);color:var(--dsw-alias-state-warn-primary)}' +
|
|
188
|
-
'.dsub-statusBad{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 15%,transparent);color:var(--dsw-alias-state-error-primary)}' +
|
|
189
|
-
'.dsub-statusOff{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-tertiary)}' +
|
|
190
|
-
'.dsub-modalFoot{display:flex;align-items:center;justify-content:space-between;margin-top:16px;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l2)}' +
|
|
191
|
-
'.dsub-btnPrimary{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:600;background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-label-primary-foreground);border:0;cursor:pointer;transition:opacity .15s}' +
|
|
192
|
-
'.dsub-btnPrimary:hover{opacity:.9}' +
|
|
193
|
-
'.dsub-btnSec{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;border-radius:7px;font-size:11.5px;font-weight:500;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;text-decoration:none;transition:all .15s}' +
|
|
194
|
-
'.dsub-btnSec:hover{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-tertiary)}' +
|
|
195
|
-
'.dsub-cq{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary);padding:0 6px}' +
|
|
196
|
-
'.dsub-cqBar{position:relative;width:40px;height:5px;border-radius:3px;background:var(--dsw-alias-bg-layer-1);overflow:hidden}' +
|
|
197
|
-
'.dsub-cqBarFill{height:100%;border-radius:3px;background:var(--dsw-alias-state-success-primary)}' +
|
|
198
|
-
'.dsub-cqBarWarn .dsub-cqBarFill{background:var(--dsw-alias-state-warn-primary)}' +
|
|
199
|
-
'.dsub-cqBarFull .dsub-cqBarFill{background:var(--dsw-alias-state-error-primary)}' +
|
|
200
|
-
'.dsub-cqB{font-variant-numeric:tabular-nums;font-weight:600;color:var(--dsw-alias-label-primary)}' +
|
|
201
|
-
'.dsub-diag{font:11px/1.5 ui-monospace,SFMono-Regular,monospace;max-height:260px;overflow:auto;white-space:pre-wrap;word-break:break-word;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:10px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary)}'
|
|
202
|
-
|
|
203
|
-
const cssId = 'dsh-subscriptions/settings.module.css'
|
|
43
|
+
".dsub-card{list-style:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;transition:border-color .16s,background .16s}.dsub-card:hover{border-color:var(--dsw-alias-label-dimmed)}.dsub-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.dsub-header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dsub-header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dsub-headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dsub-name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dsub-description{color:var(--dsw-alias-label-secondary);font-size:13px}.dsub-chev{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.dsub-chevOpen{transform:rotate(180deg)}.dsub-body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:12px}.dsub-block{margin-top:10px}.dsub-group{margin-top:12px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:0 14px}.dsub-group[open]{padding-bottom:6px}.dsub-groupHead{cursor:pointer;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);padding:10px 0;list-style:none}.dsub-groupHead::-webkit-details-marker{display:none}.dsub-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}.dsub-grow{flex:1 1 180px;min-width:140px}.dsub-helpBox{margin-top:8px;padding:12px 14px;border-radius:8px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);font-size:12px;line-height:1.6}.dsub-helpHead{display:flex;align-items:center;justify-content:space-between;font-weight:600;margin-bottom:8px;color:var(--dsw-alias-brand-primary)}.dsub-helpStep{margin-bottom:6px;color:var(--dsw-alias-label-primary)}.dsub-btnActive{background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-label-primary-foreground);border-color:var(--dsw-alias-brand-primary)}.dsub-h{font-size:13.5px;font-weight:600;color:var(--dsw-alias-label-primary)}.dsub-sub{font-size:12px;color:var(--dsw-alias-label-secondary)}.dsub-dim{font-size:11.5px;color:var(--dsw-alias-label-tertiary)}.dsub-mini{appearance:none;font:inherit;font-size:12px;cursor:pointer;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:3px 8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);transition:all .15s}.dsub-mini:hover{background:var(--dsw-alias-bg-layer-1);border-color:var(--dsw-alias-label-dimmed)}.dsub-ok{font-size:12px;color:var(--dsw-alias-state-success-primary)}.dsub-bad{font-size:12px;color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;word-break:break-word;max-width:100%}.dsub-hint{overflow-wrap:anywhere;word-break:break-word;max-width:100%}.dsub-btn{appearance:none;font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:5px 12px;font-size:12.5px;font-weight:500;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);transition:all .15s}.dsub-btn:hover{background:var(--dsw-alias-bg-layer-1);border-color:var(--dsw-alias-label-dimmed)}.dsub-inp{height:30px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);border-radius:6px;padding:0 8px;font-size:12px;min-width:180px}.dsub-inp:focus{outline:none;border-color:var(--dsw-alias-brand-primary)}.dsub-box{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:10px;margin-top:8px;background:var(--dsw-alias-bg-layer-2)}.dsub-cooldown{display:inline-block;padding:2px 6px;border-radius:4px;background:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-bg-layer-1);font-size:11px;font-weight:600}.dsub-bar{position:relative;height:6px;border-radius:3px;background:var(--dsw-alias-bg-layer-1);overflow:hidden;flex:1;min-width:80px}.dsub-barFill{height:100%;border-radius:3px;background:var(--dsw-alias-state-success-primary);transition:width .2s}.dsub-barWarn .dsub-barFill{background:var(--dsw-alias-state-warn-primary)}.dsub-barFull .dsub-barFill{background:var(--dsw-alias-state-error-primary)}.dsub-barRow{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--dsw-alias-label-secondary)}.dsub-manual{display:flex;flex-direction:column;gap:6px;margin-top:4px;padding-top:10px;border-top:1px solid var(--dsw-alias-border-l2)}.dsub-verify{font-size:12px;color:var(--dsw-alias-state-warn-primary)}.dsub-verify a{color:var(--dsw-alias-brand-primary)}.dsub-pill{display:inline-flex;align-items:center;gap:7px;height:28px;padding:0 11px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600;cursor:pointer;box-shadow:0 1px 3px color-mix(in srgb,black 15%,transparent),inset 0 1px 0 color-mix(in srgb,white 6%,transparent);transition:all .16s ease;user-select:none}.dsub-pill:hover{background:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-tertiary);transform:translateY(-1px);box-shadow:0 3px 8px color-mix(in srgb,black 25%,transparent),inset 0 1px 0 color-mix(in srgb,white 10%,transparent)}.dsub-pill:active{transform:translateY(0)}.dsub-pillTag{padding:1px 5px;border-radius:4px;font-size:10.5px;font-weight:700;letter-spacing:.02em;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary)}.dsub-led{width:7px;height:7px;border-radius:50%;flex:none;transition:all .2s ease}.dsub-ledOk{background:var(--dsw-alias-state-success-primary);box-shadow:0 0 6px color-mix(in srgb,var(--dsw-alias-state-success-primary) 70%,transparent)}.dsub-ledWarn{background:var(--dsw-alias-state-warn-primary);box-shadow:0 0 6px color-mix(in srgb,var(--dsw-alias-state-warn-primary) 70%,transparent)}.dsub-ledBad{background:var(--dsw-alias-state-error-primary);box-shadow:0 0 6px color-mix(in srgb,var(--dsw-alias-state-error-primary) 70%,transparent)}.dsub-ledOff{background:var(--dsw-alias-label-tertiary)}.dsub-toast-container{position:fixed;top:16px;right:16px;z-index:10030;display:flex;flex-direction:column;gap:8px;pointer-events:none}.dsub-toast{pointer-events:auto;min-width:280px;max-width:400px;padding:10px 14px;border-radius:10px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l1);box-shadow:0 8px 24px color-mix(in srgb,black 40%,transparent);display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;line-height:1.4;animation:dsubFadeIn .2s ease-out}.dsub-toast-warn{border-color:var(--dsw-alias-state-warn-primary)}.dsub-toast-bad{border-color:var(--dsw-alias-state-error-primary)}.dsub-toast-ok{border-color:var(--dsw-alias-state-success-primary)}.dsub-toast-close{background:none;border:none;color:var(--dsw-alias-label-tertiary);cursor:pointer;font-size:14px;padding:0 2px}.dsub-toast-close:hover{color:var(--dsw-alias-label-primary)}.dsub-modalWrap{position:fixed;inset:0;z-index:10020;display:grid;place-items:center;background:color-mix(in srgb,black 65%,transparent);backdrop-filter:blur(10px);animation:dsubFadeIn .16s ease-out}.dsub-modal{width:min(520px,94vw);max-height:min(85vh,720px);overflow-y:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:16px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);box-shadow:0 24px 64px color-mix(in srgb,black 60%,transparent),0 0 0 1px color-mix(in srgb,white 7%,transparent);padding:20px;animation:dsubScaleIn .18s cubic-bezier(.16,1,.3,1)}@keyframes dsubFadeIn{from{opacity:0}to{opacity:1}}@keyframes dsubScaleIn{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.dsub-modalHead{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dsub-modalTitleWrap{display:flex;align-items:center;gap:10px}.dsub-modalIcon{width:30px;height:30px;border-radius:8px;background:var(--dsw-alias-bg-layer-1);display:grid;place-items:center;color:var(--dsw-alias-brand-primary);font-size:14px}.dsub-modalBadge{font-size:11px;font-weight:600;padding:2px 7px;border-radius:10px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary)}.dsub-heroCard{margin-top:14px;padding:14px 16px;border-radius:12px;background:linear-gradient(135deg,var(--dsw-alias-bg-layer-2) 0%,var(--dsw-alias-bg-layer-3) 100%);border:1px solid var(--dsw-alias-border-l1);box-shadow:inset 0 1px 0 color-mix(in srgb,white 5%,transparent)}.dsub-heroHead{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.dsub-heroTitle{font-size:14px;font-weight:700;display:flex;align-items:center;gap:6px}.dsub-heroModel{font-size:11.5px;color:var(--dsw-alias-label-secondary);font-family:ui-monospace,monospace}.dsub-select{appearance:none;height:30px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);border-radius:6px;padding:0 24px 0 8px;font-size:12px;cursor:pointer}.dsub-details{margin-top:12px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:8px 12px;background:var(--dsw-alias-bg-layer-2)}.dsub-summary{cursor:pointer;font-weight:600;font-size:12.5px;color:var(--dsw-alias-label-secondary);user-select:none}.dsub-summary:hover{color:var(--dsw-alias-label-primary)}.dsub-header-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:8px 0 12px;margin-bottom:8px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dsub-badge{font-size:12px;padding:3px 10px;border-radius:999px;border:1px solid var(--dsw-alias-border-l2);display:inline-flex;align-items:center;gap:5px;font-weight:500}.dsub-badge-ok{border-color:var(--dsw-alias-state-success-primary);color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 10%,transparent)}.dsub-badge-warn{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 10%,transparent)}.dsub-badge-bad{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent)}.dsub-badge-neutral{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2)}.dsub-section-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:10px;margin-top:12px}.dsub-section-title{font-size:14.5px;font-weight:600;color:var(--dsw-alias-label-primary);display:flex;align-items:center;justify-content:space-between;gap:8px}.dsub-section-desc{font-size:12px;color:var(--dsw-alias-label-secondary);margin-top:-4px;line-height:1.4}.dsub-grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}.dsub-stat-box{padding:10px 12px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2);display:flex;flex-direction:column;gap:3px}.dsub-stat-val{font-size:16.5px;font-weight:700;color:var(--dsw-alias-label-primary)}.dsub-stat-lbl{font-size:11.5px;color:var(--dsw-alias-label-secondary)}.dsub-chart-wrap{display:flex;align-items:flex-end;gap:3px;height:52px;padding:6px 0;margin-top:8px;border-bottom:1px solid var(--dsw-alias-border-l3)}.dsub-chart-bar{flex:1;background:var(--dsw-alias-brand-primary);border-radius:2px 2px 0 0;min-height:3px;transition:height .2s ease;opacity:0.85;cursor:pointer}.dsub-chart-bar:hover{opacity:1;background:var(--dsw-alias-state-success-primary)}.dsub-chart-labels{display:flex;justify-content:space-between;font-size:10px;color:var(--dsw-alias-label-secondary);margin-top:3px}.dsub-alert-ok{padding:8px 12px;border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 10%,transparent);color:var(--dsw-alias-state-success-primary);font-size:12.5px;border:1px solid color-mix(in srgb,var(--dsw-alias-state-success-primary) 25%,transparent)}.dsub-alert-bad{padding:8px 12px;border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);color:var(--dsw-alias-state-error-primary);font-size:12.5px;border:1px solid color-mix(in srgb,var(--dsw-alias-state-error-primary) 25%,transparent)}.dsub-btn-primary{background:var(--dsw-alias-label-primary) !important;color:var(--dsw-alias-bg-layer-3) !important;border-color:transparent !important;font-weight:600}.dsub-btn-primary:hover:not(:disabled){opacity:0.9}.dsub-model-grid{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.dsub-model-chip{display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border-radius:6px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);font-size:11.5px;color:var(--dsw-alias-label-primary)}.dsub-model-chip code{font-family:ui-monospace,monospace;font-weight:600}.dsub-model-tag{font-size:10px;padding:1px 4px;border-radius:3px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font-weight:600}.dsub-trace-box{padding:8px 12px;border-radius:8px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);margin-top:8px;font-size:12px}.dsub-trace-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0;border-bottom:1px solid var(--dsw-alias-border-l3)}.dsub-trace-row:last-child{border-bottom:none}.dsub-model-status-available{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 12%,transparent)}.dsub-model-status-degraded{color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 12%,transparent)}.dsub-model-status-quarantined{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent)}.dsub-model-status-cooldown{color:var(--dsw-alias-state-business-primary);background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 12%,transparent)}.dsub-model-status-exhausted{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent)}.dsub-model-status-unconfigured{color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-3)}.dsub-heroBars{display:flex;flex-direction:column;gap:8px;margin-top:10px}.dsub-barLabelRow{display:flex;justify-content:space-between;font-size:11.5px;color:var(--dsw-alias-label-secondary);margin-bottom:3px}.dsub-barTrack{height:6px;border-radius:3px;background:var(--dsw-alias-bg-layer-1);overflow:hidden}.dsub-barFillGrad{height:100%;border-radius:3px;transition:width .3s ease}.dsub-panel-box{margin-top:10px;padding:12px 14px;border-radius:10px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);display:flex;flex-direction:column;gap:8px}.dsub-panel-warn{border-color:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 40%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 5%,transparent)}.dsub-panel-title{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);display:flex;align-items:center;justify-content:space-between}.dsub-panel-desc{font-size:12px;color:var(--dsw-alias-label-secondary);line-height:1.4}.dsub-usage-grid{display:flex;flex-direction:column;gap:8px;margin-top:4px}.dsub-usage-card{display:flex;flex-direction:column;gap:5px;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1)}.dsub-usage-head{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:500;color:var(--dsw-alias-label-primary)}.dsub-usage-track{width:100%;height:8px;border-radius:999px;background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-border-l2);overflow:hidden}.dsub-usage-fill{height:100%;border-radius:999px;transition:width .3s ease}.dsub-usage-meta{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--dsw-alias-label-secondary)}.dsub-tag-ok{border-color:color-mix(in srgb,var(--dsw-alias-state-success-primary) 30%,transparent);color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,transparent);padding:1px 7px;border-radius:999px;font-size:11px;font-weight:600;border-style:solid;border-width:1px}.dsub-tag-warn{border-color:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 40%,transparent);color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 8%,transparent);padding:1px 7px;border-radius:999px;font-size:11px;font-weight:600;border-style:solid;border-width:1px}.dsub-tag-bad{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 40%,transparent);color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent);padding:1px 7px;border-radius:999px;font-size:11px;font-weight:600;border-style:solid;border-width:1px}.dsub-slot-meta-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:12px;padding-top:10px;border-top:1px solid var(--dsw-alias-border-l2);font-size:12px}.dsub-ref-tag{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;color:var(--dsw-alias-label-secondary)}.dsub-ref-tag code{padding:2px 6px;border-radius:4px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);font-family:ui-monospace,monospace;color:var(--dsw-alias-label-primary);font-size:11px}.dsub-speed-tag{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;color:var(--dsw-alias-brand-primary);background:color-mix(in srgb,var(--dsw-alias-brand-primary) 8%,transparent);padding:2px 8px;border-radius:6px;font-weight:500;border:1px solid color-mix(in srgb,var(--dsw-alias-brand-primary) 20%,transparent)}.dsub-btn-danger{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 40%,transparent)!important;color:var(--dsw-alias-state-error-primary)!important}.dsub-btn-danger:hover:not(:disabled){background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent)!important}.dsub-poolTitle{margin-top:16px;margin-bottom:8px;font-size:11.5px;font-weight:700;color:var(--dsw-alias-label-secondary);text-transform:uppercase;letter-spacing:.05em}.dsub-accountCard{display:flex;align-items:center;gap:12px;padding:10px 14px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2);margin-top:6px;transition:border-color .15s,background .15s}.dsub-accountCard:hover{background:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-tertiary)}.dsub-brandBadge{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;font-size:12px;font-weight:700;flex-shrink:0}.dsub-brandCodex{background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 15%,transparent);color:var(--dsw-alias-state-success-primary);border:1px solid color-mix(in srgb,var(--dsw-alias-state-success-primary) 30%,transparent)}.dsub-brandClaude{background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 15%,transparent);color:var(--dsw-alias-state-warn-primary);border:1px solid color-mix(in srgb,var(--dsw-alias-state-warn-primary) 30%,transparent)}.dsub-brandGrok{background:color-mix(in srgb,var(--dsw-alias-state-business-primary,var(--dsw-alias-brand-primary)) 15%,transparent);color:var(--dsw-alias-state-business-primary,var(--dsw-alias-brand-primary));border:1px solid color-mix(in srgb,var(--dsw-alias-state-business-primary,var(--dsw-alias-brand-primary)) 30%,transparent)}.dsub-brandAgy{background:color-mix(in srgb,var(--dsw-alias-brand-primary) 15%,transparent);color:var(--dsw-alias-brand-primary);border:1px solid color-mix(in srgb,var(--dsw-alias-brand-primary) 30%,transparent)}.dsub-brandOllama{background:color-mix(in srgb,var(--dsw-alias-label-tertiary) 15%,transparent);color:var(--dsw-alias-label-secondary);border:1px solid color-mix(in srgb,var(--dsw-alias-label-tertiary) 30%,transparent)}.dsub-brandKimi{background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 15%,transparent);color:var(--dsw-alias-state-warn-primary);border:1px solid color-mix(in srgb,var(--dsw-alias-state-warn-primary) 30%,transparent)}.dsub-brandGlm{background:color-mix(in srgb,var(--dsw-alias-state-business-primary,var(--dsw-alias-brand-primary)) 15%,transparent);color:var(--dsw-alias-state-business-primary,var(--dsw-alias-brand-primary));border:1px solid color-mix(in srgb,var(--dsw-alias-state-business-primary,var(--dsw-alias-brand-primary)) 30%,transparent)}.dsub-planBadge{display:inline-flex;align-items:center;padding:1px 6px;border-radius:4px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.5px;background:color-mix(in srgb,var(--dsw-alias-brand-primary) 15%,transparent);color:var(--dsw-alias-brand-primary);border:1px solid color-mix(in srgb,var(--dsw-alias-brand-primary) 30%,transparent);margin-left:6px}.dsub-accInfo{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.dsub-accNameRow{display:flex;align-items:center;justify-content:space-between;gap:8px}.dsub-accName{font-size:13px;font-weight:600}.dsub-accStatusTag{font-size:10.5px;font-weight:600;padding:1px 6px;border-radius:4px}.dsub-statusOk{background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 15%,transparent);color:var(--dsw-alias-state-success-primary)}.dsub-statusWarn{background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 15%,transparent);color:var(--dsw-alias-state-warn-primary)}.dsub-statusBad{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 15%,transparent);color:var(--dsw-alias-state-error-primary)}.dsub-statusOff{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-tertiary)}.dsub-modalFoot{display:flex;align-items:center;justify-content:space-between;margin-top:16px;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l2)}.dsub-btnPrimary{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:600;background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-label-primary-foreground);border:0;cursor:pointer;transition:opacity .15s}.dsub-btnPrimary:hover{opacity:.9}.dsub-btnSec{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;border-radius:7px;font-size:11.5px;font-weight:500;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;text-decoration:none;transition:all .15s}.dsub-btnSec:hover{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-tertiary)}.dsub-cq{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary);padding:0 6px}.dsub-cqBar{position:relative;width:40px;height:5px;border-radius:3px;background:var(--dsw-alias-bg-layer-1);overflow:hidden}.dsub-cqBarFill{height:100%;border-radius:3px;background:var(--dsw-alias-state-success-primary)}.dsub-cqBarWarn .dsub-cqBarFill{background:var(--dsw-alias-state-warn-primary)}.dsub-cqBarFull .dsub-cqBarFill{background:var(--dsw-alias-state-error-primary)}.dsub-cqB{font-variant-numeric:tabular-nums;font-weight:600;color:var(--dsw-alias-label-primary)}.dsub-diag{font:11px/1.5 ui-monospace,SFMono-Regular,monospace;max-height:260px;overflow:auto;white-space:pre-wrap;word-break:break-word;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:10px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary)}";
|
|
44
|
+
const cssId = 'dsh-subscriptions/settings.module.css'
|
|
204
45
|
if (typeof document !== 'undefined' && !document.querySelector('style[data-plugin-css="' + cssId + '"]')) {
|
|
205
46
|
const tag = document.createElement('style')
|
|
206
47
|
tag.textContent = CSS
|
|
@@ -210,155 +51,21 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
210
51
|
document.head.appendChild(tag)
|
|
211
52
|
}
|
|
212
53
|
|
|
213
|
-
// Card strings live in the locale registry: a separate package translates
|
|
214
|
-
// them without touching this plugin's code. English is the default,
|
|
215
|
-
// and the fallback when no translation exists.
|
|
216
54
|
const NS = 'dsh-subscriptions'
|
|
217
55
|
// Plugins page row seat (DSH 0.1.6-alpha.2): key = '<package name>#<row id>'.
|
|
218
56
|
const PKG = '@goodandready/dsh-subscriptions'
|
|
219
57
|
const ROW_ID = 'dsh-subscriptions'
|
|
220
58
|
const ROW_CONFIG_KEY = PKG + '#' + ROW_ID
|
|
221
59
|
|
|
222
|
-
|
|
223
|
-
codex: {
|
|
224
|
-
title: "OpenAI / ChatGPT Codex",
|
|
225
|
-
stepsEn: [
|
|
226
|
-
"1. Log in via CLI on server: run \"codex login\" in terminal.",
|
|
227
|
-
"2. Click \"๐ฅ From CLI\" to auto-import ~/.codex/auth.json.",
|
|
228
|
-
"3. Or click \"Device Login\" above and enter the code at auth.openai.com.",
|
|
229
|
-
],
|
|
230
|
-
stepsZh: [
|
|
231
|
-
"1. ๅจๆๅกๅจไธ้่ฟ CLI ็ปๅฝ๏ผๅจ็ป็ซฏ่ฟ่ก \"codex login\"ใ",
|
|
232
|
-
"2. ็นๅป \"๐ฅ ไป CLI ๅฏผๅ
ฅ\" ่ชๅจ่ฏปๅ ~/.codex/auth.jsonใ",
|
|
233
|
-
"3. ๆ่
็นๅปไธๆน็ \"่ฎพๅค็ ็ปๅฝ\" (Device Login) ๅนถๅจ auth.openai.com ่พๅ
ฅไปฃ็ ใ",
|
|
234
|
-
],
|
|
235
|
-
link: "https://chatgpt.com",
|
|
236
|
-
},
|
|
237
|
-
claude: {
|
|
238
|
-
title: "Claude Code",
|
|
239
|
-
stepsEn: [
|
|
240
|
-
"1. Run \"claude login\" in server console.",
|
|
241
|
-
"2. Click \"๐ฅ From CLI\" โ plugin will import ~/.claude/credentials.json.",
|
|
242
|
-
"3. Or paste your Session Token / API Key from Anthropic Console and click \"Save token\".",
|
|
243
|
-
],
|
|
244
|
-
stepsZh: [
|
|
245
|
-
"1. ๅจๆๅกๅจๆงๅถๅฐ่ฟ่ก \"claude login\"ใ",
|
|
246
|
-
"2. ็นๅป \"๐ฅ ไป CLI ๅฏผๅ
ฅ\" โ ๆไปถๅฐ่ชๅจๅฏผๅ
ฅ ~/.claude/credentials.jsonใ",
|
|
247
|
-
"3. ๆ่
ไป Anthropic ๆงๅถๅฐๅคๅถๆจ็ Session Token ๆ API Key ๅนถ็นๅป \"ไฟๅญไปค็\"ใ",
|
|
248
|
-
],
|
|
249
|
-
link: "https://console.anthropic.com/settings/keys",
|
|
250
|
-
},
|
|
251
|
-
cursor: {
|
|
252
|
-
title: "Cursor IDE",
|
|
253
|
-
stepsEn: [
|
|
254
|
-
"1. Auto CLI: if Cursor is used on server, click \"๐ฅ From CLI\" (reads from ~/.cursor/cli-config.json).",
|
|
255
|
-
"2. Manual: open Cursor Settings (Connect button or link below), copy your session token or API key.",
|
|
256
|
-
"3. Paste it into the input field and click \"Save token\".",
|
|
257
|
-
],
|
|
258
|
-
stepsZh: [
|
|
259
|
-
"1. CLI ่ชๅจๅฏผๅ
ฅ๏ผ่ฅๆๅกๅจๅฎ่ฃ
ไบ Cursor๏ผ็นๅป \"๐ฅ ไป CLI ๅฏผๅ
ฅ\" (่ฏปๅ่ช ~/.cursor/cli-config.json)ใ",
|
|
260
|
-
"2. ๆๅจๅฏผๅ
ฅ๏ผๆๅผ Cursor ่ฎพ็ฝฎ้กต้ข๏ผ็นๅป่ฟๆฅๆไธๆน้พๆฅ๏ผ๏ผๅคๅถ WorkOS ไผ่ฏไปค็ๆ API ๅฏ้ฅใ",
|
|
261
|
-
"3. ๅฐๅ
ถ็ฒ่ดดๅฐ่พๅ
ฅๆกไธญๅนถ็นๅป \"ไฟๅญไปค็\"ใ",
|
|
262
|
-
],
|
|
263
|
-
link: "https://cursor.com/settings",
|
|
264
|
-
},
|
|
265
|
-
antigravity: {
|
|
266
|
-
title: "Google Antigravity / Gemini",
|
|
267
|
-
stepsEn: [
|
|
268
|
-
"1. Easiest way: click \"๐ฅ From CLI\" โ server already has active token in ~/.gemini/antigravity-cli/antigravity-oauth-token.",
|
|
269
|
-
"2. Clicking \"๐ฅ From CLI\" instantly loads fresh credentials.",
|
|
270
|
-
"3. Manual: paste session JSON or OAuth tokens and click \"Save token\".",
|
|
271
|
-
"Note: \"Connect\" button requires custom Google client_id in plugin settings; use \"๐ฅ From CLI\" for seamless login!",
|
|
272
|
-
],
|
|
273
|
-
stepsZh: [
|
|
274
|
-
"1. ๆจ่ๆนๅผ๏ผ็นๅป \"๐ฅ ไป CLI ๅฏผๅ
ฅ\" โ ๆๅกๅจๅทฒไฟๅญ ~/.gemini/antigravity-cli/antigravity-oauth-token ไผ่ฏใ",
|
|
275
|
-
"2. ็นๅป \"๐ฅ ไป CLI ๅฏผๅ
ฅ\" ๅฏๅณๆถๅ ่ฝฝๆๆฐ็ๅญๆฎไธ refresh_tokenใ",
|
|
276
|
-
"3. ๆๅจ่พๅ
ฅ๏ผๅฐไผ่ฏ JSON ๆ OAuth access_token/refresh_token ็ฒ่ดด่ณ่พๅ
ฅๆกๅนถไฟๅญใ",
|
|
277
|
-
"ๆณจ๏ผ\"่ฟๆฅ\" ๆ้ฎ้่ฆ่ชๅฎไน Google OAuth Client ID๏ผๆจ่็ดๆฅไฝฟ็จ \"๐ฅ ไป CLI ๅฏผๅ
ฅ\"๏ผ",
|
|
278
|
-
],
|
|
279
|
-
link: "https://antigravity.google",
|
|
280
|
-
},
|
|
281
|
-
kimi: {
|
|
282
|
-
title: "Moonshot Kimi",
|
|
283
|
-
stepsEn: [
|
|
284
|
-
"1. Open Moonshot developer console (link below or click Connect).",
|
|
285
|
-
"2. Generate and copy your API Key (sk-...).",
|
|
286
|
-
"3. Paste it into the input field and click \"Save token\".",
|
|
287
|
-
"4. Or click \"๐ฅ From CLI\" if ~/.kimi-code is configured.",
|
|
288
|
-
],
|
|
289
|
-
stepsZh: [
|
|
290
|
-
"1. ๆๅผ Moonshot ๅผๅ่
ๆงๅถๅฐ๏ผ็นๅปไธๆน้พๆฅๆ็นๅป่ฟๆฅ๏ผใ",
|
|
291
|
-
"2. ๅๅปบๅนถๅคๅถๆจ็ API ๅฏ้ฅ (sk-...)ใ",
|
|
292
|
-
"3. ๅฐๅฏ้ฅ็ฒ่ดดๅฐๆงฝไฝ่พๅ
ฅๆกไธญๅนถ็นๅป \"ไฟๅญไปค็\"ใ",
|
|
293
|
-
"4. ๅฆๆ้
็ฝฎไบ Kimi Code CLI๏ผไนๅฏ็นๅป \"๐ฅ ไป CLI ๅฏผๅ
ฅ\" (~/.kimi-code)ใ",
|
|
294
|
-
],
|
|
295
|
-
link: "https://platform.moonshot.cn/console/api-keys",
|
|
296
|
-
},
|
|
297
|
-
glm: {
|
|
298
|
-
title: "Zhipu GLM (Z.AI)",
|
|
299
|
-
stepsEn: [
|
|
300
|
-
"1. Open Zhipu BigModel API Keys center (link below or click Connect).",
|
|
301
|
-
"2. Copy your GLM API Key.",
|
|
302
|
-
"3. Paste it into the input field and click \"Save token\".",
|
|
303
|
-
"4. Or click \"๐ฅ From CLI\" if ZCode CLI is installed (~/.zcode).",
|
|
304
|
-
],
|
|
305
|
-
stepsZh: [
|
|
306
|
-
"1. ๆๅผๆบ่ฐฑ AI ๅผๆพๅนณๅฐ๏ผ็นๅปไธๆน้พๆฅๆ็นๅป่ฟๆฅ๏ผใ",
|
|
307
|
-
"2. ๅคๅถๆจ็ GLM API ๅฏ้ฅใ",
|
|
308
|
-
"3. ็ฒ่ดดๅฐ่พๅ
ฅๆกไธญๅนถ็นๅป \"ไฟๅญไปค็\"ใ",
|
|
309
|
-
"4. ่ฅๅทฒๅฎ่ฃ
ZCode CLI (~/.zcode)๏ผ็นๅป \"๐ฅ ไป CLI ๅฏผๅ
ฅ\" ๅณๅฏ่ชๅจๅฏผๅ
ฅใ",
|
|
310
|
-
],
|
|
311
|
-
link: "https://bigmodel.cn/usercenter/proj-mgmt/apikeys",
|
|
312
|
-
},
|
|
313
|
-
grok: {
|
|
314
|
-
title: "xAI Grok",
|
|
315
|
-
stepsEn: [
|
|
316
|
-
"1. Click \"Device Login\" (or \"Connect\") on the slot card.",
|
|
317
|
-
"2. A one-time code will appear on the card.",
|
|
318
|
-
"3. Open https://accounts.x.ai/oauth2/device, enter the code, and approve access for your xAI account.",
|
|
319
|
-
"4. The plugin automatically captures tokens and enables Grok models.",
|
|
320
|
-
"5. Or click \"๐ฅ From CLI\" (~/.grok/auth.json) / paste an xAI API Key.",
|
|
321
|
-
],
|
|
322
|
-
stepsZh: [
|
|
323
|
-
"1. ็นๅปๅก็ไธ็ \"่ฎพๅค็ ็ปๅฝ\" (Device Login) ๆ \"่ฟๆฅ\"ใ",
|
|
324
|
-
"2. ็้ขๅฐๅฑ็คบไธๆฌกๆง่ฎพๅคๆๆ็ ใ",
|
|
325
|
-
"3. ๆๅผ https://accounts.x.ai/oauth2/device๏ผ่พๅ
ฅไปฃ็ ๏ผๅนถไธบๆจๆฅๆ Grok ่ฎข้
็ xAI ่ดฆๆทๆๆใ",
|
|
326
|
-
"4. ๆๆๆๅๅ๏ผๆไปถไผ่ชๅจๆ่ทไผ่ฏๅนถๆฟๆดป Grok ๅฎๆนๆจกๅใ",
|
|
327
|
-
"5. ๆ็นๅป \"๐ฅ ไป CLI ๅฏผๅ
ฅ\" (~/.grok/auth.json) / ็ดๆฅ็ฒ่ดด xAI API ๅฏ้ฅใ",
|
|
328
|
-
],
|
|
329
|
-
link: "https://accounts.x.ai/oauth2/device",
|
|
330
|
-
},
|
|
331
|
-
kiro: {
|
|
332
|
-
title: "AWS Kiro",
|
|
333
|
-
stepsEn: [
|
|
334
|
-
"1. Click \"๐ฅ From CLI\" to import from ~/.kiro/credentials.json.",
|
|
335
|
-
"2. Or paste KIRO_API_KEY and click \"Save token\".",
|
|
336
|
-
],
|
|
337
|
-
stepsZh: [
|
|
338
|
-
"1. ็นๅป \"๐ฅ ไป CLI ๅฏผๅ
ฅ\" ไป ~/.kiro/credentials.json ๆ ~/.aws/sso ๅฏผๅ
ฅๅญๆฎใ",
|
|
339
|
-
"2. ๆ็ดๆฅ็ฒ่ดด KIRO_API_KEY ๅนถ็นๅป \"ไฟๅญไปค็\"ใ",
|
|
340
|
-
],
|
|
341
|
-
link: "https://aws.amazon.com",
|
|
342
|
-
},
|
|
343
|
-
copilot: {
|
|
344
|
-
title: "GitHub Copilot",
|
|
345
|
-
stepsEn: [
|
|
346
|
-
"1. Click \"Device Login\" (or \"Connect\") on the slot card.",
|
|
347
|
-
"2. A one-time code will appear on the card.",
|
|
348
|
-
"3. Open https://github.com/login/device, enter the code, and approve access for your GitHub account with Copilot subscription.",
|
|
349
|
-
"4. The plugin automatically captures tokens and enables Copilot models.",
|
|
350
|
-
],
|
|
351
|
-
stepsZh: [
|
|
352
|
-
"1. ็นๅปๅก็ไธ็ \"่ฎพๅค็ ็ปๅฝ\" (Device Login) ๆ \"่ฟๆฅ\"ใ",
|
|
353
|
-
"2. ็้ขๅฐๅฑ็คบไธๆฌกๆง่ฎพๅคๆๆ็ ใ",
|
|
354
|
-
"3. ๅจๆต่งๅจๆๅผ https://github.com/login/device ่พๅ
ฅไปฃ็ ๏ผๅนถไธบๆจๆฅๆ Copilot ่ฎข้
็ GitHub ่ดฆๆทๆๆใ",
|
|
355
|
-
"4. ๆๆๆๅๅ๏ผๆไปถไผ่ชๅจๆ่ทไผ่ฏๅนถๆฟๆดป GitHub Copilot ๅฎๆนๆจกๅใ",
|
|
356
|
-
],
|
|
357
|
-
link: "https://github.com/login/device",
|
|
358
|
-
},
|
|
359
|
-
}
|
|
60
|
+
let INSTRUCTIONS = {};
|
|
360
61
|
|
|
361
62
|
const en = {
|
|
63
|
+
"syncModels": "Sync Models",
|
|
64
|
+
"syncModelsTitle": "Discover and synchronize available models from vendor API",
|
|
65
|
+
"modelsSynced": "Models synchronized",
|
|
66
|
+
"doctorDiagnosis": "Doctor Verdict",
|
|
67
|
+
"recommendation": "Recommendation",
|
|
68
|
+
"pingTitle": "Measure network latency to provider API",
|
|
362
69
|
"notConnected": "Not connected",
|
|
363
70
|
"verifyAccount": "Verify account",
|
|
364
71
|
"coolingDown": "Cooling down",
|
|
@@ -649,6 +356,12 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
649
356
|
};
|
|
650
357
|
|
|
651
358
|
const zh = {
|
|
359
|
+
"syncModels": "ๅๆญฅๆจกๅ",
|
|
360
|
+
"syncModelsTitle": "ไปๆๅกๅ API ๅฎๆถๅ็ฐๅนถๅๆญฅๅฏ็จๆจกๅๅ่กจ",
|
|
361
|
+
"modelsSynced": "ๆจกๅๅทฒๅๆญฅ",
|
|
362
|
+
"doctorDiagnosis": "่ฏๆญ็ป่ฎบ",
|
|
363
|
+
"recommendation": "ไฟฎๅคๅปบ่ฎฎ",
|
|
364
|
+
"pingTitle": "ๆต่ฏๅฐๆๅกๅ API ็็ฝ็ปๅพ่ฟๅปถ่ฟ",
|
|
652
365
|
"notConnected": "ๆช่ฟๆฅ",
|
|
653
366
|
"verifyAccount": "้่ฆ้ช่ฏ่ดฆๆท",
|
|
654
367
|
"coolingDown": "ๅทๅด็ญๅพ
ไธญ",
|
|
@@ -977,7 +690,7 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
977
690
|
} else if (provider === 'glm') {
|
|
978
691
|
label = '150% Boost'
|
|
979
692
|
}
|
|
980
|
-
return label ?
|
|
693
|
+
return label ? h('span', { className: 'dsub-planBadge' }, label) : null
|
|
981
694
|
}
|
|
982
695
|
|
|
983
696
|
function formatRelativeReset(resetAt, lang, now) {
|
|
@@ -1006,13 +719,13 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1006
719
|
if (ms <= 0) return null
|
|
1007
720
|
const total = Math.floor(ms / 1000)
|
|
1008
721
|
if (total > 3600) {
|
|
1009
|
-
return
|
|
722
|
+
return h('span', { className: 'dsub-sub', style: { fontVariantNumeric: 'tabular-nums' } },
|
|
1010
723
|
t('resetLabel') + ' ' + formatRelativeReset(props.resetAt, t('lang'), now))
|
|
1011
724
|
}
|
|
1012
725
|
const m = Math.floor(total / 60)
|
|
1013
726
|
const sec = total % 60
|
|
1014
727
|
const pad = (n) => String(n).padStart(2, '0')
|
|
1015
|
-
return
|
|
728
|
+
return h('span', { className: 'dsub-sub', style: { fontVariantNumeric: 'tabular-nums' } },
|
|
1016
729
|
t('resetLabel') + ' ' + pad(m) + ':' + pad(sec))
|
|
1017
730
|
}
|
|
1018
731
|
|
|
@@ -1045,8 +758,8 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1045
758
|
ChevronIcon = null
|
|
1046
759
|
}
|
|
1047
760
|
function FallbackChevron(props) {
|
|
1048
|
-
return
|
|
1049
|
-
|
|
761
|
+
return h('svg', { className: props.className, width: 14, height: 14, viewBox: '0 0 14 14', fill: 'none' },
|
|
762
|
+
h('path', { d: 'M3.5 5.25L7 8.75l3.5-3.5', stroke: 'currentColor', 'stroke-width': 1.5, 'stroke-linecap': 'round', 'stroke-linejoin': 'round' }),
|
|
1050
763
|
)
|
|
1051
764
|
}
|
|
1052
765
|
const Chevron = ChevronIcon || FallbackChevron
|
|
@@ -1309,6 +1022,45 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1309
1022
|
.catch(() => {})
|
|
1310
1023
|
}
|
|
1311
1024
|
|
|
1025
|
+
const doPing = async (provider, index) => {
|
|
1026
|
+
try {
|
|
1027
|
+
const res = await fetch('/dsh-subscriptions/ping', {
|
|
1028
|
+
method: 'POST',
|
|
1029
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1030
|
+
body: JSON.stringify({ provider, index }),
|
|
1031
|
+
})
|
|
1032
|
+
const d = await res.json()
|
|
1033
|
+
if (d && d.ok) {
|
|
1034
|
+
setAccounts((accs) => accs.map((a) => (a.provider === provider && a.index === index) ? Object.assign({}, a, { lastPingMs: d.latencyMs, latencyGrade: d.latencyGrade, lastDoctorVerdict: null }) : a))
|
|
1035
|
+
setInfo('๐ถ Ping: ' + d.latencyMs + 'ms (' + d.latencyGrade + ')')
|
|
1036
|
+
} else if (d && d.doctor) {
|
|
1037
|
+
setAccounts((accs) => accs.map((a) => (a.provider === provider && a.index === index) ? Object.assign({}, a, { lastPingMs: d.latencyMs, latencyGrade: d.latencyGrade, lastDoctorVerdict: d.doctor }) : a))
|
|
1038
|
+
setErr('๐ฉบ ' + d.doctor.title)
|
|
1039
|
+
}
|
|
1040
|
+
} catch (e) {
|
|
1041
|
+
setErr(cleanErrorMessage(e.message || e))
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
const doSyncModels = async (provider, index) => {
|
|
1046
|
+
try {
|
|
1047
|
+
const res = await fetch('/dsh-subscriptions/accounts/sync-models', {
|
|
1048
|
+
method: 'POST',
|
|
1049
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1050
|
+
body: JSON.stringify({ provider, index }),
|
|
1051
|
+
})
|
|
1052
|
+
const d = await res.json()
|
|
1053
|
+
if (d && d.ok) {
|
|
1054
|
+
setAccounts((accs) => accs.map((a) => (a.provider === provider && a.index === index) ? Object.assign({}, a, { availableModels: d.models }) : a))
|
|
1055
|
+
setInfo('โ ' + (t('modelsSynced') || 'Models synced') + ': ' + d.count + ' models')
|
|
1056
|
+
} else {
|
|
1057
|
+
setErr('โ ' + ((d && d.doctor && d.doctor.title) || (d && d.error && d.error.message) || 'Sync failed'))
|
|
1058
|
+
}
|
|
1059
|
+
} catch (e) {
|
|
1060
|
+
setErr(cleanErrorMessage(e.message || e))
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1312
1064
|
const runSmokeTest = async (provider, index) => {
|
|
1313
1065
|
setSmoke({ testing: true, result: null })
|
|
1314
1066
|
try {
|
|
@@ -1376,15 +1128,15 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1376
1128
|
// #81: settings snapshot status - never render phantom inputs before the
|
|
1377
1129
|
// config snapshot arrives, and offer a retry when the store is unavailable.
|
|
1378
1130
|
if (!draft) {
|
|
1379
|
-
return
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
err ?
|
|
1131
|
+
return h('div', { className: 'dsub-wrap' },
|
|
1132
|
+
h('div', { className: 'dsub-row' },
|
|
1133
|
+
h('span', { className: 'dsub-sub' }, err ? t('settingsUnavailable') : t('settingsLoading')),
|
|
1134
|
+
err ? h('button', {
|
|
1383
1135
|
type: 'button', className: 'dsub-mini',
|
|
1384
1136
|
onClick: () => { setErr(''); reload().catch((e) => setErr(String(e && e.message || e))) },
|
|
1385
1137
|
}, t('settingsRetry')) : null,
|
|
1386
1138
|
),
|
|
1387
|
-
err ?
|
|
1139
|
+
err ? h('div', { className: 'dsub-bad' }, err) : null,
|
|
1388
1140
|
)
|
|
1389
1141
|
}
|
|
1390
1142
|
|
|
@@ -1617,45 +1369,45 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1617
1369
|
|
|
1618
1370
|
const connectedCount = accounts.filter((a) => a.configured).length
|
|
1619
1371
|
|
|
1620
|
-
return
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1372
|
+
return h('div', { className: 'dsub-wrap' },
|
|
1373
|
+
h('div', { className: 'dsub-header-bar' },
|
|
1374
|
+
h('div', { className: 'dsub-row', style: { marginTop: 0 } },
|
|
1375
|
+
h('span', {
|
|
1624
1376
|
className: 'dsub-badge ' + (hostPing.ok ? 'dsub-badge-ok' : 'dsub-badge-bad')
|
|
1625
1377
|
}, hostPing.ok
|
|
1626
1378
|
? (hostPing.latencyMs != null ? 'Host online (' + hostPing.latencyMs + ' ms)' : t('hostOnline'))
|
|
1627
1379
|
: t('hostOffline')
|
|
1628
1380
|
),
|
|
1629
|
-
|
|
1381
|
+
h('span', {
|
|
1630
1382
|
className: 'dsub-badge ' + (connectedCount > 0 ? 'dsub-badge-ok' : 'dsub-badge-warn')
|
|
1631
1383
|
}, connectedCount > 0
|
|
1632
1384
|
? (connectedCount + ' ' + t('subsLogged'))
|
|
1633
1385
|
: t('subsNotLogged')
|
|
1634
1386
|
),
|
|
1635
|
-
|
|
1387
|
+
h('span', {
|
|
1636
1388
|
className: 'dsub-badge dsub-badge-neutral'
|
|
1637
1389
|
}, 'Pool: ' + accounts.length + ' accounts'),
|
|
1638
1390
|
updater.status && updater.status.updateAvailable
|
|
1639
|
-
?
|
|
1391
|
+
? h('span', { className: 'dsub-badge dsub-badge-warn' },
|
|
1640
1392
|
'โฌ ' + t('updateAvailable') + ' (v' + (updater.status.latestVersion || '') + ')'
|
|
1641
1393
|
)
|
|
1642
1394
|
: (updater.status && updater.status.currentVersion
|
|
1643
|
-
?
|
|
1395
|
+
? h('span', { className: 'dsub-badge dsub-badge-neutral' },
|
|
1644
1396
|
'v' + updater.status.currentVersion
|
|
1645
1397
|
)
|
|
1646
1398
|
: null
|
|
1647
1399
|
),
|
|
1648
1400
|
),
|
|
1649
|
-
|
|
1401
|
+
h('div', { className: 'dsub-row', style: { marginTop: 0, gap: '8px' } },
|
|
1650
1402
|
updater.status && updater.status.updateAvailable && updater.status.canAutoUpdate
|
|
1651
|
-
?
|
|
1403
|
+
? h('button', {
|
|
1652
1404
|
type: 'button',
|
|
1653
1405
|
className: 'dsub-mini dsub-btn-primary',
|
|
1654
1406
|
disabled: updater.updating,
|
|
1655
1407
|
onClick: () => performUpdate(),
|
|
1656
1408
|
}, updater.updating ? t('updating') : (t('updateNow') + ' โ v' + updater.status.latestVersion))
|
|
1657
1409
|
: null,
|
|
1658
|
-
|
|
1410
|
+
h('button', {
|
|
1659
1411
|
type: 'button',
|
|
1660
1412
|
className: 'dsub-mini',
|
|
1661
1413
|
disabled: smoke.testing,
|
|
@@ -1663,69 +1415,69 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1663
1415
|
}, smoke.testing ? t('smokeTesting') : t('runSmoke')),
|
|
1664
1416
|
),
|
|
1665
1417
|
),
|
|
1666
|
-
updater.message ?
|
|
1418
|
+
updater.message ? h('div', {
|
|
1667
1419
|
className: updater.message.includes(t('updateSuccessRestart')) ? 'dsub-alert-ok' : 'dsub-alert-bad',
|
|
1668
1420
|
style: { marginBottom: '12px' }
|
|
1669
1421
|
}, updater.message) : null,
|
|
1670
|
-
smoke.result ?
|
|
1422
|
+
smoke.result ? h('div', {
|
|
1671
1423
|
className: smoke.result.ok ? 'dsub-alert-ok' : 'dsub-alert-bad',
|
|
1672
1424
|
style: { marginBottom: '12px' }
|
|
1673
1425
|
}, smoke.result.ok
|
|
1674
1426
|
? ('๐ข ' + t('smokeOk') + ': ' + (smoke.result.provider || 'Provider').toUpperCase() + ' ยท ' + (smoke.result.latencyMs != null ? smoke.result.latencyMs + ' ms' : 'OK') + (smoke.result.label ? ' (' + smoke.result.label + ')' : ''))
|
|
1675
1427
|
: ('โ ' + t('smokeFail') + ': ' + (smoke.result.error && (smoke.result.error.message || smoke.result.error.code) || 'Unknown error'))
|
|
1676
1428
|
) : null,
|
|
1677
|
-
telemetry && telemetry.totalRequests > 0 ?
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1429
|
+
telemetry && telemetry.totalRequests > 0 ? h('div', { className: 'dsub-grid-2', style: { marginBottom: '14px' } },
|
|
1430
|
+
h('div', { className: 'dsub-stat-box' },
|
|
1431
|
+
h('div', { className: 'dsub-stat-val' }, telemetry.successRequests + ' / ' + telemetry.totalRequests),
|
|
1432
|
+
h('div', { className: 'dsub-stat-lbl' }, t('statsRequests')),
|
|
1681
1433
|
),
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1434
|
+
h('div', { className: 'dsub-stat-box' },
|
|
1435
|
+
h('div', { className: 'dsub-stat-val' }, (telemetry.avgLatencyMs || 0) + ' ms'),
|
|
1436
|
+
h('div', { className: 'dsub-stat-lbl' }, t('statsLatency')),
|
|
1685
1437
|
),
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1438
|
+
h('div', { className: 'dsub-stat-box' },
|
|
1439
|
+
h('div', { className: 'dsub-stat-val' }, (telemetry.successRate || 100) + '%'),
|
|
1440
|
+
h('div', { className: 'dsub-stat-lbl' }, t('statsSuccessRate')),
|
|
1689
1441
|
),
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1442
|
+
h('div', { className: 'dsub-stat-box' },
|
|
1443
|
+
h('div', { className: 'dsub-stat-val' }, (telemetry.cacheHitPercent || 0) + '%'),
|
|
1444
|
+
h('div', { className: 'dsub-stat-lbl' }, t('cacheHitRate')),
|
|
1693
1445
|
),
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1446
|
+
h('div', { className: 'dsub-stat-box' },
|
|
1447
|
+
h('div', { className: 'dsub-stat-val' }, telemetry.lastRequestAt ? Math.round((Date.now() - telemetry.lastRequestAt) / 60000) + 'm ago' : 'โ'),
|
|
1448
|
+
h('div', { className: 'dsub-stat-lbl' }, t('statsLastActivity')),
|
|
1697
1449
|
),
|
|
1698
1450
|
) : null,
|
|
1699
|
-
(analytics && (analytics.totalRequests > 0 || (analytics.hourly && analytics.hourly.some(function(b) { return b.requests > 0 })))) || (queueStats && (queueStats.totalActive > 0 || queueStats.totalQueued > 0)) ?
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1451
|
+
(analytics && (analytics.totalRequests > 0 || (analytics.hourly && analytics.hourly.some(function(b) { return b.requests > 0 })))) || (queueStats && (queueStats.totalActive > 0 || queueStats.totalQueued > 0)) ? h('details', { className: 'dsub-group', open: true, style: { marginBottom: '14px' } },
|
|
1452
|
+
h('summary', { className: 'dsub-groupHead' }, '๐ ' + t('analyticsTitle')),
|
|
1453
|
+
h('div', { className: 'dsub-sub', style: { marginTop: '4px' } }, t('analyticsDesc')),
|
|
1454
|
+
h('div', { className: 'dsub-grid-2', style: { marginTop: '10px' } },
|
|
1455
|
+
h('div', { className: 'dsub-stat-box' },
|
|
1456
|
+
h('div', { className: 'dsub-stat-val' }, ((analytics && analytics.cache && analytics.cache.cacheHitRate) || 0) + '%'),
|
|
1457
|
+
h('div', { className: 'dsub-stat-lbl' }, t('cacheHitRate') + (analytics && analytics.cache ? ' (' + (analytics.cache.cacheReadTokens || 0).toLocaleString() + ' tok)' : '')),
|
|
1706
1458
|
),
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1459
|
+
h('div', { className: 'dsub-stat-box' },
|
|
1460
|
+
h('div', { className: 'dsub-stat-val' }, (analytics && analytics.performance && analytics.performance.ttft && analytics.performance.ttft.avgMs != null ? analytics.performance.ttft.avgMs + ' ms' : 'โ')),
|
|
1461
|
+
h('div', { className: 'dsub-stat-lbl' }, t('ttftMetric') + (analytics && analytics.performance && analytics.performance.ttft && analytics.performance.ttft.p95Ms != null ? ' ยท p95 ' + analytics.performance.ttft.p95Ms + ' ms' : '')),
|
|
1710
1462
|
),
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1463
|
+
h('div', { className: 'dsub-stat-box' },
|
|
1464
|
+
h('div', { className: 'dsub-stat-val' }, (analytics && analytics.performance && analytics.performance.tps && analytics.performance.tps.avg != null ? analytics.performance.tps.avg + ' tok/s' : 'โ')),
|
|
1465
|
+
h('div', { className: 'dsub-stat-lbl' }, t('speedMetric') + (analytics && analytics.performance && analytics.performance.tps && analytics.performance.tps.p95 != null ? ' ยท p95 ' + analytics.performance.tps.p95 : '')),
|
|
1714
1466
|
),
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1467
|
+
h('div', { className: 'dsub-stat-box' },
|
|
1468
|
+
h('div', { className: 'dsub-stat-val' }, (queueStats ? queueStats.totalActive : 0) + ' / ' + (queueStats ? queueStats.totalQueued : 0)),
|
|
1469
|
+
h('div', { className: 'dsub-stat-lbl' }, t('queueActive') + ' / ' + t('queueWaiting') + (queueStats && queueStats.metrics && queueStats.metrics.totalOverflowed ? ' ยท ' + queueStats.metrics.totalOverflowed + ' ' + t('queueRejected') : '')),
|
|
1718
1470
|
),
|
|
1719
1471
|
),
|
|
1720
1472
|
analytics && Array.isArray(analytics.hourly) && analytics.hourly.length ? (function() {
|
|
1721
1473
|
var maxReq = Math.max.apply(Math, [1].concat(analytics.hourly.map(function(b) { return b.requests || 0 })))
|
|
1722
|
-
return
|
|
1723
|
-
|
|
1724
|
-
|
|
1474
|
+
return h('div', { style: { marginTop: '12px' } },
|
|
1475
|
+
h('div', { style: { fontSize: '11.5px', fontWeight: 600, color: 'var(--dsw-alias-label-secondary)' } }, t('activity24h')),
|
|
1476
|
+
h('div', { className: 'dsub-chart-wrap' },
|
|
1725
1477
|
analytics.hourly.map(function(b, idx) {
|
|
1726
1478
|
var pct = Math.max(4, Math.round(((b.requests || 0) / maxReq) * 100))
|
|
1727
1479
|
var title = b.label + ': ' + b.requests + ' req (' + b.cacheReadTokens + ' cached tok, ' + b.errorCount + ' err)'
|
|
1728
|
-
return
|
|
1480
|
+
return h('div', {
|
|
1729
1481
|
key: idx,
|
|
1730
1482
|
className: 'dsub-chart-bar',
|
|
1731
1483
|
style: {
|
|
@@ -1738,19 +1490,19 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1738
1490
|
})
|
|
1739
1491
|
})
|
|
1740
1492
|
),
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1493
|
+
h('div', { className: 'dsub-chart-labels' },
|
|
1494
|
+
h('span', null, '-24h'),
|
|
1495
|
+
h('span', null, '-18h'),
|
|
1496
|
+
h('span', null, '-12h'),
|
|
1497
|
+
h('span', null, '-6h'),
|
|
1498
|
+
h('span', null, 'Now'),
|
|
1747
1499
|
),
|
|
1748
1500
|
)
|
|
1749
1501
|
})() : null,
|
|
1750
|
-
analytics && Array.isArray(analytics.forecast) && analytics.forecast.some(function(f) { return f.willExhaustBeforeReset || (f.burnRateTokensPerHour > 0 && f.hoursToExhaustion != null && f.hoursToExhaustion < 72) }) ?
|
|
1751
|
-
|
|
1502
|
+
analytics && Array.isArray(analytics.forecast) && analytics.forecast.some(function(f) { return f.willExhaustBeforeReset || (f.burnRateTokensPerHour > 0 && f.hoursToExhaustion != null && f.hoursToExhaustion < 72) }) ? h('div', { style: { marginTop: '12px' } },
|
|
1503
|
+
h('div', { style: { fontSize: '11.5px', fontWeight: 600, color: 'var(--dsw-alias-state-warn-primary)', marginBottom: '6px' } }, 'โ ๏ธ ' + t('forecastTitle')),
|
|
1752
1504
|
analytics.forecast.filter(function(f) { return f.willExhaustBeforeReset || (f.burnRateTokensPerHour > 0 && f.hoursToExhaustion != null && f.hoursToExhaustion < 72) }).map(function(f, idx) {
|
|
1753
|
-
return
|
|
1505
|
+
return h('div', { key: idx, className: 'dsub-alert-bad', style: { marginBottom: '6px' } },
|
|
1754
1506
|
(f.provider ? f.provider.toUpperCase() : 'LLM') + ' (' + (f.label || f.ref) + '): ' +
|
|
1755
1507
|
(f.willExhaustBeforeReset ? t('forecastExhaustWarning') : (t('forecastRunway') + ': ~' + f.hoursToExhaustion + 'h')) +
|
|
1756
1508
|
' ยท ' + t('forecastBurnRate') + ': ' + f.burnRateTokensPerHour.toLocaleString() + ' tok/h'
|
|
@@ -1758,128 +1510,128 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1758
1510
|
})
|
|
1759
1511
|
) : null,
|
|
1760
1512
|
) : null,
|
|
1761
|
-
telemetry && Array.isArray(telemetry.recentDecisions) && telemetry.recentDecisions.length ?
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1513
|
+
telemetry && Array.isArray(telemetry.recentDecisions) && telemetry.recentDecisions.length ? h('details', { className: 'dsub-group', style: { marginBottom: '14px' } },
|
|
1514
|
+
h('summary', { className: 'dsub-groupHead' }, '๐งญ ' + t('rotationDecisionsTitle')),
|
|
1515
|
+
h('div', { className: 'dsub-sub', style: { marginTop: '4px' } }, t('rotationDecisionsDesc')),
|
|
1516
|
+
h('div', { className: 'dsub-trace-box' },
|
|
1765
1517
|
telemetry.recentDecisions.map((dec, idx) => {
|
|
1766
1518
|
const reasonBadge = dec.cascaded ? ('๐ ' + t('rotationCascaded')) : (dec.decisionReason === 'cache_pinned' ? ('๐ ' + t('cachePinnedBadge')) : (dec.decisionReason === 'session_pinned' ? '๐ Pinned' : ('โก ' + dec.decisionReason)))
|
|
1767
|
-
return
|
|
1768
|
-
|
|
1769
|
-
dec.provider ?
|
|
1770
|
-
|
|
1771
|
-
dec.model ?
|
|
1519
|
+
return h('div', { key: idx, className: 'dsub-trace-row' },
|
|
1520
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: '6px' } },
|
|
1521
|
+
dec.provider ? h('span', { className: 'dsub-brand dsub-brand-' + dec.provider, style: { fontSize: '9px', padding: '1px 4px' } }, dec.provider.toUpperCase()) : null,
|
|
1522
|
+
h('span', { style: { fontWeight: 600 } }, dec.ref || 'โ'),
|
|
1523
|
+
dec.model ? h('code', { style: { fontSize: '11px', opacity: 0.8 } }, dec.model) : null,
|
|
1772
1524
|
),
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1525
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px' } },
|
|
1526
|
+
h('span', { className: 'dsub-model-tag' }, reasonBadge),
|
|
1527
|
+
h('span', { style: { fontSize: '10.5px', opacity: 0.6 } }, dec.attemptsCount > 1 ? (dec.attemptsCount + ' ' + t('rotationAttempts')) : ('1 ' + t('rotationAttempt'))),
|
|
1776
1528
|
),
|
|
1777
1529
|
)
|
|
1778
1530
|
})
|
|
1779
1531
|
),
|
|
1780
1532
|
) : null,
|
|
1781
|
-
accounts && accounts.length ?
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1533
|
+
accounts && accounts.length ? h('details', { className: 'dsub-group', open: true, style: { marginBottom: '14px' } },
|
|
1534
|
+
h('summary', { className: 'dsub-groupHead' }, '๐ ' + (t('healthMatrix') || 'Health Matrix & Quota Runway')),
|
|
1535
|
+
h('div', { style: { padding: '8px 0', overflowX: 'auto' } },
|
|
1536
|
+
h('table', { style: { width: '100%', fontSize: '12px', borderCollapse: 'collapse' } },
|
|
1537
|
+
h('thead', null,
|
|
1538
|
+
h('tr', { style: { borderBottom: '1px solid var(--dsw-alias-border-l2)', textAlign: 'left', opacity: 0.7 } },
|
|
1539
|
+
h('th', { style: { padding: '6px' } }, t('healthAccount')),
|
|
1540
|
+
h('th', { style: { padding: '6px' } }, t('healthScore')),
|
|
1541
|
+
h('th', { style: { padding: '6px' } }, t('healthLatency')),
|
|
1542
|
+
h('th', { style: { padding: '6px' } }, t('healthStatus')),
|
|
1543
|
+
h('th', { style: { padding: '6px' } }, t('healthQuota')),
|
|
1792
1544
|
),
|
|
1793
1545
|
),
|
|
1794
|
-
|
|
1546
|
+
h('tbody', null,
|
|
1795
1547
|
accounts.map((acc, idx) => {
|
|
1796
1548
|
const sc = acc.healthScore != null ? acc.healthScore : 100
|
|
1797
1549
|
const healthColor = sc >= 80 ? 'var(--dsw-alias-state-success-primary)' : (sc >= 50 ? 'var(--dsw-alias-state-warn-primary)' : 'var(--dsw-alias-state-error-primary)')
|
|
1798
1550
|
const isQ = acc.status === 'quarantine' || (acc.quarantineUntil && Number(acc.quarantineUntil) > Date.now())
|
|
1799
1551
|
const statusLabel = isQ ? ('โ ' + t('healthQuarantine')) : (acc.status === 'probing' ? ('๐ก ' + t('healthWarmup')) : (acc.configured ? ('๐ข ' + t('healthActive')) : ('โช ' + t('healthIdle'))))
|
|
1800
1552
|
const pct = acc.usagePercent != null ? Math.round(acc.usagePercent) : null
|
|
1801
|
-
return
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1553
|
+
return h('tr', { key: (acc.ref || acc.provider + acc.index || idx), style: { borderBottom: '1px solid var(--dsw-alias-border-l3)' } },
|
|
1554
|
+
h('td', { style: { padding: '6px', fontWeight: 600 } }, (acc.provider ? acc.provider.toUpperCase() : 'LLM') + ' #' + (acc.index || 1) + (acc.label ? ' (' + acc.label + ')' : '')),
|
|
1555
|
+
h('td', { style: { padding: '6px', color: healthColor } }, sc + '%'),
|
|
1556
|
+
h('td', { style: { padding: '6px' } }, acc.latencyMs ? acc.latencyMs + ' ms' : 'โ'),
|
|
1557
|
+
h('td', { style: { padding: '6px' } }, statusLabel),
|
|
1558
|
+
h('td', { style: { padding: '6px' } }, pct != null ? (pct + '% used') : 'โ'),
|
|
1807
1559
|
)
|
|
1808
1560
|
}),
|
|
1809
1561
|
),
|
|
1810
1562
|
),
|
|
1811
1563
|
),
|
|
1812
1564
|
) : null,
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1565
|
+
h('div', { className: 'dsub-block' },
|
|
1566
|
+
h('div', { className: 'dsub-h' }, t('title')),
|
|
1567
|
+
h('div', { className: 'dsub-sub' },
|
|
1816
1568
|
t('intro')),
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1569
|
+
h('details', { className: 'dsub-group', open: true },
|
|
1570
|
+
h('summary', { className: 'dsub-groupHead' }, t('groupAuth')),
|
|
1571
|
+
h('label', { className: 'dsub-row' },
|
|
1572
|
+
h('input', {
|
|
1821
1573
|
type: 'checkbox',
|
|
1822
1574
|
checked: !!draft.useWebCallback,
|
|
1823
1575
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { useWebCallback: e.target.checked })),
|
|
1824
1576
|
}),
|
|
1825
|
-
|
|
1577
|
+
h('span', null, t('useOrigin')),
|
|
1826
1578
|
),
|
|
1827
|
-
|
|
1579
|
+
h('div', { className: 'dsub-sub' },
|
|
1828
1580
|
t('useOriginHint')),
|
|
1829
|
-
|
|
1830
|
-
|
|
1581
|
+
h('label', { className: 'dsub-row' },
|
|
1582
|
+
h('input', {
|
|
1831
1583
|
type: 'checkbox',
|
|
1832
1584
|
checked: !!draft.autoLoopback,
|
|
1833
1585
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { autoLoopback: e.target.checked })),
|
|
1834
1586
|
}),
|
|
1835
|
-
|
|
1587
|
+
h('span', null, t('autoLoopback')),
|
|
1836
1588
|
),
|
|
1837
|
-
|
|
1589
|
+
h('div', { className: 'dsub-sub' },
|
|
1838
1590
|
t('autoLoopbackHint')),
|
|
1839
1591
|
),
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1592
|
+
h('details', { className: 'dsub-group', open: true },
|
|
1593
|
+
h('summary', { className: 'dsub-groupHead' }, t('groupPrivacy')),
|
|
1594
|
+
h('label', { className: 'dsub-row' },
|
|
1595
|
+
h('input', {
|
|
1844
1596
|
type: 'checkbox',
|
|
1845
1597
|
checked: !!draft.privacyMask,
|
|
1846
1598
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { privacyMask: e.target.checked })),
|
|
1847
1599
|
}),
|
|
1848
|
-
|
|
1600
|
+
h('span', null, t('privacyMask')),
|
|
1849
1601
|
),
|
|
1850
|
-
|
|
1602
|
+
h('div', { className: 'dsub-sub' },
|
|
1851
1603
|
t('privacyMaskHint')),
|
|
1852
|
-
|
|
1853
|
-
|
|
1604
|
+
h('label', { className: 'dsub-row' },
|
|
1605
|
+
h('input', {
|
|
1854
1606
|
type: 'checkbox',
|
|
1855
1607
|
checked: !!draft.hideDeprecatedModels,
|
|
1856
1608
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { hideDeprecatedModels: e.target.checked })),
|
|
1857
1609
|
}),
|
|
1858
|
-
|
|
1610
|
+
h('span', null, t('hideDeprecated')),
|
|
1859
1611
|
),
|
|
1860
|
-
|
|
1612
|
+
h('div', { className: 'dsub-sub' },
|
|
1861
1613
|
t('hideDeprecatedHint')),
|
|
1862
1614
|
),
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1615
|
+
h('details', { className: 'dsub-group', open: true },
|
|
1616
|
+
h('summary', { className: 'dsub-groupHead' }, t('groupRotation')),
|
|
1617
|
+
h('div', { className: 'dsub-row' },
|
|
1618
|
+
h('span', { className: 'dsub-h' }, t('composerQuota')),
|
|
1619
|
+
h('select', {
|
|
1868
1620
|
className: 'dsub-select',
|
|
1869
1621
|
value: draft.composerQuota || 'percent',
|
|
1870
1622
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { composerQuota: e.target.value })),
|
|
1871
1623
|
},
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1624
|
+
h('option', { value: 'off' }, t('composerQuotaOff')),
|
|
1625
|
+
h('option', { value: 'percent' }, t('composerQuotaPercent')),
|
|
1626
|
+
h('option', { value: 'bar' }, t('composerQuotaBar')),
|
|
1627
|
+
h('option', { value: 'forecast' }, t('composerQuotaForecast')),
|
|
1876
1628
|
),
|
|
1877
1629
|
),
|
|
1878
|
-
|
|
1630
|
+
h('div', { className: 'dsub-sub' },
|
|
1879
1631
|
t('composerQuotaHint')),
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1632
|
+
h('div', { className: 'dsub-row' },
|
|
1633
|
+
h('span', { className: 'dsub-h' }, t('expiryNotifyDays')),
|
|
1634
|
+
h('input', {
|
|
1883
1635
|
type: 'number',
|
|
1884
1636
|
className: 'dsub-inp',
|
|
1885
1637
|
style: { width: '80px', minWidth: '80px' },
|
|
@@ -1889,23 +1641,23 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1889
1641
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { expiryNotifyDays: Number(e.target.value) || 0 })),
|
|
1890
1642
|
}),
|
|
1891
1643
|
),
|
|
1892
|
-
|
|
1644
|
+
h('div', { className: 'dsub-sub' },
|
|
1893
1645
|
t('expiryNotifyDaysHint')),
|
|
1894
1646
|
),
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1647
|
+
h('details', { className: 'dsub-group', open: true },
|
|
1648
|
+
h('summary', { className: 'dsub-groupHead' }, '๐ฆ ' + t('groupQueue')),
|
|
1649
|
+
h('label', { className: 'dsub-row' },
|
|
1650
|
+
h('input', {
|
|
1899
1651
|
type: 'checkbox',
|
|
1900
1652
|
checked: draft.enableQueue !== false,
|
|
1901
1653
|
onChange: function(e) { setDraft(function(d) { return Object.assign({}, d, { enableQueue: e.target.checked }) }) },
|
|
1902
1654
|
}),
|
|
1903
|
-
|
|
1655
|
+
h('span', null, t('enableQueue')),
|
|
1904
1656
|
),
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1657
|
+
h('div', { className: 'dsub-sub' }, t('enableQueueHint')),
|
|
1658
|
+
h('div', { className: 'dsub-row' },
|
|
1659
|
+
h('span', { className: 'dsub-h' }, t('accountMaxConcurrency')),
|
|
1660
|
+
h('input', {
|
|
1909
1661
|
type: 'number',
|
|
1910
1662
|
className: 'dsub-inp',
|
|
1911
1663
|
style: { width: '80px', minWidth: '80px' },
|
|
@@ -1915,10 +1667,10 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1915
1667
|
onChange: function(e) { setDraft(function(d) { return Object.assign({}, d, { accountMaxConcurrency: Math.max(1, Number(e.target.value) || 2) }) }) },
|
|
1916
1668
|
}),
|
|
1917
1669
|
),
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1670
|
+
h('div', { className: 'dsub-sub' }, t('accountMaxConcurrencyHint')),
|
|
1671
|
+
h('div', { className: 'dsub-row' },
|
|
1672
|
+
h('span', { className: 'dsub-h' }, t('maxQueueSize')),
|
|
1673
|
+
h('input', {
|
|
1922
1674
|
type: 'number',
|
|
1923
1675
|
className: 'dsub-inp',
|
|
1924
1676
|
style: { width: '80px', minWidth: '80px' },
|
|
@@ -1928,10 +1680,10 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1928
1680
|
onChange: function(e) { setDraft(function(d) { return Object.assign({}, d, { maxQueueSize: Math.max(1, Number(e.target.value) || 20) }) }) },
|
|
1929
1681
|
}),
|
|
1930
1682
|
),
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1683
|
+
h('div', { className: 'dsub-sub' }, t('maxQueueSizeHint')),
|
|
1684
|
+
h('div', { className: 'dsub-row' },
|
|
1685
|
+
h('span', { className: 'dsub-h' }, t('queueTimeoutSec')),
|
|
1686
|
+
h('input', {
|
|
1935
1687
|
type: 'number',
|
|
1936
1688
|
className: 'dsub-inp',
|
|
1937
1689
|
style: { width: '80px', minWidth: '80px' },
|
|
@@ -1941,52 +1693,52 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1941
1693
|
onChange: function(e) { setDraft(function(d) { return Object.assign({}, d, { queueTimeoutMs: Math.max(1, Number(e.target.value) || 30) * 1000 }) }) },
|
|
1942
1694
|
}),
|
|
1943
1695
|
),
|
|
1944
|
-
|
|
1696
|
+
h('div', { className: 'dsub-sub' }, t('queueTimeoutSecHint')),
|
|
1945
1697
|
),
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1698
|
+
h('details', { className: 'dsub-group', open: true },
|
|
1699
|
+
h('summary', { className: 'dsub-groupHead' }, t('groupProvider')),
|
|
1700
|
+
h('label', { className: 'dsub-row' },
|
|
1701
|
+
h('input', {
|
|
1950
1702
|
type: 'checkbox',
|
|
1951
1703
|
checked: !!draft.codexFastMode,
|
|
1952
1704
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { codexFastMode: e.target.checked })),
|
|
1953
1705
|
}),
|
|
1954
|
-
|
|
1706
|
+
h('span', null, t('codexFastMode')),
|
|
1955
1707
|
),
|
|
1956
|
-
|
|
1708
|
+
h('div', { className: 'dsub-sub' },
|
|
1957
1709
|
t('codexFastModeHint')),
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1710
|
+
h('div', { className: 'dsub-row' },
|
|
1711
|
+
h('span', { className: 'dsub-h' }, t('codexVerbosity')),
|
|
1712
|
+
h('select', {
|
|
1961
1713
|
className: 'dsub-select',
|
|
1962
1714
|
value: draft.codexVerbosity || 'default',
|
|
1963
1715
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { codexVerbosity: e.target.value })),
|
|
1964
1716
|
},
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1717
|
+
h('option', { value: 'default' }, t('codexVerbosityDefault')),
|
|
1718
|
+
h('option', { value: 'low' }, t('codexVerbosityLow')),
|
|
1719
|
+
h('option', { value: 'medium' }, t('codexVerbosityMedium')),
|
|
1720
|
+
h('option', { value: 'high' }, t('codexVerbosityHigh')),
|
|
1969
1721
|
),
|
|
1970
1722
|
),
|
|
1971
|
-
|
|
1723
|
+
h('div', { className: 'dsub-sub' },
|
|
1972
1724
|
t('codexVerbosityHint')),
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1725
|
+
h('div', { className: 'dsub-row' },
|
|
1726
|
+
h('span', { className: 'dsub-h' }, t('copilotMode')),
|
|
1727
|
+
h('select', {
|
|
1976
1728
|
className: 'dsub-select',
|
|
1977
1729
|
value: draft.copilotMode || 'auto',
|
|
1978
1730
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { copilotMode: e.target.value })),
|
|
1979
1731
|
},
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1732
|
+
h('option', { value: 'auto' }, t('copilotModeAuto')),
|
|
1733
|
+
h('option', { value: 'cli' }, t('copilotModeCli')),
|
|
1734
|
+
h('option', { value: 'web' }, t('copilotModeWeb')),
|
|
1983
1735
|
),
|
|
1984
1736
|
),
|
|
1985
|
-
|
|
1737
|
+
h('div', { className: 'dsub-sub' },
|
|
1986
1738
|
t('copilotModeHint')),
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1739
|
+
h('div', { className: 'dsub-row' },
|
|
1740
|
+
h('span', { className: 'dsub-h' }, t('copilotCliPath')),
|
|
1741
|
+
h('input', {
|
|
1990
1742
|
className: 'dsub-input',
|
|
1991
1743
|
type: 'text',
|
|
1992
1744
|
value: draft.copilotCliPath || '',
|
|
@@ -1994,30 +1746,30 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
1994
1746
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { copilotCliPath: e.target.value })),
|
|
1995
1747
|
}),
|
|
1996
1748
|
),
|
|
1997
|
-
|
|
1749
|
+
h('div', { className: 'dsub-sub' },
|
|
1998
1750
|
t('copilotCliPathHint')),
|
|
1999
1751
|
),
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
1752
|
+
h('details', { className: 'dsub-group', open: true },
|
|
1753
|
+
h('summary', { className: 'dsub-groupHead' }, t('groupFallback')),
|
|
1754
|
+
h('label', { className: 'dsub-row' },
|
|
1755
|
+
h('input', {
|
|
2004
1756
|
type: 'checkbox',
|
|
2005
1757
|
checked: !!draft.ollamaFallback,
|
|
2006
1758
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { ollamaFallback: e.target.checked })),
|
|
2007
1759
|
}),
|
|
2008
|
-
|
|
1760
|
+
h('span', null, t('ollamaFallback')),
|
|
2009
1761
|
),
|
|
2010
|
-
|
|
1762
|
+
h('div', { className: 'dsub-sub' },
|
|
2011
1763
|
t('ollamaFallbackHint')),
|
|
2012
|
-
draft.ollamaFallback ?
|
|
2013
|
-
|
|
1764
|
+
draft.ollamaFallback ? h('div', { className: 'dsub-row' },
|
|
1765
|
+
h('input', {
|
|
2014
1766
|
type: 'text',
|
|
2015
1767
|
className: 'dsub-inp dsub-grow',
|
|
2016
1768
|
placeholder: 'http://localhost:11434',
|
|
2017
1769
|
value: draft.ollamaBaseUrl || '',
|
|
2018
1770
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { ollamaBaseUrl: e.target.value })),
|
|
2019
1771
|
}),
|
|
2020
|
-
|
|
1772
|
+
h('input', {
|
|
2021
1773
|
type: 'text',
|
|
2022
1774
|
className: 'dsub-inp dsub-grow',
|
|
2023
1775
|
placeholder: 'llama3:latest',
|
|
@@ -2026,10 +1778,10 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2026
1778
|
}),
|
|
2027
1779
|
) : null,
|
|
2028
1780
|
),
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
1781
|
+
h('details', { className: 'dsub-group' },
|
|
1782
|
+
h('summary', { className: 'dsub-groupHead' }, '๐ฏ ' + t('modelsCatalogTitle')),
|
|
1783
|
+
h('div', { className: 'dsub-sub', style: { marginTop: '4px' } }, t('modelsCatalogDesc')),
|
|
1784
|
+
h('div', { className: 'dsub-model-grid' },
|
|
2033
1785
|
(Array.isArray(modelsCatalog) && modelsCatalog.length ? modelsCatalog : [
|
|
2034
1786
|
{ id: 'gpt-4o', contextLabel: '128k', capabilities: ['vision'], pool: { status: 'available' } },
|
|
2035
1787
|
{ id: 'o1 / o3-mini', contextLabel: '200k', capabilities: ['reasoning'], pool: { status: 'available' } },
|
|
@@ -2068,22 +1820,22 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2068
1820
|
}
|
|
2069
1821
|
}
|
|
2070
1822
|
|
|
2071
|
-
return
|
|
2072
|
-
m.provider ?
|
|
2073
|
-
|
|
2074
|
-
tags.length ?
|
|
2075
|
-
|
|
1823
|
+
return h('div', { key: (m.id || idx) + '_' + idx, className: 'dsub-model-chip' },
|
|
1824
|
+
m.provider ? h('span', { className: 'dsub-brand dsub-brand-' + m.provider, style: { fontSize: '9px', padding: '1px 4px' } }, m.provider.toUpperCase()) : null,
|
|
1825
|
+
h('code', null, m.name || m.id),
|
|
1826
|
+
tags.length ? h('span', { className: 'dsub-model-tag' }, tags.join(' ยท ')) : null,
|
|
1827
|
+
h('span', { className: 'dsub-model-tag ' + statusClass }, poolLabel),
|
|
2076
1828
|
)
|
|
2077
1829
|
})
|
|
2078
1830
|
),
|
|
2079
1831
|
),
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
1832
|
+
h('details', { className: 'dsub-group' },
|
|
1833
|
+
h('summary', { className: 'dsub-groupHead' }, '๐ง ' + t('reasoningEffortTitle')),
|
|
1834
|
+
h('div', { className: 'dsub-sub', style: { marginTop: '4px' } }, t('reasoningEffortDesc')),
|
|
1835
|
+
h('div', { style: { display: 'flex', flexWrap: 'wrap', gap: '8px', marginTop: '10px' } },
|
|
2084
1836
|
['off', 'low', 'medium', 'high', 'max'].map((lvl) => {
|
|
2085
1837
|
const label = lvl === 'off' ? t('reasoningLevelOff') : (lvl.charAt(0).toUpperCase() + lvl.slice(1))
|
|
2086
|
-
return
|
|
1838
|
+
return h('span', {
|
|
2087
1839
|
key: lvl,
|
|
2088
1840
|
className: 'dsub-model-tag',
|
|
2089
1841
|
style: { padding: '4px 10px', fontSize: '12px', cursor: 'default' }
|
|
@@ -2091,12 +1843,12 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2091
1843
|
})
|
|
2092
1844
|
)
|
|
2093
1845
|
),
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
1846
|
+
h('details', { className: 'dsub-details' },
|
|
1847
|
+
h('summary', { className: 'dsub-summary' }, t('advancedSettings')),
|
|
1848
|
+
h('div', { className: 'dsub-block' },
|
|
1849
|
+
h('div', { className: 'dsub-row' },
|
|
1850
|
+
h('span', { className: 'dsub-h' }, t('cooldownMs')),
|
|
1851
|
+
h('input', {
|
|
2100
1852
|
type: 'number',
|
|
2101
1853
|
className: 'dsub-inp',
|
|
2102
1854
|
style: { width: '80px', minWidth: '80px' },
|
|
@@ -2106,10 +1858,10 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2106
1858
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { cooldownMs: (Number(e.target.value) || 10) * 60000 })),
|
|
2107
1859
|
}),
|
|
2108
1860
|
),
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
1861
|
+
h('div', { className: 'dsub-sub' }, t('cooldownMsHint')),
|
|
1862
|
+
h('div', { className: 'dsub-row' },
|
|
1863
|
+
h('span', { className: 'dsub-h' }, t('probeIntervalMin')),
|
|
1864
|
+
h('input', {
|
|
2113
1865
|
type: 'number',
|
|
2114
1866
|
className: 'dsub-inp',
|
|
2115
1867
|
style: { width: '80px', minWidth: '80px' },
|
|
@@ -2119,34 +1871,34 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2119
1871
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { probeIntervalMin: Number(e.target.value) || 15 })),
|
|
2120
1872
|
}),
|
|
2121
1873
|
),
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
1874
|
+
h('div', { className: 'dsub-sub' }, t('probeIntervalMinHint')),
|
|
1875
|
+
h('label', { className: 'dsub-row' },
|
|
1876
|
+
h('input', {
|
|
2125
1877
|
type: 'checkbox',
|
|
2126
1878
|
checked: draft.notifyLimits !== false,
|
|
2127
1879
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { notifyLimits: e.target.checked })),
|
|
2128
1880
|
}),
|
|
2129
|
-
|
|
1881
|
+
h('span', null, t('notifyLimits')),
|
|
2130
1882
|
),
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
1883
|
+
h('div', { className: 'dsub-sub' }, t('notifyLimitsHint')),
|
|
1884
|
+
h('label', { className: 'dsub-row', style: { marginTop: 10 } },
|
|
1885
|
+
h('input', {
|
|
2134
1886
|
type: 'checkbox',
|
|
2135
1887
|
checked: Boolean(draft.cascadingFallback),
|
|
2136
1888
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { cascadingFallback: e.target.checked })),
|
|
2137
1889
|
}),
|
|
2138
|
-
|
|
1890
|
+
h('span', null, t('cascadingFallback')),
|
|
2139
1891
|
),
|
|
2140
|
-
|
|
2141
|
-
Boolean(draft.cascadingFallback) ?
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
1892
|
+
h('div', { className: 'dsub-sub' }, t('cascadingFallbackHint')),
|
|
1893
|
+
Boolean(draft.cascadingFallback) ? h('div', { style: { marginTop: 8, padding: '8px 12px', background: 'var(--dsw-alias-bg-layer-2)', borderRadius: 8 } },
|
|
1894
|
+
h('div', { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 } }, t('cascadingFallbackOrder')),
|
|
1895
|
+
h('div', { className: 'dsub-sub', style: { marginBottom: 8 } }, t('cascadingFallbackOrderHint')),
|
|
1896
|
+
h('div', { style: { display: 'flex', flexDirection: 'column', gap: 4 } },
|
|
2145
1897
|
(Array.isArray(draft.cascadingFallbackOrder) && draft.cascadingFallbackOrder.length ? draft.cascadingFallbackOrder : (providers.length ? providers : ['antigravity', 'claude', 'codex', 'grok', 'copilot', 'cursor'])).map((p, idx, arr) => {
|
|
2146
|
-
return
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
idx > 0 ?
|
|
1898
|
+
return h('div', { key: p, style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '4px 8px', background: 'var(--dsw-alias-bg-layer-1)', borderRadius: 6, fontSize: 12 } },
|
|
1899
|
+
h('span', null, (idx + 1) + '. ' + p.toUpperCase()),
|
|
1900
|
+
h('div', { style: { display: 'flex', gap: 4 } },
|
|
1901
|
+
idx > 0 ? h('button', {
|
|
2150
1902
|
type: 'button', className: 'dsub-mini', style: { padding: '1px 6px', fontSize: 10 },
|
|
2151
1903
|
onClick: () => {
|
|
2152
1904
|
const next = arr.slice()
|
|
@@ -2156,7 +1908,7 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2156
1908
|
setDraft((d) => Object.assign({}, d, { cascadingFallbackOrder: next }))
|
|
2157
1909
|
}
|
|
2158
1910
|
}, 'โฒ') : null,
|
|
2159
|
-
idx < arr.length - 1 ?
|
|
1911
|
+
idx < arr.length - 1 ? h('button', {
|
|
2160
1912
|
type: 'button', className: 'dsub-mini', style: { padding: '1px 6px', fontSize: 10 },
|
|
2161
1913
|
onClick: () => {
|
|
2162
1914
|
const next = arr.slice()
|
|
@@ -2172,62 +1924,62 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2172
1924
|
)
|
|
2173
1925
|
) : null,
|
|
2174
1926
|
),
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
1927
|
+
h('div', { className: 'dsub-row', style: { marginTop: 12 } },
|
|
1928
|
+
h('label', { style: { display: 'flex', flexDirection: 'column', gap: 4 } },
|
|
1929
|
+
h('span', { style: { fontWeight: 600 } }, t('rotationStrategy')),
|
|
1930
|
+
h('span', { className: 'dsub-sub' }, t('rotationStrategyHint')),
|
|
1931
|
+
h('select', {
|
|
2180
1932
|
className: 'dsub-select',
|
|
2181
1933
|
value: draft.rotationStrategy || 'round-robin',
|
|
2182
1934
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { rotationStrategy: e.target.value })),
|
|
2183
1935
|
style: { maxWidth: 320, marginTop: 4 }
|
|
2184
1936
|
},
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
1937
|
+
h('option', { value: 'round-robin' }, t('rotationRoundRobin')),
|
|
1938
|
+
h('option', { value: 'least-loaded' }, t('rotationLeastLoaded')),
|
|
1939
|
+
h('option', { value: 'priority' }, t('rotationPriority')),
|
|
2188
1940
|
),
|
|
2189
1941
|
),
|
|
2190
1942
|
),
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
1943
|
+
h('div', { className: 'dsub-row', style: { marginTop: 12 } },
|
|
1944
|
+
h('label', { style: { display: 'flex', alignItems: 'center', gap: 8, cursor: 'pointer' } },
|
|
1945
|
+
h('input', {
|
|
2194
1946
|
type: 'checkbox',
|
|
2195
1947
|
checked: draft.enableSoftFailureSentinel !== false,
|
|
2196
1948
|
onChange: (e) => setDraft((d) => Object.assign({}, d, { enableSoftFailureSentinel: e.target.checked })),
|
|
2197
1949
|
}),
|
|
2198
|
-
|
|
1950
|
+
h('span', null, t('softFailureSentinel')),
|
|
2199
1951
|
),
|
|
2200
|
-
|
|
1952
|
+
h('div', { className: 'dsub-sub' }, t('softFailureSentinelHint')),
|
|
2201
1953
|
),
|
|
2202
1954
|
),
|
|
2203
1955
|
),
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
1956
|
+
h('div', { className: 'dsub-block' },
|
|
1957
|
+
h('div', { className: 'dsub-row' },
|
|
1958
|
+
h('button', { type: 'button', className: 'dsub-mini', onClick: () => runWizard(null, null, null, false) }, '๐ฉบ ' + t('wizardAll')),
|
|
1959
|
+
h('button', { type: 'button', className: 'dsub-mini', onClick: genDiag }, t('diagGenerate')),
|
|
1960
|
+
h('button', { type: 'button', className: 'dsub-mini', onClick: runAnalyzeSession }, analyzingCache ? 'โฆ' : t('cacheAnalyze')),
|
|
1961
|
+
h('button', { type: 'button', className: 'dsub-mini', onClick: () => { setBackupModal('export'); setBackupErr(''); setBackupInfo('') } }, '๐ ' + t('backupExport')),
|
|
1962
|
+
h('button', { type: 'button', className: 'dsub-mini', onClick: () => { setBackupModal('import'); setBackupErr(''); setBackupInfo('') } }, '๐ฅ ' + t('backupImport')),
|
|
1963
|
+
h('a', { href: 'https://github.com/GooDAnDReaDY/dsh-subscriptions/issues', target: '_blank', rel: 'noopener noreferrer', className: 'dsub-mini' }, t('diagIssues')),
|
|
2212
1964
|
),
|
|
2213
|
-
|
|
2214
|
-
sessionAnalysis ?
|
|
1965
|
+
h('div', { className: 'dsub-sub' }, t('diagHint')),
|
|
1966
|
+
sessionAnalysis ? h('div', { className: 'dsub-sub', style: { marginTop: '6px', fontWeight: 500 } },
|
|
2215
1967
|
t('cacheHitRate') + ': ' + sessionAnalysis.weightedCacheHitPercent + '% ยท ' +
|
|
2216
1968
|
t('tokensSaved') + ': ' + sessionAnalysis.savedTokens + ' / ' + sessionAnalysis.totalTokens
|
|
2217
1969
|
) : null,
|
|
2218
|
-
diag ?
|
|
2219
|
-
|
|
1970
|
+
diag ? h('div', { className: 'dsub-row' },
|
|
1971
|
+
h('button', {
|
|
2220
1972
|
type: 'button', className: 'dsub-mini',
|
|
2221
1973
|
onClick: () => { try { navigator.clipboard.writeText(diag) } catch { /* clipboard write error */ } },
|
|
2222
1974
|
}, t('diagCopy')),
|
|
2223
|
-
|
|
1975
|
+
h('pre', { className: 'dsub-diag' }, diag),
|
|
2224
1976
|
) : null,
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
1977
|
+
h('details', { className: 'dsub-details', style: { marginTop: 12 } },
|
|
1978
|
+
h('summary', { className: 'dsub-summary' }, 'โ ๏ธ ' + t('recentErrors')),
|
|
1979
|
+
h('div', { className: 'dsub-block' },
|
|
1980
|
+
h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 } },
|
|
1981
|
+
h('span', { className: 'dsub-sub' }, t('recentErrorsDesc')),
|
|
1982
|
+
h('button', {
|
|
2231
1983
|
type: 'button', className: 'dsub-mini',
|
|
2232
1984
|
onClick: async () => {
|
|
2233
1985
|
await fetch('/dsh-subscriptions/diagnostics/errors/clear', { method: 'POST' }).catch(() => {})
|
|
@@ -2236,79 +1988,79 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2236
1988
|
}, t('recentErrorsClear'))
|
|
2237
1989
|
),
|
|
2238
1990
|
(diagReport && Array.isArray(diagReport.recentErrors) && diagReport.recentErrors.length ? diagReport.recentErrors : []).length === 0
|
|
2239
|
-
?
|
|
2240
|
-
:
|
|
2241
|
-
(diagReport.recentErrors || []).map((err, i) =>
|
|
1991
|
+
? h('div', { className: 'dsub-dim', style: { padding: 8 } }, t('recentErrorsEmpty'))
|
|
1992
|
+
: h('div', { style: { display: 'flex', flexDirection: 'column', gap: 6 } },
|
|
1993
|
+
(diagReport.recentErrors || []).map((err, i) => h('div', {
|
|
2242
1994
|
key: i,
|
|
2243
1995
|
style: { padding: '6px 10px', background: 'var(--dsw-alias-bg-layer-2)', borderRadius: 6, fontSize: 11.5, borderLeft: '3px solid var(--dsw-alias-state-error-primary)' }
|
|
2244
1996
|
},
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
1997
|
+
h('div', { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 2 } },
|
|
1998
|
+
h('span', { style: { fontWeight: 600 } }, (err.provider || 'unknown').toUpperCase() + (err.model ? ' ยท ' + err.model : '')),
|
|
1999
|
+
h('span', { className: 'dsub-dim' }, (err.ts || '').slice(11, 19))
|
|
2248
2000
|
),
|
|
2249
|
-
|
|
2250
|
-
err.code ?
|
|
2251
|
-
err.status ?
|
|
2252
|
-
|
|
2001
|
+
h('div', { style: { display: 'flex', gap: 6, alignItems: 'center' } },
|
|
2002
|
+
err.code ? h('span', { className: 'dsub-pillTag', style: { background: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 15%,transparent)', color: 'var(--dsw-alias-state-error-primary)' } }, err.code) : null,
|
|
2003
|
+
err.status ? h('span', { className: 'dsub-dim' }, 'HTTP ' + err.status) : null,
|
|
2004
|
+
h('span', { style: { opacity: 0.9, wordBreak: 'break-word' } }, err.message)
|
|
2253
2005
|
)
|
|
2254
2006
|
))
|
|
2255
2007
|
)
|
|
2256
2008
|
)
|
|
2257
2009
|
),
|
|
2258
|
-
wizardModal ?
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2010
|
+
wizardModal ? h('div', { className: 'dsub-modalWrap', onClick: (e) => { if (e.target === e.currentTarget) setWizardModal(null) } },
|
|
2011
|
+
h('div', { className: 'dsub-modal' },
|
|
2012
|
+
h('div', { className: 'dsub-modalHead' },
|
|
2013
|
+
h('div', { className: 'dsub-modalTitleWrap' },
|
|
2014
|
+
h('div', { className: 'dsub-modalIcon' }, '๐ฉบ'),
|
|
2015
|
+
h('div', null,
|
|
2016
|
+
h('div', { style: { fontWeight: 700, fontSize: '15px' } }, t('wizardTitle')),
|
|
2017
|
+
h('div', { style: { fontSize: '11.5px', opacity: 0.7 } },
|
|
2266
2018
|
wizardModal.provider && wizardModal.provider !== 'all' ? (wizardModal.provider.toUpperCase() + ' #' + wizardModal.index + (wizardModal.ref ? ' (' + wizardModal.ref + ')' : '')) : t('wizardAll')
|
|
2267
2019
|
),
|
|
2268
2020
|
),
|
|
2269
2021
|
),
|
|
2270
|
-
|
|
2022
|
+
h('button', { type: 'button', className: 'dsub-mini', onClick: () => setWizardModal(null) }, 'โ ' + t('closeModal')),
|
|
2271
2023
|
),
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2024
|
+
h('div', { style: { marginTop: '14px' } },
|
|
2025
|
+
h('label', { className: 'dsub-row', style: { marginBottom: '10px' } },
|
|
2026
|
+
h('input', {
|
|
2275
2027
|
type: 'checkbox',
|
|
2276
2028
|
checked: !!wizardModal.includeNetwork,
|
|
2277
2029
|
onChange: (e) => runWizard(wizardModal.provider === 'all' ? null : wizardModal.provider, wizardModal.index, wizardModal.ref, e.target.checked),
|
|
2278
2030
|
}),
|
|
2279
|
-
|
|
2031
|
+
h('span', { style: { fontSize: '12px' } }, t('wizardIncludeNetwork')),
|
|
2280
2032
|
),
|
|
2281
|
-
wizardModal.loading ?
|
|
2282
|
-
wizardModal.error ?
|
|
2283
|
-
wizardModal.report ?
|
|
2284
|
-
|
|
2285
|
-
|
|
2033
|
+
wizardModal.loading ? h('div', { className: 'dsub-alert-ok', style: { marginBottom: '12px' } }, 'โณ ' + t('wizardRunning')) : null,
|
|
2034
|
+
wizardModal.error ? h('div', { className: 'dsub-alert-bad', style: { marginBottom: '12px' } }, wizardModal.error) : null,
|
|
2035
|
+
wizardModal.report ? h('div', null,
|
|
2036
|
+
h('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: '12px' } },
|
|
2037
|
+
h('span', {
|
|
2286
2038
|
className: 'dsub-badge ' + (wizardModal.report.overallStatus === 'healthy' ? 'dsub-badge-ok' : (wizardModal.report.overallStatus === 'degraded' ? 'dsub-badge-warn' : 'dsub-badge-bad'))
|
|
2287
2039
|
}, (wizardModal.report.overallStatus === 'healthy' ? '๐ข ' + t('wizardHealthy') : (wizardModal.report.overallStatus === 'degraded' ? '๐ก ' + t('wizardDegraded') : '๐ด ' + t('wizardFailing')))),
|
|
2288
|
-
|
|
2040
|
+
h('span', { style: { fontSize: '11.5px', opacity: 0.7 } },
|
|
2289
2041
|
wizardModal.report.summary.passed + ' passed ยท ' + wizardModal.report.summary.warnings + ' warn ยท ' + wizardModal.report.summary.failed + ' fail'
|
|
2290
2042
|
),
|
|
2291
2043
|
),
|
|
2292
|
-
|
|
2044
|
+
h('div', { className: 'dsub-trace-box', style: { marginBottom: '12px' } },
|
|
2293
2045
|
wizardModal.report.steps.map((st, idx) => {
|
|
2294
2046
|
const icon = st.status === 'pass' ? 'โ
' : (st.status === 'warn' ? 'โ ๏ธ' : (st.status === 'fail' ? 'โ' : 'โช'))
|
|
2295
2047
|
const color = st.status === 'pass' ? 'var(--dsw-alias-state-success-primary)' : (st.status === 'warn' ? 'var(--dsw-alias-state-warn-primary)' : (st.status === 'fail' ? 'var(--dsw-alias-state-error-primary)' : 'var(--dsw-alias-label-secondary)'))
|
|
2296
|
-
return
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
st.latencyMs != null ?
|
|
2048
|
+
return h('div', { key: idx, className: 'dsub-trace-row' },
|
|
2049
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px' } },
|
|
2050
|
+
h('span', null, icon),
|
|
2051
|
+
h('span', { style: { fontWeight: 600 } }, st.name),
|
|
2052
|
+
st.latencyMs != null ? h('span', { style: { fontSize: '10px', opacity: 0.6 } }, st.latencyMs + 'ms') : null,
|
|
2301
2053
|
),
|
|
2302
|
-
|
|
2054
|
+
h('span', { style: { fontSize: '11px', color: color } }, st.message),
|
|
2303
2055
|
)
|
|
2304
2056
|
})
|
|
2305
2057
|
),
|
|
2306
|
-
wizardModal.report.recommendations && wizardModal.report.recommendations.length ?
|
|
2307
|
-
|
|
2308
|
-
wizardModal.report.recommendations.map((rec, rIdx) =>
|
|
2058
|
+
wizardModal.report.recommendations && wizardModal.report.recommendations.length ? h('div', { style: { marginBottom: '12px' } },
|
|
2059
|
+
h('div', { style: { fontSize: '11.5px', fontWeight: 600, color: 'var(--dsw-alias-state-warn-primary)', marginBottom: '4px' } }, '๐ก ' + t('wizardRecommendations')),
|
|
2060
|
+
wizardModal.report.recommendations.map((rec, rIdx) => h('div', { key: rIdx, className: 'dsub-alert-bad', style: { marginBottom: '4px', fontSize: '11.5px' } }, rec))
|
|
2309
2061
|
) : null,
|
|
2310
|
-
|
|
2311
|
-
|
|
2062
|
+
h('div', { style: { display: 'flex', justifyContent: 'flex-end', gap: '8px', marginTop: '10px' } },
|
|
2063
|
+
h('button', {
|
|
2312
2064
|
type: 'button',
|
|
2313
2065
|
className: 'dsub-mini',
|
|
2314
2066
|
onClick: () => {
|
|
@@ -2321,60 +2073,60 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2321
2073
|
),
|
|
2322
2074
|
),
|
|
2323
2075
|
) : null,
|
|
2324
|
-
backupModal ?
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2076
|
+
backupModal ? h('div', { className: 'dsub-panel-box', style: { marginTop: '10px' } },
|
|
2077
|
+
h('div', { className: 'dsub-panel-title' },
|
|
2078
|
+
h('span', null, backupModal === 'export' ? ('๐ ' + t('backupExportTitle')) : ('๐ฅ ' + t('backupImportTitle'))),
|
|
2079
|
+
h('button', {
|
|
2328
2080
|
type: 'button',
|
|
2329
2081
|
className: 'dsub-mini',
|
|
2330
2082
|
onClick: () => { setBackupModal(null); setBackupPass(''); setBackupData(''); setBackupErr(''); setBackupInfo('') }
|
|
2331
2083
|
}, 'โ ' + t('closeModal'))
|
|
2332
2084
|
),
|
|
2333
|
-
|
|
2085
|
+
h('div', { className: 'dsub-panel-desc' },
|
|
2334
2086
|
backupModal === 'export' ? t('backupExportHint') : t('backupImportHint')
|
|
2335
2087
|
),
|
|
2336
|
-
|
|
2337
|
-
backupModal === 'import' ?
|
|
2088
|
+
h('div', { style: { display: 'flex', flexDirection: 'column', gap: '8px', marginTop: '8px' } },
|
|
2089
|
+
backupModal === 'import' ? h('textarea', {
|
|
2338
2090
|
className: 'dsub-diag',
|
|
2339
2091
|
style: { width: '100%', height: '80px', fontFamily: 'monospace', fontSize: '11px' },
|
|
2340
2092
|
placeholder: t('backupPayloadPlaceholder'),
|
|
2341
2093
|
value: backupData,
|
|
2342
2094
|
onChange: (e) => setBackupData(e.target.value),
|
|
2343
2095
|
}) : null,
|
|
2344
|
-
|
|
2345
|
-
|
|
2096
|
+
h('div', { className: 'dsub-row' },
|
|
2097
|
+
h('input', {
|
|
2346
2098
|
type: 'password',
|
|
2347
2099
|
className: 'dsub-grow',
|
|
2348
2100
|
placeholder: t('backupPassphrase'),
|
|
2349
2101
|
value: backupPass,
|
|
2350
2102
|
onChange: (e) => setBackupPass(e.target.value),
|
|
2351
2103
|
}),
|
|
2352
|
-
backupModal === 'export' ?
|
|
2104
|
+
backupModal === 'export' ? h('button', {
|
|
2353
2105
|
type: 'button',
|
|
2354
2106
|
className: 'dsub-mini',
|
|
2355
2107
|
disabled: backupLoading || !backupPass || backupPass.length < 12,
|
|
2356
2108
|
onClick: doExportBackup,
|
|
2357
|
-
}, backupLoading ? 'โฆ' : t('backupExportAction')) :
|
|
2109
|
+
}, backupLoading ? 'โฆ' : t('backupExportAction')) : h('button', {
|
|
2358
2110
|
type: 'button',
|
|
2359
2111
|
className: 'dsub-mini',
|
|
2360
2112
|
disabled: backupLoading || !backupPass || !backupData,
|
|
2361
2113
|
onClick: doImportBackup,
|
|
2362
2114
|
}, backupLoading ? 'โฆ' : t('backupImportAction'))
|
|
2363
2115
|
),
|
|
2364
|
-
backupErr ?
|
|
2365
|
-
backupInfo ?
|
|
2366
|
-
(backupModal === 'export' && backupData) ?
|
|
2367
|
-
|
|
2116
|
+
backupErr ? h('div', { className: 'dsub-bad' }, backupErr) : null,
|
|
2117
|
+
backupInfo ? h('div', { className: 'dsub-ok' }, backupInfo) : null,
|
|
2118
|
+
(backupModal === 'export' && backupData) ? h('div', { className: 'dsub-row' },
|
|
2119
|
+
h('button', {
|
|
2368
2120
|
type: 'button',
|
|
2369
2121
|
className: 'dsub-mini',
|
|
2370
2122
|
onClick: () => { try { navigator.clipboard.writeText(backupData) } catch { /* ignore */ } },
|
|
2371
2123
|
}, t('diagCopy')),
|
|
2372
|
-
|
|
2124
|
+
h('button', {
|
|
2373
2125
|
type: 'button',
|
|
2374
2126
|
className: 'dsub-mini',
|
|
2375
2127
|
onClick: downloadBackupFile,
|
|
2376
2128
|
}, t('backupDownload')),
|
|
2377
|
-
|
|
2129
|
+
h('pre', { className: 'dsub-diag', style: { maxHeight: '60px', overflow: 'hidden', textOverflow: 'ellipsis' } }, backupData)
|
|
2378
2130
|
) : null
|
|
2379
2131
|
)
|
|
2380
2132
|
) : null,
|
|
@@ -2383,15 +2135,15 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2383
2135
|
const rows = slots
|
|
2384
2136
|
.map((slot, i) => ({ slot: slot, i: i }))
|
|
2385
2137
|
.filter((row) => row.slot.provider === prov.id)
|
|
2386
|
-
return
|
|
2387
|
-
|
|
2138
|
+
return h('div', { className: 'dsub-block', key: prov.id },
|
|
2139
|
+
h('div', { className: 'dsub-h' }, prov.name),
|
|
2388
2140
|
rows.map((row) => {
|
|
2389
2141
|
const account = accountOf(row.slot.provider, row.slot.index)
|
|
2390
2142
|
const key = row.slot.provider + ':' + row.slot.index
|
|
2391
2143
|
const on = !!account.configured
|
|
2392
|
-
return
|
|
2393
|
-
|
|
2394
|
-
|
|
2144
|
+
return h('div', { className: 'dsub-card', key: key },
|
|
2145
|
+
h('div', { className: 'dsub-row' },
|
|
2146
|
+
h('input', {
|
|
2395
2147
|
className: 'dsub-grow',
|
|
2396
2148
|
value: row.slot.label || '',
|
|
2397
2149
|
placeholder: account.label || (t('accountLabel') + ' ' + row.slot.index),
|
|
@@ -2401,22 +2153,22 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2401
2153
|
setSlots(next)
|
|
2402
2154
|
},
|
|
2403
2155
|
}),
|
|
2404
|
-
|
|
2156
|
+
h('span', { className: 'dsub-badge' + (account.validationUrl ? ' dsub-badge-warn' : (on ? ' dsub-badge-on' : '')) }, badgeFor(account, t)),
|
|
2405
2157
|
normalizePlanBadge(row.slot.provider, account.plan || (account.quota && account.quota.plan)),
|
|
2406
|
-
|
|
2158
|
+
h('button', {
|
|
2407
2159
|
type: 'button', className: 'dsub-mini',
|
|
2408
2160
|
onClick: () => connect(row.slot.provider, row.slot.index).catch((e) => setErr(cleanErrorMessage(e.message || e))),
|
|
2409
2161
|
}, on ? t('reconnect') : t('connect')),
|
|
2410
|
-
((row.slot.provider === 'codex' || row.slot.provider === 'copilot' || row.slot.provider === 'grok') ?
|
|
2162
|
+
((row.slot.provider === 'codex' || row.slot.provider === 'copilot' || row.slot.provider === 'grok') ? h('button', {
|
|
2411
2163
|
type: 'button', className: 'dsub-mini',
|
|
2412
2164
|
onClick: () => deviceStartLogin(row.slot.provider, row.slot.index).catch((e) => setErr(cleanErrorMessage(e.message || e))),
|
|
2413
2165
|
}, t('deviceLogin')) : null),
|
|
2414
|
-
|
|
2166
|
+
h('button', {
|
|
2415
2167
|
type: 'button', className: 'dsub-mini',
|
|
2416
2168
|
disabled: !on,
|
|
2417
2169
|
onClick: () => logout(row.slot.provider, row.slot.index).catch((e) => setErr(cleanErrorMessage(e.message || e))),
|
|
2418
2170
|
}, t('disconnect')),
|
|
2419
|
-
|
|
2171
|
+
h('button', {
|
|
2420
2172
|
type: 'button', className: 'dsub-mini',
|
|
2421
2173
|
disabled: checking[key],
|
|
2422
2174
|
title: t('smokeDesc'),
|
|
@@ -2427,30 +2179,47 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2427
2179
|
if (!r) return null;
|
|
2428
2180
|
var cls = r.ok ? 'dsub-badge-ok' : 'dsub-badge-bad';
|
|
2429
2181
|
var txt = r.ok ? ('โ ' + (r.latencyMs != null ? r.latencyMs + 'ms' : 'OK')) : ('โ ' + ((r.error && (r.error.code || r.error.message)) || 'FAIL'));
|
|
2430
|
-
return
|
|
2182
|
+
return h('span', { className: 'dsub-badge ' + cls, style: { marginLeft: 4 }, title: r.ok ? t('testConnectionSuccess') : ((r.error && r.error.message) || 'fail') }, txt);
|
|
2431
2183
|
})(),
|
|
2432
|
-
|
|
2184
|
+
(account && account.lastPingMs != null ? (function(){
|
|
2185
|
+
var ms = account.lastPingMs;
|
|
2186
|
+
var grade = account.latencyGrade || (ms < 250 ? 'good' : (ms < 750 ? 'fair' : 'poor'));
|
|
2187
|
+
var cls = grade === 'good' ? 'dsub-badge-ok' : (grade === 'fair' ? 'dsub-badge-warn' : 'dsub-badge-bad');
|
|
2188
|
+
return h('span', {
|
|
2189
|
+
className: 'dsub-badge ' + cls,
|
|
2190
|
+
style: { marginLeft: 4, cursor: 'pointer' },
|
|
2191
|
+
title: 'Latency: ' + ms + 'ms (' + grade + '). Click to test.',
|
|
2192
|
+
onClick: () => doPing(row.slot.provider, row.slot.index),
|
|
2193
|
+
}, '๐ถ ' + ms + 'ms');
|
|
2194
|
+
})() : null),
|
|
2195
|
+
h('button', {
|
|
2196
|
+
type: 'button',
|
|
2197
|
+
className: 'dsub-mini',
|
|
2198
|
+
title: t('syncModelsTitle'),
|
|
2199
|
+
onClick: () => doSyncModels(row.slot.provider, row.slot.index),
|
|
2200
|
+
}, '๐ ' + t('syncModels')),
|
|
2201
|
+
h('button', {
|
|
2433
2202
|
type: 'button', className: 'dsub-mini',
|
|
2434
2203
|
title: t('wizardTitle'),
|
|
2435
2204
|
onClick: () => runWizard(row.slot.provider, row.slot.index, row.slot.ref, false),
|
|
2436
2205
|
}, '๐ฉบ ' + t('wizardButton')),
|
|
2437
2206
|
|
|
2438
|
-
(account && account.quarantineUntil && Number(account.quarantineUntil) > Date.now() ?
|
|
2439
|
-
|
|
2207
|
+
(account && account.quarantineUntil && Number(account.quarantineUntil) > Date.now() ? h(React.Fragment, null,
|
|
2208
|
+
h('button', {
|
|
2440
2209
|
type: 'button', className: 'dsub-mini', title: t('probeWarmupTitle'),
|
|
2441
2210
|
disabled: checking[key],
|
|
2442
2211
|
onClick: () => doProbeQuarantine(row.slot.provider, row.slot.index, false),
|
|
2443
2212
|
}, checking[key] ? t('checking') : ('๐ ' + t('probeWarmupNow'))),
|
|
2444
|
-
|
|
2213
|
+
h('button', {
|
|
2445
2214
|
type: 'button', className: 'dsub-mini', title: t('releaseQuarantineTitle'),
|
|
2446
2215
|
disabled: checking[key],
|
|
2447
2216
|
onClick: () => doProbeQuarantine(row.slot.provider, row.slot.index, true),
|
|
2448
2217
|
}, ('โ ' + t('releaseQuarantine'))),
|
|
2449
|
-
) : (on ?
|
|
2218
|
+
) : (on ? h('button', {
|
|
2450
2219
|
type: 'button', className: 'dsub-mini', title: t('quarantineParkTitle'),
|
|
2451
2220
|
onClick: () => doParkQuarantine(row.slot.provider, row.slot.index, 3600000),
|
|
2452
2221
|
}, ('โธ ' + t('quarantinePark'))) : null)),
|
|
2453
|
-
|
|
2222
|
+
h('button', {
|
|
2454
2223
|
type: 'button', className: 'dsub-mini', title: t('removeSlot'),
|
|
2455
2224
|
onClick: () => {
|
|
2456
2225
|
const slot = row.slot
|
|
@@ -2460,55 +2229,75 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2460
2229
|
},
|
|
2461
2230
|
}, '\u00d7'),
|
|
2462
2231
|
),
|
|
2463
|
-
(account && account.quarantineUntil && Number(account.quarantineUntil) > Date.now()) ?
|
|
2464
|
-
|
|
2232
|
+
(account && account.quarantineUntil && Number(account.quarantineUntil) > Date.now()) ? h('div', { className: 'dsub-row', style: { marginTop: 4 } },
|
|
2233
|
+
h('span', { className: 'dsub-sub', style: { color: 'var(--dsw-alias-state-error-primary)', fontVariantNumeric: 'tabular-nums' } },
|
|
2465
2234
|
'โ ' + (account.quarantineReason || 'QUARANTINE') + ' ยท ' + t('resetsIn') + ' ' + formatRelativeReset(account.quarantineUntil, t('lang'), Date.now())
|
|
2466
2235
|
),
|
|
2467
|
-
) : (account && account.quota && account.quota.resetAt && Number(account.quota.resetAt) > Date.now()) ?
|
|
2468
|
-
|
|
2236
|
+
) : (account && account.quota && account.quota.resetAt && Number(account.quota.resetAt) > Date.now()) ? h('div', { className: 'dsub-row', style: { marginTop: 4 } },
|
|
2237
|
+
h(ResetCountdown, { resetAt: account.quota.resetAt }),
|
|
2469
2238
|
) : null,
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2239
|
+
h('div', { className: 'dsub-manual' },
|
|
2240
|
+
h('span', { className: 'dsub-sub' }, t('manualTitle')),
|
|
2241
|
+
h('div', { className: 'dsub-row' },
|
|
2242
|
+
h('input', {
|
|
2474
2243
|
className: 'dsub-grow',
|
|
2475
2244
|
value: paste[key] || '',
|
|
2476
2245
|
placeholder: t('pastePlaceholder'),
|
|
2477
2246
|
onChange: (e) => setPaste((p) => Object.assign({}, p, { [key]: e.target.value })),
|
|
2478
2247
|
}),
|
|
2479
|
-
|
|
2248
|
+
h('button', {
|
|
2480
2249
|
type: 'button', className: 'dsub-mini',
|
|
2481
2250
|
onClick: () => complete(row.slot.provider, row.slot.index).catch((e) => setErr(cleanErrorMessage(e.message || e))),
|
|
2482
2251
|
}, t('submitCode')),
|
|
2483
2252
|
),
|
|
2484
|
-
|
|
2485
|
-
|
|
2253
|
+
h('div', { className: 'dsub-row', style: { justifyContent: 'space-between' } },
|
|
2254
|
+
h('button', {
|
|
2486
2255
|
type: 'button',
|
|
2487
2256
|
className: 'dsub-mini',
|
|
2488
2257
|
title: t('importLocalCliTitle'),
|
|
2489
2258
|
style: { display: 'inline-flex', alignItems: 'center', gap: 6, fontWeight: 600 },
|
|
2490
2259
|
onClick: () => importLocalCli(row.slot.provider, row.slot.index).catch((e) => setErr(cleanErrorMessage(e.message || e))),
|
|
2491
2260
|
}, t('importLocalCli')),
|
|
2492
|
-
|
|
2261
|
+
h('button', {
|
|
2493
2262
|
type: 'button',
|
|
2494
2263
|
className: 'dsub-mini' + (openHelp[key] ? ' dsub-btnActive' : ''),
|
|
2495
2264
|
title: t('howToGetTokenTitle'),
|
|
2496
2265
|
onClick: (e) => { if (e) { e.preventDefault(); e.stopPropagation(); } setOpenHelp((h) => Object.assign({}, h, { [key]: !h[key] })); },
|
|
2497
2266
|
}, t('howToGetToken')),
|
|
2498
2267
|
),
|
|
2499
|
-
|
|
2500
|
-
|
|
2268
|
+
h('div', { className: 'dsub-row' },
|
|
2269
|
+
h('input', {
|
|
2501
2270
|
className: 'dsub-grow',
|
|
2502
2271
|
value: tokenDraft[key] || '',
|
|
2503
2272
|
placeholder: t('importTokenPlace'),
|
|
2504
2273
|
onChange: (e) => setTokenDraft((d) => Object.assign({}, d, { [key]: e.target.value })),
|
|
2505
2274
|
}),
|
|
2506
|
-
|
|
2275
|
+
h('button', {
|
|
2507
2276
|
type: 'button', className: 'dsub-mini',
|
|
2508
2277
|
title: t('importToken'),
|
|
2509
2278
|
onClick: () => importToken(row.slot.provider, row.slot.index).catch((e) => setErr(cleanErrorMessage(e.message || e))),
|
|
2510
2279
|
}, t('importToken')),
|
|
2511
2280
|
),
|
|
2281
|
+
(account && account.lastDoctorVerdict ? (function(){
|
|
2282
|
+
var doc = account.lastDoctorVerdict;
|
|
2283
|
+
return h('div', {
|
|
2284
|
+
className: 'dsub-helpBox',
|
|
2285
|
+
style: {
|
|
2286
|
+
marginTop: 6,
|
|
2287
|
+
padding: '8px 12px',
|
|
2288
|
+
borderLeft: '3px solid var(--dsw-alias-brand-primary)',
|
|
2289
|
+
background: 'var(--dsw-alias-bg-layer-2)',
|
|
2290
|
+
},
|
|
2291
|
+
},
|
|
2292
|
+
h('div', { style: { fontWeight: 600, color: 'var(--dsw-alias-label-primary)', display: 'flex', alignItems: 'center', gap: 6, marginBottom: 4 } },
|
|
2293
|
+
'๐ฉบ ' + doc.title
|
|
2294
|
+
),
|
|
2295
|
+
h('div', { style: { fontSize: 12, color: 'var(--dsw-alias-label-secondary)', marginBottom: 4 } }, doc.details),
|
|
2296
|
+
h('div', { style: { fontSize: 12, color: 'var(--dsw-alias-brand-primary)', fontWeight: 500 } },
|
|
2297
|
+
'๐ก ' + (t('recommendation') || 'Recommendation') + ': ' + doc.recommendation
|
|
2298
|
+
)
|
|
2299
|
+
);
|
|
2300
|
+
})() : null),
|
|
2512
2301
|
(openHelp[key] ? (function renderInlineHelp(){
|
|
2513
2302
|
const prov = row.slot.provider;
|
|
2514
2303
|
const info = (typeof INSTRUCTIONS !== 'undefined' && INSTRUCTIONS[prov]) || {
|
|
@@ -2519,10 +2308,10 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2519
2308
|
// Determine language safely from current locale (fallback to zh if Chinese or en)
|
|
2520
2309
|
const isZh = t('instructionsTitle').indexOf('่ทๅ') >= 0 || t('close') === 'ๅ
ณ้ญ';
|
|
2521
2310
|
const steps = (isZh && info.stepsZh) ? info.stepsZh : (info.stepsEn || []);
|
|
2522
|
-
return
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2311
|
+
return h('div', { className: 'dsub-helpBox' },
|
|
2312
|
+
h('div', { className: 'dsub-helpHead' },
|
|
2313
|
+
h('span', null, 'โน๏ธ ' + info.title + ' โ ' + t('instructionsTitle')),
|
|
2314
|
+
h('button', {
|
|
2526
2315
|
type: 'button', className: 'dsub-mini',
|
|
2527
2316
|
style: { padding: '1px 6px', fontSize: 11 },
|
|
2528
2317
|
onClick: (e) => {
|
|
@@ -2531,9 +2320,9 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2531
2320
|
},
|
|
2532
2321
|
}, 'โ')
|
|
2533
2322
|
),
|
|
2534
|
-
steps.map((st, i) =>
|
|
2535
|
-
info.link ?
|
|
2536
|
-
|
|
2323
|
+
steps.map((st, i) => h('div', { key: i, className: 'dsub-helpStep' }, st)),
|
|
2324
|
+
info.link ? h('div', { style: { marginTop: 8 } },
|
|
2325
|
+
h('a', {
|
|
2537
2326
|
href: info.link,
|
|
2538
2327
|
target: '_blank',
|
|
2539
2328
|
rel: 'noopener noreferrer',
|
|
@@ -2543,8 +2332,8 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2543
2332
|
) : null
|
|
2544
2333
|
);
|
|
2545
2334
|
})() : null),
|
|
2546
|
-
|
|
2547
|
-
|
|
2335
|
+
h('div', { className: 'dsub-row' },
|
|
2336
|
+
h('input', {
|
|
2548
2337
|
className: 'dsub-grow',
|
|
2549
2338
|
value: row.slot.proxyUrl || '',
|
|
2550
2339
|
placeholder: t('proxyPlaceholder'),
|
|
@@ -2554,7 +2343,7 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2554
2343
|
setSlots(next)
|
|
2555
2344
|
},
|
|
2556
2345
|
}),
|
|
2557
|
-
|
|
2346
|
+
h('button', {
|
|
2558
2347
|
type: 'button', className: 'dsub-mini',
|
|
2559
2348
|
disabled: checking['proxy:' + key],
|
|
2560
2349
|
onClick: () => doProxyCheck(row.slot.provider, row.slot.index).catch((e) => setErr(cleanErrorMessage(e.message || e))),
|
|
@@ -2564,7 +2353,7 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2564
2353
|
var r = proxyRes[key]
|
|
2565
2354
|
if (!r) return null
|
|
2566
2355
|
var txt = r.ok ? (t('proxyOk') + ' ' + r.latencyMs + 'ms' + (r.viaProxy ? '' : ' (direct)')) : (t('proxyFail') + ': ' + ((r.error && r.error.message) || ''))
|
|
2567
|
-
return
|
|
2356
|
+
return h('div', { className: r.ok ? 'dsub-ok' : 'dsub-bad' }, txt)
|
|
2568
2357
|
})(),
|
|
2569
2358
|
),
|
|
2570
2359
|
(function devicePanel(){
|
|
@@ -2572,18 +2361,18 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2572
2361
|
if (!d) return null
|
|
2573
2362
|
var txt = d.status === 'authorized' ? t('deviceAuthorized') : (d.status === 'expired' ? t('deviceExpired') : t('devicePending'))
|
|
2574
2363
|
var cls = d.status === 'authorized' ? 'dsub-ok' : (d.status === 'expired' ? 'dsub-bad' : 'dsub-verify')
|
|
2575
|
-
return
|
|
2576
|
-
|
|
2577
|
-
d.status === 'pending' ?
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2364
|
+
return h('div', { className: 'dsub-verify' },
|
|
2365
|
+
h('div', { className: cls }, txt),
|
|
2366
|
+
d.status === 'pending' ? h(React.Fragment, null,
|
|
2367
|
+
h('div', { style: { fontSize: '2em', fontWeight: 700, letterSpacing: '0.15em', margin: '4px 0' } }, d.userCode),
|
|
2368
|
+
h('div', { className: 'dsub-row' },
|
|
2369
|
+
h('button', {
|
|
2581
2370
|
type: 'button', className: 'dsub-mini',
|
|
2582
2371
|
onClick: () => { try { navigator.clipboard.writeText(d.userCode) } catch { /* clipboard write error */ } },
|
|
2583
2372
|
}, t('deviceCopy')),
|
|
2584
|
-
|
|
2373
|
+
h('a', { href: d.authUrl, target: '_blank', rel: 'noopener noreferrer', className: 'dsub-mini' }, t('verifyLink')),
|
|
2585
2374
|
),
|
|
2586
|
-
|
|
2375
|
+
h('div', { className: 'dsub-sub' }, t('deviceHint')),
|
|
2587
2376
|
) : null,
|
|
2588
2377
|
)
|
|
2589
2378
|
})(),
|
|
@@ -2598,63 +2387,63 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2598
2387
|
return code
|
|
2599
2388
|
}
|
|
2600
2389
|
if (st.phase !== 'confirm') {
|
|
2601
|
-
return
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2390
|
+
return h('div', { className: 'dsub-panel-box' },
|
|
2391
|
+
h('div', { className: 'dsub-panel-title' },
|
|
2392
|
+
h('span', null, 'โก ' + t('resetCredits')),
|
|
2393
|
+
h('button', {
|
|
2605
2394
|
type: 'button',
|
|
2606
2395
|
className: 'dsub-mini',
|
|
2607
2396
|
disabled: st.phase === 'loading',
|
|
2608
2397
|
onClick: () => resetPrepare(row.slot.provider, row.slot.index, key).catch((e) => setErr(String(e && e.message || e))),
|
|
2609
2398
|
}, st.phase === 'loading' ? 'โฆ' : t('resetCreditsAction'))
|
|
2610
2399
|
),
|
|
2611
|
-
|
|
2400
|
+
h('div', { className: 'dsub-panel-desc' }, t('resetCreditsHint'))
|
|
2612
2401
|
)
|
|
2613
2402
|
}
|
|
2614
2403
|
var ready = now >= st.readyAt
|
|
2615
2404
|
var secs = Math.max(0, Math.ceil((st.readyAt - now) / 1000))
|
|
2616
|
-
return
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2405
|
+
return h('div', { className: 'dsub-panel-box dsub-panel-warn' },
|
|
2406
|
+
h('div', { className: 'dsub-panel-title' },
|
|
2407
|
+
h('span', null, 'โ ๏ธ ' + t('resetCredits')),
|
|
2408
|
+
h('span', { className: 'dsub-tag-ok' }, t('resetAvailable') + ': ' + st.availableCount)
|
|
2620
2409
|
),
|
|
2621
|
-
st.creditExpiresAt ?
|
|
2410
|
+
st.creditExpiresAt ? h('div', { className: 'dsub-panel-desc' },
|
|
2622
2411
|
t('resetExpires') + ': ' + new Date(st.creditExpiresAt).toLocaleString()
|
|
2623
2412
|
) : null,
|
|
2624
|
-
|
|
2625
|
-
|
|
2413
|
+
h('label', { className: 'dsub-row', style: { cursor: 'pointer', margin: '4px 0' } },
|
|
2414
|
+
h('input', {
|
|
2626
2415
|
type: 'checkbox',
|
|
2627
2416
|
checked: !!st.ack,
|
|
2628
2417
|
onChange: (e) => setReset((m) => Object.assign({}, m, { [key]: Object.assign({}, st, { ack: e.target.checked }) })),
|
|
2629
2418
|
}),
|
|
2630
|
-
|
|
2419
|
+
h('span', { style: { fontSize: '12px', fontWeight: 500 } }, t('resetAck')),
|
|
2631
2420
|
),
|
|
2632
|
-
|
|
2633
|
-
|
|
2421
|
+
h('div', { className: 'dsub-row', style: { gap: '8px' } },
|
|
2422
|
+
h('button', {
|
|
2634
2423
|
type: 'button',
|
|
2635
2424
|
className: 'dsub-mini dsub-btn-danger',
|
|
2636
2425
|
disabled: !st.ack || !ready || !!st.busy,
|
|
2637
2426
|
onClick: () => resetConsume(key).catch((e) => setErr(String(e && e.message || e))),
|
|
2638
2427
|
}, st.busy ? t('resetBusy') : (ready ? t('resetGo') : (t('resetWait') + ' ' + secs + 's'))),
|
|
2639
|
-
!ready && !st.busy ?
|
|
2640
|
-
st.ack && ready ?
|
|
2641
|
-
|
|
2428
|
+
!ready && !st.busy ? h('span', { className: 'dsub-sub' }, t('resetWait') + ' ' + secs + 's') : null,
|
|
2429
|
+
st.ack && ready ? h('span', { className: 'dsub-ok', style: { fontSize: '12px', fontWeight: 600 } }, 'โ ' + t('resetReady')) : null,
|
|
2430
|
+
h('button', {
|
|
2642
2431
|
type: 'button',
|
|
2643
2432
|
className: 'dsub-mini',
|
|
2644
2433
|
style: { marginLeft: 'auto' },
|
|
2645
2434
|
onClick: () => setReset((m) => Object.assign({}, m, { [key]: { phase: 'idle' } })),
|
|
2646
2435
|
}, t('cancel'))
|
|
2647
2436
|
),
|
|
2648
|
-
st.result ?
|
|
2649
|
-
st.error ?
|
|
2437
|
+
st.result ? h('div', { className: 'dsub-ok', style: { fontWeight: 600 } }, resultText(st.result)) : null,
|
|
2438
|
+
st.error ? h('div', { className: 'dsub-bad' }, st.error) : null,
|
|
2650
2439
|
)
|
|
2651
2440
|
})() : null),
|
|
2652
|
-
account.accountNotice ?
|
|
2653
|
-
account.refreshError ?
|
|
2654
|
-
(function(){ var r=checkRes[key]; if(!r) return null; var txt=r.ok ? ('ok ' + (r.email||'')) : ('fail ' + (r.error && r.error.message || '')); var cls=r.ok ? 'dsub-ok' : 'dsub-bad'; var q=r.quota; if(q && q.remaining!=null) txt += ' quota:'+q.remaining+(q.limit!=null?'/'+q.limit:''); return
|
|
2655
|
-
account.validationUrl ?
|
|
2441
|
+
account.accountNotice ? h('div', { className: 'dsub-verify' }, account.accountNotice) : null,
|
|
2442
|
+
account.refreshError ? h('div', { className: 'dsub-bad' }, t('reconnectRequired') + ': ' + account.refreshError) : null,
|
|
2443
|
+
(function(){ var r=checkRes[key]; if(!r) return null; var txt=r.ok ? ('ok ' + (r.email||'')) : ('fail ' + (r.error && r.error.message || '')); var cls=r.ok ? 'dsub-ok' : 'dsub-bad'; var q=r.quota; if(q && q.remaining!=null) txt += ' quota:'+q.remaining+(q.limit!=null?'/'+q.limit:''); return h('div', {className: cls}, txt) })(),
|
|
2444
|
+
account.validationUrl ? h('div', { className: 'dsub-verify' },
|
|
2656
2445
|
t('verifyPrefix'),
|
|
2657
|
-
|
|
2446
|
+
h('a', { href: account.validationUrl, target: '_blank', rel: 'noopener noreferrer' }, t('verifyLink')),
|
|
2658
2447
|
t('verifySuffix'),
|
|
2659
2448
|
) : null,
|
|
2660
2449
|
(function usageLimitsBlock(){
|
|
@@ -2680,18 +2469,18 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2680
2469
|
var p = Math.min(100, Math.max(0, Math.round(pct)))
|
|
2681
2470
|
var tagCls = p >= 90 ? 'dsub-tag-bad' : (p >= 70 ? 'dsub-tag-warn' : 'dsub-tag-ok')
|
|
2682
2471
|
var fillBg = p >= 90 ? 'var(--dsw-alias-state-error-primary)' : (p >= 70 ? 'var(--dsw-alias-state-warn-primary)' : 'var(--dsw-alias-state-success-primary)')
|
|
2683
|
-
return
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2472
|
+
return h('div', { key: label, className: 'dsub-usage-card' },
|
|
2473
|
+
h('div', { className: 'dsub-usage-head' },
|
|
2474
|
+
h('span', null, label),
|
|
2475
|
+
h('span', { className: tagCls }, p + '%')
|
|
2687
2476
|
),
|
|
2688
|
-
|
|
2689
|
-
|
|
2477
|
+
h('div', { className: 'dsub-usage-track' },
|
|
2478
|
+
h('div', {
|
|
2690
2479
|
className: 'dsub-usage-fill',
|
|
2691
2480
|
style: { width: p + '%', background: fillBg }
|
|
2692
2481
|
})
|
|
2693
2482
|
),
|
|
2694
|
-
detail ?
|
|
2483
|
+
detail ? h('div', { className: 'dsub-usage-meta' }, detail) : null
|
|
2695
2484
|
)
|
|
2696
2485
|
}
|
|
2697
2486
|
|
|
@@ -2703,18 +2492,18 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2703
2492
|
if (idx === 0 && account.requests && w.usedPercent < 100) {
|
|
2704
2493
|
var rem = 100 - w.usedPercent
|
|
2705
2494
|
var est = Math.floor(rem / (w.usedPercent / account.requests))
|
|
2706
|
-
if (est > 0) extra =
|
|
2495
|
+
if (est > 0) extra = h('span', null, t('forecast') + ' ' + est)
|
|
2707
2496
|
}
|
|
2708
|
-
var resetElem = w.resetAt ?
|
|
2497
|
+
var resetElem = w.resetAt ? h(ResetCountdown, { key: 'reset-' + idx, resetAt: w.resetAt }) : null
|
|
2709
2498
|
var extraContent = (resetElem && extra)
|
|
2710
|
-
?
|
|
2499
|
+
? h('span', { className: 'dsub-row', style: { gap: '6px' } }, resetElem, extra)
|
|
2711
2500
|
: (resetElem || extra)
|
|
2712
2501
|
items.push(renderItem(windowLabel(w), w.usedPercent, extraContent))
|
|
2713
2502
|
}
|
|
2714
2503
|
})
|
|
2715
2504
|
}
|
|
2716
2505
|
if (hasQuota) {
|
|
2717
|
-
items.push(renderItem(t('quota'), q.usedPercent, q.resetAt ?
|
|
2506
|
+
items.push(renderItem(t('quota'), q.usedPercent, q.resetAt ? h(ResetCountdown, { key: 'reset', resetAt: q.resetAt }) : null))
|
|
2718
2507
|
} else if (hasUsagePct) {
|
|
2719
2508
|
items.push(renderItem(t('quota'), account.usagePercent, null))
|
|
2720
2509
|
}
|
|
@@ -2726,17 +2515,17 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2726
2515
|
if (m >= 1) agoStr = m + 'm ' + (t('close') === 'ๅ
ณ้ญ' ? 'ๅ' : 'ago')
|
|
2727
2516
|
}
|
|
2728
2517
|
|
|
2729
|
-
return
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
agoStr ?
|
|
2518
|
+
return h('div', { className: 'dsub-panel-box' },
|
|
2519
|
+
h('div', { className: 'dsub-panel-title' },
|
|
2520
|
+
h('span', null, '๐ ' + t('usageLimitsTitle')),
|
|
2521
|
+
agoStr ? h('span', { className: 'dsub-sub' }, agoStr) : null
|
|
2733
2522
|
),
|
|
2734
|
-
|
|
2523
|
+
h('div', { className: 'dsub-usage-grid' }, items)
|
|
2735
2524
|
)
|
|
2736
2525
|
})(),
|
|
2737
|
-
((account.paidTierName || account.ref || (telemetry && telemetry.accounts && telemetry.accounts[account.ref])) ?
|
|
2738
|
-
account.paidTierName ?
|
|
2739
|
-
|
|
2526
|
+
((account.paidTierName || account.ref || (telemetry && telemetry.accounts && telemetry.accounts[account.ref])) ? h('div', { className: 'dsub-slot-meta-row' },
|
|
2527
|
+
account.paidTierName ? h('span', { className: 'dsub-sub' },
|
|
2528
|
+
h('strong', null, t('plan') + ': '),
|
|
2740
2529
|
account.paidTierName
|
|
2741
2530
|
) : null,
|
|
2742
2531
|
(function(){
|
|
@@ -2748,31 +2537,31 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2748
2537
|
if (accTelem.avgTps != null) parts.push(accTelem.avgTps + ' t/s')
|
|
2749
2538
|
else if (accTelem.lastTps != null) parts.push(accTelem.lastTps + ' t/s')
|
|
2750
2539
|
if (parts.length === 0) return null
|
|
2751
|
-
return
|
|
2540
|
+
return h('span', { className: 'dsub-speed-tag', title: t('speedMetricsHint') },
|
|
2752
2541
|
'โก ' + parts.join(' ยท ')
|
|
2753
2542
|
)
|
|
2754
2543
|
})(),
|
|
2755
|
-
account.ref ?
|
|
2756
|
-
|
|
2757
|
-
|
|
2544
|
+
account.ref ? h('span', { className: 'dsub-ref-tag' },
|
|
2545
|
+
h('span', null, t('storedAs')),
|
|
2546
|
+
h('code', null, account.ref)
|
|
2758
2547
|
) : null
|
|
2759
2548
|
) : null),
|
|
2760
2549
|
)
|
|
2761
2550
|
}),
|
|
2762
|
-
|
|
2551
|
+
h('button', {
|
|
2763
2552
|
type: 'button', className: 'dsub-mini',
|
|
2764
2553
|
onClick: () => addSlot(prov.id),
|
|
2765
2554
|
}, t('addAccount')),
|
|
2766
2555
|
)
|
|
2767
2556
|
}),
|
|
2768
|
-
|
|
2769
|
-
|
|
2557
|
+
h('div', { className: 'dsub-foot' },
|
|
2558
|
+
h('button', {
|
|
2770
2559
|
type: 'button', className: 'dsub-save',
|
|
2771
2560
|
onClick: () => save().catch((e) => setErr(cleanErrorMessage(e.message || e))),
|
|
2772
2561
|
}, t('save')),
|
|
2773
|
-
saved ?
|
|
2774
|
-
info ?
|
|
2775
|
-
err ?
|
|
2562
|
+
saved ? h('span', { className: 'dsub-ok' }, t('saved')) : null,
|
|
2563
|
+
info ? h('span', { className: 'dsub-ok' }, info) : null,
|
|
2564
|
+
err ? h('span', { className: 'dsub-bad' }, err) : null,
|
|
2776
2565
|
),
|
|
2777
2566
|
)
|
|
2778
2567
|
}
|
|
@@ -2786,29 +2575,29 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2786
2575
|
// Row seat (plugins.row.config): the host page draws title/icon/crumb and the
|
|
2787
2576
|
// padding, so the summary is a one-liner and the page drops our card chrome.
|
|
2788
2577
|
if (props && props.view === 'summary') {
|
|
2789
|
-
return
|
|
2578
|
+
return h('div', { className: 'dsub-description' }, cardT('cardIntro'))
|
|
2790
2579
|
}
|
|
2791
2580
|
// Check host snapshot status (#408, #459): loading, unavailable, or error
|
|
2792
2581
|
if (props && props.status === 'loading') {
|
|
2793
|
-
return
|
|
2582
|
+
return h(page ? 'div' : 'li', {
|
|
2794
2583
|
className: page ? 'dsub-page' : 'dsub-card',
|
|
2795
2584
|
},
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2585
|
+
h('div', { className: 'dsub-header', style: { cursor: 'default' } },
|
|
2586
|
+
h('div', { className: 'dsub-headText' },
|
|
2587
|
+
h('div', { className: 'dsub-name' }, cardT('title')),
|
|
2588
|
+
h('div', { className: 'dsub-description' }, cardT('loading') || cardT('settingsLoading') || 'Loadingโฆ'),
|
|
2800
2589
|
),
|
|
2801
2590
|
)
|
|
2802
2591
|
)
|
|
2803
2592
|
}
|
|
2804
2593
|
if (props && props.status === 'unavailable') {
|
|
2805
|
-
return
|
|
2594
|
+
return h(page ? 'div' : 'li', {
|
|
2806
2595
|
className: page ? 'dsub-page' : 'dsub-card',
|
|
2807
2596
|
},
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2597
|
+
h('div', { className: 'dsub-header', style: { cursor: 'default' } },
|
|
2598
|
+
h('div', { className: 'dsub-headText' },
|
|
2599
|
+
h('div', { className: 'dsub-name' }, cardT('title')),
|
|
2600
|
+
h('div', { className: 'dsub-description', style: { color: 'var(--dsw-alias-state-warn-primary)' } },
|
|
2812
2601
|
cardT('unavailable') || cardT('settingsUnavailable') || 'Settings are unavailable',
|
|
2813
2602
|
),
|
|
2814
2603
|
),
|
|
@@ -2816,37 +2605,37 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
2816
2605
|
)
|
|
2817
2606
|
}
|
|
2818
2607
|
if (props && props.status === 'error') {
|
|
2819
|
-
return
|
|
2608
|
+
return h(page ? 'div' : 'li', {
|
|
2820
2609
|
className: page ? 'dsub-page' : 'dsub-card',
|
|
2821
2610
|
},
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2611
|
+
h('div', { className: 'dsub-header', style: { cursor: 'default' } },
|
|
2612
|
+
h('div', { className: 'dsub-headText' },
|
|
2613
|
+
h('div', { className: 'dsub-name' }, cardT('title')),
|
|
2614
|
+
h('div', { className: 'dsub-description', style: { color: 'var(--dsw-alias-state-error-primary)' } },
|
|
2826
2615
|
(props.error && (props.error.message || String(props.error))) || cardT('error') || cardT('settingsError') || 'Settings error',
|
|
2827
2616
|
),
|
|
2828
2617
|
),
|
|
2829
2618
|
)
|
|
2830
2619
|
)
|
|
2831
2620
|
}
|
|
2832
|
-
return
|
|
2621
|
+
return h(page ? 'div' : 'li', {
|
|
2833
2622
|
className: page ? 'dsub-page' : 'dsub-card' + (open ? ' dsub-cardOpen' : ''),
|
|
2834
2623
|
},
|
|
2835
|
-
|
|
2624
|
+
h('button', {
|
|
2836
2625
|
type: 'button',
|
|
2837
2626
|
className: 'dsub-header',
|
|
2838
2627
|
style: page ? { display: 'none' } : undefined,
|
|
2839
2628
|
onClick: () => setOpen(!open),
|
|
2840
2629
|
'aria-expanded': page ? true : open,
|
|
2841
2630
|
},
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2631
|
+
h('div', { className: 'dsub-headText' },
|
|
2632
|
+
h('div', { className: 'dsub-name' }, cardT('title')),
|
|
2633
|
+
h('div', { className: 'dsub-description' }, cardT('cardIntro')),
|
|
2845
2634
|
),
|
|
2846
|
-
|
|
2635
|
+
h(Chevron, { className: 'dsub-chev' + (open ? ' dsub-chevOpen' : '') }),
|
|
2847
2636
|
),
|
|
2848
|
-
(page || open) ?
|
|
2849
|
-
|
|
2637
|
+
(page || open) ? h('div', { className: 'dsub-body' },
|
|
2638
|
+
h(ErrorBoundary, null, h(SubsSection, props)),
|
|
2850
2639
|
) : null,
|
|
2851
2640
|
)
|
|
2852
2641
|
}
|
|
@@ -3024,21 +2813,21 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
3024
2813
|
const cls = state.remaining <= 10 ? ' dsub-cqBarFull' : (state.remaining <= 30 ? ' dsub-cqBarWarn' : '')
|
|
3025
2814
|
var value = null
|
|
3026
2815
|
if (state.mode === 'percent') {
|
|
3027
|
-
value =
|
|
2816
|
+
value = h('span', { className: 'dsub-cqB' }, Math.round(state.remaining) + '%')
|
|
3028
2817
|
} else if (state.mode === 'bar') {
|
|
3029
|
-
value =
|
|
3030
|
-
|
|
2818
|
+
value = h('span', { className: 'dsub-cqBar' + cls },
|
|
2819
|
+
h('span', { className: 'dsub-cqBarFill', style: { width: Math.min(100, Math.max(0, state.remaining)) + '%' } }))
|
|
3031
2820
|
} else if (state.mode === 'forecast') {
|
|
3032
2821
|
var est = state.est
|
|
3033
|
-
if (!est || est.status === 'calibrating') value =
|
|
3034
|
-
else if (est.status === 'idle') value =
|
|
2822
|
+
if (!est || est.status === 'calibrating') value = h('span', { className: 'dsub-cqB' }, t('fcCalibrating'))
|
|
2823
|
+
else if (est.status === 'idle') value = h('span', { className: 'dsub-cqB' }, t('fcIdle'))
|
|
3035
2824
|
else {
|
|
3036
2825
|
var secs = est.runwaySeconds || 0
|
|
3037
2826
|
var txt = secs >= 3600 ? ('~' + (Math.round((secs / 3600) * 10) / 10) + t('fcHours')) : ('~' + Math.max(1, Math.round(secs / 60)) + t('fcMinutes'))
|
|
3038
|
-
value =
|
|
2827
|
+
value = h('span', { className: 'dsub-cqB' }, txt)
|
|
3039
2828
|
}
|
|
3040
2829
|
} else return null
|
|
3041
|
-
return
|
|
2830
|
+
return h('span', { className: 'dsub-cq', title: t('forecast') + ' ยท ' + state.active.provider }, value)
|
|
3042
2831
|
}
|
|
3043
2832
|
|
|
3044
2833
|
// #83: SUBS(N) pill in the session header with a pool health LED and
|
|
@@ -3255,23 +3044,23 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
3255
3044
|
const primPct = primaryWin && primaryWin.usedPercent != null ? Math.round(primaryWin.usedPercent) : (a.usagePercent != null ? Math.round(a.usagePercent) : 0)
|
|
3256
3045
|
const secPct = secWin && secWin.usedPercent != null ? Math.round(secWin.usedPercent) : null
|
|
3257
3046
|
|
|
3258
|
-
return
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
a.fastMode ?
|
|
3047
|
+
return h('div', { className: 'dsub-heroCard' },
|
|
3048
|
+
h('div', { className: 'dsub-heroHead' },
|
|
3049
|
+
h('div', { className: 'dsub-heroTitle' },
|
|
3050
|
+
h('span', { className: 'dsub-brandBadge ' + b.cls, style: { width: 24, height: 24, fontSize: 11 } }, b.icon),
|
|
3051
|
+
h('span', null, (a.provider ? a.provider.toUpperCase() : 'LLM') + (a.index ? ' #' + a.index : '')),
|
|
3052
|
+
a.fastMode ? h('span', { className: 'dsub-pillTag', style: { background: 'color-mix(in srgb,var(--dsw-alias-state-warn-primary) 15%,transparent)', color: 'var(--dsw-alias-state-warn-primary)' } }, 'โก FAST 1.5x') : null,
|
|
3264
3053
|
),
|
|
3265
|
-
|
|
3054
|
+
h('span', { className: 'dsub-heroModel' }, a.model || 'active model'),
|
|
3266
3055
|
),
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3056
|
+
h('div', { className: 'dsub-heroBars' },
|
|
3057
|
+
h('div', null,
|
|
3058
|
+
h('div', { className: 'dsub-barLabelRow' },
|
|
3059
|
+
h('span', { style: { fontWeight: 600 } }, ((primaryWin && primaryWin.label) ? primaryWin.label + ' window' : t('subs5hWindow')) + (primaryWin && primaryWin.resetAt ? ' (' + formatRelativeReset(primaryWin.resetAt, t('lang'), now) + ')' : '')),
|
|
3060
|
+
h('span', { style: { fontVariantNumeric: 'tabular-nums', fontWeight: 600 } }, primPct + '% ' + t('subsUsed') + ' (' + (100 - primPct) + '% ' + t('subsFree') + ')'),
|
|
3272
3061
|
),
|
|
3273
|
-
|
|
3274
|
-
|
|
3062
|
+
h('div', { className: 'dsub-barTrack' },
|
|
3063
|
+
h('div', {
|
|
3275
3064
|
className: 'dsub-barFillGrad',
|
|
3276
3065
|
style: {
|
|
3277
3066
|
width: Math.min(100, Math.max(0, primPct)) + '%',
|
|
@@ -3280,13 +3069,13 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
3280
3069
|
}),
|
|
3281
3070
|
),
|
|
3282
3071
|
),
|
|
3283
|
-
secWin ?
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3072
|
+
secWin ? h('div', null,
|
|
3073
|
+
h('div', { className: 'dsub-barLabelRow' },
|
|
3074
|
+
h('span', null, ((secWin.label || '7d') + ' window') + (secWin && secWin.resetAt ? ' (' + formatRelativeReset(secWin.resetAt, t('lang'), now) + ')' : '')),
|
|
3075
|
+
h('span', { style: { fontVariantNumeric: 'tabular-nums' } }, secPct + '%'),
|
|
3287
3076
|
),
|
|
3288
|
-
|
|
3289
|
-
|
|
3077
|
+
h('div', { className: 'dsub-barTrack' },
|
|
3078
|
+
h('div', {
|
|
3290
3079
|
className: 'dsub-barFillGrad',
|
|
3291
3080
|
style: {
|
|
3292
3081
|
width: Math.min(100, Math.max(0, secPct)) + '%',
|
|
@@ -3345,19 +3134,19 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
3345
3134
|
else { statusClass = 'dsub-statusOk'; statusText = (pct != null ? pct + '% ยท ' : '') + t('subsLogged') }
|
|
3346
3135
|
}
|
|
3347
3136
|
|
|
3348
|
-
return
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
isActiveThis ?
|
|
3355
|
-
a.proxy ?
|
|
3137
|
+
return h('div', { className: 'dsub-accountCard', key: i },
|
|
3138
|
+
h('div', { className: 'dsub-brandBadge ' + b.cls }, b.icon),
|
|
3139
|
+
h('div', { className: 'dsub-accInfo' },
|
|
3140
|
+
h('div', { className: 'dsub-accNameRow' },
|
|
3141
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: 6 } },
|
|
3142
|
+
h('span', { className: 'dsub-accName' }, a.provider.toUpperCase() + (a.index ? ' #' + a.index : '')),
|
|
3143
|
+
isActiveThis ? h('span', { className: 'dsub-pillTag', style: { background: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 15%,transparent)', color: 'var(--dsw-alias-state-success-primary)' } }, 'ACTIVE') : null,
|
|
3144
|
+
a.proxy ? h('span', { className: 'dsub-dim', title: a.proxy }, '๐ proxy') : null,
|
|
3356
3145
|
),
|
|
3357
|
-
|
|
3146
|
+
h('span', { className: 'dsub-accStatusTag ' + statusClass, role: 'status', 'aria-live': 'polite' }, statusText),
|
|
3358
3147
|
),
|
|
3359
|
-
(isLogged && pct != null) ?
|
|
3360
|
-
|
|
3148
|
+
(isLogged && pct != null) ? h('div', { className: 'dsub-barTrack', style: { marginTop: 4, height: 4 } },
|
|
3149
|
+
h('div', {
|
|
3361
3150
|
className: 'dsub-barFillGrad',
|
|
3362
3151
|
style: {
|
|
3363
3152
|
width: Math.min(100, Math.max(0, pct)) + '%',
|
|
@@ -3369,49 +3158,49 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
3369
3158
|
)
|
|
3370
3159
|
})
|
|
3371
3160
|
|
|
3372
|
-
return
|
|
3373
|
-
toasts.length > 0 ?
|
|
3374
|
-
toasts.map((toast) =>
|
|
3375
|
-
|
|
3376
|
-
|
|
3161
|
+
return h(React.Fragment, null,
|
|
3162
|
+
toasts.length > 0 ? h('div', { className: 'dsub-toast-container' },
|
|
3163
|
+
toasts.map((toast) => h('div', { className: 'dsub-toast ' + toast.cls, key: toast.id },
|
|
3164
|
+
h('span', null, toast.message),
|
|
3165
|
+
h('button', {
|
|
3377
3166
|
type: 'button',
|
|
3378
3167
|
className: 'dsub-toast-close',
|
|
3379
3168
|
onClick: () => dismissToast(toast.id),
|
|
3380
3169
|
}, "\u00d7"),
|
|
3381
3170
|
))
|
|
3382
3171
|
) : null,
|
|
3383
|
-
|
|
3172
|
+
h('button', {
|
|
3384
3173
|
type: 'button',
|
|
3385
3174
|
className: 'dsub-pill',
|
|
3386
3175
|
'aria-expanded': state.open ? 'true' : 'false',
|
|
3387
3176
|
title: t('subsPill') + ': ' + (n > 0 ? (n + ' ' + t('connected')) : t('notConnected')),
|
|
3388
3177
|
onClick: () => setState((s) => Object.assign({}, s, { open: !s.open })),
|
|
3389
3178
|
},
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3179
|
+
h('span', { className: 'dsub-led ' + led }),
|
|
3180
|
+
h('span', null, pillText),
|
|
3181
|
+
h('span', { style: { fontSize: 9, opacity: 0.6, marginLeft: 2 } }, 'โผ'),
|
|
3393
3182
|
),
|
|
3394
|
-
state.open ?
|
|
3183
|
+
state.open ? h('div', {
|
|
3395
3184
|
className: 'dsub-modalWrap',
|
|
3396
3185
|
onClick: (e) => { if (e.target === e.currentTarget) setState((s) => Object.assign({}, s, { open: false })) },
|
|
3397
3186
|
},
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3187
|
+
h('div', { className: 'dsub-modal', role: 'dialog', 'aria-modal': 'true', 'aria-label': t('subsModalTitle') },
|
|
3188
|
+
h('div', { className: 'dsub-modalHead' },
|
|
3189
|
+
h('div', { className: 'dsub-modalTitleWrap' },
|
|
3190
|
+
h('div', { className: 'dsub-modalIcon' }, 'โก'),
|
|
3191
|
+
h('div', null,
|
|
3192
|
+
h('div', { style: { fontWeight: 700, fontSize: 15 } }, t('subsModalTitle')),
|
|
3193
|
+
h('div', { className: 'dsub-dim' }, n + ' of ' + total + ' ' + t('connected')),
|
|
3405
3194
|
),
|
|
3406
3195
|
),
|
|
3407
|
-
|
|
3408
|
-
|
|
3196
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: 6 } },
|
|
3197
|
+
h('button', {
|
|
3409
3198
|
type: 'button',
|
|
3410
3199
|
className: 'dsub-mini',
|
|
3411
3200
|
title: t('subsRefresh'),
|
|
3412
3201
|
onClick: () => pull(),
|
|
3413
3202
|
}, state.loading ? 'โฆ' : '๐'),
|
|
3414
|
-
|
|
3203
|
+
h('button', {
|
|
3415
3204
|
type: 'button',
|
|
3416
3205
|
className: 'dsub-mini',
|
|
3417
3206
|
autoFocus: true,
|
|
@@ -3421,11 +3210,11 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
3421
3210
|
),
|
|
3422
3211
|
),
|
|
3423
3212
|
renderActiveHero(),
|
|
3424
|
-
|
|
3425
|
-
rows.length ? rows :
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3213
|
+
h('div', { className: 'dsub-poolTitle' }, t('subsPoolTitle')),
|
|
3214
|
+
rows.length ? rows : h('div', { className: 'dsub-sub', style: { padding: '12px 0' } }, t('subsNotLogged')),
|
|
3215
|
+
h('div', { className: 'dsub-modalFoot' },
|
|
3216
|
+
h('span', { className: 'dsub-dim' }, 'DSH Subscriptions'),
|
|
3217
|
+
h('a', {
|
|
3429
3218
|
className: 'dsub-btnSec',
|
|
3430
3219
|
href: '#',
|
|
3431
3220
|
onClick: (e) => {
|
|
@@ -3466,7 +3255,7 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
3466
3255
|
order: 15,
|
|
3467
3256
|
locale: NS,
|
|
3468
3257
|
},
|
|
3469
|
-
() =>
|
|
3258
|
+
() => h(ErrorBoundary, null, h(SubsPill, { t, ctx })),
|
|
3470
3259
|
),
|
|
3471
3260
|
)
|
|
3472
3261
|
}, 'dsh-subscriptions: subs pill')
|
|
@@ -3482,7 +3271,7 @@ const cssId = 'dsh-subscriptions/settings.module.css'
|
|
|
3482
3271
|
order: 5,
|
|
3483
3272
|
locale: NS,
|
|
3484
3273
|
},
|
|
3485
|
-
() =>
|
|
3274
|
+
() => h(ErrorBoundary, null, h(ComposerQuota, { t })),
|
|
3486
3275
|
),
|
|
3487
3276
|
)
|
|
3488
3277
|
}, 'dsh-subscriptions: composer quota')
|