dsh-agy-link 0.4.5 → 0.4.9
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/CHANGELOG.md +25 -0
- package/README.md +141 -150
- package/dist/client.js +843 -444
- package/dist/index.js +385 -181
- package/docs/spec-account-pool.md +1 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -4,6 +4,33 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
//#region src/client/brand-icons.ts
|
|
8
|
+
const BRAND_PATHS = {
|
|
9
|
+
gemini: "M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81",
|
|
10
|
+
claude: "m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",
|
|
11
|
+
openai: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"
|
|
12
|
+
};
|
|
13
|
+
const BRAND_COLORS = {
|
|
14
|
+
gemini: "#8E75B2",
|
|
15
|
+
claude: "#D97757",
|
|
16
|
+
openai: "#10a37f"
|
|
17
|
+
};
|
|
18
|
+
const UI_PATHS = {
|
|
19
|
+
trash: "M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6",
|
|
20
|
+
plus: "M12 5v14M5 12h14",
|
|
21
|
+
refresh: "M21.5 2v6h-6M2.5 22v-6h6M2.5 11.5a10 10 0 0 1 17.5-4.5l1.5 2M21.5 12.5a10 10 0 0 1-17.5 4.5l-1.5-2",
|
|
22
|
+
star: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",
|
|
23
|
+
mail: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2zM22 6l-10 7L2 6",
|
|
24
|
+
globe: "M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z",
|
|
25
|
+
zap: "M13 2L3 14h9l-1 8 10-12h-9l1-8z",
|
|
26
|
+
chevronDown: "M6 9l6 6 6-6",
|
|
27
|
+
chevronUp: "M18 15l-6-6-6 6",
|
|
28
|
+
check: "M20 6L9 17l-5-5",
|
|
29
|
+
x: "M18 6L6 18M6 6l12 12",
|
|
30
|
+
externalLink: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3",
|
|
31
|
+
alert: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM12 9v4M12 17h.01"
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
7
34
|
//#region src/client/index.ts
|
|
8
35
|
const { createElement: h, useState, useEffect, useRef } = require("react");
|
|
9
36
|
const reactDom = require("react-dom");
|
|
@@ -60,52 +87,362 @@ window.__ModuleLoader__.load({
|
|
|
60
87
|
};
|
|
61
88
|
}
|
|
62
89
|
};
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
countdownText: "",
|
|
69
|
-
isWeeklyLockout: false
|
|
70
|
-
};
|
|
90
|
+
/**
|
|
91
|
+
* Format reset timestamp into readable date/time + relative countdown.
|
|
92
|
+
*/
|
|
93
|
+
function formatQuotaWindow(resetTimeStr) {
|
|
94
|
+
if (!resetTimeStr) return { resetText: "" };
|
|
71
95
|
try {
|
|
72
96
|
const d = new Date(resetTimeStr);
|
|
73
97
|
const diffMs = d.getTime() - Date.now();
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
else countdown = `${mins}分钟后`;
|
|
85
|
-
} else countdown = "即将重置";
|
|
86
|
-
let resetText = "";
|
|
87
|
-
if (isWeekly) resetText = `${(d.getMonth() + 1).toString().padStart(2, "0")}/${d.getDate().toString().padStart(2, "0")} ${timeStr} (${countdown})`;
|
|
88
|
-
else resetText = `${timeStr} (${countdown})`;
|
|
89
|
-
return {
|
|
90
|
-
windowType,
|
|
91
|
-
resetText,
|
|
92
|
-
countdownText: countdown,
|
|
93
|
-
isWeeklyLockout: isWeekly && (remainingFraction ?? 1) <= .05
|
|
94
|
-
};
|
|
98
|
+
if (diffMs <= 0) return { resetText: "" };
|
|
99
|
+
const totalMins = Math.ceil(diffMs / 6e4);
|
|
100
|
+
const days = Math.floor(totalMins / 1440);
|
|
101
|
+
const hours = Math.floor(totalMins % 1440 / 60);
|
|
102
|
+
const mins = totalMins % 60;
|
|
103
|
+
const isWeekly = days >= 1;
|
|
104
|
+
const countdown = days > 0 ? `${days}d${hours}h` : hours > 0 ? `${hours}h${mins}m` : `${mins}m`;
|
|
105
|
+
const hh = d.getHours().toString().padStart(2, "0");
|
|
106
|
+
const mm = d.getMinutes().toString().padStart(2, "0");
|
|
107
|
+
return { resetText: isWeekly ? `${d.getMonth() + 1}/${d.getDate()} ${hh}:${mm} (${countdown})` : `${hh}:${mm} (${countdown})` };
|
|
95
108
|
} catch {
|
|
96
|
-
return {
|
|
97
|
-
windowType: "5小时额度",
|
|
98
|
-
resetText: "",
|
|
99
|
-
countdownText: "",
|
|
100
|
-
isWeeklyLockout: false
|
|
101
|
-
};
|
|
109
|
+
return { resetText: "" };
|
|
102
110
|
}
|
|
103
111
|
}
|
|
112
|
+
/** Inline brand logo (Gemini / Claude / OpenAI) as a crisp SVG mark. */
|
|
113
|
+
function brandIcon(key, size = 13) {
|
|
114
|
+
return h("svg", {
|
|
115
|
+
viewBox: "0 0 24 24",
|
|
116
|
+
width: size,
|
|
117
|
+
height: size,
|
|
118
|
+
"aria-hidden": true,
|
|
119
|
+
style: {
|
|
120
|
+
display: "inline-block",
|
|
121
|
+
verticalAlign: "-2px",
|
|
122
|
+
flexShrink: 0
|
|
123
|
+
}
|
|
124
|
+
}, h("path", {
|
|
125
|
+
d: BRAND_PATHS[key],
|
|
126
|
+
fill: BRAND_COLORS[key]
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
/** Clean outline/filled SVG icon (Lucide-style), zero emoji dependency. */
|
|
130
|
+
function uiIcon(key, size = 12, color = "currentColor") {
|
|
131
|
+
const p = UI_PATHS[key];
|
|
132
|
+
const isFilled = key === "star";
|
|
133
|
+
return h("svg", {
|
|
134
|
+
viewBox: "0 0 24 24",
|
|
135
|
+
width: size,
|
|
136
|
+
height: size,
|
|
137
|
+
"aria-hidden": true,
|
|
138
|
+
style: {
|
|
139
|
+
display: "inline-block",
|
|
140
|
+
verticalAlign: "-1.5px",
|
|
141
|
+
flexShrink: 0
|
|
142
|
+
}
|
|
143
|
+
}, h("path", {
|
|
144
|
+
d: p,
|
|
145
|
+
fill: isFilled ? color : "none",
|
|
146
|
+
stroke: isFilled ? "none" : color,
|
|
147
|
+
"stroke-width": isFilled ? void 0 : 2,
|
|
148
|
+
"stroke-linecap": isFilled ? void 0 : "round",
|
|
149
|
+
"stroke-linejoin": isFilled ? void 0 : "round"
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
const FAMILY_BRAND = {
|
|
153
|
+
google: "gemini",
|
|
154
|
+
anthropic: "claude",
|
|
155
|
+
openai: "openai"
|
|
156
|
+
};
|
|
157
|
+
let agyIconSeq = 0;
|
|
158
|
+
/** Antigravity mark: gradient orb with an orbit ring (product has no public simple-icon). */
|
|
159
|
+
function agyIcon(size = 14) {
|
|
160
|
+
const gid = `agy-g${++agyIconSeq}`;
|
|
161
|
+
return h("svg", {
|
|
162
|
+
viewBox: "0 0 24 24",
|
|
163
|
+
width: size,
|
|
164
|
+
height: size,
|
|
165
|
+
"aria-hidden": true,
|
|
166
|
+
style: {
|
|
167
|
+
display: "inline-block",
|
|
168
|
+
verticalAlign: "-2px",
|
|
169
|
+
flexShrink: 0
|
|
170
|
+
}
|
|
171
|
+
}, h("defs", null, h("linearGradient", {
|
|
172
|
+
id: gid,
|
|
173
|
+
x1: "0",
|
|
174
|
+
y1: "0",
|
|
175
|
+
x2: "1",
|
|
176
|
+
y2: "1"
|
|
177
|
+
}, h("stop", {
|
|
178
|
+
offset: "0",
|
|
179
|
+
"stop-color": "#4C8DFF"
|
|
180
|
+
}), h("stop", {
|
|
181
|
+
offset: "1",
|
|
182
|
+
"stop-color": "#A96BFF"
|
|
183
|
+
}))), h("circle", {
|
|
184
|
+
cx: 12,
|
|
185
|
+
cy: 12,
|
|
186
|
+
r: 6,
|
|
187
|
+
fill: `url(#${gid})`
|
|
188
|
+
}), h("ellipse", {
|
|
189
|
+
cx: 12,
|
|
190
|
+
cy: 12,
|
|
191
|
+
rx: 10.4,
|
|
192
|
+
ry: 3.9,
|
|
193
|
+
fill: "none",
|
|
194
|
+
stroke: `url(#${gid})`,
|
|
195
|
+
"stroke-width": 1.4,
|
|
196
|
+
transform: "rotate(-18 12 12)"
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
104
199
|
const GLOBAL_CSS = `
|
|
105
200
|
@keyframes agy-spin {
|
|
106
201
|
0% { transform: rotate(0deg); }
|
|
107
202
|
100% { transform: rotate(360deg); }
|
|
108
203
|
}
|
|
204
|
+
|
|
205
|
+
:root, body {
|
|
206
|
+
--agy-font-family: var(--dsw-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif);
|
|
207
|
+
--agy-bg-panel: var(--dsw-alias-bg-layer-2, #ffffff);
|
|
208
|
+
--agy-bg-card: var(--dsw-alias-bg-layer-2, #ffffff);
|
|
209
|
+
--agy-bg-card-primary: #f0f7ff;
|
|
210
|
+
--agy-bg-header: var(--dsw-alias-bg-layer-1, #f8fafc);
|
|
211
|
+
--agy-bg-box: var(--dsw-alias-bg-layer-1, #f8fafc);
|
|
212
|
+
--agy-bg-subbox: var(--dsw-alias-bg-layer-3, #f1f5f9);
|
|
213
|
+
--agy-bg-input: var(--dsw-alias-bg-layer-1, #ffffff);
|
|
214
|
+
--agy-bg-btn: var(--dsw-alias-bg-layer-3, #f1f5f9);
|
|
215
|
+
--agy-bg-btn-hover: var(--dsw-alias-interactive-bg-hover, #e2e8f0);
|
|
216
|
+
--agy-bg-btn-primary: var(--dsw-alias-state-business-primary, #2563eb);
|
|
217
|
+
--agy-bg-progress-track: #e2e8f0;
|
|
218
|
+
|
|
219
|
+
--agy-border-card: var(--dsw-alias-border-l2, #e2e8f0);
|
|
220
|
+
--agy-border-card-primary: #3b82f6;
|
|
221
|
+
--agy-border-box: var(--dsw-alias-border-l1, #e2e8f0);
|
|
222
|
+
--agy-border-subbox: var(--dsw-alias-border-l2, #cbd5e1);
|
|
223
|
+
--agy-border-input: var(--dsw-alias-border-l2, #cbd5e1);
|
|
224
|
+
--agy-border-input-focus: var(--dsw-alias-state-business-primary, #2563eb);
|
|
225
|
+
--agy-border-btn: var(--dsw-alias-border-l2, #cbd5e1);
|
|
226
|
+
--agy-border-btn-primary: #2563eb;
|
|
227
|
+
--agy-border-divider: var(--dsw-alias-border-l2, #e2e8f0);
|
|
228
|
+
|
|
229
|
+
--agy-text-primary: var(--dsw-alias-label-primary, #0f172a);
|
|
230
|
+
--agy-text-secondary: var(--dsw-alias-label-secondary, #334155);
|
|
231
|
+
--agy-text-tertiary: var(--dsw-alias-label-tertiary, #64748b);
|
|
232
|
+
--agy-text-muted: var(--dsw-alias-label-caption, #94a3b8);
|
|
233
|
+
--agy-text-btn: var(--dsw-alias-label-primary, #0f172a);
|
|
234
|
+
--agy-text-btn-primary: #ffffff;
|
|
235
|
+
--agy-text-window-label: #2563eb;
|
|
236
|
+
|
|
237
|
+
--agy-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
238
|
+
--agy-shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
239
|
+
--agy-shadow-card-primary: 0 0 0 1px #3b82f6, 0 4px 14px rgba(37, 99, 235, 0.12);
|
|
240
|
+
--agy-shadow-modal: 0 20px 50px rgba(0, 0, 0, 0.18);
|
|
241
|
+
--agy-modal-backdrop: rgba(15, 23, 42, 0.5);
|
|
242
|
+
|
|
243
|
+
/* Badges */
|
|
244
|
+
--agy-badge-primary-bg: #dbeafe;
|
|
245
|
+
--agy-badge-primary-text: #1e40af;
|
|
246
|
+
--agy-badge-primary-border: #60a5fa;
|
|
247
|
+
|
|
248
|
+
--agy-badge-tag-bg: #f1f5f9;
|
|
249
|
+
--agy-badge-tag-text: #334155;
|
|
250
|
+
--agy-badge-tag-border: #cbd5e1;
|
|
251
|
+
|
|
252
|
+
--agy-badge-email-bg: #eff6ff;
|
|
253
|
+
--agy-badge-email-text: #1d4ed8;
|
|
254
|
+
--agy-badge-email-border: #bfdbfe;
|
|
255
|
+
|
|
256
|
+
--agy-badge-proxy-bg: #ecfdf5;
|
|
257
|
+
--agy-badge-proxy-text: #047857;
|
|
258
|
+
--agy-badge-proxy-border: #a7f3d0;
|
|
259
|
+
|
|
260
|
+
--agy-badge-ready-bg: #ecfdf5;
|
|
261
|
+
--agy-badge-ready-text: #047857;
|
|
262
|
+
--agy-badge-ready-border: #a7f3d0;
|
|
263
|
+
|
|
264
|
+
--agy-badge-unready-bg: #eff6ff;
|
|
265
|
+
--agy-badge-unready-text: #1d4ed8;
|
|
266
|
+
--agy-badge-unready-border: #bfdbfe;
|
|
267
|
+
|
|
268
|
+
/* Quota status pills */
|
|
269
|
+
--agy-quota-high-bg: #ecfdf5;
|
|
270
|
+
--agy-quota-high-text: #047857;
|
|
271
|
+
--agy-quota-high-border: #a7f3d0;
|
|
272
|
+
--agy-quota-med-bg: #fffbeb;
|
|
273
|
+
--agy-quota-med-text: #b45309;
|
|
274
|
+
--agy-quota-med-border: #fde68a;
|
|
275
|
+
--agy-quota-low-bg: #fef2f2;
|
|
276
|
+
--agy-quota-low-text: #b91c1c;
|
|
277
|
+
--agy-quota-low-border: #fecaca;
|
|
278
|
+
--agy-quota-none-bg: #f1f5f9;
|
|
279
|
+
--agy-quota-none-text: #64748b;
|
|
280
|
+
--agy-quota-none-border: #cbd5e1;
|
|
281
|
+
|
|
282
|
+
/* Danger button */
|
|
283
|
+
--agy-danger-bg: #fef2f2;
|
|
284
|
+
--agy-danger-text: #b91c1c;
|
|
285
|
+
--agy-danger-border: #fecaca;
|
|
286
|
+
--agy-danger-hover-bg: #fee2e2;
|
|
287
|
+
|
|
288
|
+
/* Warning banner */
|
|
289
|
+
--agy-warn-bg: #fffbeb;
|
|
290
|
+
--agy-warn-text: #92400e;
|
|
291
|
+
--agy-warn-border: #fcd34d;
|
|
292
|
+
--agy-warn-btn-bg: #fef3c7;
|
|
293
|
+
--agy-warn-btn-text: #92400e;
|
|
294
|
+
--agy-warn-btn-border: #f59e0b;
|
|
295
|
+
|
|
296
|
+
/* Toast notices */
|
|
297
|
+
--agy-toast-success-bg: #ecfdf5;
|
|
298
|
+
--agy-toast-success-text: #065f46;
|
|
299
|
+
--agy-toast-success-border: #6ee7b7;
|
|
300
|
+
--agy-toast-info-bg: #eff6ff;
|
|
301
|
+
--agy-toast-info-text: #1e40af;
|
|
302
|
+
--agy-toast-info-border: #93c5fd;
|
|
303
|
+
--agy-toast-warn-bg: #fffbeb;
|
|
304
|
+
--agy-toast-warn-text: #92400e;
|
|
305
|
+
--agy-toast-warn-border: #fcd34d;
|
|
306
|
+
--agy-toast-error-bg: #fef2f2;
|
|
307
|
+
--agy-toast-error-text: #991b1b;
|
|
308
|
+
--agy-toast-error-border: #fca5a5;
|
|
309
|
+
|
|
310
|
+
/* Auth Modal / Box */
|
|
311
|
+
--agy-auth-box-bg: #f0f7ff;
|
|
312
|
+
--agy-auth-box-border: #3b82f6;
|
|
313
|
+
|
|
314
|
+
/* Segment control */
|
|
315
|
+
--agy-seg-group-bg: #e2e8f0;
|
|
316
|
+
--agy-seg-group-border: #cbd5e1;
|
|
317
|
+
--agy-seg-btn-text: #475569;
|
|
318
|
+
--agy-seg-btn-active-bg: var(--dsw-alias-state-business-primary, #2563eb);
|
|
319
|
+
--agy-seg-btn-active-text: #ffffff;
|
|
320
|
+
--agy-seg-danger-bg: #dc2626;
|
|
321
|
+
--agy-seg-danger-text: #ffffff;
|
|
322
|
+
--agy-seg-danger-border: #b91c1c;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
body[data-ds-dark-theme],
|
|
326
|
+
body.dark,
|
|
327
|
+
[data-theme="dark"] {
|
|
328
|
+
--agy-bg-panel: var(--dsw-alias-bg-layer-2, #0f172a);
|
|
329
|
+
--agy-bg-card: var(--dsw-alias-bg-layer-2, #1e293b);
|
|
330
|
+
--agy-bg-card-primary: #111d33;
|
|
331
|
+
--agy-bg-header: var(--dsw-alias-bg-layer-1, #1e293b);
|
|
332
|
+
--agy-bg-box: var(--dsw-alias-bg-layer-1, #0f172a);
|
|
333
|
+
--agy-bg-subbox: var(--dsw-alias-bg-layer-3, #090d16);
|
|
334
|
+
--agy-bg-input: var(--dsw-alias-bg-layer-3, #090d16);
|
|
335
|
+
--agy-bg-btn: var(--dsw-alias-bg-layer-3, #334155);
|
|
336
|
+
--agy-bg-btn-hover: var(--dsw-alias-interactive-bg-hover, #475569);
|
|
337
|
+
--agy-bg-btn-primary: var(--dsw-alias-state-business-primary, #2563eb);
|
|
338
|
+
--agy-bg-progress-track: #1e293b;
|
|
339
|
+
|
|
340
|
+
--agy-border-card: var(--dsw-alias-border-l2, #334155);
|
|
341
|
+
--agy-border-card-primary: #3b82f6;
|
|
342
|
+
--agy-border-box: var(--dsw-alias-border-l1, #1e293b);
|
|
343
|
+
--agy-border-subbox: var(--dsw-alias-border-l2, #334155);
|
|
344
|
+
--agy-border-input: var(--dsw-alias-border-l2, #334155);
|
|
345
|
+
--agy-border-input-focus: #3b82f6;
|
|
346
|
+
--agy-border-btn: var(--dsw-alias-border-l2, #475569);
|
|
347
|
+
--agy-border-btn-primary: #3b82f6;
|
|
348
|
+
--agy-border-divider: var(--dsw-alias-border-l2, #334155);
|
|
349
|
+
|
|
350
|
+
--agy-text-primary: var(--dsw-alias-label-primary, #f8fafc);
|
|
351
|
+
--agy-text-secondary: var(--dsw-alias-label-secondary, #cbd5e1);
|
|
352
|
+
--agy-text-tertiary: var(--dsw-alias-label-tertiary, #94a3b8);
|
|
353
|
+
--agy-text-muted: var(--dsw-alias-label-caption, #64748b);
|
|
354
|
+
--agy-text-btn: var(--dsw-alias-label-primary, #ffffff);
|
|
355
|
+
--agy-text-btn-primary: #ffffff;
|
|
356
|
+
--agy-text-window-label: #93c5fd;
|
|
357
|
+
|
|
358
|
+
--agy-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
359
|
+
--agy-shadow-card-hover: 0 6px 16px rgba(0, 0, 0, 0.4);
|
|
360
|
+
--agy-shadow-card-primary: 0 0 16px rgba(59, 130, 246, 0.25);
|
|
361
|
+
--agy-shadow-modal: 0 25px 60px rgba(0, 0, 0, 0.8);
|
|
362
|
+
--agy-modal-backdrop: rgba(0, 0, 0, 0.75);
|
|
363
|
+
|
|
364
|
+
/* Badges */
|
|
365
|
+
--agy-badge-primary-bg: #1e3a8a;
|
|
366
|
+
--agy-badge-primary-text: #93c5fd;
|
|
367
|
+
--agy-badge-primary-border: #3b82f6;
|
|
368
|
+
|
|
369
|
+
--agy-badge-tag-bg: #0f172a;
|
|
370
|
+
--agy-badge-tag-text: #cbd5e1;
|
|
371
|
+
--agy-badge-tag-border: #334155;
|
|
372
|
+
|
|
373
|
+
--agy-badge-email-bg: #1e293b;
|
|
374
|
+
--agy-badge-email-text: #93c5fd;
|
|
375
|
+
--agy-badge-email-border: #3b82f6;
|
|
376
|
+
|
|
377
|
+
--agy-badge-proxy-bg: #064e3b;
|
|
378
|
+
--agy-badge-proxy-text: #6ee7b7;
|
|
379
|
+
--agy-badge-proxy-border: #059669;
|
|
380
|
+
|
|
381
|
+
--agy-badge-ready-bg: rgba(16, 185, 129, 0.15);
|
|
382
|
+
--agy-badge-ready-text: #34d399;
|
|
383
|
+
--agy-badge-ready-border: rgba(16, 185, 129, 0.35);
|
|
384
|
+
|
|
385
|
+
--agy-badge-unready-bg: rgba(59, 130, 246, 0.15);
|
|
386
|
+
--agy-badge-unready-text: #93c5fd;
|
|
387
|
+
--agy-badge-unready-border: rgba(59, 130, 246, 0.35);
|
|
388
|
+
|
|
389
|
+
/* Quota status pills */
|
|
390
|
+
--agy-quota-high-bg: #064e3b;
|
|
391
|
+
--agy-quota-high-text: #6ee7b7;
|
|
392
|
+
--agy-quota-high-border: #059669;
|
|
393
|
+
--agy-quota-med-bg: #451a03;
|
|
394
|
+
--agy-quota-med-text: #fde68a;
|
|
395
|
+
--agy-quota-med-border: #d97706;
|
|
396
|
+
--agy-quota-low-bg: #450a0a;
|
|
397
|
+
--agy-quota-low-text: #fca5a5;
|
|
398
|
+
--agy-quota-low-border: #dc2626;
|
|
399
|
+
--agy-quota-none-bg: #1e293b;
|
|
400
|
+
--agy-quota-none-text: #94a3b8;
|
|
401
|
+
--agy-quota-none-border: #475569;
|
|
402
|
+
|
|
403
|
+
/* Danger button */
|
|
404
|
+
--agy-danger-bg: #450a0a;
|
|
405
|
+
--agy-danger-text: #fca5a5;
|
|
406
|
+
--agy-danger-border: #ef4444;
|
|
407
|
+
--agy-danger-hover-bg: #5f1313;
|
|
408
|
+
|
|
409
|
+
/* Warning banner */
|
|
410
|
+
--agy-warn-bg: #451a03;
|
|
411
|
+
--agy-warn-text: #fde68a;
|
|
412
|
+
--agy-warn-border: #d97706;
|
|
413
|
+
--agy-warn-btn-bg: #78350f;
|
|
414
|
+
--agy-warn-btn-text: #fde68a;
|
|
415
|
+
--agy-warn-btn-border: #d97706;
|
|
416
|
+
|
|
417
|
+
/* Toast notices */
|
|
418
|
+
--agy-toast-success-bg: #064e3b;
|
|
419
|
+
--agy-toast-success-text: #6ee7b7;
|
|
420
|
+
--agy-toast-success-border: #059669;
|
|
421
|
+
--agy-toast-info-bg: #1e3a8a;
|
|
422
|
+
--agy-toast-info-text: #93c5fd;
|
|
423
|
+
--agy-toast-info-border: #3b82f6;
|
|
424
|
+
--agy-toast-warn-bg: #451a03;
|
|
425
|
+
--agy-toast-warn-text: #fde68a;
|
|
426
|
+
--agy-toast-warn-border: #d97706;
|
|
427
|
+
--agy-toast-error-bg: #450a0a;
|
|
428
|
+
--agy-toast-error-text: #fca5a5;
|
|
429
|
+
--agy-toast-error-border: #dc2626;
|
|
430
|
+
|
|
431
|
+
/* Auth Modal / Box */
|
|
432
|
+
--agy-auth-box-bg: #0f223a;
|
|
433
|
+
--agy-auth-box-border: #3b82f6;
|
|
434
|
+
|
|
435
|
+
/* Segment control */
|
|
436
|
+
--agy-seg-group-bg: #090d16;
|
|
437
|
+
--agy-seg-group-border: #334155;
|
|
438
|
+
--agy-seg-btn-text: #94a3b8;
|
|
439
|
+
--agy-seg-btn-active-bg: var(--dsw-alias-state-business-primary, #2563eb);
|
|
440
|
+
--agy-seg-btn-active-text: #ffffff;
|
|
441
|
+
--agy-seg-danger-bg: #7f1d1d;
|
|
442
|
+
--agy-seg-danger-text: #fca5a5;
|
|
443
|
+
--agy-seg-danger-border: #ef4444;
|
|
444
|
+
}
|
|
445
|
+
|
|
109
446
|
.agy-spinner {
|
|
110
447
|
display: inline-block;
|
|
111
448
|
width: 12px;
|
|
@@ -124,16 +461,18 @@ window.__ModuleLoader__.load({
|
|
|
124
461
|
border-radius: 50%;
|
|
125
462
|
}
|
|
126
463
|
.agy-card-hover {
|
|
127
|
-
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
464
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
|
|
128
465
|
}
|
|
129
466
|
.agy-card-hover:hover {
|
|
130
|
-
border-color:
|
|
467
|
+
border-color: var(--agy-border-card-primary, #3b82f6) !important;
|
|
468
|
+
box-shadow: var(--agy-shadow-card-hover) !important;
|
|
131
469
|
}
|
|
132
470
|
.agy-btn {
|
|
133
471
|
transition: all 0.15s ease;
|
|
472
|
+
user-select: none;
|
|
134
473
|
}
|
|
135
474
|
.agy-btn:hover:not(:disabled) {
|
|
136
|
-
filter: brightness(1.
|
|
475
|
+
filter: brightness(1.08);
|
|
137
476
|
transform: translateY(-0.5px);
|
|
138
477
|
}
|
|
139
478
|
.agy-btn:active:not(:disabled) {
|
|
@@ -146,8 +485,8 @@ window.__ModuleLoader__.load({
|
|
|
146
485
|
position: fixed;
|
|
147
486
|
inset: 0;
|
|
148
487
|
z-index: 9999;
|
|
149
|
-
background:
|
|
150
|
-
backdrop-filter: blur(
|
|
488
|
+
background: var(--agy-modal-backdrop);
|
|
489
|
+
backdrop-filter: blur(6px);
|
|
151
490
|
display: flex;
|
|
152
491
|
align-items: center;
|
|
153
492
|
justify-content: center;
|
|
@@ -159,93 +498,127 @@ window.__ModuleLoader__.load({
|
|
|
159
498
|
width: 100%;
|
|
160
499
|
max-width: 640px;
|
|
161
500
|
max-height: min(820px, calc(100vh - 48px));
|
|
162
|
-
background: var(--
|
|
163
|
-
border: 1px solid var(--
|
|
164
|
-
border-radius:
|
|
165
|
-
box-shadow:
|
|
501
|
+
background: var(--agy-bg-panel);
|
|
502
|
+
border: 1px solid var(--agy-border-card);
|
|
503
|
+
border-radius: 14px;
|
|
504
|
+
box-shadow: var(--agy-shadow-modal);
|
|
166
505
|
display: flex;
|
|
167
506
|
flex-direction: column;
|
|
168
507
|
overflow: hidden;
|
|
169
|
-
color:
|
|
170
|
-
font-family:
|
|
508
|
+
color: var(--agy-text-primary);
|
|
509
|
+
font-family: var(--agy-font-family);
|
|
171
510
|
}
|
|
172
511
|
.agy-submodel-row {
|
|
173
512
|
display: flex;
|
|
174
513
|
align-items: center;
|
|
175
514
|
justify-content: space-between;
|
|
176
|
-
padding:
|
|
177
|
-
font-size:
|
|
178
|
-
border-radius:
|
|
179
|
-
background:
|
|
180
|
-
|
|
515
|
+
padding: 7px 10px;
|
|
516
|
+
font-size: 11.5px;
|
|
517
|
+
border-radius: 6px;
|
|
518
|
+
background: var(--agy-bg-subbox);
|
|
519
|
+
border: 1px solid var(--agy-border-box);
|
|
520
|
+
margin: 4px 0;
|
|
521
|
+
color: var(--agy-text-primary);
|
|
181
522
|
}
|
|
182
523
|
`;
|
|
183
524
|
const S = {
|
|
184
525
|
container: {
|
|
185
526
|
lineHeight: 1.5,
|
|
186
527
|
fontSize: "13px",
|
|
187
|
-
fontFamily: "
|
|
188
|
-
color: "
|
|
528
|
+
fontFamily: "var(--agy-font-family)",
|
|
529
|
+
color: "var(--agy-text-primary)"
|
|
189
530
|
},
|
|
190
531
|
headerCard: {
|
|
191
532
|
display: "flex",
|
|
192
533
|
alignItems: "center",
|
|
193
534
|
justifyContent: "space-between",
|
|
194
|
-
padding: "12px
|
|
195
|
-
background: "
|
|
196
|
-
border: "1px solid
|
|
197
|
-
borderRadius: "
|
|
198
|
-
marginBottom: "12px"
|
|
535
|
+
padding: "12px 16px",
|
|
536
|
+
background: "var(--agy-bg-header)",
|
|
537
|
+
border: "1px solid var(--agy-border-card)",
|
|
538
|
+
borderRadius: "10px",
|
|
539
|
+
marginBottom: "12px",
|
|
540
|
+
color: "var(--agy-text-primary)",
|
|
541
|
+
boxShadow: "var(--agy-shadow-card)"
|
|
199
542
|
},
|
|
200
543
|
badgePrimary: {
|
|
201
544
|
display: "inline-flex",
|
|
202
545
|
alignItems: "center",
|
|
203
|
-
gap: "
|
|
204
|
-
background: "
|
|
205
|
-
color: "
|
|
206
|
-
border: "1px solid
|
|
207
|
-
padding: "
|
|
546
|
+
gap: "4px",
|
|
547
|
+
background: "var(--agy-badge-primary-bg)",
|
|
548
|
+
color: "var(--agy-badge-primary-text)",
|
|
549
|
+
border: "1px solid var(--agy-badge-primary-border)",
|
|
550
|
+
padding: "2px 8px",
|
|
208
551
|
borderRadius: "5px",
|
|
209
552
|
fontSize: "11px",
|
|
210
|
-
fontWeight:
|
|
553
|
+
fontWeight: 700
|
|
211
554
|
},
|
|
212
555
|
badgeTag: {
|
|
213
556
|
display: "inline-flex",
|
|
214
557
|
alignItems: "center",
|
|
215
|
-
gap: "
|
|
216
|
-
background: "
|
|
217
|
-
color: "
|
|
218
|
-
border: "1px solid
|
|
219
|
-
padding: "
|
|
220
|
-
borderRadius: "
|
|
221
|
-
fontSize: "11px"
|
|
558
|
+
gap: "4px",
|
|
559
|
+
background: "var(--agy-badge-tag-bg)",
|
|
560
|
+
color: "var(--agy-badge-tag-text)",
|
|
561
|
+
border: "1px solid var(--agy-badge-tag-border)",
|
|
562
|
+
padding: "2px 7px",
|
|
563
|
+
borderRadius: "5px",
|
|
564
|
+
fontSize: "11px",
|
|
565
|
+
fontWeight: 600
|
|
566
|
+
},
|
|
567
|
+
badgeReady: {
|
|
568
|
+
display: "inline-flex",
|
|
569
|
+
alignItems: "center",
|
|
570
|
+
gap: "4px",
|
|
571
|
+
background: "var(--agy-badge-ready-bg)",
|
|
572
|
+
color: "var(--agy-badge-ready-text)",
|
|
573
|
+
border: "1px solid var(--agy-badge-ready-border)",
|
|
574
|
+
padding: "2px 8px",
|
|
575
|
+
borderRadius: "5px",
|
|
576
|
+
fontSize: "11px",
|
|
577
|
+
fontWeight: 700
|
|
578
|
+
},
|
|
579
|
+
badgeUnready: {
|
|
580
|
+
display: "inline-flex",
|
|
581
|
+
alignItems: "center",
|
|
582
|
+
gap: "4px",
|
|
583
|
+
background: "var(--agy-badge-unready-bg)",
|
|
584
|
+
color: "var(--agy-badge-unready-text)",
|
|
585
|
+
border: "1px solid var(--agy-badge-unready-border)",
|
|
586
|
+
padding: "2px 8px",
|
|
587
|
+
borderRadius: "5px",
|
|
588
|
+
fontSize: "11px",
|
|
589
|
+
fontWeight: 700
|
|
222
590
|
},
|
|
223
591
|
card: {
|
|
224
|
-
background: "
|
|
225
|
-
border: "1px solid
|
|
226
|
-
borderRadius: "
|
|
227
|
-
padding: "
|
|
228
|
-
marginBottom: "
|
|
592
|
+
background: "var(--agy-bg-card)",
|
|
593
|
+
border: "1px solid var(--agy-border-card)",
|
|
594
|
+
borderRadius: "10px",
|
|
595
|
+
padding: "14px 16px",
|
|
596
|
+
marginBottom: "12px",
|
|
597
|
+
color: "var(--agy-text-primary)",
|
|
598
|
+
boxShadow: "var(--agy-shadow-card)"
|
|
229
599
|
},
|
|
230
600
|
cardPrimary: {
|
|
231
|
-
background: "
|
|
232
|
-
border: "
|
|
233
|
-
borderRadius: "
|
|
234
|
-
padding: "
|
|
235
|
-
marginBottom: "
|
|
601
|
+
background: "var(--agy-bg-card-primary)",
|
|
602
|
+
border: "1.5px solid var(--agy-border-card-primary)",
|
|
603
|
+
borderRadius: "10px",
|
|
604
|
+
padding: "14px 16px",
|
|
605
|
+
marginBottom: "12px",
|
|
606
|
+
boxShadow: "var(--agy-shadow-card-primary)",
|
|
607
|
+
color: "var(--agy-text-primary)"
|
|
236
608
|
},
|
|
237
609
|
quotaBox: {
|
|
238
|
-
background: "
|
|
239
|
-
border: "1px solid
|
|
240
|
-
borderRadius: "
|
|
241
|
-
padding: "8px
|
|
242
|
-
marginTop: "
|
|
610
|
+
background: "var(--agy-bg-box)",
|
|
611
|
+
border: "1px solid var(--agy-border-box)",
|
|
612
|
+
borderRadius: "8px",
|
|
613
|
+
padding: "8px 10px",
|
|
614
|
+
marginTop: "10px"
|
|
243
615
|
},
|
|
244
616
|
progressBarBg: {
|
|
245
617
|
flex: "1",
|
|
246
|
-
height: "
|
|
247
|
-
borderRadius: "
|
|
248
|
-
background: "
|
|
618
|
+
height: "8px",
|
|
619
|
+
borderRadius: "4px",
|
|
620
|
+
background: "var(--agy-bg-progress-track)",
|
|
621
|
+
border: "1px solid var(--agy-border-box)",
|
|
249
622
|
overflow: "hidden",
|
|
250
623
|
margin: "0 10px"
|
|
251
624
|
},
|
|
@@ -253,125 +626,127 @@ window.__ModuleLoader__.load({
|
|
|
253
626
|
display: "inline-flex",
|
|
254
627
|
alignItems: "center",
|
|
255
628
|
justifyContent: "center",
|
|
256
|
-
padding: "
|
|
629
|
+
padding: "5px 12px",
|
|
257
630
|
borderRadius: "6px",
|
|
258
|
-
border: "1px solid
|
|
259
|
-
background: "
|
|
260
|
-
color: "
|
|
631
|
+
border: "1px solid var(--agy-border-btn)",
|
|
632
|
+
background: "var(--agy-bg-btn)",
|
|
633
|
+
color: "var(--agy-text-btn)",
|
|
261
634
|
cursor: "pointer",
|
|
262
635
|
fontSize: "12px",
|
|
263
|
-
fontWeight:
|
|
636
|
+
fontWeight: 600
|
|
264
637
|
},
|
|
265
638
|
btnPrimary: {
|
|
266
639
|
display: "inline-flex",
|
|
267
640
|
alignItems: "center",
|
|
268
641
|
justifyContent: "center",
|
|
269
|
-
padding: "5px
|
|
642
|
+
padding: "5px 13px",
|
|
270
643
|
borderRadius: "6px",
|
|
271
|
-
border: "1px solid
|
|
272
|
-
background: "
|
|
273
|
-
color: "
|
|
644
|
+
border: "1px solid var(--agy-border-btn-primary)",
|
|
645
|
+
background: "var(--agy-bg-btn-primary)",
|
|
646
|
+
color: "var(--agy-text-btn-primary)",
|
|
274
647
|
cursor: "pointer",
|
|
275
648
|
fontSize: "12px",
|
|
276
|
-
fontWeight:
|
|
649
|
+
fontWeight: 700,
|
|
650
|
+
boxShadow: "0 2px 6px rgba(37, 99, 235, 0.35)"
|
|
277
651
|
},
|
|
278
652
|
btnDanger: {
|
|
279
653
|
display: "inline-flex",
|
|
280
654
|
alignItems: "center",
|
|
281
655
|
justifyContent: "center",
|
|
282
|
-
padding: "
|
|
283
|
-
borderRadius: "
|
|
284
|
-
border: "1px solid
|
|
285
|
-
background: "
|
|
286
|
-
color: "
|
|
656
|
+
padding: "4px 9px",
|
|
657
|
+
borderRadius: "6px",
|
|
658
|
+
border: "1px solid var(--agy-danger-border)",
|
|
659
|
+
background: "var(--agy-danger-bg)",
|
|
660
|
+
color: "var(--agy-danger-text)",
|
|
287
661
|
cursor: "pointer",
|
|
288
662
|
fontSize: "11px",
|
|
289
|
-
fontWeight:
|
|
663
|
+
fontWeight: 600
|
|
290
664
|
},
|
|
291
665
|
btnSm: {
|
|
292
666
|
display: "inline-flex",
|
|
293
667
|
alignItems: "center",
|
|
294
668
|
justifyContent: "center",
|
|
295
|
-
padding: "
|
|
669
|
+
padding: "4px 9px",
|
|
296
670
|
borderRadius: "5px",
|
|
297
|
-
border: "1px solid
|
|
298
|
-
background: "
|
|
299
|
-
color: "
|
|
671
|
+
border: "1px solid var(--agy-border-btn)",
|
|
672
|
+
background: "var(--agy-bg-btn)",
|
|
673
|
+
color: "var(--agy-text-btn)",
|
|
300
674
|
cursor: "pointer",
|
|
301
|
-
fontSize: "
|
|
302
|
-
fontWeight:
|
|
675
|
+
fontSize: "11.5px",
|
|
676
|
+
fontWeight: 600
|
|
303
677
|
},
|
|
304
678
|
btnSmPrimary: {
|
|
305
679
|
display: "inline-flex",
|
|
306
680
|
alignItems: "center",
|
|
307
681
|
justifyContent: "center",
|
|
308
|
-
padding: "
|
|
682
|
+
padding: "4px 9px",
|
|
309
683
|
borderRadius: "5px",
|
|
310
|
-
border: "1px solid
|
|
311
|
-
background: "
|
|
312
|
-
color: "
|
|
684
|
+
border: "1px solid var(--agy-border-btn-primary)",
|
|
685
|
+
background: "var(--agy-bg-btn-primary)",
|
|
686
|
+
color: "var(--agy-text-btn-primary)",
|
|
313
687
|
cursor: "pointer",
|
|
314
|
-
fontSize: "
|
|
315
|
-
fontWeight:
|
|
688
|
+
fontSize: "11.5px",
|
|
689
|
+
fontWeight: 700
|
|
316
690
|
},
|
|
317
691
|
segGroup: {
|
|
318
692
|
display: "inline-flex",
|
|
319
|
-
background: "
|
|
320
|
-
borderRadius: "
|
|
321
|
-
padding: "
|
|
322
|
-
border: "1px solid
|
|
693
|
+
background: "var(--agy-seg-group-bg)",
|
|
694
|
+
borderRadius: "7px",
|
|
695
|
+
padding: "3px",
|
|
696
|
+
border: "1px solid var(--agy-seg-group-border)"
|
|
323
697
|
},
|
|
324
698
|
segBtn: {
|
|
325
|
-
padding: "
|
|
699
|
+
padding: "4px 10px",
|
|
326
700
|
borderRadius: "4px",
|
|
327
701
|
border: "none",
|
|
328
702
|
background: "transparent",
|
|
329
|
-
color: "
|
|
703
|
+
color: "var(--agy-seg-btn-text)",
|
|
330
704
|
cursor: "pointer",
|
|
331
|
-
fontSize: "
|
|
332
|
-
fontWeight:
|
|
333
|
-
opacity: .75
|
|
705
|
+
fontSize: "11.5px",
|
|
706
|
+
fontWeight: 600
|
|
334
707
|
},
|
|
335
708
|
segBtnActive: {
|
|
336
|
-
padding: "
|
|
709
|
+
padding: "4px 10px",
|
|
337
710
|
borderRadius: "4px",
|
|
338
711
|
border: "none",
|
|
339
|
-
background: "
|
|
340
|
-
color: "
|
|
712
|
+
background: "var(--agy-seg-btn-active-bg)",
|
|
713
|
+
color: "var(--agy-seg-btn-active-text)",
|
|
341
714
|
cursor: "pointer",
|
|
342
|
-
fontSize: "
|
|
343
|
-
fontWeight:
|
|
344
|
-
|
|
715
|
+
fontSize: "11.5px",
|
|
716
|
+
fontWeight: 700,
|
|
717
|
+
boxShadow: "0 2px 4px rgba(37, 99, 235, 0.4)"
|
|
345
718
|
},
|
|
346
719
|
input: {
|
|
347
720
|
flex: "1",
|
|
348
|
-
padding: "
|
|
721
|
+
padding: "7px 12px",
|
|
349
722
|
borderRadius: "6px",
|
|
350
|
-
border: "
|
|
351
|
-
background: "
|
|
352
|
-
color: "
|
|
353
|
-
fontSize: "
|
|
723
|
+
border: "1.5px solid var(--agy-border-input)",
|
|
724
|
+
background: "var(--agy-bg-input)",
|
|
725
|
+
color: "var(--agy-text-primary)",
|
|
726
|
+
fontSize: "12.5px",
|
|
354
727
|
outline: "none"
|
|
355
728
|
},
|
|
356
729
|
muted: {
|
|
357
|
-
color: "
|
|
358
|
-
fontSize: "
|
|
730
|
+
color: "var(--agy-text-tertiary)",
|
|
731
|
+
fontSize: "11.5px"
|
|
359
732
|
},
|
|
360
733
|
noticeBanner: {
|
|
361
734
|
display: "flex",
|
|
362
735
|
alignItems: "center",
|
|
363
736
|
justifyContent: "space-between",
|
|
364
|
-
padding: "
|
|
365
|
-
borderRadius: "
|
|
366
|
-
marginBottom: "
|
|
367
|
-
fontSize: "
|
|
737
|
+
padding: "10px 14px",
|
|
738
|
+
borderRadius: "8px",
|
|
739
|
+
marginBottom: "12px",
|
|
740
|
+
fontSize: "12.5px",
|
|
741
|
+
fontWeight: 500
|
|
368
742
|
},
|
|
369
743
|
authModal: {
|
|
370
|
-
background: "
|
|
371
|
-
border: "
|
|
372
|
-
borderRadius: "
|
|
373
|
-
padding: "
|
|
374
|
-
marginBottom: "
|
|
744
|
+
background: "var(--agy-auth-box-bg)",
|
|
745
|
+
border: "1.5px solid var(--agy-auth-box-border)",
|
|
746
|
+
borderRadius: "10px",
|
|
747
|
+
padding: "14px 16px",
|
|
748
|
+
marginBottom: "14px",
|
|
749
|
+
color: "var(--agy-text-primary)"
|
|
375
750
|
}
|
|
376
751
|
};
|
|
377
752
|
function apply(ctx) {
|
|
@@ -414,10 +789,10 @@ window.__ModuleLoader__.load({
|
|
|
414
789
|
setAddingAccount(false);
|
|
415
790
|
setAuthCodeInput("");
|
|
416
791
|
setAliasInput("");
|
|
417
|
-
showToast(
|
|
792
|
+
showToast(pa.message || "账号已激活入池", "success");
|
|
418
793
|
} else if (pa.phase === "failed") {
|
|
419
794
|
flowStartedRef.current = false;
|
|
420
|
-
showToast(
|
|
795
|
+
showToast(pa.message || "授权失败", "error");
|
|
421
796
|
}
|
|
422
797
|
}, [
|
|
423
798
|
addingAccount,
|
|
@@ -444,8 +819,8 @@ window.__ModuleLoader__.load({
|
|
|
444
819
|
if (res && res.ok) {
|
|
445
820
|
flowStartedRef.current = true;
|
|
446
821
|
await refresh();
|
|
447
|
-
if (res.browserOpened) showToast("
|
|
448
|
-
else showToast("
|
|
822
|
+
if (res.browserOpened) showToast("浏览器已打开 Google 授权页,完成授权后将自动同步", "info");
|
|
823
|
+
else showToast("无法自动打开浏览器,请点击下方链接手动完成授权", "warn");
|
|
449
824
|
} else showToast(`启动 Google 授权失败: ${res?.message || "请检查网络或代理配置"}`, "error");
|
|
450
825
|
};
|
|
451
826
|
const handleCompleteAddAccount = async () => {
|
|
@@ -459,8 +834,8 @@ window.__ModuleLoader__.load({
|
|
|
459
834
|
setAliasInput("");
|
|
460
835
|
setAddingAccount(false);
|
|
461
836
|
await refresh();
|
|
462
|
-
showToast(
|
|
463
|
-
} else showToast(
|
|
837
|
+
showToast(res.message || "成功添加并激活 Google 账号", "success");
|
|
838
|
+
} else showToast(res?.message || res?.error || "授权码验证失败", "error");
|
|
464
839
|
};
|
|
465
840
|
const handleCancelAddAccount = async () => {
|
|
466
841
|
flowStartedRef.current = false;
|
|
@@ -484,7 +859,7 @@ window.__ModuleLoader__.load({
|
|
|
484
859
|
await postJson("/plugins/agy-link/pool/primary", { id });
|
|
485
860
|
await refresh();
|
|
486
861
|
setLoadingAction(null);
|
|
487
|
-
showToast("
|
|
862
|
+
showToast("已设为主用账号", "success");
|
|
488
863
|
};
|
|
489
864
|
const removeAccount = async (id, alias) => {
|
|
490
865
|
setLoadingAction(`remove:${id}`);
|
|
@@ -498,7 +873,7 @@ window.__ModuleLoader__.load({
|
|
|
498
873
|
await postJson("/plugins/agy-link/pool/refresh-quota", { id });
|
|
499
874
|
await refresh();
|
|
500
875
|
setLoadingAction(null);
|
|
501
|
-
showToast("
|
|
876
|
+
showToast("额度已刷新", "success");
|
|
502
877
|
};
|
|
503
878
|
const saveProxy = async (id) => {
|
|
504
879
|
setLoadingAction(`proxy:${id}`);
|
|
@@ -510,7 +885,7 @@ window.__ModuleLoader__.load({
|
|
|
510
885
|
setEditingProxyId(null);
|
|
511
886
|
await refresh();
|
|
512
887
|
setLoadingAction(null);
|
|
513
|
-
showToast("
|
|
888
|
+
showToast("代理已保存", "success");
|
|
514
889
|
};
|
|
515
890
|
const setMode = async (mode) => {
|
|
516
891
|
setLoadingAction(`mode:${mode}`);
|
|
@@ -523,7 +898,7 @@ window.__ModuleLoader__.load({
|
|
|
523
898
|
await postJson("/plugins/agy-link/pool/clear-cooldown", { id });
|
|
524
899
|
await refresh();
|
|
525
900
|
setLoadingAction(null);
|
|
526
|
-
showToast("
|
|
901
|
+
showToast("已清除冷却", "success");
|
|
527
902
|
};
|
|
528
903
|
const toggleExpand = (accId) => {
|
|
529
904
|
setExpandedModels((prev) => ({
|
|
@@ -539,126 +914,150 @@ window.__ModuleLoader__.load({
|
|
|
539
914
|
const renderSpinner = () => h("span", { className: "agy-spinner" });
|
|
540
915
|
const renderToastBanner = () => {
|
|
541
916
|
if (!toast) return null;
|
|
542
|
-
const
|
|
917
|
+
const style = {
|
|
543
918
|
success: {
|
|
544
|
-
background: "
|
|
545
|
-
border: "1px solid
|
|
546
|
-
color: "
|
|
919
|
+
background: "var(--agy-toast-success-bg)",
|
|
920
|
+
border: "1px solid var(--agy-toast-success-border)",
|
|
921
|
+
color: "var(--agy-toast-success-text)"
|
|
547
922
|
},
|
|
548
923
|
info: {
|
|
549
|
-
background: "
|
|
550
|
-
border: "1px solid
|
|
551
|
-
color: "
|
|
924
|
+
background: "var(--agy-toast-info-bg)",
|
|
925
|
+
border: "1px solid var(--agy-toast-info-border)",
|
|
926
|
+
color: "var(--agy-toast-info-text)"
|
|
552
927
|
},
|
|
553
928
|
warn: {
|
|
554
|
-
background: "
|
|
555
|
-
border: "1px solid
|
|
556
|
-
color: "
|
|
929
|
+
background: "var(--agy-toast-warn-bg)",
|
|
930
|
+
border: "1px solid var(--agy-toast-warn-border)",
|
|
931
|
+
color: "var(--agy-toast-warn-text)"
|
|
557
932
|
},
|
|
558
933
|
error: {
|
|
559
|
-
background: "
|
|
560
|
-
border: "1px solid
|
|
561
|
-
color: "
|
|
934
|
+
background: "var(--agy-toast-error-bg)",
|
|
935
|
+
border: "1px solid var(--agy-toast-error-border)",
|
|
936
|
+
color: "var(--agy-toast-error-text)"
|
|
562
937
|
}
|
|
563
|
-
};
|
|
938
|
+
}[toast.type];
|
|
564
939
|
return h("div", { style: {
|
|
565
940
|
...S.noticeBanner,
|
|
566
|
-
...
|
|
567
|
-
} }, h("
|
|
941
|
+
...style
|
|
942
|
+
} }, h("div", { style: {
|
|
943
|
+
display: "flex",
|
|
944
|
+
alignItems: "center",
|
|
945
|
+
gap: "8px",
|
|
946
|
+
fontWeight: 600
|
|
947
|
+
} }, uiIcon(toast.type === "success" ? "check" : toast.type === "error" || toast.type === "warn" ? "alert" : "globe", 14, style.color), h("span", null, toast.text)), h("button", {
|
|
568
948
|
type: "button",
|
|
569
949
|
style: {
|
|
570
950
|
background: "transparent",
|
|
571
951
|
border: "none",
|
|
572
952
|
color: "inherit",
|
|
573
953
|
cursor: "pointer",
|
|
574
|
-
fontSize: "14px",
|
|
575
954
|
padding: "0 4px",
|
|
576
|
-
opacity: .8
|
|
955
|
+
opacity: .8,
|
|
956
|
+
display: "inline-flex",
|
|
957
|
+
alignItems: "center"
|
|
577
958
|
},
|
|
578
959
|
onClick: () => setToast(null)
|
|
579
|
-
}, "
|
|
960
|
+
}, uiIcon("x", 12)));
|
|
580
961
|
};
|
|
581
|
-
const renderQuotaBar = (label,
|
|
962
|
+
const renderQuotaBar = (label, familyKey, acc) => {
|
|
582
963
|
const info = acc.quotas[familyKey];
|
|
583
964
|
const cd = acc.cooldowns[familyKey];
|
|
584
965
|
const inCooldown = cd && cd.cooldownUntil > Date.now();
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
966
|
+
let pct5h = typeof info?.remainingFraction === "number" && Number.isFinite(info.remainingFraction) ? Math.max(0, Math.min(100, Math.round(info.remainingFraction * 100))) : -1;
|
|
967
|
+
if (inCooldown) pct5h = 0;
|
|
968
|
+
const w5h = formatQuotaWindow(info?.resetTime);
|
|
969
|
+
const pctWeekly = typeof info?.weeklyFraction === "number" && Number.isFinite(info.weeklyFraction) ? Math.max(0, Math.min(100, Math.round(info.weeklyFraction * 100))) : -1;
|
|
970
|
+
const wWeekly = formatQuotaWindow(info?.weeklyResetTime);
|
|
971
|
+
const getColors = (pct) => {
|
|
972
|
+
if (pct < 0) return {
|
|
973
|
+
bar: "var(--agy-quota-none-border)",
|
|
974
|
+
text: "var(--agy-quota-none-text)",
|
|
975
|
+
bg: "var(--agy-quota-none-bg)",
|
|
976
|
+
border: "var(--agy-quota-none-border)"
|
|
977
|
+
};
|
|
978
|
+
if (pct <= 20) return {
|
|
979
|
+
bar: "linear-gradient(90deg, #dc2626, #ef4444)",
|
|
980
|
+
text: "var(--agy-quota-low-text)",
|
|
981
|
+
bg: "var(--agy-quota-low-bg)",
|
|
982
|
+
border: "var(--agy-quota-low-border)"
|
|
983
|
+
};
|
|
984
|
+
if (pct <= 50) return {
|
|
985
|
+
bar: "linear-gradient(90deg, #d97706, #f59e0b)",
|
|
986
|
+
text: "var(--agy-quota-med-text)",
|
|
987
|
+
bg: "var(--agy-quota-med-bg)",
|
|
988
|
+
border: "var(--agy-quota-med-border)"
|
|
989
|
+
};
|
|
990
|
+
return {
|
|
991
|
+
bar: "linear-gradient(90deg, #059669, #10b981)",
|
|
992
|
+
text: "var(--agy-quota-high-text)",
|
|
993
|
+
bg: "var(--agy-quota-high-bg)",
|
|
994
|
+
border: "var(--agy-quota-high-border)"
|
|
995
|
+
};
|
|
996
|
+
};
|
|
997
|
+
const c5h = getColors(pct5h);
|
|
998
|
+
const cWeekly = getColors(pctWeekly);
|
|
999
|
+
const renderLine = (windowName, percent, c, resetStr) => {
|
|
1000
|
+
return h("div", { style: {
|
|
1001
|
+
display: "flex",
|
|
1002
|
+
alignItems: "center",
|
|
1003
|
+
fontSize: "11.5px",
|
|
1004
|
+
margin: "4px 0"
|
|
1005
|
+
} }, h("span", { style: {
|
|
1006
|
+
width: "52px",
|
|
1007
|
+
color: "var(--agy-text-window-label)",
|
|
1008
|
+
fontSize: "11px",
|
|
1009
|
+
fontWeight: 700,
|
|
1010
|
+
flexShrink: 0
|
|
1011
|
+
} }, windowName), h("div", { style: S.progressBarBg }, h("div", {
|
|
1012
|
+
className: "agy-progress-fill",
|
|
1013
|
+
style: {
|
|
1014
|
+
width: `${percent < 0 ? 100 : percent}%`,
|
|
1015
|
+
height: "100%",
|
|
1016
|
+
background: c.bar,
|
|
1017
|
+
borderRadius: "3px"
|
|
1018
|
+
}
|
|
1019
|
+
})), h("div", { style: {
|
|
1020
|
+
display: "inline-flex",
|
|
1021
|
+
alignItems: "center",
|
|
1022
|
+
gap: "8px",
|
|
1023
|
+
minWidth: "140px",
|
|
1024
|
+
justifyContent: "flex-end",
|
|
1025
|
+
flexShrink: 0
|
|
1026
|
+
} }, h("span", { style: {
|
|
1027
|
+
padding: "2px 7px",
|
|
1028
|
+
borderRadius: "4px",
|
|
1029
|
+
background: c.bg,
|
|
1030
|
+
color: c.text,
|
|
1031
|
+
border: `1px solid ${c.border}`,
|
|
1032
|
+
fontWeight: 700,
|
|
1033
|
+
fontSize: "11.5px",
|
|
1034
|
+
lineHeight: 1.2
|
|
1035
|
+
} }, percent < 0 ? "—" : `${percent}%`), resetStr ? h("span", { style: {
|
|
1036
|
+
color: "var(--agy-text-secondary)",
|
|
1037
|
+
fontSize: "11px",
|
|
1038
|
+
fontWeight: 500
|
|
1039
|
+
} }, `↻ ${resetStr}`) : null));
|
|
1040
|
+
};
|
|
612
1041
|
return h("div", { style: {
|
|
613
|
-
display: "flex",
|
|
614
|
-
alignItems: "center",
|
|
615
|
-
fontSize: "11px",
|
|
616
1042
|
margin: "6px 0",
|
|
617
|
-
|
|
618
|
-
|
|
1043
|
+
padding: "8px 10px",
|
|
1044
|
+
background: "var(--agy-bg-subbox)",
|
|
1045
|
+
borderRadius: "7px",
|
|
1046
|
+
border: "1px solid var(--agy-border-box)"
|
|
619
1047
|
} }, h("div", { style: {
|
|
620
|
-
|
|
621
|
-
display: "inline-flex",
|
|
622
|
-
alignItems: "center",
|
|
623
|
-
gap: "4px",
|
|
624
|
-
fontWeight: 500
|
|
625
|
-
} }, h("span", null, icon), h("span", null, label), hasData ? h("span", { style: {
|
|
626
|
-
fontSize: "9.5px",
|
|
627
|
-
padding: "0 4px",
|
|
628
|
-
borderRadius: "3px",
|
|
629
|
-
background: windowInfo.isWeeklyLockout ? "rgba(239,68,68,0.2)" : "rgba(128,128,128,0.14)",
|
|
630
|
-
color: windowInfo.isWeeklyLockout ? "#ef4444" : "#9aa0a6",
|
|
631
|
-
border: "1px solid rgba(128,128,128,0.2)"
|
|
632
|
-
} }, windowInfo.windowType) : null), h("div", { style: S.progressBarBg }, h("div", {
|
|
633
|
-
className: "agy-progress-fill",
|
|
634
|
-
style: {
|
|
635
|
-
width: `${percent < 0 ? 100 : percent}%`,
|
|
636
|
-
height: "100%",
|
|
637
|
-
background: barGradient,
|
|
638
|
-
borderRadius: "3px"
|
|
639
|
-
}
|
|
640
|
-
})), h("div", { style: {
|
|
641
|
-
display: "inline-flex",
|
|
1048
|
+
display: "flex",
|
|
642
1049
|
alignItems: "center",
|
|
643
1050
|
gap: "6px",
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
background: badgeBg,
|
|
650
|
-
color: textColor,
|
|
651
|
-
fontWeight: 600,
|
|
652
|
-
fontSize: "11px"
|
|
653
|
-
} }, percent < 0 ? `— ${statusLabel}` : `${percent}% ${statusLabel}`), windowInfo.resetText ? h("span", { style: {
|
|
654
|
-
...S.muted,
|
|
655
|
-
fontSize: "10px"
|
|
656
|
-
} }, `(${windowInfo.resetText})`) : null));
|
|
1051
|
+
fontWeight: 700,
|
|
1052
|
+
fontSize: "12.5px",
|
|
1053
|
+
marginBottom: "5px",
|
|
1054
|
+
color: "var(--agy-text-primary)"
|
|
1055
|
+
} }, brandIcon(FAMILY_BRAND[familyKey], 14), h("span", null, label)), renderLine("5h 额度", pct5h, c5h, w5h.resetText), renderLine("周额度", pctWeekly, cWeekly, wWeekly.resetText));
|
|
657
1056
|
};
|
|
658
1057
|
const renderedAccountCards = accounts.map((acc) => {
|
|
659
1058
|
const isPrimary = acc.id === pool?.primaryAccountId;
|
|
660
1059
|
const hasCooldown = Object.entries(acc.cooldowns).some(([, cd]) => cd && cd.cooldownUntil > Date.now());
|
|
661
|
-
const dotColor = !acc.enabled ? "#
|
|
1060
|
+
const dotColor = !acc.enabled ? "#64748b" : hasCooldown ? "#f59e0b" : "#10b981";
|
|
662
1061
|
const isEditingProxy = editingProxyId === acc.id;
|
|
663
1062
|
const isExpanded = expandedModels[acc.id] ?? false;
|
|
664
1063
|
const cardStyle = isPrimary ? { ...S.cardPrimary } : { ...S.card };
|
|
@@ -687,7 +1086,7 @@ window.__ModuleLoader__.load({
|
|
|
687
1086
|
display: "flex",
|
|
688
1087
|
alignItems: "center",
|
|
689
1088
|
justifyContent: "space-between",
|
|
690
|
-
marginBottom: "
|
|
1089
|
+
marginBottom: "8px"
|
|
691
1090
|
} }, h("div", { style: {
|
|
692
1091
|
display: "flex",
|
|
693
1092
|
alignItems: "center",
|
|
@@ -697,100 +1096,141 @@ window.__ModuleLoader__.load({
|
|
|
697
1096
|
className: "agy-pulse-dot",
|
|
698
1097
|
style: {
|
|
699
1098
|
background: dotColor,
|
|
700
|
-
boxShadow: `0 0 8px ${dotColor}
|
|
1099
|
+
boxShadow: `0 0 8px ${dotColor}aa`
|
|
701
1100
|
}
|
|
702
1101
|
}), h("span", { style: {
|
|
703
|
-
fontWeight:
|
|
704
|
-
fontSize: "
|
|
1102
|
+
fontWeight: 700,
|
|
1103
|
+
fontSize: "13.5px",
|
|
1104
|
+
color: "var(--agy-text-primary)"
|
|
705
1105
|
} }, acc.alias), acc.email ? h("span", { style: {
|
|
706
1106
|
...S.badgeTag,
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
1107
|
+
background: "var(--agy-badge-email-bg)",
|
|
1108
|
+
color: "var(--agy-badge-email-text)",
|
|
1109
|
+
borderColor: "var(--agy-badge-email-border)",
|
|
1110
|
+
gap: "5px"
|
|
1111
|
+
} }, uiIcon("mail", 11, "var(--agy-badge-email-text)"), acc.email) : null, isPrimary ? h("span", { style: {
|
|
1112
|
+
...S.badgePrimary,
|
|
1113
|
+
gap: "4px"
|
|
1114
|
+
} }, uiIcon("star", 10, "var(--agy-badge-primary-text)"), "主用") : null, acc.proxyUrl ? h("span", { style: {
|
|
710
1115
|
...S.badgeTag,
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
display: "flex",
|
|
1116
|
+
background: "var(--agy-badge-proxy-bg)",
|
|
1117
|
+
color: "var(--agy-badge-proxy-text)",
|
|
1118
|
+
borderColor: "var(--agy-badge-proxy-border)",
|
|
715
1119
|
gap: "5px"
|
|
1120
|
+
} }, uiIcon("globe", 11, "var(--agy-badge-proxy-text)"), "代理") : null), h("div", { style: {
|
|
1121
|
+
display: "flex",
|
|
1122
|
+
gap: "5px",
|
|
1123
|
+
alignItems: "center"
|
|
716
1124
|
} }, allChildModels.length > 0 ? h("button", {
|
|
717
1125
|
type: "button",
|
|
718
1126
|
className: "agy-btn",
|
|
719
|
-
style: isExpanded ? {
|
|
1127
|
+
style: isExpanded ? {
|
|
1128
|
+
...S.btnSmPrimary,
|
|
1129
|
+
gap: "3px"
|
|
1130
|
+
} : {
|
|
1131
|
+
...S.btnSm,
|
|
1132
|
+
gap: "3px"
|
|
1133
|
+
},
|
|
720
1134
|
onClick: () => toggleExpand(acc.id)
|
|
721
|
-
}, isExpanded ? "
|
|
1135
|
+
}, isExpanded ? [uiIcon("chevronUp", 11), " 收起"] : [uiIcon("chevronDown", 11), " 明细"]) : null, !isPrimary ? h("button", {
|
|
722
1136
|
type: "button",
|
|
723
1137
|
className: "agy-btn",
|
|
724
|
-
style:
|
|
1138
|
+
style: {
|
|
1139
|
+
...S.btnSm,
|
|
1140
|
+
gap: "4px"
|
|
1141
|
+
},
|
|
725
1142
|
disabled: isBusy,
|
|
726
1143
|
onClick: () => void setPrimary(acc.id)
|
|
727
|
-
}, loadingAction === `primary:${acc.id}` ? [renderSpinner(), "设置中"] : "设为主用") : null, h("button", {
|
|
1144
|
+
}, loadingAction === `primary:${acc.id}` ? [renderSpinner(), "设置中"] : [uiIcon("star", 11), " 设为主用"]) : null, h("button", {
|
|
728
1145
|
type: "button",
|
|
729
1146
|
className: "agy-btn",
|
|
730
|
-
style: isEditingProxy ? {
|
|
1147
|
+
style: isEditingProxy ? {
|
|
1148
|
+
...S.btnSmPrimary,
|
|
1149
|
+
gap: "4px"
|
|
1150
|
+
} : {
|
|
1151
|
+
...S.btnSm,
|
|
1152
|
+
gap: "4px"
|
|
1153
|
+
},
|
|
731
1154
|
disabled: isBusy,
|
|
732
1155
|
onClick: () => setEditingProxyId(isEditingProxy ? null : acc.id)
|
|
733
|
-
}, "代理"), accounts.length > 1 ? h("button", {
|
|
1156
|
+
}, [uiIcon("globe", 11), " 代理"]), accounts.length > 1 ? h("button", {
|
|
734
1157
|
type: "button",
|
|
735
1158
|
className: "agy-btn",
|
|
736
|
-
style:
|
|
1159
|
+
style: {
|
|
1160
|
+
...S.btnDanger,
|
|
1161
|
+
padding: "3px 7px"
|
|
1162
|
+
},
|
|
1163
|
+
title: "移除此账号",
|
|
737
1164
|
disabled: isBusy,
|
|
738
1165
|
onClick: () => void removeAccount(acc.id, acc.alias)
|
|
739
|
-
}, loadingAction === `remove:${acc.id}` ?
|
|
1166
|
+
}, loadingAction === `remove:${acc.id}` ? renderSpinner() : uiIcon("trash", 12, "var(--agy-danger-text)")) : null)), h("div", { style: S.quotaBox }, renderQuotaBar("Gemini", "google", acc), renderQuotaBar("Claude", "anthropic", acc), renderQuotaBar("GPT-OSS", "openai", acc), isExpanded && allChildModels.length > 0 ? h("div", { style: {
|
|
740
1167
|
marginTop: "8px",
|
|
741
1168
|
paddingTop: "8px",
|
|
742
|
-
borderTop: "1px solid
|
|
1169
|
+
borderTop: "1px solid var(--agy-border-box)"
|
|
743
1170
|
} }, h("div", { style: {
|
|
744
|
-
|
|
745
|
-
marginBottom: "
|
|
746
|
-
fontWeight: 600
|
|
747
|
-
|
|
1171
|
+
color: "var(--agy-text-secondary)",
|
|
1172
|
+
marginBottom: "6px",
|
|
1173
|
+
fontWeight: 600,
|
|
1174
|
+
fontSize: "11px"
|
|
1175
|
+
} }, "单模型明细:"), allChildModels.map(({ family, model }) => {
|
|
748
1176
|
const frac = model.remainingFraction ?? 1;
|
|
749
1177
|
const pct = Math.round(frac * 100);
|
|
750
|
-
const w = formatQuotaWindow(model.resetTime
|
|
751
|
-
const pColor = pct <= 20 ? "
|
|
1178
|
+
const w = formatQuotaWindow(model.resetTime);
|
|
1179
|
+
const pColor = pct <= 20 ? "var(--agy-quota-low-text)" : pct <= 50 ? "var(--agy-quota-med-text)" : "var(--agy-quota-high-text)";
|
|
752
1180
|
return h("div", {
|
|
753
1181
|
key: model.modelId,
|
|
754
1182
|
className: "agy-submodel-row"
|
|
755
|
-
}, h("span", { style: {
|
|
1183
|
+
}, h("span", { style: {
|
|
1184
|
+
fontWeight: 500,
|
|
1185
|
+
color: "var(--agy-text-primary)"
|
|
1186
|
+
} }, `[${family}] ${model.displayName || model.modelId}`), h("div", { style: {
|
|
756
1187
|
display: "flex",
|
|
757
1188
|
alignItems: "center",
|
|
758
|
-
gap: "
|
|
1189
|
+
gap: "8px"
|
|
759
1190
|
} }, h("span", { style: {
|
|
760
1191
|
color: pColor,
|
|
761
|
-
fontWeight:
|
|
762
|
-
} }, `${pct}%`), w.resetText ? h("span", { style:
|
|
1192
|
+
fontWeight: 700
|
|
1193
|
+
} }, `${pct}%`), w.resetText ? h("span", { style: {
|
|
1194
|
+
color: "var(--agy-text-tertiary)",
|
|
1195
|
+
fontSize: "10.5px"
|
|
1196
|
+
} }, `↻ ${w.resetText}`) : null));
|
|
763
1197
|
})) : null), hasCooldown ? h("div", { style: {
|
|
764
|
-
background: "
|
|
765
|
-
border: "1px solid
|
|
766
|
-
borderRadius: "
|
|
767
|
-
padding: "
|
|
768
|
-
color: "
|
|
769
|
-
fontSize: "
|
|
770
|
-
|
|
1198
|
+
background: "var(--agy-warn-bg)",
|
|
1199
|
+
border: "1px solid var(--agy-warn-border)",
|
|
1200
|
+
borderRadius: "7px",
|
|
1201
|
+
padding: "6px 10px",
|
|
1202
|
+
color: "var(--agy-warn-text)",
|
|
1203
|
+
fontSize: "11.5px",
|
|
1204
|
+
fontWeight: 600,
|
|
1205
|
+
marginTop: "8px",
|
|
771
1206
|
display: "flex",
|
|
772
1207
|
alignItems: "center",
|
|
773
1208
|
justifyContent: "space-between"
|
|
774
|
-
} }, h("
|
|
1209
|
+
} }, h("div", { style: {
|
|
1210
|
+
display: "flex",
|
|
1211
|
+
alignItems: "center",
|
|
1212
|
+
gap: "6px"
|
|
1213
|
+
} }, uiIcon("alert", 13, "var(--agy-warn-text)"), h("span", null, "部分模型限流中,已自动切换账号")), h("button", {
|
|
775
1214
|
type: "button",
|
|
776
1215
|
className: "agy-btn",
|
|
777
1216
|
style: {
|
|
778
1217
|
...S.btnSm,
|
|
779
|
-
color: "
|
|
780
|
-
borderColor: "
|
|
781
|
-
background: "
|
|
1218
|
+
color: "var(--agy-warn-btn-text)",
|
|
1219
|
+
borderColor: "var(--agy-warn-btn-border)",
|
|
1220
|
+
background: "var(--agy-warn-btn-bg)",
|
|
1221
|
+
gap: "4px"
|
|
782
1222
|
},
|
|
783
1223
|
disabled: isBusy,
|
|
784
1224
|
onClick: () => void clearCooldown(acc.id)
|
|
785
|
-
}, loadingAction === `clearCooldown:${acc.id}` ? [renderSpinner(), ""] : "
|
|
786
|
-
marginTop: "
|
|
787
|
-
padding: "
|
|
788
|
-
background: "
|
|
789
|
-
borderRadius: "
|
|
790
|
-
border: "1px solid
|
|
1225
|
+
}, loadingAction === `clearCooldown:${acc.id}` ? [renderSpinner(), ""] : [uiIcon("zap", 11, "var(--agy-warn-btn-text)"), " 清除冷却"])) : null, isEditingProxy ? h("div", { style: {
|
|
1226
|
+
marginTop: "8px",
|
|
1227
|
+
padding: "10px 12px",
|
|
1228
|
+
background: "var(--agy-bg-subbox)",
|
|
1229
|
+
borderRadius: "7px",
|
|
1230
|
+
border: "1px solid var(--agy-border-subbox)"
|
|
791
1231
|
} }, h("div", { style: {
|
|
792
1232
|
display: "flex",
|
|
793
|
-
gap: "
|
|
1233
|
+
gap: "8px"
|
|
794
1234
|
} }, h("input", {
|
|
795
1235
|
style: S.input,
|
|
796
1236
|
value: proxyInputs[acc.id] !== void 0 ? proxyInputs[acc.id] : acc.proxyUrl ?? "",
|
|
@@ -816,10 +1256,14 @@ window.__ModuleLoader__.load({
|
|
|
816
1256
|
const flowPhase = poolAuth?.phase ?? "idle";
|
|
817
1257
|
const flowActive = flowPhase === "waiting" || flowPhase === "exchanging";
|
|
818
1258
|
const addAccountSection = addingAccount ? h("div", { style: S.authModal }, h("div", { style: {
|
|
819
|
-
fontWeight:
|
|
820
|
-
fontSize: "
|
|
821
|
-
marginBottom: "
|
|
822
|
-
|
|
1259
|
+
fontWeight: 700,
|
|
1260
|
+
fontSize: "13.5px",
|
|
1261
|
+
marginBottom: "10px",
|
|
1262
|
+
display: "flex",
|
|
1263
|
+
alignItems: "center",
|
|
1264
|
+
gap: "6px",
|
|
1265
|
+
color: "var(--agy-text-primary)"
|
|
1266
|
+
} }, uiIcon("plus", 13, "var(--agy-btn-primary-bg)"), "添加 Google 账号"), !flowActive ? h("div", null, h("div", { style: {
|
|
823
1267
|
display: "flex",
|
|
824
1268
|
gap: "8px"
|
|
825
1269
|
} }, h("input", {
|
|
@@ -830,38 +1274,50 @@ window.__ModuleLoader__.load({
|
|
|
830
1274
|
}), h("button", {
|
|
831
1275
|
type: "button",
|
|
832
1276
|
className: "agy-btn",
|
|
833
|
-
style:
|
|
1277
|
+
style: {
|
|
1278
|
+
...S.btnPrimary,
|
|
1279
|
+
gap: "4px"
|
|
1280
|
+
},
|
|
834
1281
|
disabled: isBusy,
|
|
835
1282
|
onClick: () => void handleBeginAddAccount()
|
|
836
|
-
}, loadingAction === "pool:beginAdd" ? [renderSpinner(), "正在打开浏览器..."] : "
|
|
1283
|
+
}, loadingAction === "pool:beginAdd" ? [renderSpinner(), "正在打开浏览器..."] : [uiIcon("externalLink", 12, "#ffffff"), " 打开浏览器登录"]), h("button", {
|
|
837
1284
|
type: "button",
|
|
838
1285
|
className: "agy-btn",
|
|
839
1286
|
style: S.btn,
|
|
840
1287
|
onClick: () => handleCancelAddAccount()
|
|
841
1288
|
}, "取消")), flowPhase === "failed" && poolAuth?.message ? h("div", { style: {
|
|
842
1289
|
...S.muted,
|
|
843
|
-
color: "
|
|
844
|
-
marginTop: "8px"
|
|
845
|
-
} }, `❌ ${poolAuth.message}`) : null) : h("div", null, h("div", { style: {
|
|
1290
|
+
color: "var(--agy-danger-text)",
|
|
1291
|
+
marginTop: "8px",
|
|
846
1292
|
display: "flex",
|
|
847
1293
|
alignItems: "center",
|
|
848
|
-
|
|
1294
|
+
gap: "5px",
|
|
1295
|
+
fontWeight: 600
|
|
1296
|
+
} }, uiIcon("alert", 12, "var(--agy-danger-text)"), poolAuth.message) : null) : h("div", null, h("div", { style: {
|
|
1297
|
+
display: "flex",
|
|
1298
|
+
alignItems: "center",
|
|
1299
|
+
color: "var(--agy-text-secondary)",
|
|
849
1300
|
marginBottom: "8px",
|
|
850
|
-
lineHeight: 1.5
|
|
851
|
-
|
|
1301
|
+
lineHeight: 1.5,
|
|
1302
|
+
fontSize: "12px"
|
|
1303
|
+
} }, renderSpinner(), flowPhase === "exchanging" ? "正在验证授权并激活账号,请稍候..." : "等待浏览器中完成 Google 授权,成功后将自动激活。"), poolAuth?.url ? h("div", { style: { marginBottom: "8px" } }, h("a", {
|
|
852
1304
|
href: poolAuth.url,
|
|
853
1305
|
target: "_blank",
|
|
854
1306
|
style: {
|
|
855
|
-
color: "#
|
|
856
|
-
textDecoration: "
|
|
1307
|
+
color: "var(--dsw-alias-state-business-primary, #2563eb)",
|
|
1308
|
+
textDecoration: "underline",
|
|
857
1309
|
fontSize: "12px",
|
|
858
|
-
fontWeight:
|
|
1310
|
+
fontWeight: 600,
|
|
1311
|
+
display: "inline-flex",
|
|
1312
|
+
alignItems: "center",
|
|
1313
|
+
gap: "4px"
|
|
859
1314
|
}
|
|
860
|
-
}, "
|
|
861
|
-
|
|
1315
|
+
}, uiIcon("externalLink", 12, "currentColor"), "若浏览器未打开,请点击此处手动打开 Google 登录页")) : null, h("div", { style: {
|
|
1316
|
+
color: "var(--agy-text-tertiary)",
|
|
862
1317
|
marginBottom: "6px",
|
|
863
|
-
fontSize: "
|
|
864
|
-
|
|
1318
|
+
fontSize: "11px",
|
|
1319
|
+
fontWeight: 500
|
|
1320
|
+
} }, "未完成自动回调时,可粘贴授权码或回调 URL:"), h("div", { style: {
|
|
865
1321
|
display: "flex",
|
|
866
1322
|
gap: "8px"
|
|
867
1323
|
} }, h("input", {
|
|
@@ -872,10 +1328,13 @@ window.__ModuleLoader__.load({
|
|
|
872
1328
|
}), h("button", {
|
|
873
1329
|
type: "button",
|
|
874
1330
|
className: "agy-btn",
|
|
875
|
-
style:
|
|
1331
|
+
style: {
|
|
1332
|
+
...S.btnPrimary,
|
|
1333
|
+
gap: "4px"
|
|
1334
|
+
},
|
|
876
1335
|
disabled: isBusy || !authCodeInput.trim(),
|
|
877
1336
|
onClick: () => void handleCompleteAddAccount()
|
|
878
|
-
}, loadingAction === "pool:completeAdd" ? [renderSpinner(), "验证激活中..."] : "
|
|
1337
|
+
}, loadingAction === "pool:completeAdd" ? [renderSpinner(), "验证激活中..."] : [uiIcon("check", 12, "#ffffff"), " 手动激活"]), h("button", {
|
|
879
1338
|
type: "button",
|
|
880
1339
|
className: "agy-btn",
|
|
881
1340
|
style: S.btn,
|
|
@@ -892,62 +1351,48 @@ window.__ModuleLoader__.load({
|
|
|
892
1351
|
display: "flex",
|
|
893
1352
|
alignItems: "center",
|
|
894
1353
|
gap: "8px"
|
|
895
|
-
} }, h("span", {
|
|
896
|
-
className: "agy-pulse-dot",
|
|
897
|
-
style: {
|
|
898
|
-
background: isAuthed ? "#10b981" : "#f59e0b",
|
|
899
|
-
boxShadow: `0 0 8px ${isAuthed ? "#10b981" : "#f59e0b"}`
|
|
900
|
-
}
|
|
901
|
-
}), h("span", { style: {
|
|
1354
|
+
} }, agyIcon(16), h("span", { style: {
|
|
902
1355
|
fontWeight: 700,
|
|
903
|
-
fontSize: "14px"
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
color: "#10b981",
|
|
907
|
-
background: "rgba(16,185,129,0.12)",
|
|
908
|
-
borderColor: "rgba(16,185,129,0.3)"
|
|
909
|
-
} : S.badgePrimary }, isAuthed ? "就绪" : "待认证")), h("div", { style: {
|
|
1356
|
+
fontSize: "14px",
|
|
1357
|
+
color: "var(--agy-text-primary)"
|
|
1358
|
+
} }, "Antigravity"), h("span", { style: isAuthed ? S.badgeReady : S.badgeUnready }, isAuthed ? "就绪" : "待认证")), h("div", { style: {
|
|
910
1359
|
display: "flex",
|
|
911
|
-
gap: "6px"
|
|
1360
|
+
gap: "6px",
|
|
1361
|
+
alignItems: "center"
|
|
912
1362
|
} }, !addingAccount ? h("button", {
|
|
913
1363
|
type: "button",
|
|
914
1364
|
className: "agy-btn",
|
|
915
|
-
style:
|
|
1365
|
+
style: {
|
|
1366
|
+
...S.btnPrimary,
|
|
1367
|
+
gap: "4px"
|
|
1368
|
+
},
|
|
916
1369
|
onClick: () => setAddingAccount(true)
|
|
917
|
-
}, "
|
|
1370
|
+
}, [uiIcon("plus", 12, "#ffffff"), " 添加账号"]) : null, h("button", {
|
|
918
1371
|
type: "button",
|
|
919
1372
|
className: "agy-btn",
|
|
920
|
-
style:
|
|
1373
|
+
style: {
|
|
1374
|
+
...S.btn,
|
|
1375
|
+
gap: "4px"
|
|
1376
|
+
},
|
|
921
1377
|
disabled: isBusy,
|
|
922
1378
|
onClick: () => void refreshQuota()
|
|
923
|
-
}, loadingAction === "refresh:all" ? [renderSpinner(), "刷新中"] : "
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
padding: "8px 10px",
|
|
928
|
-
marginBottom: "10px",
|
|
929
|
-
fontSize: "11px",
|
|
930
|
-
lineHeight: "1.6"
|
|
931
|
-
} }, h("div", { style: {
|
|
932
|
-
fontWeight: 600,
|
|
933
|
-
color: "#3b82f6",
|
|
934
|
-
marginBottom: "2px",
|
|
935
|
-
display: "flex",
|
|
936
|
-
alignItems: "center",
|
|
937
|
-
gap: "4px"
|
|
938
|
-
} }, "💡 Antigravity 额度机制说明 (5小时额度 & 周额度)"), h("div", { style: { opacity: .85 } }, h("div", null, "• 🕒 5小时短期额度:各模型族按 5 小时滚动窗口刷新配额,日常对话优先消耗此额度。"), h("div", null, "• 📅 周额度 / 总量上限:Google 账号设有周期总量保护;若高频重度使用触及周上限,重置时间将显示为数天后。"), h("div", null, "• 🔄 多账号号池调度:单账号 5 小时额度或周额度受限时,号池自动平滑接力至下一可用账号,无缝保障持续编码。"))), h("div", { style: {
|
|
939
|
-
marginTop: "14px",
|
|
940
|
-
paddingTop: "10px",
|
|
941
|
-
borderTop: "1px solid rgba(128,128,128,0.15)"
|
|
1379
|
+
}, loadingAction === "refresh:all" ? [renderSpinner(), "刷新中"] : [uiIcon("refresh", 12, "var(--agy-text-btn)"), " 刷新额度"]))), renderToastBanner(), addAccountSection, renderedAccountCards, h("div", { style: {
|
|
1380
|
+
marginTop: "16px",
|
|
1381
|
+
paddingTop: "12px",
|
|
1382
|
+
borderTop: "1px solid var(--agy-border-divider)"
|
|
942
1383
|
} }, h("div", { style: {
|
|
943
1384
|
display: "flex",
|
|
944
1385
|
flexDirection: "column",
|
|
945
|
-
gap: "
|
|
1386
|
+
gap: "10px"
|
|
946
1387
|
} }, h("div", { style: {
|
|
947
1388
|
display: "flex",
|
|
948
1389
|
alignItems: "center",
|
|
949
1390
|
justifyContent: "space-between"
|
|
950
|
-
} }, h("span", { style:
|
|
1391
|
+
} }, h("span", { style: {
|
|
1392
|
+
color: "var(--agy-text-primary)",
|
|
1393
|
+
fontWeight: 600,
|
|
1394
|
+
fontSize: "12.5px"
|
|
1395
|
+
} }, "权限模式:"), h("div", { style: S.segGroup }, h("button", {
|
|
951
1396
|
type: "button",
|
|
952
1397
|
style: status?.permissionMode === "plan" ? S.segBtnActive : S.segBtn,
|
|
953
1398
|
onClick: () => void setCfg("permissionMode", "plan")
|
|
@@ -959,15 +1404,20 @@ window.__ModuleLoader__.load({
|
|
|
959
1404
|
type: "button",
|
|
960
1405
|
style: status?.permissionMode === "skip" ? {
|
|
961
1406
|
...S.segBtnActive,
|
|
962
|
-
color: "
|
|
963
|
-
background: "
|
|
1407
|
+
color: "var(--agy-seg-danger-text)",
|
|
1408
|
+
background: "var(--agy-seg-danger-bg)",
|
|
1409
|
+
border: "1px solid var(--agy-seg-danger-border)"
|
|
964
1410
|
} : S.segBtn,
|
|
965
1411
|
onClick: () => void setCfg("permissionMode", "skip")
|
|
966
1412
|
}, "skip (全自动免确认)"))), h("div", { style: {
|
|
967
1413
|
display: "flex",
|
|
968
1414
|
alignItems: "center",
|
|
969
1415
|
justifyContent: "space-between"
|
|
970
|
-
} }, h("span", { style:
|
|
1416
|
+
} }, h("span", { style: {
|
|
1417
|
+
color: "var(--agy-text-primary)",
|
|
1418
|
+
fontWeight: 600,
|
|
1419
|
+
fontSize: "12.5px"
|
|
1420
|
+
} }, "思考强度:"), h("div", { style: S.segGroup }, h("button", {
|
|
971
1421
|
type: "button",
|
|
972
1422
|
style: status?.defaultEffort === "" ? S.segBtnActive : S.segBtn,
|
|
973
1423
|
onClick: () => void setCfg("defaultEffort", "")
|
|
@@ -987,7 +1437,11 @@ window.__ModuleLoader__.load({
|
|
|
987
1437
|
display: "flex",
|
|
988
1438
|
alignItems: "center",
|
|
989
1439
|
justifyContent: "space-between"
|
|
990
|
-
} }, h("span", { style:
|
|
1440
|
+
} }, h("span", { style: {
|
|
1441
|
+
color: "var(--agy-text-primary)",
|
|
1442
|
+
fontWeight: 600,
|
|
1443
|
+
fontSize: "12.5px"
|
|
1444
|
+
} }, "号池调度:"), h("div", { style: S.segGroup }, h("button", {
|
|
991
1445
|
type: "button",
|
|
992
1446
|
style: pool?.mode === "sequential" || !pool?.mode ? S.segBtnActive : S.segBtn,
|
|
993
1447
|
onClick: () => void setMode("sequential")
|
|
@@ -1030,92 +1484,42 @@ window.__ModuleLoader__.load({
|
|
|
1030
1484
|
display: "flex",
|
|
1031
1485
|
alignItems: "center",
|
|
1032
1486
|
justifyContent: "space-between",
|
|
1033
|
-
padding: "
|
|
1034
|
-
borderBottom: "1px solid
|
|
1035
|
-
background: "
|
|
1487
|
+
padding: "14px 18px",
|
|
1488
|
+
borderBottom: "1px solid var(--agy-border-card)",
|
|
1489
|
+
background: "var(--agy-bg-header)",
|
|
1490
|
+
color: "var(--agy-text-primary)"
|
|
1036
1491
|
} }, h("div", { style: {
|
|
1037
1492
|
display: "flex",
|
|
1038
1493
|
alignItems: "center",
|
|
1039
1494
|
gap: "8px"
|
|
1040
|
-
} },
|
|
1495
|
+
} }, agyIcon(18), h("strong", { style: {
|
|
1496
|
+
fontSize: "14.5px",
|
|
1497
|
+
fontWeight: 700,
|
|
1498
|
+
color: "var(--agy-text-primary)"
|
|
1499
|
+
} }, "Antigravity 管理控制台")), h("button", {
|
|
1041
1500
|
type: "button",
|
|
1042
1501
|
title: "关闭 (Esc)",
|
|
1043
1502
|
style: {
|
|
1044
|
-
background: "
|
|
1045
|
-
border: "
|
|
1046
|
-
color: "
|
|
1503
|
+
background: "var(--agy-bg-btn)",
|
|
1504
|
+
border: "1px solid var(--agy-border-btn)",
|
|
1505
|
+
color: "var(--agy-text-btn)",
|
|
1047
1506
|
cursor: "pointer",
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1507
|
+
padding: "4px 8px",
|
|
1508
|
+
borderRadius: "6px",
|
|
1509
|
+
display: "inline-flex",
|
|
1510
|
+
alignItems: "center"
|
|
1052
1511
|
},
|
|
1053
1512
|
onClick: () => agyModalStore.setOpen(false)
|
|
1054
|
-
}, "
|
|
1513
|
+
}, uiIcon("x", 14, "var(--agy-text-btn)"))), h("div", { style: {
|
|
1055
1514
|
overflowY: "auto",
|
|
1056
|
-
padding: "
|
|
1057
|
-
flex: "1"
|
|
1515
|
+
padding: "18px",
|
|
1516
|
+
flex: "1",
|
|
1517
|
+
background: "var(--agy-bg-panel)"
|
|
1058
1518
|
} }, h(AgySettingsSection, {
|
|
1059
1519
|
isModal: true,
|
|
1060
1520
|
onClose: () => agyModalStore.setOpen(false)
|
|
1061
1521
|
}))));
|
|
1062
1522
|
};
|
|
1063
|
-
/** Sidebar bottom-left action button + body portal modal */
|
|
1064
|
-
const AgySidebarFooterAction = (props) => {
|
|
1065
|
-
const [status, setStatus] = useState(statusCache);
|
|
1066
|
-
const isWide = props?.wide !== false;
|
|
1067
|
-
useEffect(() => {
|
|
1068
|
-
let alive = true;
|
|
1069
|
-
const tick = async () => {
|
|
1070
|
-
const st = await getStatus();
|
|
1071
|
-
if (!alive || !st) return;
|
|
1072
|
-
setStatus(st);
|
|
1073
|
-
};
|
|
1074
|
-
tick();
|
|
1075
|
-
const timer = setInterval(tick, 3e3);
|
|
1076
|
-
return () => {
|
|
1077
|
-
alive = false;
|
|
1078
|
-
clearInterval(timer);
|
|
1079
|
-
};
|
|
1080
|
-
}, []);
|
|
1081
|
-
const accounts = (status?.pool)?.accounts ?? [];
|
|
1082
|
-
const hasCooldown = accounts.some((a) => Object.entries(a.cooldowns).some(([, cd]) => cd && cd.cooldownUntil > Date.now()));
|
|
1083
|
-
const isAuthed = status?.auth?.phase === "ok" || accounts.length > 0;
|
|
1084
|
-
const dotColor = status === null ? "#9aa0a6" : status.dormantReason ? "#f59e0b" : hasCooldown ? "#f59e0b" : isAuthed ? "#10b981" : "#f59e0b";
|
|
1085
|
-
const button = h("button", {
|
|
1086
|
-
type: "button",
|
|
1087
|
-
title: `Antigravity: ${accounts.length} accounts (${isAuthed ? "就绪" : "待认证"}) · 点击打开管理控制台`,
|
|
1088
|
-
className: "agy-btn",
|
|
1089
|
-
style: {
|
|
1090
|
-
display: "inline-flex",
|
|
1091
|
-
alignItems: "center",
|
|
1092
|
-
gap: "6px",
|
|
1093
|
-
padding: isWide ? "5px 10px" : "6px",
|
|
1094
|
-
border: "1px solid rgba(128,128,128,0.22)",
|
|
1095
|
-
borderRadius: "8px",
|
|
1096
|
-
background: "rgba(128,128,128,0.08)",
|
|
1097
|
-
color: "inherit",
|
|
1098
|
-
cursor: "pointer",
|
|
1099
|
-
fontSize: "12px",
|
|
1100
|
-
lineHeight: 1.4
|
|
1101
|
-
},
|
|
1102
|
-
onClick: () => agyModalStore.setOpen(true)
|
|
1103
|
-
}, h("span", { style: { fontSize: "13px" } }, "🪐"), isWide ? h("span", { style: { fontWeight: 500 } }, "Antigravity") : null, h("span", { style: {
|
|
1104
|
-
display: "inline-block",
|
|
1105
|
-
width: "7px",
|
|
1106
|
-
height: "7px",
|
|
1107
|
-
borderRadius: "50%",
|
|
1108
|
-
background: dotColor,
|
|
1109
|
-
boxShadow: `0 0 6px ${dotColor}`
|
|
1110
|
-
} }), isWide && accounts.length > 0 ? h("span", { style: {
|
|
1111
|
-
fontSize: "10px",
|
|
1112
|
-
opacity: .75,
|
|
1113
|
-
background: "rgba(128,128,128,0.18)",
|
|
1114
|
-
padding: "1px 5px",
|
|
1115
|
-
borderRadius: "10px"
|
|
1116
|
-
} }, `${accounts.length}`) : null);
|
|
1117
|
-
return h("div", { style: { display: "inline-block" } }, button, portalToBody(h(AgyModalDialog, null)));
|
|
1118
|
-
};
|
|
1119
1523
|
/** Session Header badge in chat toolbar */
|
|
1120
1524
|
const AgySessionStatus = () => {
|
|
1121
1525
|
const [status, setStatus] = useState(statusCache);
|
|
@@ -1141,24 +1545,26 @@ window.__ModuleLoader__.load({
|
|
|
1141
1545
|
const accounts = (status?.pool)?.accounts ?? [];
|
|
1142
1546
|
const hasCooldown = accounts.some((a) => Object.entries(a.cooldowns).some(([, cd]) => cd && cd.cooldownUntil > Date.now()));
|
|
1143
1547
|
const isAuthed = status?.auth?.phase === "ok" || accounts.length > 0;
|
|
1144
|
-
const color = status === null ? "#
|
|
1145
|
-
|
|
1548
|
+
const color = status === null ? "#64748b" : status.dormantReason ? "#f59e0b" : hasCooldown ? "#f59e0b" : isAuthed ? "#10b981" : "#f59e0b";
|
|
1549
|
+
const badge = h("button", {
|
|
1146
1550
|
type: "button",
|
|
1147
1551
|
title: `Antigravity: ${accounts.length} accounts ready · 点击打开控制台`,
|
|
1148
1552
|
className: "agy-btn",
|
|
1149
1553
|
onClick: () => agyModalStore.setOpen(true),
|
|
1150
1554
|
style: {
|
|
1151
|
-
background: "
|
|
1152
|
-
border: "1px solid
|
|
1555
|
+
background: "var(--agy-bg-header)",
|
|
1556
|
+
border: "1px solid var(--agy-border-card)",
|
|
1153
1557
|
borderRadius: "999px",
|
|
1154
1558
|
cursor: "pointer",
|
|
1155
|
-
padding: "
|
|
1156
|
-
fontSize: "
|
|
1559
|
+
padding: "3px 10px",
|
|
1560
|
+
fontSize: "11.5px",
|
|
1561
|
+
fontWeight: 600,
|
|
1157
1562
|
lineHeight: 1.5,
|
|
1158
|
-
color: "
|
|
1563
|
+
color: "var(--agy-text-primary)",
|
|
1159
1564
|
display: "inline-flex",
|
|
1160
1565
|
alignItems: "center",
|
|
1161
|
-
gap: "
|
|
1566
|
+
gap: "6px",
|
|
1567
|
+
boxShadow: "var(--agy-shadow-card)"
|
|
1162
1568
|
}
|
|
1163
1569
|
}, h("span", { style: {
|
|
1164
1570
|
display: "inline-block",
|
|
@@ -1167,6 +1573,7 @@ window.__ModuleLoader__.load({
|
|
|
1167
1573
|
borderRadius: "50%",
|
|
1168
1574
|
background: color
|
|
1169
1575
|
} }), `AGY (${accounts.length})`);
|
|
1576
|
+
return h("div", { style: { display: "inline-block" } }, badge, portalToBody(h(AgyModalDialog, null)));
|
|
1170
1577
|
};
|
|
1171
1578
|
ctx.slots.inject("conversation.session.header.actions", () => {
|
|
1172
1579
|
return ctx.slots.register({
|
|
@@ -1184,14 +1591,6 @@ window.__ModuleLoader__.load({
|
|
|
1184
1591
|
label: "Antigravity"
|
|
1185
1592
|
}, AgySettingsSection);
|
|
1186
1593
|
});
|
|
1187
|
-
ctx.slots.inject("sidebar.footer.action", () => {
|
|
1188
|
-
return ctx.slots.register({
|
|
1189
|
-
name: "sidebar.footer.action",
|
|
1190
|
-
id: "agy-link-sidebar-footer",
|
|
1191
|
-
order: 50,
|
|
1192
|
-
label: "Antigravity"
|
|
1193
|
-
}, AgySidebarFooterAction);
|
|
1194
|
-
});
|
|
1195
1594
|
}
|
|
1196
1595
|
//#endregion
|
|
1197
1596
|
exports.apply = apply;
|