@cartanova/qgrid-cli 2.11.0 → 2.11.1
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/bundle/web-dist/client/assets/index-C96h3feE.js +32 -0
- package/bundle/web-dist/client/assets/logs-DBM6U0QD.js +1 -0
- package/bundle/web-dist/client/assets/monit-BBjXa7vB.js +1 -0
- package/bundle/web-dist/client/assets/plus-BsQdY7PS.js +1 -0
- package/bundle/web-dist/client/assets/refresh-cw-D9IUmT23.js +1 -0
- package/bundle/web-dist/client/assets/request-model-Bpp_rkK8.js +1 -0
- package/bundle/web-dist/client/assets/routes-Crz_PQzi.js +5 -0
- package/bundle/web-dist/client/assets/{services.generated-CefiDXEv.js → services.generated-B5lc3aIC.js} +1 -1
- package/bundle/web-dist/client/assets/settings-Cdwm3OBB.js +1 -0
- package/bundle/web-dist/client/assets/show-DBUhALT1.js +2 -0
- package/bundle/web-dist/client/assets/tokens-CVQAVJTo.js +1 -0
- package/bundle/web-dist/client/assets/use-oauth-login-flow-BfxYI4Oh.js +1 -0
- package/bundle/web-dist/client/assets/use-update-token-mutation-qKBC2sn7.js +1 -0
- package/bundle/web-dist/client/assets/vendor-react-DH4kUfK2.js +9 -0
- package/bundle/web-dist/client/assets/vendor-tanstack-DRPs09ai.js +1 -0
- package/bundle/web-dist/client/index.html +4 -4
- package/bundle/web-dist/server/assets/{lazyRouteComponent-D8iTIHyn.js → lazyRouteComponent-AKiHfZWp.js} +2 -2
- package/bundle/web-dist/server/assets/logs-B7QmGJq3.js +513 -0
- package/bundle/web-dist/server/assets/{monit-B2hqorPe.js → monit-DFt7x3bh.js} +117 -375
- package/bundle/web-dist/server/assets/plus-DaYQRpBt.js +19 -0
- package/bundle/web-dist/server/assets/{react-dom-BIYQzBqG.js → react-dom-Cv23mm1K.js} +1 -1
- package/bundle/web-dist/server/assets/refresh-cw-BpXNsAy-.js +23 -0
- package/bundle/web-dist/server/assets/{request-model-I6OdODSH.js → request-model-eHE6YbaF.js} +6 -15
- package/bundle/web-dist/server/assets/{routes-B95YlUv2.js → routes-_Y-PJfgO.js} +203 -679
- package/bundle/web-dist/server/assets/{services.generated-DQATJ6qf.js → services.generated-CMJ8AHbO.js} +3796 -4012
- package/bundle/web-dist/server/assets/settings-JwJKxn2e.js +461 -0
- package/bundle/web-dist/server/assets/{show-Bxaj3rhH.js → show-BEv6z1v_.js} +368 -1270
- package/bundle/web-dist/server/assets/tokens-CNT4mI-f.js +560 -0
- package/bundle/web-dist/server/assets/{use-oauth-login-flow-CKDHgc3U.js → use-oauth-login-flow-jkAkT3X6.js} +16 -50
- package/bundle/web-dist/server/assets/{use-update-token-mutation-BEbgOzaa.js → use-update-token-mutation-Sm6kh02m.js} +1 -1
- package/bundle/web-dist/server/entry-server.generated.js +1130 -2626
- package/package.json +1 -1
- package/bundle/web-dist/client/assets/index-BA7uQ-6c.js +0 -31
- package/bundle/web-dist/client/assets/logs-C47OJGEI.js +0 -1
- package/bundle/web-dist/client/assets/monit-BS9no0dU.js +0 -4
- package/bundle/web-dist/client/assets/plus-sdACTfH0.js +0 -1
- package/bundle/web-dist/client/assets/refresh-cw-CY8o_1cT.js +0 -1
- package/bundle/web-dist/client/assets/request-model-BRtFuZvj.js +0 -1
- package/bundle/web-dist/client/assets/routes-kqgkUxE8.js +0 -5
- package/bundle/web-dist/client/assets/settings-DNDvFGSw.js +0 -1
- package/bundle/web-dist/client/assets/show-u8Np69q3.js +0 -2
- package/bundle/web-dist/client/assets/tokens-QvP410NW.js +0 -1
- package/bundle/web-dist/client/assets/use-oauth-login-flow-Bzdh28Ws.js +0 -1
- package/bundle/web-dist/client/assets/use-update-token-mutation-CfJKaxmR.js +0 -1
- package/bundle/web-dist/client/assets/vendor-react-CUFFrVN9.js +0 -244
- package/bundle/web-dist/client/assets/vendor-tanstack-Bf_jag9G.js +0 -1
- package/bundle/web-dist/server/assets/logs-B3OTd9hy.js +0 -825
- package/bundle/web-dist/server/assets/plus-DwG7h9kq.js +0 -28
- package/bundle/web-dist/server/assets/refresh-cw-mMBkwOq0.js +0 -44
- package/bundle/web-dist/server/assets/settings-C3gbGk0m.js +0 -830
- package/bundle/web-dist/server/assets/tokens-CZjH3cB7.js +0 -1038
|
@@ -1,1038 +0,0 @@
|
|
|
1
|
-
import { F as require_react, N as useQueryClient, k as require_jsx_dev_runtime, n as QgridService, o as TokenService, tt as __toESM } from "./services.generated-DQATJ6qf.js";
|
|
2
|
-
import { i as o, n as useOAuthLoginFlow, r as OAuthCodeEntry } from "./use-oauth-login-flow-CKDHgc3U.js";
|
|
3
|
-
import { u as lucideKeyRound } from "../entry-server.generated.js";
|
|
4
|
-
import { t as useUpdateTokenMutation } from "./use-update-token-mutation-BEbgOzaa.js";
|
|
5
|
-
import { t as lucidePlus } from "./plus-DwG7h9kq.js";
|
|
6
|
-
//#region src/components/qgrid/DeviceCodeEntry.tsx
|
|
7
|
-
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
8
|
-
var import_jsx_dev_runtime = require_jsx_dev_runtime();
|
|
9
|
-
var _jsxFileName$5 = "/home/runner/work/qgrid/qgrid/packages/web/src/components/qgrid/DeviceCodeEntry.tsx";
|
|
10
|
-
function formatRemaining(ms) {
|
|
11
|
-
const totalSec = Math.max(Math.ceil(ms / 1e3), 0);
|
|
12
|
-
const m = Math.floor(totalSec / 60);
|
|
13
|
-
const s = totalSec % 60;
|
|
14
|
-
return `${m}:${String(s).padStart(2, "0")}`;
|
|
15
|
-
}
|
|
16
|
-
/** 만료 시각까지 1초마다 갱신되는 남은 시간. */
|
|
17
|
-
function Countdown({ expiresAt }) {
|
|
18
|
-
const [now, setNow] = (0, import_react.useState)(() => Date.now());
|
|
19
|
-
(0, import_react.useEffect)(() => {
|
|
20
|
-
const id = window.setInterval(() => setNow(Date.now()), 1e3);
|
|
21
|
-
return () => clearInterval(id);
|
|
22
|
-
}, []);
|
|
23
|
-
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
24
|
-
className: "tabular-nums",
|
|
25
|
-
children: formatRemaining(expiresAt - now)
|
|
26
|
-
}, void 0, false, {
|
|
27
|
-
fileName: _jsxFileName$5,
|
|
28
|
-
lineNumber: 22,
|
|
29
|
-
columnNumber: 10
|
|
30
|
-
}, this);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Grok device-code 로그인 단계. 사용자 코드와 인증 링크를 보여 주고, 폴링 상태를 표시한다.
|
|
34
|
-
* 폴링 자체는 `useOAuthLoginFlow().startDevice` 가 소유한다.
|
|
35
|
-
*/
|
|
36
|
-
function DeviceCodeEntry({ flow, onRestart }) {
|
|
37
|
-
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
38
|
-
className: "space-y-2",
|
|
39
|
-
children: [
|
|
40
|
-
flow.status === "starting" && /* @__PURE__ */ (void 0)("p", {
|
|
41
|
-
className: "flex items-center gap-1.5 text-[12px] text-sand-600",
|
|
42
|
-
children: [/* @__PURE__ */ (void 0)("span", { className: "w-3.5 h-3.5 border-2 border-sand-400 border-t-transparent rounded-full animate-spin" }, void 0, false, {
|
|
43
|
-
fileName: _jsxFileName$5,
|
|
44
|
-
lineNumber: 40,
|
|
45
|
-
columnNumber: 11
|
|
46
|
-
}, this), "Requesting device code..."]
|
|
47
|
-
}, void 0, true, {
|
|
48
|
-
fileName: _jsxFileName$5,
|
|
49
|
-
lineNumber: 39,
|
|
50
|
-
columnNumber: 9
|
|
51
|
-
}, this),
|
|
52
|
-
flow.status === "waiting" && /* @__PURE__ */ (void 0)(import_jsx_dev_runtime.Fragment, { children: [
|
|
53
|
-
/* @__PURE__ */ (void 0)("p", {
|
|
54
|
-
className: "text-[12px] text-sand-600 leading-relaxed",
|
|
55
|
-
children: "아래 링크를 열어 xAI 계정으로 로그인한 뒤 이 코드를 입력하세요. 승인되면 토큰이 자동으로 추가됩니다."
|
|
56
|
-
}, void 0, false, {
|
|
57
|
-
fileName: _jsxFileName$5,
|
|
58
|
-
lineNumber: 47,
|
|
59
|
-
columnNumber: 11
|
|
60
|
-
}, this),
|
|
61
|
-
/* @__PURE__ */ (void 0)("div", {
|
|
62
|
-
className: "rounded-md border border-sand-200 bg-sand-50 px-3 py-3 text-center",
|
|
63
|
-
children: [/* @__PURE__ */ (void 0)("p", {
|
|
64
|
-
className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
|
|
65
|
-
children: "Device code"
|
|
66
|
-
}, void 0, false, {
|
|
67
|
-
fileName: _jsxFileName$5,
|
|
68
|
-
lineNumber: 52,
|
|
69
|
-
columnNumber: 13
|
|
70
|
-
}, this), /* @__PURE__ */ (void 0)("p", {
|
|
71
|
-
className: "mt-1 font-mono text-lg tracking-widest text-sand-900 select-all",
|
|
72
|
-
children: flow.userCode
|
|
73
|
-
}, void 0, false, {
|
|
74
|
-
fileName: _jsxFileName$5,
|
|
75
|
-
lineNumber: 55,
|
|
76
|
-
columnNumber: 13
|
|
77
|
-
}, this)]
|
|
78
|
-
}, void 0, true, {
|
|
79
|
-
fileName: _jsxFileName$5,
|
|
80
|
-
lineNumber: 51,
|
|
81
|
-
columnNumber: 11
|
|
82
|
-
}, this),
|
|
83
|
-
/* @__PURE__ */ (void 0)("a", {
|
|
84
|
-
href: flow.verificationUriComplete ?? flow.verificationUri,
|
|
85
|
-
target: "_blank",
|
|
86
|
-
rel: "noopener noreferrer",
|
|
87
|
-
className: "block w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white text-center hover:bg-sand-800 transition-colors duration-150",
|
|
88
|
-
children: "Open xAI to approve"
|
|
89
|
-
}, void 0, false, {
|
|
90
|
-
fileName: _jsxFileName$5,
|
|
91
|
-
lineNumber: 59,
|
|
92
|
-
columnNumber: 11
|
|
93
|
-
}, this),
|
|
94
|
-
/* @__PURE__ */ (void 0)("p", {
|
|
95
|
-
className: "flex items-center justify-between text-[11px] text-sand-500",
|
|
96
|
-
children: [/* @__PURE__ */ (void 0)("span", {
|
|
97
|
-
className: "flex items-center gap-1.5",
|
|
98
|
-
children: [/* @__PURE__ */ (void 0)("span", { className: "w-2.5 h-2.5 border-2 border-sand-400 border-t-transparent rounded-full animate-spin" }, void 0, false, {
|
|
99
|
-
fileName: _jsxFileName$5,
|
|
100
|
-
lineNumber: 69,
|
|
101
|
-
columnNumber: 15
|
|
102
|
-
}, this), flow.slowDown ? "Waiting for approval (polling slowed down)..." : "Waiting for approval..."]
|
|
103
|
-
}, void 0, true, {
|
|
104
|
-
fileName: _jsxFileName$5,
|
|
105
|
-
lineNumber: 68,
|
|
106
|
-
columnNumber: 13
|
|
107
|
-
}, this), /* @__PURE__ */ (void 0)("span", { children: ["expires in ", /* @__PURE__ */ (void 0)(Countdown, { expiresAt: flow.expiresAt }, void 0, false, {
|
|
108
|
-
fileName: _jsxFileName$5,
|
|
109
|
-
lineNumber: 75,
|
|
110
|
-
columnNumber: 26
|
|
111
|
-
}, this)] }, void 0, true, {
|
|
112
|
-
fileName: _jsxFileName$5,
|
|
113
|
-
lineNumber: 74,
|
|
114
|
-
columnNumber: 13
|
|
115
|
-
}, this)]
|
|
116
|
-
}, void 0, true, {
|
|
117
|
-
fileName: _jsxFileName$5,
|
|
118
|
-
lineNumber: 67,
|
|
119
|
-
columnNumber: 11
|
|
120
|
-
}, this)
|
|
121
|
-
] }, void 0, true),
|
|
122
|
-
flow.status === "added" && /* @__PURE__ */ (void 0)("p", {
|
|
123
|
-
className: "text-[12px] text-sage-600",
|
|
124
|
-
children: [
|
|
125
|
-
"Token \"",
|
|
126
|
-
flow.name,
|
|
127
|
-
"\" added."
|
|
128
|
-
]
|
|
129
|
-
}, void 0, true, {
|
|
130
|
-
fileName: _jsxFileName$5,
|
|
131
|
-
lineNumber: 82,
|
|
132
|
-
columnNumber: 9
|
|
133
|
-
}, this),
|
|
134
|
-
flow.status === "expired" && /* @__PURE__ */ (void 0)("p", {
|
|
135
|
-
className: "text-[11px] text-red-500",
|
|
136
|
-
children: "Device code가 만료되었습니다 — 로그인을 다시 시작하세요."
|
|
137
|
-
}, void 0, false, {
|
|
138
|
-
fileName: _jsxFileName$5,
|
|
139
|
-
lineNumber: 86,
|
|
140
|
-
columnNumber: 9
|
|
141
|
-
}, this),
|
|
142
|
-
flow.status === "error" && /* @__PURE__ */ (void 0)("p", {
|
|
143
|
-
className: "text-[11px] text-red-500",
|
|
144
|
-
children: flow.message
|
|
145
|
-
}, void 0, false, {
|
|
146
|
-
fileName: _jsxFileName$5,
|
|
147
|
-
lineNumber: 91,
|
|
148
|
-
columnNumber: 35
|
|
149
|
-
}, this),
|
|
150
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
151
|
-
type: "button",
|
|
152
|
-
className: "w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150",
|
|
153
|
-
onClick: onRestart,
|
|
154
|
-
children: "처음부터 다시 시작"
|
|
155
|
-
}, void 0, false, {
|
|
156
|
-
fileName: _jsxFileName$5,
|
|
157
|
-
lineNumber: 93,
|
|
158
|
-
columnNumber: 7
|
|
159
|
-
}, this)
|
|
160
|
-
]
|
|
161
|
-
}, void 0, true, {
|
|
162
|
-
fileName: _jsxFileName$5,
|
|
163
|
-
lineNumber: 37,
|
|
164
|
-
columnNumber: 5
|
|
165
|
-
}, this);
|
|
166
|
-
}
|
|
167
|
-
//#endregion
|
|
168
|
-
//#region src/components/qgrid/AddTokenModal.tsx
|
|
169
|
-
var _jsxFileName$4 = "/home/runner/work/qgrid/qgrid/packages/web/src/components/qgrid/AddTokenModal.tsx";
|
|
170
|
-
function Spinner({ light }) {
|
|
171
|
-
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
172
|
-
className: "flex items-center gap-1.5",
|
|
173
|
-
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { className: `w-3.5 h-3.5 border-2 border-t-transparent rounded-full animate-spin ${light ? "border-white" : "border-sand-400"}` }, void 0, false, {
|
|
174
|
-
fileName: _jsxFileName$4,
|
|
175
|
-
lineNumber: 13,
|
|
176
|
-
columnNumber: 7
|
|
177
|
-
}, this), "Waiting for login..."]
|
|
178
|
-
}, void 0, true, {
|
|
179
|
-
fileName: _jsxFileName$4,
|
|
180
|
-
lineNumber: 12,
|
|
181
|
-
columnNumber: 5
|
|
182
|
-
}, this);
|
|
183
|
-
}
|
|
184
|
-
function OrDivider() {
|
|
185
|
-
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
186
|
-
className: "flex items-center gap-3",
|
|
187
|
-
children: [
|
|
188
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "flex-1 h-px bg-sand-200" }, void 0, false, {
|
|
189
|
-
fileName: _jsxFileName$4,
|
|
190
|
-
lineNumber: 24,
|
|
191
|
-
columnNumber: 7
|
|
192
|
-
}, this),
|
|
193
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
194
|
-
className: "text-[10px] text-sand-400 uppercase",
|
|
195
|
-
children: "or"
|
|
196
|
-
}, void 0, false, {
|
|
197
|
-
fileName: _jsxFileName$4,
|
|
198
|
-
lineNumber: 25,
|
|
199
|
-
columnNumber: 7
|
|
200
|
-
}, this),
|
|
201
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "flex-1 h-px bg-sand-200" }, void 0, false, {
|
|
202
|
-
fileName: _jsxFileName$4,
|
|
203
|
-
lineNumber: 26,
|
|
204
|
-
columnNumber: 7
|
|
205
|
-
}, this)
|
|
206
|
-
]
|
|
207
|
-
}, void 0, true, {
|
|
208
|
-
fileName: _jsxFileName$4,
|
|
209
|
-
lineNumber: 23,
|
|
210
|
-
columnNumber: 5
|
|
211
|
-
}, this);
|
|
212
|
-
}
|
|
213
|
-
/** Provider 선택 버튼들. 상태는 상위(`useOAuthLoginFlow`)가 소유한다. */
|
|
214
|
-
function AddTokenProviderOptions({ disabled, loadingProvider, onStart, onStartGrokDevice }) {
|
|
215
|
-
const secondary = "w-full py-2.5 text-sm font-medium rounded-md border border-sand-300 text-sand-700 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2";
|
|
216
|
-
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
217
|
-
className: "space-y-2",
|
|
218
|
-
children: [
|
|
219
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
220
|
-
type: "button",
|
|
221
|
-
className: "w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2",
|
|
222
|
-
disabled,
|
|
223
|
-
onClick: () => onStart("openai"),
|
|
224
|
-
children: loadingProvider === "openai" ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Spinner, { light: true }, void 0, false, {
|
|
225
|
-
fileName: _jsxFileName$4,
|
|
226
|
-
lineNumber: 55,
|
|
227
|
-
columnNumber: 11
|
|
228
|
-
}, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideKeyRound, { className: "size-4" }, void 0, false, {
|
|
229
|
-
fileName: _jsxFileName$4,
|
|
230
|
-
lineNumber: 58,
|
|
231
|
-
columnNumber: 13
|
|
232
|
-
}, this), "Login with OpenAI"] }, void 0, true)
|
|
233
|
-
}, void 0, false, {
|
|
234
|
-
fileName: _jsxFileName$4,
|
|
235
|
-
lineNumber: 48,
|
|
236
|
-
columnNumber: 7
|
|
237
|
-
}, this),
|
|
238
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(OrDivider, {}, void 0, false, {
|
|
239
|
-
fileName: _jsxFileName$4,
|
|
240
|
-
lineNumber: 64,
|
|
241
|
-
columnNumber: 7
|
|
242
|
-
}, this),
|
|
243
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
244
|
-
type: "button",
|
|
245
|
-
className: secondary,
|
|
246
|
-
disabled,
|
|
247
|
-
onClick: () => onStart("anthropic"),
|
|
248
|
-
children: loadingProvider === "anthropic" ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Spinner, { light: false }, void 0, false, {
|
|
249
|
-
fileName: _jsxFileName$4,
|
|
250
|
-
lineNumber: 73,
|
|
251
|
-
columnNumber: 11
|
|
252
|
-
}, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideKeyRound, { className: "size-4" }, void 0, false, {
|
|
253
|
-
fileName: _jsxFileName$4,
|
|
254
|
-
lineNumber: 76,
|
|
255
|
-
columnNumber: 13
|
|
256
|
-
}, this), "Login with Claude"] }, void 0, true)
|
|
257
|
-
}, void 0, false, {
|
|
258
|
-
fileName: _jsxFileName$4,
|
|
259
|
-
lineNumber: 66,
|
|
260
|
-
columnNumber: 7
|
|
261
|
-
}, this),
|
|
262
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(OrDivider, {}, void 0, false, {
|
|
263
|
-
fileName: _jsxFileName$4,
|
|
264
|
-
lineNumber: 82,
|
|
265
|
-
columnNumber: 7
|
|
266
|
-
}, this),
|
|
267
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
268
|
-
type: "button",
|
|
269
|
-
className: secondary,
|
|
270
|
-
disabled,
|
|
271
|
-
onClick: onStartGrokDevice,
|
|
272
|
-
children: loadingProvider === "grok" ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Spinner, { light: false }, void 0, false, {
|
|
273
|
-
fileName: _jsxFileName$4,
|
|
274
|
-
lineNumber: 86,
|
|
275
|
-
columnNumber: 11
|
|
276
|
-
}, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideKeyRound, { className: "size-4" }, void 0, false, {
|
|
277
|
-
fileName: _jsxFileName$4,
|
|
278
|
-
lineNumber: 89,
|
|
279
|
-
columnNumber: 13
|
|
280
|
-
}, this), "Login with xAI"] }, void 0, true)
|
|
281
|
-
}, void 0, false, {
|
|
282
|
-
fileName: _jsxFileName$4,
|
|
283
|
-
lineNumber: 84,
|
|
284
|
-
columnNumber: 7
|
|
285
|
-
}, this)
|
|
286
|
-
]
|
|
287
|
-
}, void 0, true, {
|
|
288
|
-
fileName: _jsxFileName$4,
|
|
289
|
-
lineNumber: 47,
|
|
290
|
-
columnNumber: 5
|
|
291
|
-
}, this);
|
|
292
|
-
}
|
|
293
|
-
function AddTokenModal() {
|
|
294
|
-
const [open, setOpen] = (0, import_react.useState)(false);
|
|
295
|
-
const [name, setName] = (0, import_react.useState)("");
|
|
296
|
-
const oauth = useOAuthLoginFlow();
|
|
297
|
-
const close = () => {
|
|
298
|
-
setOpen(false);
|
|
299
|
-
setName("");
|
|
300
|
-
oauth.reset();
|
|
301
|
-
};
|
|
302
|
-
const submitPastedCode = async (pastedCode) => {
|
|
303
|
-
if (await oauth.submitCode(pastedCode)) close();
|
|
304
|
-
};
|
|
305
|
-
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
306
|
-
type: "button",
|
|
307
|
-
className: "px-3.5 py-1.5 text-[12px] font-medium rounded-lg bg-sienna-500 text-white hover:bg-sienna-600 disabled:opacity-50 transition-all duration-150 active:scale-[0.97] flex items-center gap-1.5 shadow-sm",
|
|
308
|
-
onClick: () => setOpen(true),
|
|
309
|
-
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucidePlus, { className: "size-3.5" }, void 0, false, {
|
|
310
|
-
fileName: _jsxFileName$4,
|
|
311
|
-
lineNumber: 120,
|
|
312
|
-
columnNumber: 9
|
|
313
|
-
}, this), "Add Token"]
|
|
314
|
-
}, void 0, true, {
|
|
315
|
-
fileName: _jsxFileName$4,
|
|
316
|
-
lineNumber: 115,
|
|
317
|
-
columnNumber: 7
|
|
318
|
-
}, this), open && /* @__PURE__ */ (void 0)("div", {
|
|
319
|
-
className: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",
|
|
320
|
-
children: [/* @__PURE__ */ (void 0)("div", {
|
|
321
|
-
className: "absolute inset-0 bg-sand-900/8 backdrop-blur-sm",
|
|
322
|
-
onClick: close,
|
|
323
|
-
onKeyDown: () => {}
|
|
324
|
-
}, void 0, false, {
|
|
325
|
-
fileName: _jsxFileName$4,
|
|
326
|
-
lineNumber: 126,
|
|
327
|
-
columnNumber: 11
|
|
328
|
-
}, this), /* @__PURE__ */ (void 0)("div", {
|
|
329
|
-
className: "relative panel shadow-xl w-full max-w-md mx-4",
|
|
330
|
-
children: [
|
|
331
|
-
/* @__PURE__ */ (void 0)("div", {
|
|
332
|
-
className: "px-5 py-4 border-b border-sand-100/50",
|
|
333
|
-
children: /* @__PURE__ */ (void 0)("h2", {
|
|
334
|
-
className: "text-base font-medium text-sand-900",
|
|
335
|
-
children: "Add Token"
|
|
336
|
-
}, void 0, false, {
|
|
337
|
-
fileName: _jsxFileName$4,
|
|
338
|
-
lineNumber: 134,
|
|
339
|
-
columnNumber: 15
|
|
340
|
-
}, this)
|
|
341
|
-
}, void 0, false, {
|
|
342
|
-
fileName: _jsxFileName$4,
|
|
343
|
-
lineNumber: 133,
|
|
344
|
-
columnNumber: 13
|
|
345
|
-
}, this),
|
|
346
|
-
/* @__PURE__ */ (void 0)("div", {
|
|
347
|
-
className: "px-5 py-4 space-y-4",
|
|
348
|
-
children: [/* @__PURE__ */ (void 0)("div", { children: [/* @__PURE__ */ (void 0)("label", {
|
|
349
|
-
htmlFor: "token-name",
|
|
350
|
-
className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
|
|
351
|
-
children: "Name *"
|
|
352
|
-
}, void 0, false, {
|
|
353
|
-
fileName: _jsxFileName$4,
|
|
354
|
-
lineNumber: 140,
|
|
355
|
-
columnNumber: 17
|
|
356
|
-
}, this), /* @__PURE__ */ (void 0)(o, {
|
|
357
|
-
value: name,
|
|
358
|
-
onChange: (e) => setName(e.target.value),
|
|
359
|
-
placeholder: "e.g. your-token-name",
|
|
360
|
-
className: "mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300"
|
|
361
|
-
}, void 0, false, {
|
|
362
|
-
fileName: _jsxFileName$4,
|
|
363
|
-
lineNumber: 146,
|
|
364
|
-
columnNumber: 17
|
|
365
|
-
}, this)] }, void 0, true, {
|
|
366
|
-
fileName: _jsxFileName$4,
|
|
367
|
-
lineNumber: 139,
|
|
368
|
-
columnNumber: 15
|
|
369
|
-
}, this), oauth.codeEntryProvider ? /* @__PURE__ */ (void 0)(OAuthCodeEntry, {
|
|
370
|
-
provider: oauth.codeEntryProvider,
|
|
371
|
-
isPending: oauth.completeMutation.isPending,
|
|
372
|
-
isError: oauth.completeMutation.isError,
|
|
373
|
-
onSubmit: (code) => void submitPastedCode(code),
|
|
374
|
-
onRestart: oauth.reset
|
|
375
|
-
}, void 0, false, {
|
|
376
|
-
fileName: _jsxFileName$4,
|
|
377
|
-
lineNumber: 156,
|
|
378
|
-
columnNumber: 17
|
|
379
|
-
}, this) : oauth.deviceFlow ? /* @__PURE__ */ (void 0)(DeviceCodeEntry, {
|
|
380
|
-
flow: oauth.deviceFlow,
|
|
381
|
-
onRestart: oauth.reset
|
|
382
|
-
}, void 0, false, {
|
|
383
|
-
fileName: _jsxFileName$4,
|
|
384
|
-
lineNumber: 164,
|
|
385
|
-
columnNumber: 17
|
|
386
|
-
}, this) : /* @__PURE__ */ (void 0)(AddTokenProviderOptions, {
|
|
387
|
-
disabled: !name.trim() || oauth.loadingProvider !== null,
|
|
388
|
-
loadingProvider: oauth.loadingProvider,
|
|
389
|
-
onStart: (provider) => void oauth.start(provider, name),
|
|
390
|
-
onStartGrokDevice: () => void oauth.startDevice(name, close)
|
|
391
|
-
}, void 0, false, {
|
|
392
|
-
fileName: _jsxFileName$4,
|
|
393
|
-
lineNumber: 166,
|
|
394
|
-
columnNumber: 17
|
|
395
|
-
}, this)]
|
|
396
|
-
}, void 0, true, {
|
|
397
|
-
fileName: _jsxFileName$4,
|
|
398
|
-
lineNumber: 137,
|
|
399
|
-
columnNumber: 13
|
|
400
|
-
}, this),
|
|
401
|
-
/* @__PURE__ */ (void 0)("div", {
|
|
402
|
-
className: "px-5 py-3 border-t border-sand-100/50 flex items-center justify-end gap-2",
|
|
403
|
-
children: /* @__PURE__ */ (void 0)("button", {
|
|
404
|
-
type: "button",
|
|
405
|
-
className: "px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150",
|
|
406
|
-
onClick: close,
|
|
407
|
-
children: "Cancel"
|
|
408
|
-
}, void 0, false, {
|
|
409
|
-
fileName: _jsxFileName$4,
|
|
410
|
-
lineNumber: 176,
|
|
411
|
-
columnNumber: 15
|
|
412
|
-
}, this)
|
|
413
|
-
}, void 0, false, {
|
|
414
|
-
fileName: _jsxFileName$4,
|
|
415
|
-
lineNumber: 175,
|
|
416
|
-
columnNumber: 13
|
|
417
|
-
}, this)
|
|
418
|
-
]
|
|
419
|
-
}, void 0, true, {
|
|
420
|
-
fileName: _jsxFileName$4,
|
|
421
|
-
lineNumber: 132,
|
|
422
|
-
columnNumber: 11
|
|
423
|
-
}, this)]
|
|
424
|
-
}, void 0, true, {
|
|
425
|
-
fileName: _jsxFileName$4,
|
|
426
|
-
lineNumber: 125,
|
|
427
|
-
columnNumber: 9
|
|
428
|
-
}, this)] }, void 0, true);
|
|
429
|
-
}
|
|
430
|
-
//#endregion
|
|
431
|
-
//#region ~icons/lucide/pencil.jsx
|
|
432
|
-
var _jsxFileName$3 = "~icons/lucide/pencil.jsx";
|
|
433
|
-
var lucidePencil = (props) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("svg", {
|
|
434
|
-
viewBox: "0 0 24 24",
|
|
435
|
-
width: "1.2em",
|
|
436
|
-
height: "1.2em",
|
|
437
|
-
...props,
|
|
438
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("path", {
|
|
439
|
-
fill: "none",
|
|
440
|
-
stroke: "currentColor",
|
|
441
|
-
strokeLinecap: "round",
|
|
442
|
-
strokeLinejoin: "round",
|
|
443
|
-
strokeWidth: 2,
|
|
444
|
-
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4"
|
|
445
|
-
}, void 0, false, {
|
|
446
|
-
fileName: _jsxFileName$3,
|
|
447
|
-
lineNumber: 2,
|
|
448
|
-
columnNumber: 96
|
|
449
|
-
}, void 0)
|
|
450
|
-
}, void 0, false, {
|
|
451
|
-
fileName: _jsxFileName$3,
|
|
452
|
-
lineNumber: 2,
|
|
453
|
-
columnNumber: 31
|
|
454
|
-
}, void 0);
|
|
455
|
-
//#endregion
|
|
456
|
-
//#region ~icons/lucide/trash-2.jsx
|
|
457
|
-
var _jsxFileName$2 = "~icons/lucide/trash-2.jsx";
|
|
458
|
-
var lucideTrash2 = (props) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("svg", {
|
|
459
|
-
viewBox: "0 0 24 24",
|
|
460
|
-
width: "1.2em",
|
|
461
|
-
height: "1.2em",
|
|
462
|
-
...props,
|
|
463
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("path", {
|
|
464
|
-
fill: "none",
|
|
465
|
-
stroke: "currentColor",
|
|
466
|
-
strokeLinecap: "round",
|
|
467
|
-
strokeLinejoin: "round",
|
|
468
|
-
strokeWidth: 2,
|
|
469
|
-
d: "M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
|
|
470
|
-
}, void 0, false, {
|
|
471
|
-
fileName: _jsxFileName$2,
|
|
472
|
-
lineNumber: 2,
|
|
473
|
-
columnNumber: 96
|
|
474
|
-
}, void 0)
|
|
475
|
-
}, void 0, false, {
|
|
476
|
-
fileName: _jsxFileName$2,
|
|
477
|
-
lineNumber: 2,
|
|
478
|
-
columnNumber: 31
|
|
479
|
-
}, void 0);
|
|
480
|
-
//#endregion
|
|
481
|
-
//#region src/lib/token-label.ts
|
|
482
|
-
function maskAccessToken(credentials) {
|
|
483
|
-
const token = credentials.accessToken;
|
|
484
|
-
if (!token) return "—";
|
|
485
|
-
return token.length <= 12 ? token : `${token.slice(0, 8)}...${token.slice(-4)}`;
|
|
486
|
-
}
|
|
487
|
-
//#endregion
|
|
488
|
-
//#region src/components/qgrid/TokenTable.tsx
|
|
489
|
-
var _jsxFileName$1 = "/home/runner/work/qgrid/qgrid/packages/web/src/components/qgrid/TokenTable.tsx";
|
|
490
|
-
function getExpiresAt(token) {
|
|
491
|
-
const c = token.credentials;
|
|
492
|
-
if ("accessTokenExpiresAt" in c) return c.accessTokenExpiresAt;
|
|
493
|
-
if ("authMode" in c) {
|
|
494
|
-
const ms = Date.parse(c.expiresAt);
|
|
495
|
-
return Number.isNaN(ms) ? null : ms;
|
|
496
|
-
}
|
|
497
|
-
return c.expiresAt;
|
|
498
|
-
}
|
|
499
|
-
function formatExpiry(expiresAt) {
|
|
500
|
-
if (!expiresAt) return {
|
|
501
|
-
text: "",
|
|
502
|
-
color: ""
|
|
503
|
-
};
|
|
504
|
-
const diff = expiresAt - Date.now();
|
|
505
|
-
if (diff <= 0) return {
|
|
506
|
-
text: "expired",
|
|
507
|
-
color: "text-red-500"
|
|
508
|
-
};
|
|
509
|
-
const h = Math.floor(diff / 36e5);
|
|
510
|
-
const m = Math.floor(diff % 36e5 / 6e4);
|
|
511
|
-
const text = h > 0 ? `${h}h ${m}m` : `${m}m`;
|
|
512
|
-
if (diff < 36e5) return {
|
|
513
|
-
text,
|
|
514
|
-
color: "text-amber-500"
|
|
515
|
-
};
|
|
516
|
-
return {
|
|
517
|
-
text,
|
|
518
|
-
color: "text-sand-400"
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
function TokenTable({ data, isLoading }) {
|
|
522
|
-
const [deleteTarget, setDeleteTarget] = (0, import_react.useState)(null);
|
|
523
|
-
const [editTarget, setEditTarget] = (0, import_react.useState)(null);
|
|
524
|
-
const [editName, setEditName] = (0, import_react.useState)("");
|
|
525
|
-
const queryClient = useQueryClient();
|
|
526
|
-
const removeMutation = QgridService.useRemoveTokenMutation();
|
|
527
|
-
const updateMutation = useUpdateTokenMutation();
|
|
528
|
-
const toggleMutation = QgridService.useToggleTokenMutation();
|
|
529
|
-
const invalidate = () => Promise.all([queryClient.invalidateQueries({ queryKey: ["Token"] }), queryClient.invalidateQueries({ queryKey: ["Qgrid"] })]);
|
|
530
|
-
const handleToggle = async (token) => {
|
|
531
|
-
await toggleMutation.mutateAsync({ id: token.id });
|
|
532
|
-
await invalidate();
|
|
533
|
-
};
|
|
534
|
-
const handleDelete = async () => {
|
|
535
|
-
if (!deleteTarget) return;
|
|
536
|
-
await removeMutation.mutateAsync({ id: deleteTarget.id });
|
|
537
|
-
await invalidate();
|
|
538
|
-
setDeleteTarget(null);
|
|
539
|
-
};
|
|
540
|
-
const openEdit = (token) => {
|
|
541
|
-
setEditTarget(token);
|
|
542
|
-
setEditName(token.name ?? "");
|
|
543
|
-
};
|
|
544
|
-
const handleUpdate = async () => {
|
|
545
|
-
if (!editTarget) return;
|
|
546
|
-
await updateMutation.mutateAsync({
|
|
547
|
-
id: editTarget.id,
|
|
548
|
-
name: editName.trim()
|
|
549
|
-
});
|
|
550
|
-
await invalidate();
|
|
551
|
-
setEditTarget(null);
|
|
552
|
-
};
|
|
553
|
-
if (isLoading) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
554
|
-
className: "space-y-2",
|
|
555
|
-
children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "h-12 bg-sand-100 rounded-md animate-pulse" }, `skeleton-${i}`, false, {
|
|
556
|
-
fileName: _jsxFileName$1,
|
|
557
|
-
lineNumber: 101,
|
|
558
|
-
columnNumber: 11
|
|
559
|
-
}, this))
|
|
560
|
-
}, void 0, false, {
|
|
561
|
-
fileName: _jsxFileName$1,
|
|
562
|
-
lineNumber: 99,
|
|
563
|
-
columnNumber: 7
|
|
564
|
-
}, this);
|
|
565
|
-
const tokens = data ?? [];
|
|
566
|
-
if (tokens.length === 0) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
567
|
-
className: "text-sand-400 text-center py-16 text-sm",
|
|
568
|
-
children: [
|
|
569
|
-
"No tokens registered. Click ",
|
|
570
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("strong", {
|
|
571
|
-
className: "text-sand-600",
|
|
572
|
-
children: "Add Token"
|
|
573
|
-
}, void 0, false, {
|
|
574
|
-
fileName: _jsxFileName$1,
|
|
575
|
-
lineNumber: 112,
|
|
576
|
-
columnNumber: 37
|
|
577
|
-
}, this),
|
|
578
|
-
" to get started."
|
|
579
|
-
]
|
|
580
|
-
}, void 0, true, {
|
|
581
|
-
fileName: _jsxFileName$1,
|
|
582
|
-
lineNumber: 111,
|
|
583
|
-
columnNumber: 7
|
|
584
|
-
}, this);
|
|
585
|
-
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [
|
|
586
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
587
|
-
className: "panel overflow-hidden",
|
|
588
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
589
|
-
className: "overflow-x-auto",
|
|
590
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("table", {
|
|
591
|
-
className: "w-full min-w-[640px] text-[13px]",
|
|
592
|
-
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("thead", { children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("tr", {
|
|
593
|
-
className: "panel-header",
|
|
594
|
-
children: [
|
|
595
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", {
|
|
596
|
-
className: "text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium",
|
|
597
|
-
children: "Provider"
|
|
598
|
-
}, void 0, false, {
|
|
599
|
-
fileName: _jsxFileName$1,
|
|
600
|
-
lineNumber: 127,
|
|
601
|
-
columnNumber: 17
|
|
602
|
-
}, this),
|
|
603
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", {
|
|
604
|
-
className: "text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium",
|
|
605
|
-
children: "Name"
|
|
606
|
-
}, void 0, false, {
|
|
607
|
-
fileName: _jsxFileName$1,
|
|
608
|
-
lineNumber: 130,
|
|
609
|
-
columnNumber: 17
|
|
610
|
-
}, this),
|
|
611
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", {
|
|
612
|
-
className: "text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium",
|
|
613
|
-
children: "Token"
|
|
614
|
-
}, void 0, false, {
|
|
615
|
-
fileName: _jsxFileName$1,
|
|
616
|
-
lineNumber: 133,
|
|
617
|
-
columnNumber: 17
|
|
618
|
-
}, this),
|
|
619
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", {
|
|
620
|
-
className: "text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium",
|
|
621
|
-
children: "Status"
|
|
622
|
-
}, void 0, false, {
|
|
623
|
-
fileName: _jsxFileName$1,
|
|
624
|
-
lineNumber: 136,
|
|
625
|
-
columnNumber: 17
|
|
626
|
-
}, this),
|
|
627
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", {
|
|
628
|
-
className: "text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium",
|
|
629
|
-
children: "Expires"
|
|
630
|
-
}, void 0, false, {
|
|
631
|
-
fileName: _jsxFileName$1,
|
|
632
|
-
lineNumber: 139,
|
|
633
|
-
columnNumber: 17
|
|
634
|
-
}, this),
|
|
635
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", { className: "w-20 px-3 py-2.5" }, void 0, false, {
|
|
636
|
-
fileName: _jsxFileName$1,
|
|
637
|
-
lineNumber: 142,
|
|
638
|
-
columnNumber: 17
|
|
639
|
-
}, this)
|
|
640
|
-
]
|
|
641
|
-
}, void 0, true, {
|
|
642
|
-
fileName: _jsxFileName$1,
|
|
643
|
-
lineNumber: 126,
|
|
644
|
-
columnNumber: 15
|
|
645
|
-
}, this) }, void 0, false, {
|
|
646
|
-
fileName: _jsxFileName$1,
|
|
647
|
-
lineNumber: 125,
|
|
648
|
-
columnNumber: 13
|
|
649
|
-
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("tbody", {
|
|
650
|
-
className: "divide-y divide-sand-100/80",
|
|
651
|
-
children: tokens.map((token) => {
|
|
652
|
-
const expiry = formatExpiry(getExpiresAt(token));
|
|
653
|
-
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("tr", {
|
|
654
|
-
className: `transition-colors duration-150 hover:bg-sand-100/60 ${token.active ? "" : "opacity-50"}`,
|
|
655
|
-
children: [
|
|
656
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
|
|
657
|
-
className: "px-5 py-3",
|
|
658
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
659
|
-
className: "text-xs font-medium text-sand-500 uppercase",
|
|
660
|
-
children: token.provider
|
|
661
|
-
}, void 0, false, {
|
|
662
|
-
fileName: _jsxFileName$1,
|
|
663
|
-
lineNumber: 155,
|
|
664
|
-
columnNumber: 23
|
|
665
|
-
}, this)
|
|
666
|
-
}, void 0, false, {
|
|
667
|
-
fileName: _jsxFileName$1,
|
|
668
|
-
lineNumber: 154,
|
|
669
|
-
columnNumber: 21
|
|
670
|
-
}, this),
|
|
671
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
|
|
672
|
-
className: "px-5 py-3",
|
|
673
|
-
children: token.name ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
674
|
-
className: "text-sm text-sand-700",
|
|
675
|
-
children: token.name
|
|
676
|
-
}, void 0, false, {
|
|
677
|
-
fileName: _jsxFileName$1,
|
|
678
|
-
lineNumber: 161,
|
|
679
|
-
columnNumber: 25
|
|
680
|
-
}, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
681
|
-
className: "text-[11px] text-sand-400",
|
|
682
|
-
children: "—"
|
|
683
|
-
}, void 0, false, {
|
|
684
|
-
fileName: _jsxFileName$1,
|
|
685
|
-
lineNumber: 163,
|
|
686
|
-
columnNumber: 25
|
|
687
|
-
}, this)
|
|
688
|
-
}, void 0, false, {
|
|
689
|
-
fileName: _jsxFileName$1,
|
|
690
|
-
lineNumber: 159,
|
|
691
|
-
columnNumber: 21
|
|
692
|
-
}, this),
|
|
693
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
|
|
694
|
-
className: "px-5 py-3",
|
|
695
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("code", {
|
|
696
|
-
className: "text-[13px] font-mono text-sand-800",
|
|
697
|
-
children: maskAccessToken(token.credentials)
|
|
698
|
-
}, void 0, false, {
|
|
699
|
-
fileName: _jsxFileName$1,
|
|
700
|
-
lineNumber: 167,
|
|
701
|
-
columnNumber: 23
|
|
702
|
-
}, this)
|
|
703
|
-
}, void 0, false, {
|
|
704
|
-
fileName: _jsxFileName$1,
|
|
705
|
-
lineNumber: 166,
|
|
706
|
-
columnNumber: 21
|
|
707
|
-
}, this),
|
|
708
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
|
|
709
|
-
className: "px-5 py-3",
|
|
710
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
711
|
-
type: "button",
|
|
712
|
-
className: `relative inline-flex h-5 w-9 items-center rounded-full transition-colors duration-200 ${token.active ? "bg-sage-400" : "bg-sand-300"}`,
|
|
713
|
-
onClick: () => handleToggle(token),
|
|
714
|
-
disabled: toggleMutation.isPending || !token.active && token.reauth_required,
|
|
715
|
-
title: !token.active && token.reauth_required ? "재로그인이 필요한 토큰입니다" : void 0,
|
|
716
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { className: `inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${token.active ? "translate-x-4.5" : "translate-x-0.5"}` }, void 0, false, {
|
|
717
|
-
fileName: _jsxFileName$1,
|
|
718
|
-
lineNumber: 185,
|
|
719
|
-
columnNumber: 25
|
|
720
|
-
}, this)
|
|
721
|
-
}, void 0, false, {
|
|
722
|
-
fileName: _jsxFileName$1,
|
|
723
|
-
lineNumber: 172,
|
|
724
|
-
columnNumber: 23
|
|
725
|
-
}, this)
|
|
726
|
-
}, void 0, false, {
|
|
727
|
-
fileName: _jsxFileName$1,
|
|
728
|
-
lineNumber: 171,
|
|
729
|
-
columnNumber: 21
|
|
730
|
-
}, this),
|
|
731
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
|
|
732
|
-
className: "px-5 py-3",
|
|
733
|
-
children: expiry.text && /* @__PURE__ */ (void 0)("span", {
|
|
734
|
-
className: `text-xs ${expiry.color}`,
|
|
735
|
-
children: expiry.text
|
|
736
|
-
}, void 0, false, {
|
|
737
|
-
fileName: _jsxFileName$1,
|
|
738
|
-
lineNumber: 192,
|
|
739
|
-
columnNumber: 25
|
|
740
|
-
}, this)
|
|
741
|
-
}, void 0, false, {
|
|
742
|
-
fileName: _jsxFileName$1,
|
|
743
|
-
lineNumber: 190,
|
|
744
|
-
columnNumber: 21
|
|
745
|
-
}, this),
|
|
746
|
-
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
|
|
747
|
-
className: "px-3 py-3",
|
|
748
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
749
|
-
className: "flex items-center gap-1",
|
|
750
|
-
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
751
|
-
type: "button",
|
|
752
|
-
className: "p-1 rounded text-sand-400 hover:text-sienna-500 transition-colors duration-150",
|
|
753
|
-
onClick: () => openEdit(token),
|
|
754
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucidePencil, { className: "size-4" }, void 0, false, {
|
|
755
|
-
fileName: _jsxFileName$1,
|
|
756
|
-
lineNumber: 202,
|
|
757
|
-
columnNumber: 27
|
|
758
|
-
}, this)
|
|
759
|
-
}, void 0, false, {
|
|
760
|
-
fileName: _jsxFileName$1,
|
|
761
|
-
lineNumber: 197,
|
|
762
|
-
columnNumber: 25
|
|
763
|
-
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
764
|
-
type: "button",
|
|
765
|
-
className: "p-1 rounded text-sand-400 hover:text-red-500 transition-colors duration-150",
|
|
766
|
-
onClick: () => setDeleteTarget(token),
|
|
767
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideTrash2, { className: "size-4" }, void 0, false, {
|
|
768
|
-
fileName: _jsxFileName$1,
|
|
769
|
-
lineNumber: 209,
|
|
770
|
-
columnNumber: 27
|
|
771
|
-
}, this)
|
|
772
|
-
}, void 0, false, {
|
|
773
|
-
fileName: _jsxFileName$1,
|
|
774
|
-
lineNumber: 204,
|
|
775
|
-
columnNumber: 25
|
|
776
|
-
}, this)]
|
|
777
|
-
}, void 0, true, {
|
|
778
|
-
fileName: _jsxFileName$1,
|
|
779
|
-
lineNumber: 196,
|
|
780
|
-
columnNumber: 23
|
|
781
|
-
}, this)
|
|
782
|
-
}, void 0, false, {
|
|
783
|
-
fileName: _jsxFileName$1,
|
|
784
|
-
lineNumber: 195,
|
|
785
|
-
columnNumber: 21
|
|
786
|
-
}, this)
|
|
787
|
-
]
|
|
788
|
-
}, token.id, true, {
|
|
789
|
-
fileName: _jsxFileName$1,
|
|
790
|
-
lineNumber: 150,
|
|
791
|
-
columnNumber: 19
|
|
792
|
-
}, this);
|
|
793
|
-
})
|
|
794
|
-
}, void 0, false, {
|
|
795
|
-
fileName: _jsxFileName$1,
|
|
796
|
-
lineNumber: 145,
|
|
797
|
-
columnNumber: 13
|
|
798
|
-
}, this)]
|
|
799
|
-
}, void 0, true, {
|
|
800
|
-
fileName: _jsxFileName$1,
|
|
801
|
-
lineNumber: 124,
|
|
802
|
-
columnNumber: 11
|
|
803
|
-
}, this)
|
|
804
|
-
}, void 0, false, {
|
|
805
|
-
fileName: _jsxFileName$1,
|
|
806
|
-
lineNumber: 123,
|
|
807
|
-
columnNumber: 9
|
|
808
|
-
}, this)
|
|
809
|
-
}, void 0, false, {
|
|
810
|
-
fileName: _jsxFileName$1,
|
|
811
|
-
lineNumber: 120,
|
|
812
|
-
columnNumber: 7
|
|
813
|
-
}, this),
|
|
814
|
-
editTarget && /* @__PURE__ */ (void 0)("div", {
|
|
815
|
-
className: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",
|
|
816
|
-
children: [/* @__PURE__ */ (void 0)("div", {
|
|
817
|
-
className: "absolute inset-0 bg-sand-900/8 backdrop-blur-sm",
|
|
818
|
-
onClick: () => setEditTarget(null),
|
|
819
|
-
onKeyDown: () => {}
|
|
820
|
-
}, void 0, false, {
|
|
821
|
-
fileName: _jsxFileName$1,
|
|
822
|
-
lineNumber: 224,
|
|
823
|
-
columnNumber: 11
|
|
824
|
-
}, this), /* @__PURE__ */ (void 0)("div", {
|
|
825
|
-
className: "relative panel shadow-xl w-full max-w-sm mx-4",
|
|
826
|
-
children: [
|
|
827
|
-
/* @__PURE__ */ (void 0)("div", {
|
|
828
|
-
className: "px-5 py-4 border-b border-sand-100/60",
|
|
829
|
-
children: /* @__PURE__ */ (void 0)("h3", {
|
|
830
|
-
className: "text-base font-medium text-sand-900",
|
|
831
|
-
children: "Edit Token"
|
|
832
|
-
}, void 0, false, {
|
|
833
|
-
fileName: _jsxFileName$1,
|
|
834
|
-
lineNumber: 231,
|
|
835
|
-
columnNumber: 15
|
|
836
|
-
}, this)
|
|
837
|
-
}, void 0, false, {
|
|
838
|
-
fileName: _jsxFileName$1,
|
|
839
|
-
lineNumber: 230,
|
|
840
|
-
columnNumber: 13
|
|
841
|
-
}, this),
|
|
842
|
-
/* @__PURE__ */ (void 0)("div", {
|
|
843
|
-
className: "px-5 py-4 space-y-3",
|
|
844
|
-
children: /* @__PURE__ */ (void 0)("div", { children: [/* @__PURE__ */ (void 0)("label", {
|
|
845
|
-
htmlFor: "token-name",
|
|
846
|
-
className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
|
|
847
|
-
children: "Name"
|
|
848
|
-
}, void 0, false, {
|
|
849
|
-
fileName: _jsxFileName$1,
|
|
850
|
-
lineNumber: 235,
|
|
851
|
-
columnNumber: 17
|
|
852
|
-
}, this), /* @__PURE__ */ (void 0)(o, {
|
|
853
|
-
value: editName,
|
|
854
|
-
onChange: (e) => setEditName(e.target.value),
|
|
855
|
-
placeholder: "e.g. prod, dev, team-a",
|
|
856
|
-
className: "mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300"
|
|
857
|
-
}, void 0, false, {
|
|
858
|
-
fileName: _jsxFileName$1,
|
|
859
|
-
lineNumber: 241,
|
|
860
|
-
columnNumber: 17
|
|
861
|
-
}, this)] }, void 0, true, {
|
|
862
|
-
fileName: _jsxFileName$1,
|
|
863
|
-
lineNumber: 234,
|
|
864
|
-
columnNumber: 15
|
|
865
|
-
}, this)
|
|
866
|
-
}, void 0, false, {
|
|
867
|
-
fileName: _jsxFileName$1,
|
|
868
|
-
lineNumber: 233,
|
|
869
|
-
columnNumber: 13
|
|
870
|
-
}, this),
|
|
871
|
-
/* @__PURE__ */ (void 0)("div", {
|
|
872
|
-
className: "px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2",
|
|
873
|
-
children: [/* @__PURE__ */ (void 0)("button", {
|
|
874
|
-
type: "button",
|
|
875
|
-
className: "px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150",
|
|
876
|
-
onClick: () => setEditTarget(null),
|
|
877
|
-
children: "Cancel"
|
|
878
|
-
}, void 0, false, {
|
|
879
|
-
fileName: _jsxFileName$1,
|
|
880
|
-
lineNumber: 250,
|
|
881
|
-
columnNumber: 15
|
|
882
|
-
}, this), /* @__PURE__ */ (void 0)("button", {
|
|
883
|
-
type: "button",
|
|
884
|
-
className: "px-3 py-1 text-xs font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150",
|
|
885
|
-
disabled: updateMutation.isPending,
|
|
886
|
-
onClick: handleUpdate,
|
|
887
|
-
children: updateMutation.isPending ? "Saving..." : "Save"
|
|
888
|
-
}, void 0, false, {
|
|
889
|
-
fileName: _jsxFileName$1,
|
|
890
|
-
lineNumber: 257,
|
|
891
|
-
columnNumber: 15
|
|
892
|
-
}, this)]
|
|
893
|
-
}, void 0, true, {
|
|
894
|
-
fileName: _jsxFileName$1,
|
|
895
|
-
lineNumber: 249,
|
|
896
|
-
columnNumber: 13
|
|
897
|
-
}, this)
|
|
898
|
-
]
|
|
899
|
-
}, void 0, true, {
|
|
900
|
-
fileName: _jsxFileName$1,
|
|
901
|
-
lineNumber: 229,
|
|
902
|
-
columnNumber: 11
|
|
903
|
-
}, this)]
|
|
904
|
-
}, void 0, true, {
|
|
905
|
-
fileName: _jsxFileName$1,
|
|
906
|
-
lineNumber: 223,
|
|
907
|
-
columnNumber: 9
|
|
908
|
-
}, this),
|
|
909
|
-
deleteTarget && /* @__PURE__ */ (void 0)("div", {
|
|
910
|
-
className: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",
|
|
911
|
-
children: [/* @__PURE__ */ (void 0)("div", {
|
|
912
|
-
className: "absolute inset-0 bg-sand-900/8 backdrop-blur-sm",
|
|
913
|
-
onClick: () => setDeleteTarget(null),
|
|
914
|
-
onKeyDown: () => {}
|
|
915
|
-
}, void 0, false, {
|
|
916
|
-
fileName: _jsxFileName$1,
|
|
917
|
-
lineNumber: 273,
|
|
918
|
-
columnNumber: 11
|
|
919
|
-
}, this), /* @__PURE__ */ (void 0)("div", {
|
|
920
|
-
className: "relative panel shadow-xl w-full max-w-sm mx-4",
|
|
921
|
-
children: [/* @__PURE__ */ (void 0)("div", {
|
|
922
|
-
className: "px-5 py-4",
|
|
923
|
-
children: [/* @__PURE__ */ (void 0)("h3", {
|
|
924
|
-
className: "text-base font-medium text-sand-900",
|
|
925
|
-
children: "Remove Token"
|
|
926
|
-
}, void 0, false, {
|
|
927
|
-
fileName: _jsxFileName$1,
|
|
928
|
-
lineNumber: 280,
|
|
929
|
-
columnNumber: 15
|
|
930
|
-
}, this), /* @__PURE__ */ (void 0)("p", {
|
|
931
|
-
className: "text-sm text-sand-700 mt-2",
|
|
932
|
-
children: [
|
|
933
|
-
"Are you sure you want to remove",
|
|
934
|
-
" ",
|
|
935
|
-
/* @__PURE__ */ (void 0)("code", {
|
|
936
|
-
className: "text-[13px] font-mono text-sand-800",
|
|
937
|
-
children: maskAccessToken(deleteTarget.credentials)
|
|
938
|
-
}, void 0, false, {
|
|
939
|
-
fileName: _jsxFileName$1,
|
|
940
|
-
lineNumber: 283,
|
|
941
|
-
columnNumber: 17
|
|
942
|
-
}, this),
|
|
943
|
-
deleteTarget.name && /* @__PURE__ */ (void 0)("span", {
|
|
944
|
-
className: "text-sand-500",
|
|
945
|
-
children: [
|
|
946
|
-
" (",
|
|
947
|
-
deleteTarget.name,
|
|
948
|
-
")"
|
|
949
|
-
]
|
|
950
|
-
}, void 0, true, {
|
|
951
|
-
fileName: _jsxFileName$1,
|
|
952
|
-
lineNumber: 286,
|
|
953
|
-
columnNumber: 39
|
|
954
|
-
}, this),
|
|
955
|
-
"?"
|
|
956
|
-
]
|
|
957
|
-
}, void 0, true, {
|
|
958
|
-
fileName: _jsxFileName$1,
|
|
959
|
-
lineNumber: 281,
|
|
960
|
-
columnNumber: 15
|
|
961
|
-
}, this)]
|
|
962
|
-
}, void 0, true, {
|
|
963
|
-
fileName: _jsxFileName$1,
|
|
964
|
-
lineNumber: 279,
|
|
965
|
-
columnNumber: 13
|
|
966
|
-
}, this), /* @__PURE__ */ (void 0)("div", {
|
|
967
|
-
className: "px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2",
|
|
968
|
-
children: [/* @__PURE__ */ (void 0)("button", {
|
|
969
|
-
type: "button",
|
|
970
|
-
className: "px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150",
|
|
971
|
-
onClick: () => setDeleteTarget(null),
|
|
972
|
-
children: "Cancel"
|
|
973
|
-
}, void 0, false, {
|
|
974
|
-
fileName: _jsxFileName$1,
|
|
975
|
-
lineNumber: 291,
|
|
976
|
-
columnNumber: 15
|
|
977
|
-
}, this), /* @__PURE__ */ (void 0)("button", {
|
|
978
|
-
type: "button",
|
|
979
|
-
className: "px-3 py-1 text-xs font-medium rounded-md bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 transition-colors duration-150",
|
|
980
|
-
disabled: removeMutation.isPending,
|
|
981
|
-
onClick: handleDelete,
|
|
982
|
-
children: removeMutation.isPending ? "Removing..." : "Remove"
|
|
983
|
-
}, void 0, false, {
|
|
984
|
-
fileName: _jsxFileName$1,
|
|
985
|
-
lineNumber: 298,
|
|
986
|
-
columnNumber: 15
|
|
987
|
-
}, this)]
|
|
988
|
-
}, void 0, true, {
|
|
989
|
-
fileName: _jsxFileName$1,
|
|
990
|
-
lineNumber: 290,
|
|
991
|
-
columnNumber: 13
|
|
992
|
-
}, this)]
|
|
993
|
-
}, void 0, true, {
|
|
994
|
-
fileName: _jsxFileName$1,
|
|
995
|
-
lineNumber: 278,
|
|
996
|
-
columnNumber: 11
|
|
997
|
-
}, this)]
|
|
998
|
-
}, void 0, true, {
|
|
999
|
-
fileName: _jsxFileName$1,
|
|
1000
|
-
lineNumber: 272,
|
|
1001
|
-
columnNumber: 9
|
|
1002
|
-
}, this)
|
|
1003
|
-
] }, void 0, true);
|
|
1004
|
-
}
|
|
1005
|
-
//#endregion
|
|
1006
|
-
//#region src/routes/tokens.tsx?tsr-split=component
|
|
1007
|
-
var _jsxFileName = "/home/runner/work/qgrid/qgrid/packages/web/src/routes/tokens.tsx?tsr-split=component";
|
|
1008
|
-
function TokensPage() {
|
|
1009
|
-
const { data, isLoading } = TokenService.useTokens("A");
|
|
1010
|
-
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
1011
|
-
className: "max-w-6xl mx-auto space-y-4",
|
|
1012
|
-
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
1013
|
-
className: "flex items-center justify-end",
|
|
1014
|
-
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(AddTokenModal, {}, void 0, false, {
|
|
1015
|
-
fileName: _jsxFileName,
|
|
1016
|
-
lineNumber: 11,
|
|
1017
|
-
columnNumber: 9
|
|
1018
|
-
}, this)
|
|
1019
|
-
}, void 0, false, {
|
|
1020
|
-
fileName: _jsxFileName,
|
|
1021
|
-
lineNumber: 10,
|
|
1022
|
-
columnNumber: 7
|
|
1023
|
-
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(TokenTable, {
|
|
1024
|
-
data: data?.rows,
|
|
1025
|
-
isLoading
|
|
1026
|
-
}, void 0, false, {
|
|
1027
|
-
fileName: _jsxFileName,
|
|
1028
|
-
lineNumber: 13,
|
|
1029
|
-
columnNumber: 7
|
|
1030
|
-
}, this)]
|
|
1031
|
-
}, void 0, true, {
|
|
1032
|
-
fileName: _jsxFileName,
|
|
1033
|
-
lineNumber: 9,
|
|
1034
|
-
columnNumber: 10
|
|
1035
|
-
}, this);
|
|
1036
|
-
}
|
|
1037
|
-
//#endregion
|
|
1038
|
-
export { TokensPage as component };
|