@parallelworks/tandem-web 0.188.0 → 0.189.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/_virtual/_virtual_i18n/en/common.js +3 -0
- package/_virtual/_virtual_i18n/es/common.js +3 -0
- package/_virtual/_virtual_i18n/ja/common.js +3 -0
- package/_virtual/_virtual_i18n/ko/common.js +3 -0
- package/_virtual/_virtual_i18n/zh/common.js +3 -0
- package/components/HoverCards.js +118 -115
- package/components/SubpageViews.js +335 -270
- package/package.json +1 -1
- package/pages/issues.js +306 -306
- package/routes/_workspace/settings/runners2.js +96 -96
- package/routes/_workspace2.js +5 -4
|
@@ -1,183 +1,183 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../../../api/client.js";
|
|
2
2
|
import { runnersQuery as n, workspaceRunsQuery as r } from "../../../api/queries.js";
|
|
3
|
-
import { ComputeTargets as
|
|
4
|
-
import { InlineCommand as
|
|
5
|
-
import { WorkerIcon as
|
|
6
|
-
import { SettingsPage as
|
|
7
|
-
import { useConfirm as
|
|
8
|
-
import { copyItem as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
3
|
+
import { ComputeTargets as ee } from "../../../components/ComputeTargets.js";
|
|
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 { useCan as te } from "../../../lib/roles.js";
|
|
10
|
+
import { Link as l } from "../../../lib/router.js";
|
|
11
|
+
import { useTime as u } from "../../../lib/time.js";
|
|
12
|
+
import { Route as d } from "./runners.js";
|
|
13
|
+
import { Callout as f, StatusDot as ne, Table as p, menuDivider as m, useOpenMenu as h } from "@parallelworks/ui";
|
|
14
|
+
import { useMemo as g } from "react";
|
|
15
|
+
import { useFormatter as _, useTranslations as v } from "use-intl";
|
|
16
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
17
|
+
import { useMutation as re, useQuery as ie, useQueryClient as ae, useSuspenseQuery as x } from "@tanstack/react-query";
|
|
18
|
+
import { ListCellText as S, ListColumns as C, ListPage as w, ListRow as T, ListToolbar as E, NameCell as D, listTableProps as O, useListNavigate as k, useListSearch as A, useListView as j } from "@parallelworks/ui/list";
|
|
18
19
|
// src/routes/$workspace/settings/runners.tsx?tsr-split=component
|
|
19
|
-
var
|
|
20
|
+
var M = {
|
|
20
21
|
default: "runnerModeDefault",
|
|
21
22
|
"accept-edits": "runnerModeAcceptEdits",
|
|
22
23
|
auto: "runnerModeAuto",
|
|
23
24
|
bypass: "runnerModeBypass"
|
|
24
25
|
};
|
|
25
|
-
function
|
|
26
|
-
let { workspace: e } =
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
function N() {
|
|
27
|
+
let { workspace: e } = d.useParams();
|
|
28
|
+
return /* @__PURE__ */ y(P, { workspace: e });
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
-
let { data:
|
|
30
|
+
function P({ workspace: d }) {
|
|
31
|
+
let { data: N } = x(n(d)), { data: P = [] } = ie(r(d, {
|
|
31
32
|
live: !0,
|
|
32
33
|
limit: 200
|
|
33
|
-
})),
|
|
34
|
-
for (let e of
|
|
35
|
-
let
|
|
34
|
+
})), F = /* @__PURE__ */ new Map();
|
|
35
|
+
for (let e of P) e.state === "working" && e.runnerId && F.set(e.runnerId, [...F.get(e.runnerId) ?? [], e]);
|
|
36
|
+
let I = v("account"), L = _(), R = v("common"), z = u(), B = ae(), V = A(), H = k(), U = h(), W = te(d, "manage_agents"), G = re({
|
|
36
37
|
mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/runners/{runnerId}", { params: { path: {
|
|
37
|
-
workspace:
|
|
38
|
+
workspace: d,
|
|
38
39
|
runnerId: n
|
|
39
40
|
} } })),
|
|
40
|
-
onSettled: () =>
|
|
41
|
-
}), { confirm:
|
|
42
|
-
title:
|
|
43
|
-
description:
|
|
44
|
-
confirmLabel:
|
|
45
|
-
onConfirm: () =>
|
|
46
|
-
}),
|
|
41
|
+
onSettled: () => B.invalidateQueries({ queryKey: n(d).queryKey })
|
|
42
|
+
}), { confirm: K, dialog: q } = s(), J = (e) => K({
|
|
43
|
+
title: I("revokeRunnerTitle"),
|
|
44
|
+
description: I("revokeRunnerDescription", { name: e.name }),
|
|
45
|
+
confirmLabel: I("revoke"),
|
|
46
|
+
onConfirm: () => G.mutateAsync(e.id)
|
|
47
|
+
}), oe = g(() => [
|
|
47
48
|
{
|
|
48
49
|
key: "name",
|
|
49
|
-
label:
|
|
50
|
+
label: R("name"),
|
|
50
51
|
headerClassName: "py-2",
|
|
51
52
|
alwaysVisible: !0
|
|
52
53
|
},
|
|
53
54
|
{
|
|
54
55
|
key: "working",
|
|
55
|
-
label:
|
|
56
|
+
label: I("runnerColWorking"),
|
|
56
57
|
headerClassName: "py-2 w-48"
|
|
57
58
|
},
|
|
58
59
|
{
|
|
59
60
|
key: "seen",
|
|
60
|
-
label:
|
|
61
|
+
label: I("runnerColSeen"),
|
|
61
62
|
headerClassName: "py-2 w-40",
|
|
62
63
|
align: "end"
|
|
63
64
|
}
|
|
64
|
-
], [
|
|
65
|
+
], [I, R]), se = g(() => [{
|
|
65
66
|
value: "name",
|
|
66
|
-
label:
|
|
67
|
+
label: R("name"),
|
|
67
68
|
compare: (e, t) => e.name.localeCompare(t.name)
|
|
68
69
|
}, {
|
|
69
70
|
value: "seen",
|
|
70
|
-
label:
|
|
71
|
+
label: I("runnerColSeen"),
|
|
71
72
|
compare: (e, t) => (t.lastSeenAt ?? "").localeCompare(e.lastSeenAt ?? "")
|
|
72
|
-
}], [
|
|
73
|
-
storageKey: `tandem-runners-${
|
|
73
|
+
}], [I, R]), Y = j({
|
|
74
|
+
storageKey: `tandem-runners-${d}`,
|
|
74
75
|
defaultShowColumnHeaders: !1,
|
|
75
|
-
columns:
|
|
76
|
-
orderBys:
|
|
76
|
+
columns: oe,
|
|
77
|
+
orderBys: se,
|
|
77
78
|
defaultOrderBy: "name",
|
|
78
79
|
facets: []
|
|
79
|
-
}), X =
|
|
80
|
+
}), X = V.filter.trim().toLowerCase(), Z = N.filter((e) => !X || [
|
|
80
81
|
e.name,
|
|
81
82
|
e.group ?? "",
|
|
82
83
|
...e.harnesses,
|
|
83
84
|
...e.labels
|
|
84
|
-
].some((e) => e.toLowerCase().includes(X))), Q =
|
|
85
|
-
return /* @__PURE__ */
|
|
85
|
+
].some((e) => e.toLowerCase().includes(X))), Q = N.filter((e) => e.sharingRefused), $ = N.filter((e) => e.sharingUnchecked);
|
|
86
|
+
return /* @__PURE__ */ b(o, {
|
|
86
87
|
wide: !0,
|
|
87
|
-
title:
|
|
88
|
-
description:
|
|
89
|
-
toolbar:
|
|
88
|
+
title: I("runners"),
|
|
89
|
+
description: I.rich("runnersDescription", { code: (e) => /* @__PURE__ */ y(i, { children: e }) }),
|
|
90
|
+
toolbar: N.length > 0 && /* @__PURE__ */ y(E, {
|
|
90
91
|
view: Y,
|
|
91
|
-
search:
|
|
92
|
-
searchLabel:
|
|
93
|
-
searchPlaceholder:
|
|
92
|
+
search: V,
|
|
93
|
+
searchLabel: I("runnerSearch"),
|
|
94
|
+
searchPlaceholder: I("runnerSearch")
|
|
94
95
|
}),
|
|
95
96
|
children: [
|
|
96
|
-
Q.length > 0 && /* @__PURE__ */
|
|
97
|
+
Q.length > 0 && /* @__PURE__ */ y(f, {
|
|
97
98
|
tone: "warning",
|
|
98
99
|
className: "mb-6",
|
|
99
|
-
children:
|
|
100
|
+
children: I("runnerSharingRefused", {
|
|
100
101
|
count: Q.length,
|
|
101
|
-
names:
|
|
102
|
+
names: L.list(Q.map((e) => e.name), { type: "conjunction" })
|
|
102
103
|
})
|
|
103
104
|
}),
|
|
104
|
-
$.length > 0 && /* @__PURE__ */
|
|
105
|
+
$.length > 0 && /* @__PURE__ */ y(f, {
|
|
105
106
|
tone: "muted",
|
|
106
107
|
className: "mb-6",
|
|
107
|
-
children:
|
|
108
|
+
children: I("runnerSharingUnchecked", {
|
|
108
109
|
count: $.length,
|
|
109
|
-
names:
|
|
110
|
+
names: L.list($.map((e) => e.name), { type: "conjunction" })
|
|
110
111
|
})
|
|
111
112
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ y("div", {
|
|
113
114
|
className: "border-t border-border",
|
|
114
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ y(w, {
|
|
115
116
|
view: Y,
|
|
116
|
-
total:
|
|
117
|
+
total: N.length,
|
|
117
118
|
matches: Z.length,
|
|
118
119
|
count: {
|
|
119
|
-
filterActive:
|
|
120
|
-
noun:
|
|
121
|
-
nounPlural:
|
|
120
|
+
filterActive: V.filter.trim() !== "",
|
|
121
|
+
noun: I("runnerNoun"),
|
|
122
|
+
nounPlural: I("runnerNounPlural")
|
|
122
123
|
},
|
|
123
124
|
empty: {
|
|
124
|
-
icon: /* @__PURE__ */
|
|
125
|
-
title:
|
|
125
|
+
icon: /* @__PURE__ */ y(a, {}),
|
|
126
|
+
title: I("noRunners")
|
|
126
127
|
},
|
|
127
|
-
noMatches:
|
|
128
|
-
children: /* @__PURE__ */
|
|
129
|
-
...
|
|
130
|
-
children: [/* @__PURE__ */
|
|
128
|
+
noMatches: I("runnerNoMatches"),
|
|
129
|
+
children: /* @__PURE__ */ b(p, {
|
|
130
|
+
...O,
|
|
131
|
+
children: [/* @__PURE__ */ y(C, { view: Y }), Y.applyOrder(Z).map((e) => /* @__PURE__ */ b(T, {
|
|
131
132
|
href: null,
|
|
132
|
-
goTo:
|
|
133
|
-
openMenu:
|
|
133
|
+
goTo: H,
|
|
134
|
+
openMenu: U,
|
|
134
135
|
items: [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
m,
|
|
138
|
-
|
|
139
|
-
label: F("revoke"),
|
|
136
|
+
c(I("copyRunnerId"), e.id),
|
|
137
|
+
c(R("copyName"), e.name),
|
|
138
|
+
...!e.group || W ? [m, {
|
|
139
|
+
label: I("revoke"),
|
|
140
140
|
destructive: !0,
|
|
141
|
-
onClick: () =>
|
|
142
|
-
}
|
|
141
|
+
onClick: () => J(e)
|
|
142
|
+
}] : []
|
|
143
143
|
],
|
|
144
144
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
icon: /* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ y(D, {
|
|
146
|
+
icon: /* @__PURE__ */ y(a, {}),
|
|
147
147
|
iconTile: !0,
|
|
148
148
|
name: e.name,
|
|
149
|
-
subtitle:
|
|
150
|
-
...e.group ? [
|
|
151
|
-
...e.sharingRefused ? [
|
|
152
|
-
...e.sharingUnchecked ? [
|
|
153
|
-
...e.permissionMode ? [
|
|
149
|
+
subtitle: L.list([
|
|
150
|
+
...e.group ? [I("runnerSharedWith", { group: e.group })] : [],
|
|
151
|
+
...e.sharingRefused ? [I("runnerNotTakingRuns")] : [],
|
|
152
|
+
...e.sharingUnchecked ? [I("runnerSharingUnknown")] : [],
|
|
153
|
+
...e.permissionMode ? [I(M[e.permissionMode])] : [],
|
|
154
154
|
...e.harnesses,
|
|
155
155
|
...e.labels
|
|
156
156
|
], { type: "unit" }),
|
|
157
157
|
href: null
|
|
158
158
|
}),
|
|
159
|
-
Y.isVisible("working") && /* @__PURE__ */
|
|
159
|
+
Y.isVisible("working") && /* @__PURE__ */ y(p.Item, {
|
|
160
160
|
className: "py-2.5",
|
|
161
|
-
children: /* @__PURE__ */
|
|
161
|
+
children: /* @__PURE__ */ y(S, { children: (F.get(e.id) ?? []).length > 0 ? (F.get(e.id) ?? []).map((e, t) => /* @__PURE__ */ b("span", { children: [t > 0 && ", ", /* @__PURE__ */ y(l, {
|
|
162
162
|
to: "/$workspace/issues/$identifier",
|
|
163
163
|
params: {
|
|
164
|
-
workspace:
|
|
164
|
+
workspace: d,
|
|
165
165
|
identifier: e.identifier
|
|
166
166
|
},
|
|
167
167
|
className: "hover:underline",
|
|
168
168
|
title: e.issueTitle,
|
|
169
169
|
children: e.identifier
|
|
170
|
-
})] }, e.id)) :
|
|
170
|
+
})] }, e.id)) : I("runnerIdle") })
|
|
171
171
|
}),
|
|
172
|
-
Y.isVisible("seen") && /* @__PURE__ */
|
|
172
|
+
Y.isVisible("seen") && /* @__PURE__ */ b(p.Item, {
|
|
173
173
|
className: "py-2.5",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ y(S, { children: e.lastSeenAt ? I("runnerSeen", { seen: z.relative(e.lastSeenAt) }) : I("runnerNeverConnected") }), e.isolation && /* @__PURE__ */ b("span", {
|
|
175
175
|
className: "flex items-center justify-end gap-1.5 text-xs text-muted-foreground",
|
|
176
176
|
title: e.isolation.failures.join("\n") || void 0,
|
|
177
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ y(ne, {
|
|
178
178
|
variant: e.isolation.passed ? "success" : "error",
|
|
179
179
|
size: 8
|
|
180
|
-
}), e.isolation.passed ?
|
|
180
|
+
}), e.isolation.passed ? I("runnerIsolated") : I("runnerNotIsolated", { count: e.isolation.failures.length })]
|
|
181
181
|
})]
|
|
182
182
|
})
|
|
183
183
|
]
|
|
@@ -185,9 +185,9 @@ function N({ workspace: u }) {
|
|
|
185
185
|
})
|
|
186
186
|
})
|
|
187
187
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
|
|
188
|
+
/* @__PURE__ */ y(ee, { workspace: d }),
|
|
189
|
+
q
|
|
190
190
|
]
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
export {
|
|
193
|
+
export { N as component };
|
package/routes/_workspace2.js
CHANGED
|
@@ -419,7 +419,7 @@ function at() {
|
|
|
419
419
|
myUsername: g.user.username,
|
|
420
420
|
currentHref: J.pathname + J.searchStr
|
|
421
421
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ A(P, {
|
|
423
423
|
label: U("teams"),
|
|
424
424
|
collapsible: !1,
|
|
425
425
|
action: C && /* @__PURE__ */ A(w, {
|
|
@@ -429,15 +429,16 @@ function at() {
|
|
|
429
429
|
label: U("createTeam"),
|
|
430
430
|
onClick: () => S(!0)
|
|
431
431
|
}),
|
|
432
|
-
children:
|
|
432
|
+
children: v.length === 0 && (C ? /* @__PURE__ */ A(F, {
|
|
433
433
|
label: U("createFirstTeam"),
|
|
434
434
|
icon: /* @__PURE__ */ A(p, { className: "size-4" }),
|
|
435
435
|
onClick: () => S(!0)
|
|
436
436
|
}) : /* @__PURE__ */ A("p", {
|
|
437
437
|
className: "px-2 text-sm text-muted-foreground",
|
|
438
438
|
children: U("noTeams")
|
|
439
|
-
}))
|
|
440
|
-
})
|
|
439
|
+
}))
|
|
440
|
+
}),
|
|
441
|
+
m
|
|
441
442
|
] })
|
|
442
443
|
] });
|
|
443
444
|
}, qt = X ? void 0 : ({ expanded: e, isMobile: t }) => {
|