@parallelworks/tandem-web 0.175.1 → 0.175.2
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/_virtual/_virtual_i18n/en/common.js +1 -0
- package/_virtual/_virtual_i18n/es/common.js +1 -0
- package/_virtual/_virtual_i18n/ja/common.js +1 -0
- package/_virtual/_virtual_i18n/ko/common.js +1 -0
- package/_virtual/_virtual_i18n/zh/common.js +1 -0
- package/components/InlineCommand.js +13 -0
- package/package.json +1 -1
- package/routes/_workspace/settings/runners2.js +41 -43
- package/routes/_workspace/settings/tokens2.js +115 -117
|
@@ -132,6 +132,7 @@ var e = {
|
|
|
132
132
|
usernameDescription: "Used in links and the API. Old links stop working when you change it.",
|
|
133
133
|
tokens: "CLI and API tokens",
|
|
134
134
|
tokensDescription: "Tokens act as you, within the access you give them. Create one here for a script or integration, or sign in with <code>tandem login</code>. Unused tokens expire after 90 days.",
|
|
135
|
+
command: "command",
|
|
135
136
|
revoke: "Revoke",
|
|
136
137
|
revokeTokenTitle: "Revoke token?",
|
|
137
138
|
revokeTokenDescription: "Anything using {name} will be signed out.",
|
|
@@ -132,6 +132,7 @@ var e = {
|
|
|
132
132
|
usernameDescription: "Se usa en los enlaces y en la API. Los enlaces antiguos dejan de funcionar cuando lo cambias.",
|
|
133
133
|
tokens: "Tokens de CLI y API",
|
|
134
134
|
tokensDescription: "Los tokens actúan como tú, dentro del acceso que les des. Crea uno aquí para un script o una integración, o inicia sesión con <code>tandem login</code>. Los tokens sin usar caducan a los 90 días.",
|
|
135
|
+
command: "comando",
|
|
135
136
|
revoke: "Revocar",
|
|
136
137
|
revokeTokenTitle: "¿Revocar el token?",
|
|
137
138
|
revokeTokenDescription: "Se cerrará la sesión de todo lo que use {name}.",
|
|
@@ -132,6 +132,7 @@ var e = {
|
|
|
132
132
|
usernameDescription: "リンクや API で使われます。変更すると、古いリンクは使えなくなります。",
|
|
133
133
|
tokens: "CLI・API トークン",
|
|
134
134
|
tokensDescription: "トークンは、付与したアクセス権の範囲内であなたとして動作します。スクリプトや連携用にここで作成するか、<code>tandem login</code> でサインインしてください。使われていないトークンは 90 日後に失効します。",
|
|
135
|
+
command: "コマンド",
|
|
135
136
|
revoke: "取り消す",
|
|
136
137
|
revokeTokenTitle: "トークンを取り消しますか?",
|
|
137
138
|
revokeTokenDescription: "{name} を使っているものはすべてサインアウトされます。",
|
|
@@ -132,6 +132,7 @@ var e = {
|
|
|
132
132
|
usernameDescription: "링크와 API에 사용됩니다. 변경하면 이전 링크는 더 이상 작동하지 않습니다.",
|
|
133
133
|
tokens: "CLI 및 API 토큰",
|
|
134
134
|
tokensDescription: "토큰은 부여한 액세스 범위 안에서 회원님으로 동작합니다. 스크립트나 통합에 사용할 토큰을 여기에서 만들거나 <code>tandem login</code>으로 로그인하세요. 사용하지 않는 토큰은 90일 후 만료됩니다.",
|
|
135
|
+
command: "명령어",
|
|
135
136
|
revoke: "해지",
|
|
136
137
|
revokeTokenTitle: "토큰을 해지하시겠습니까?",
|
|
137
138
|
revokeTokenDescription: "{name}을(를) 사용하는 모든 항목이 로그아웃됩니다.",
|
|
@@ -132,6 +132,7 @@ var e = {
|
|
|
132
132
|
usernameDescription: "用于链接和 API。更改后,旧链接将失效。",
|
|
133
133
|
tokens: "CLI 和 API 令牌",
|
|
134
134
|
tokensDescription: "令牌以您的身份操作,权限不超出您授予的范围。可在此为脚本或集成创建令牌,也可以使用 <code>tandem login</code> 登录。未使用的令牌将在 90 天后过期。",
|
|
135
|
+
command: "命令",
|
|
135
136
|
revoke: "撤销",
|
|
136
137
|
revokeTokenTitle: "撤销令牌?",
|
|
137
138
|
revokeTokenDescription: "所有使用 {name} 的程序都将退出登录。",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CopyCodeBlock as e } from "@parallelworks/ui";
|
|
2
|
+
import { useTranslations as t } from "use-intl";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
// src/components/InlineCommand.tsx
|
|
5
|
+
function r({ children: r }) {
|
|
6
|
+
let i = t("account");
|
|
7
|
+
return /* @__PURE__ */ n(e, {
|
|
8
|
+
inline: !0,
|
|
9
|
+
text: [r].flat().join(""),
|
|
10
|
+
label: i("command")
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export { r as InlineCommand };
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../../../api/client.js";
|
|
2
2
|
import { runnersQuery as n } from "../../../api/queries.js";
|
|
3
3
|
import { ComputeTargets as r } from "../../../components/ComputeTargets.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
4
|
+
import { InlineCommand as i } from "../../../components/InlineCommand.js";
|
|
5
|
+
import { WorkerIcon as a } from "../../../components/icons.js";
|
|
6
|
+
import { SettingsPage as o } from "../../../components/settings.js";
|
|
7
|
+
import { useConfirm as s } from "../../../lib/confirm.js";
|
|
8
|
+
import { copyItem as c } from "../../../lib/menus.js";
|
|
9
|
+
import { useTime as l } from "../../../lib/time.js";
|
|
10
|
+
import { Route as u } from "./runners.js";
|
|
11
|
+
import { Callout as d, StatusDot as f, Table as p, menuDivider as m, useOpenMenu as h } from "@parallelworks/ui";
|
|
12
|
+
import { useMemo as g } from "react";
|
|
13
|
+
import { useFormatter as _, useTranslations as v } from "use-intl";
|
|
14
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
15
|
+
import { useMutation as x, useQueryClient as ee, useSuspenseQuery as S } from "@tanstack/react-query";
|
|
15
16
|
import { ListCellText as C, ListColumns as w, ListPage as T, ListRow as E, ListToolbar as D, NameCell as O, listTableProps as k, useListNavigate as A, useListSearch as j, useListView as M } from "@parallelworks/ui/list";
|
|
16
17
|
// src/routes/$workspace/settings/runners.tsx?tsr-split=component
|
|
17
18
|
var N = {
|
|
@@ -21,22 +22,22 @@ var N = {
|
|
|
21
22
|
bypass: "runnerModeBypass"
|
|
22
23
|
};
|
|
23
24
|
function P() {
|
|
24
|
-
let { workspace: e } =
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
let { workspace: e } = u.useParams();
|
|
26
|
+
return /* @__PURE__ */ y(F, { workspace: e });
|
|
26
27
|
}
|
|
27
|
-
function F({ workspace:
|
|
28
|
-
let { data: P } = S(n(
|
|
28
|
+
function F({ workspace: u }) {
|
|
29
|
+
let { data: P } = S(n(u)), F = v("account"), I = _(), L = v("common"), R = l(), z = ee(), B = j(), V = A(), H = h(), U = x({
|
|
29
30
|
mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/runners/{runnerId}", { params: { path: {
|
|
30
|
-
workspace:
|
|
31
|
+
workspace: u,
|
|
31
32
|
runnerId: n
|
|
32
33
|
} } })),
|
|
33
|
-
onSettled: () => z.invalidateQueries({ queryKey: n(
|
|
34
|
-
}), { confirm: W, dialog: G } =
|
|
34
|
+
onSettled: () => z.invalidateQueries({ queryKey: n(u).queryKey })
|
|
35
|
+
}), { confirm: W, dialog: G } = s(), K = (e) => W({
|
|
35
36
|
title: F("revokeRunnerTitle"),
|
|
36
37
|
description: F("revokeRunnerDescription", { name: e.name }),
|
|
37
38
|
confirmLabel: F("revoke"),
|
|
38
39
|
onConfirm: () => U.mutateAsync(e.id)
|
|
39
|
-
}), q =
|
|
40
|
+
}), q = g(() => [{
|
|
40
41
|
key: "name",
|
|
41
42
|
label: L("name"),
|
|
42
43
|
headerClassName: "py-2",
|
|
@@ -46,7 +47,7 @@ function F({ workspace: l }) {
|
|
|
46
47
|
label: F("runnerColSeen"),
|
|
47
48
|
headerClassName: "py-2 w-40",
|
|
48
49
|
align: "end"
|
|
49
|
-
}], [F, L]), J =
|
|
50
|
+
}], [F, L]), J = g(() => [{
|
|
50
51
|
value: "name",
|
|
51
52
|
label: L("name"),
|
|
52
53
|
compare: (e, t) => e.name.localeCompare(t.name)
|
|
@@ -55,7 +56,7 @@ function F({ workspace: l }) {
|
|
|
55
56
|
label: F("runnerColSeen"),
|
|
56
57
|
compare: (e, t) => (t.lastSeenAt ?? "").localeCompare(e.lastSeenAt ?? "")
|
|
57
58
|
}], [F, L]), Y = M({
|
|
58
|
-
storageKey: `tandem-runners-${
|
|
59
|
+
storageKey: `tandem-runners-${u}`,
|
|
59
60
|
defaultShowColumnHeaders: !1,
|
|
60
61
|
columns: q,
|
|
61
62
|
orderBys: J,
|
|
@@ -67,21 +68,18 @@ function F({ workspace: l }) {
|
|
|
67
68
|
...e.harnesses,
|
|
68
69
|
...e.labels
|
|
69
70
|
].some((e) => e.toLowerCase().includes(X))), Q = P.filter((e) => e.sharingRefused), $ = P.filter((e) => e.sharingUnchecked);
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ b(o, {
|
|
71
72
|
wide: !0,
|
|
72
73
|
title: F("runners"),
|
|
73
|
-
description: F.rich("runnersDescription", { code: (e) => /* @__PURE__ */
|
|
74
|
-
|
|
75
|
-
children: e
|
|
76
|
-
}) }),
|
|
77
|
-
toolbar: P.length > 0 && /* @__PURE__ */ v(D, {
|
|
74
|
+
description: F.rich("runnersDescription", { code: (e) => /* @__PURE__ */ y(i, { children: e }) }),
|
|
75
|
+
toolbar: P.length > 0 && /* @__PURE__ */ y(D, {
|
|
78
76
|
view: Y,
|
|
79
77
|
search: B,
|
|
80
78
|
searchLabel: F("runnerSearch"),
|
|
81
79
|
searchPlaceholder: F("runnerSearch")
|
|
82
80
|
}),
|
|
83
81
|
children: [
|
|
84
|
-
Q.length > 0 && /* @__PURE__ */
|
|
82
|
+
Q.length > 0 && /* @__PURE__ */ y(d, {
|
|
85
83
|
tone: "warning",
|
|
86
84
|
className: "mb-6",
|
|
87
85
|
children: F("runnerSharingRefused", {
|
|
@@ -89,7 +87,7 @@ function F({ workspace: l }) {
|
|
|
89
87
|
names: I.list(Q.map((e) => e.name), { type: "conjunction" })
|
|
90
88
|
})
|
|
91
89
|
}),
|
|
92
|
-
$.length > 0 && /* @__PURE__ */
|
|
90
|
+
$.length > 0 && /* @__PURE__ */ y(d, {
|
|
93
91
|
tone: "muted",
|
|
94
92
|
className: "mb-6",
|
|
95
93
|
children: F("runnerSharingUnchecked", {
|
|
@@ -97,9 +95,9 @@ function F({ workspace: l }) {
|
|
|
97
95
|
names: I.list($.map((e) => e.name), { type: "conjunction" })
|
|
98
96
|
})
|
|
99
97
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ y("div", {
|
|
101
99
|
className: "border-t border-border",
|
|
102
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ y(T, {
|
|
103
101
|
view: Y,
|
|
104
102
|
total: P.length,
|
|
105
103
|
matches: Z.length,
|
|
@@ -109,28 +107,28 @@ function F({ workspace: l }) {
|
|
|
109
107
|
nounPlural: F("runnerNounPlural")
|
|
110
108
|
},
|
|
111
109
|
empty: {
|
|
112
|
-
icon: /* @__PURE__ */
|
|
110
|
+
icon: /* @__PURE__ */ y(a, {}),
|
|
113
111
|
title: F("noRunners")
|
|
114
112
|
},
|
|
115
113
|
noMatches: F("runnerNoMatches"),
|
|
116
|
-
children: /* @__PURE__ */
|
|
114
|
+
children: /* @__PURE__ */ b(p, {
|
|
117
115
|
...k,
|
|
118
|
-
children: [/* @__PURE__ */
|
|
116
|
+
children: [/* @__PURE__ */ y(w, { view: Y }), Y.applyOrder(Z).map((e) => /* @__PURE__ */ b(E, {
|
|
119
117
|
href: null,
|
|
120
118
|
goTo: V,
|
|
121
119
|
openMenu: H,
|
|
122
120
|
items: [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
c(F("copyRunnerId"), e.id),
|
|
122
|
+
c(L("copyName"), e.name),
|
|
123
|
+
m,
|
|
126
124
|
{
|
|
127
125
|
label: F("revoke"),
|
|
128
126
|
destructive: !0,
|
|
129
127
|
onClick: () => K(e)
|
|
130
128
|
}
|
|
131
129
|
],
|
|
132
|
-
children: [/* @__PURE__ */
|
|
133
|
-
icon: /* @__PURE__ */
|
|
130
|
+
children: [/* @__PURE__ */ y(O, {
|
|
131
|
+
icon: /* @__PURE__ */ y(a, {}),
|
|
134
132
|
iconTile: !0,
|
|
135
133
|
name: e.name,
|
|
136
134
|
subtitle: I.list([
|
|
@@ -142,12 +140,12 @@ function F({ workspace: l }) {
|
|
|
142
140
|
...e.labels
|
|
143
141
|
], { type: "unit" }),
|
|
144
142
|
href: null
|
|
145
|
-
}), Y.isVisible("seen") && /* @__PURE__ */
|
|
143
|
+
}), Y.isVisible("seen") && /* @__PURE__ */ b(p.Item, {
|
|
146
144
|
className: "py-2.5",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ y(C, { children: e.lastSeenAt ? F("runnerSeen", { seen: R.relative(e.lastSeenAt) }) : F("runnerNeverConnected") }), e.isolation && /* @__PURE__ */ b("span", {
|
|
148
146
|
className: "flex items-center justify-end gap-1.5 text-xs text-muted-foreground",
|
|
149
147
|
title: e.isolation.failures.join("\n") || void 0,
|
|
150
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ y(f, {
|
|
151
149
|
variant: e.isolation.passed ? "success" : "error",
|
|
152
150
|
size: 8
|
|
153
151
|
}), e.isolation.passed ? F("runnerIsolated") : F("runnerNotIsolated", { count: e.isolation.failures.length })]
|
|
@@ -157,7 +155,7 @@ function F({ workspace: l }) {
|
|
|
157
155
|
})
|
|
158
156
|
})
|
|
159
157
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ y(r, { workspace: u }),
|
|
161
159
|
G
|
|
162
160
|
]
|
|
163
161
|
});
|
|
@@ -1,160 +1,158 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../../../api/client.js";
|
|
2
2
|
import { tokensQuery as n } from "../../../api/queries.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
3
|
+
import { InlineCommand as r } from "../../../components/InlineCommand.js";
|
|
4
|
+
import { KeyIcon as i } from "../../../components/icons.js";
|
|
5
|
+
import { OneTimeSecret as a } from "../../../components/OneTimeSecret.js";
|
|
6
|
+
import { SettingsPage as o, useFormError as s } from "../../../components/settings.js";
|
|
7
|
+
import { useConfirm as c } from "../../../lib/confirm.js";
|
|
8
|
+
import { copyItem as l } from "../../../lib/menus.js";
|
|
9
|
+
import { useTime as u } from "../../../lib/time.js";
|
|
10
|
+
import { Route as d } from "./tokens.js";
|
|
11
|
+
import { Button as f, ErrorText as p, Input as m, Modal as h, ModalTitle as g, PageHeaderAddButton as _, Select as v, Table as y, menuDivider as b, useOpenMenu as x } from "@parallelworks/ui";
|
|
12
|
+
import { useMemo as S, useState as C } from "react";
|
|
13
|
+
import { useTranslations as w } from "use-intl";
|
|
14
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
15
|
+
import { useMutation as D, useQueryClient as O, useSuspenseQuery as k } from "@tanstack/react-query";
|
|
16
|
+
import { ListCellText as A, ListColumns as j, ListPage as M, ListRow as N, ListToolbar as P, NameCell as F, listTableProps as I, useListNavigate as L, useListSearch as R, useListView as z } from "@parallelworks/ui/list";
|
|
16
17
|
// src/routes/$workspace/settings/tokens.tsx?tsr-split=component
|
|
17
|
-
function
|
|
18
|
-
let { workspace:
|
|
18
|
+
function B() {
|
|
19
|
+
let { workspace: s } = d.useParams(), { data: f } = k(n), p = w("account"), m = w("common"), h = u(), g = O(), v = R(), B = L(), H = x(), [U, W] = C(!1), [G, K] = C(null), q = D({
|
|
19
20
|
mutationFn: async (n) => t(await e.DELETE("/api/v1/me/tokens/{tokenId}", { params: { path: { tokenId: n } } })),
|
|
20
|
-
onSettled: () =>
|
|
21
|
-
}), { confirm:
|
|
22
|
-
title:
|
|
23
|
-
description:
|
|
24
|
-
confirmLabel:
|
|
25
|
-
onConfirm: () =>
|
|
26
|
-
}),
|
|
21
|
+
onSettled: () => g.invalidateQueries({ queryKey: n.queryKey })
|
|
22
|
+
}), { confirm: J, dialog: Y } = c(), X = (e) => J({
|
|
23
|
+
title: p("revokeTokenTitle"),
|
|
24
|
+
description: p("revokeTokenDescription", { name: e.name }),
|
|
25
|
+
confirmLabel: p("revoke"),
|
|
26
|
+
onConfirm: () => q.mutateAsync(e.id)
|
|
27
|
+
}), ee = S(() => [
|
|
27
28
|
{
|
|
28
29
|
key: "name",
|
|
29
|
-
label:
|
|
30
|
+
label: m("name"),
|
|
30
31
|
headerClassName: "py-2",
|
|
31
32
|
alwaysVisible: !0
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
35
|
key: "access",
|
|
35
|
-
label:
|
|
36
|
+
label: p("tokenAccess"),
|
|
36
37
|
headerClassName: "py-2 w-56"
|
|
37
38
|
},
|
|
38
39
|
{
|
|
39
40
|
key: "used",
|
|
40
|
-
label:
|
|
41
|
+
label: p("tokenColUsed"),
|
|
41
42
|
headerClassName: "py-2 w-40",
|
|
42
43
|
align: "end"
|
|
43
44
|
}
|
|
44
|
-
], [
|
|
45
|
+
], [p, m]), te = S(() => [{
|
|
45
46
|
value: "name",
|
|
46
|
-
label:
|
|
47
|
+
label: m("name"),
|
|
47
48
|
compare: (e, t) => e.name.localeCompare(t.name)
|
|
48
49
|
}, {
|
|
49
50
|
value: "used",
|
|
50
|
-
label:
|
|
51
|
+
label: p("tokenColUsed"),
|
|
51
52
|
compare: (e, t) => (t.lastUsedAt ?? "").localeCompare(e.lastUsedAt ?? "")
|
|
52
|
-
}], [
|
|
53
|
+
}], [p, m]), Z = z({
|
|
53
54
|
storageKey: "tandem-tokens",
|
|
54
55
|
defaultShowColumnHeaders: !1,
|
|
55
|
-
columns:
|
|
56
|
-
orderBys:
|
|
56
|
+
columns: ee,
|
|
57
|
+
orderBys: te,
|
|
57
58
|
defaultOrderBy: "name",
|
|
58
59
|
facets: []
|
|
59
|
-
}), Q =
|
|
60
|
-
return /* @__PURE__ */
|
|
60
|
+
}), Q = v.filter.trim().toLowerCase(), $ = f.filter((e) => !Q || e.name.toLowerCase().includes(Q));
|
|
61
|
+
return /* @__PURE__ */ E(o, {
|
|
61
62
|
wide: !0,
|
|
62
|
-
title:
|
|
63
|
-
description:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}) }),
|
|
67
|
-
actions: /* @__PURE__ */ w(g, {
|
|
68
|
-
label: f("newToken"),
|
|
63
|
+
title: p("tokens"),
|
|
64
|
+
description: p.rich("tokensDescription", { code: (e) => /* @__PURE__ */ T(r, { children: e }) }),
|
|
65
|
+
actions: /* @__PURE__ */ T(_, {
|
|
66
|
+
label: p("newToken"),
|
|
69
67
|
word: "create",
|
|
70
|
-
onClick: () =>
|
|
68
|
+
onClick: () => W(!0)
|
|
71
69
|
}),
|
|
72
|
-
toolbar:
|
|
70
|
+
toolbar: f.length > 0 && /* @__PURE__ */ T(P, {
|
|
73
71
|
view: Z,
|
|
74
|
-
search:
|
|
75
|
-
searchLabel:
|
|
76
|
-
searchPlaceholder:
|
|
72
|
+
search: v,
|
|
73
|
+
searchLabel: p("tokenSearch"),
|
|
74
|
+
searchPlaceholder: p("tokenSearch")
|
|
77
75
|
}),
|
|
78
76
|
children: [
|
|
79
|
-
|
|
77
|
+
G && /* @__PURE__ */ T("div", {
|
|
80
78
|
className: "px-4 pb-4",
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
-
title:
|
|
83
|
-
secret:
|
|
84
|
-
onDismiss: () =>
|
|
79
|
+
children: /* @__PURE__ */ T(a, {
|
|
80
|
+
title: p("tokenCreated", { name: G.name }),
|
|
81
|
+
secret: G.secret,
|
|
82
|
+
onDismiss: () => K(null)
|
|
85
83
|
})
|
|
86
84
|
}),
|
|
87
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ T("div", {
|
|
88
86
|
className: "border-t border-border",
|
|
89
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ T(M, {
|
|
90
88
|
view: Z,
|
|
91
|
-
total:
|
|
89
|
+
total: f.length,
|
|
92
90
|
matches: $.length,
|
|
93
91
|
count: {
|
|
94
|
-
filterActive:
|
|
95
|
-
noun:
|
|
96
|
-
nounPlural:
|
|
92
|
+
filterActive: v.filter.trim() !== "",
|
|
93
|
+
noun: p("tokenNoun"),
|
|
94
|
+
nounPlural: p("tokenNounPlural")
|
|
97
95
|
},
|
|
98
96
|
empty: {
|
|
99
|
-
icon: /* @__PURE__ */
|
|
100
|
-
title:
|
|
97
|
+
icon: /* @__PURE__ */ T(i, {}),
|
|
98
|
+
title: p("noTokens")
|
|
101
99
|
},
|
|
102
|
-
noMatches:
|
|
103
|
-
children: /* @__PURE__ */
|
|
104
|
-
...
|
|
105
|
-
children: [/* @__PURE__ */
|
|
100
|
+
noMatches: p("tokenNoMatches"),
|
|
101
|
+
children: /* @__PURE__ */ E(y, {
|
|
102
|
+
...I,
|
|
103
|
+
children: [/* @__PURE__ */ T(j, { view: Z }), Z.applyOrder($).map((e) => /* @__PURE__ */ E(N, {
|
|
106
104
|
href: null,
|
|
107
|
-
goTo:
|
|
108
|
-
openMenu:
|
|
105
|
+
goTo: B,
|
|
106
|
+
openMenu: H,
|
|
109
107
|
items: [
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
l(m("copyName"), e.name),
|
|
109
|
+
b,
|
|
112
110
|
{
|
|
113
|
-
label:
|
|
111
|
+
label: p("revoke"),
|
|
114
112
|
destructive: !0,
|
|
115
|
-
onClick: () =>
|
|
113
|
+
onClick: () => X(e)
|
|
116
114
|
}
|
|
117
115
|
],
|
|
118
116
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
icon: /* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ T(F, {
|
|
118
|
+
icon: /* @__PURE__ */ T(i, {}),
|
|
121
119
|
iconTile: !0,
|
|
122
120
|
name: e.name,
|
|
123
|
-
subtitle:
|
|
121
|
+
subtitle: p("tokenCreatedAgo", { created: h.relative(e.createdAt) }),
|
|
124
122
|
href: null
|
|
125
123
|
}),
|
|
126
|
-
Z.isVisible("access") && /* @__PURE__ */
|
|
124
|
+
Z.isVisible("access") && /* @__PURE__ */ T(y.Item, {
|
|
127
125
|
className: "py-2.5",
|
|
128
|
-
children: /* @__PURE__ */
|
|
129
|
-
e.readOnly ?
|
|
126
|
+
children: /* @__PURE__ */ E(A, { children: [
|
|
127
|
+
e.readOnly ? p("readOnly") : p("readWrite"),
|
|
130
128
|
" · ",
|
|
131
|
-
e.workspace ||
|
|
129
|
+
e.workspace || p("allWorkspaces")
|
|
132
130
|
] })
|
|
133
131
|
}),
|
|
134
|
-
Z.isVisible("used") && /* @__PURE__ */
|
|
132
|
+
Z.isVisible("used") && /* @__PURE__ */ T(y.Item, {
|
|
135
133
|
className: "py-2.5",
|
|
136
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ T(A, { children: e.lastUsedAt ? h.relative(e.lastUsedAt) : p("tokenNotUsed") })
|
|
137
135
|
})
|
|
138
136
|
]
|
|
139
137
|
}, e.id))]
|
|
140
138
|
})
|
|
141
139
|
})
|
|
142
140
|
}),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
workspace:
|
|
141
|
+
Y,
|
|
142
|
+
U && /* @__PURE__ */ T(V, {
|
|
143
|
+
workspace: s,
|
|
146
144
|
onCreated: (e) => {
|
|
147
|
-
|
|
145
|
+
W(!1), K(e);
|
|
148
146
|
},
|
|
149
|
-
onClose: () =>
|
|
147
|
+
onClose: () => W(!1)
|
|
150
148
|
})
|
|
151
149
|
]
|
|
152
150
|
});
|
|
153
151
|
}
|
|
154
|
-
function
|
|
155
|
-
let
|
|
152
|
+
function V({ workspace: r, onCreated: i, onClose: a }) {
|
|
153
|
+
let o = w("account"), c = w("common"), l = O(), u = s(), [d, _] = C(""), [y, b] = C("read"), [x, S] = C("one"), [k, A] = C("90"), j = D({
|
|
156
154
|
mutationFn: async () => t(await e.POST("/api/v1/me/tokens", { body: {
|
|
157
|
-
name:
|
|
155
|
+
name: d,
|
|
158
156
|
readOnly: y === "read",
|
|
159
157
|
...x === "one" && { workspace: r },
|
|
160
158
|
...k !== "0" && { expiresInDays: Number(k) }
|
|
@@ -167,104 +165,104 @@ function B({ workspace: r, onCreated: i, onClose: a }) {
|
|
|
167
165
|
onSettled: () => l.invalidateQueries({ queryKey: n.queryKey }),
|
|
168
166
|
onError: u.set
|
|
169
167
|
});
|
|
170
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ T(h, {
|
|
171
169
|
open: !0,
|
|
172
170
|
onClose: a,
|
|
173
171
|
className: "w-full max-w-md p-5",
|
|
174
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ E("form", {
|
|
175
173
|
onSubmit: (e) => {
|
|
176
174
|
e.preventDefault(), j.mutate();
|
|
177
175
|
},
|
|
178
176
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ T(g, {
|
|
180
178
|
className: "text-sm font-semibold",
|
|
181
|
-
children:
|
|
179
|
+
children: o("newToken")
|
|
182
180
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ T(m, {
|
|
184
182
|
required: !0,
|
|
185
183
|
autoFocus: !0,
|
|
186
|
-
value:
|
|
187
|
-
onChange: (e) =>
|
|
188
|
-
placeholder:
|
|
189
|
-
"aria-label":
|
|
184
|
+
value: d,
|
|
185
|
+
onChange: (e) => _(e.target.value),
|
|
186
|
+
placeholder: o("tokenNamePlaceholder"),
|
|
187
|
+
"aria-label": o("tokenName"),
|
|
190
188
|
className: "mt-4 w-full"
|
|
191
189
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ E("div", {
|
|
193
191
|
className: "mt-3 flex flex-wrap gap-2",
|
|
194
192
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ T(v, {
|
|
196
194
|
value: y,
|
|
197
195
|
onValueChange: b,
|
|
198
|
-
"aria-label":
|
|
196
|
+
"aria-label": o("tokenAccess"),
|
|
199
197
|
items: [{
|
|
200
198
|
value: "read",
|
|
201
|
-
label:
|
|
199
|
+
label: o("readOnly")
|
|
202
200
|
}, {
|
|
203
201
|
value: "write",
|
|
204
|
-
label:
|
|
202
|
+
label: o("readWrite")
|
|
205
203
|
}],
|
|
206
204
|
width: "content"
|
|
207
205
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ T(v, {
|
|
209
207
|
value: x,
|
|
210
|
-
onValueChange:
|
|
211
|
-
"aria-label":
|
|
208
|
+
onValueChange: S,
|
|
209
|
+
"aria-label": o("tokenWorkspace"),
|
|
212
210
|
items: [{
|
|
213
211
|
value: "one",
|
|
214
|
-
label:
|
|
212
|
+
label: o("thisWorkspace", { workspace: r })
|
|
215
213
|
}, {
|
|
216
214
|
value: "all",
|
|
217
|
-
label:
|
|
215
|
+
label: o("allWorkspaces")
|
|
218
216
|
}],
|
|
219
217
|
width: "content"
|
|
220
218
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ T(v, {
|
|
222
220
|
value: k,
|
|
223
221
|
onValueChange: A,
|
|
224
|
-
"aria-label":
|
|
222
|
+
"aria-label": o("tokenExpiry"),
|
|
225
223
|
items: [
|
|
226
224
|
{
|
|
227
225
|
value: "30",
|
|
228
|
-
label:
|
|
226
|
+
label: o("expiresIn", { days: 30 })
|
|
229
227
|
},
|
|
230
228
|
{
|
|
231
229
|
value: "90",
|
|
232
|
-
label:
|
|
230
|
+
label: o("expiresIn", { days: 90 })
|
|
233
231
|
},
|
|
234
232
|
{
|
|
235
233
|
value: "365",
|
|
236
|
-
label:
|
|
234
|
+
label: o("expiresIn", { days: 365 })
|
|
237
235
|
},
|
|
238
236
|
{
|
|
239
237
|
value: "0",
|
|
240
|
-
label:
|
|
238
|
+
label: o("noExpiry")
|
|
241
239
|
}
|
|
242
240
|
],
|
|
243
241
|
width: "content"
|
|
244
242
|
})
|
|
245
243
|
]
|
|
246
244
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ T(p, {
|
|
248
246
|
size: "md",
|
|
249
247
|
className: "mt-3",
|
|
250
248
|
children: u.error
|
|
251
249
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ E("div", {
|
|
253
251
|
className: "mt-5 flex justify-end gap-2",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ T(f, {
|
|
255
253
|
type: "button",
|
|
256
254
|
onClick: a,
|
|
257
255
|
children: c("cancel")
|
|
258
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ T(f, {
|
|
259
257
|
type: "submit",
|
|
260
258
|
variant: "primary",
|
|
261
|
-
disabled: !
|
|
259
|
+
disabled: !d.trim(),
|
|
262
260
|
loading: j.isPending,
|
|
263
|
-
children:
|
|
261
|
+
children: o("createToken")
|
|
264
262
|
})]
|
|
265
263
|
})
|
|
266
264
|
]
|
|
267
265
|
})
|
|
268
266
|
});
|
|
269
267
|
}
|
|
270
|
-
export {
|
|
268
|
+
export { B as component };
|