@parallelworks/tandem-web 0.157.1 → 0.159.0
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 +42 -1
- package/_virtual/_virtual_i18n/es/common.js +42 -1
- package/_virtual/_virtual_i18n/ja/common.js +42 -1
- package/_virtual/_virtual_i18n/ko/common.js +42 -1
- package/_virtual/_virtual_i18n/zh/common.js +42 -1
- package/api/queries.js +39 -1
- package/components/ComputeTargets.js +117 -0
- package/components/Editor.js +78 -76
- package/components/Figma.js +215 -0
- package/components/LinkCard.js +63 -56
- package/components/SlashMenu.js +2 -0
- package/package.json +1 -1
- package/routes/_workspace/issues/_identifier2.js +167 -162
- package/routes/_workspace/settings/runners2.js +99 -87
|
@@ -6,130 +6,142 @@ import { useTime as a } from "../../../lib/time.js";
|
|
|
6
6
|
import { useConfirm as o } from "../../../lib/confirm.js";
|
|
7
7
|
import { SettingsPage as s } from "../../../components/settings.js";
|
|
8
8
|
import { Route as c } from "./runners.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import { ComputeTargets as l } from "../../../components/ComputeTargets.js";
|
|
10
|
+
import { StatusDot as u, Table as d, menuDivider as f, useOpenMenu as p } from "@parallelworks/ui";
|
|
11
|
+
import { useMemo as m } from "react";
|
|
12
|
+
import { useFormatter as h, useTranslations as g } from "use-intl";
|
|
13
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
14
|
+
import { useMutation as y, useQueryClient as b, useSuspenseQuery as x } from "@tanstack/react-query";
|
|
15
|
+
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";
|
|
15
16
|
// src/routes/$workspace/settings/runners.tsx?tsr-split=component
|
|
16
|
-
var
|
|
17
|
+
var M = {
|
|
17
18
|
default: "runnerModeDefault",
|
|
18
19
|
"accept-edits": "runnerModeAcceptEdits",
|
|
19
20
|
auto: "runnerModeAuto",
|
|
20
21
|
bypass: "runnerModeBypass"
|
|
21
22
|
};
|
|
22
|
-
function
|
|
23
|
+
function N() {
|
|
23
24
|
let { workspace: e } = c.useParams();
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ _(P, { workspace: e });
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
let { data:
|
|
27
|
+
function P({ workspace: c }) {
|
|
28
|
+
let { data: N } = x(n(c)), P = g("account"), F = h(), I = g("common"), L = a(), R = b(), z = A(), B = k(), V = p(), H = y({
|
|
28
29
|
mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/runners/{runnerId}", { params: { path: {
|
|
29
30
|
workspace: c,
|
|
30
31
|
runnerId: n
|
|
31
32
|
} } })),
|
|
32
|
-
onSettled: () =>
|
|
33
|
-
}), { confirm:
|
|
34
|
-
title:
|
|
35
|
-
description:
|
|
36
|
-
confirmLabel:
|
|
37
|
-
onConfirm: () =>
|
|
38
|
-
}),
|
|
33
|
+
onSettled: () => R.invalidateQueries({ queryKey: n(c).queryKey })
|
|
34
|
+
}), { confirm: U, dialog: W } = o(), G = (e) => U({
|
|
35
|
+
title: P("revokeRunnerTitle"),
|
|
36
|
+
description: P("revokeRunnerDescription", { name: e.name }),
|
|
37
|
+
confirmLabel: P("revoke"),
|
|
38
|
+
onConfirm: () => H.mutateAsync(e.id)
|
|
39
|
+
}), K = m(() => [{
|
|
39
40
|
key: "name",
|
|
40
|
-
label:
|
|
41
|
+
label: I("name"),
|
|
41
42
|
headerClassName: "py-2",
|
|
42
43
|
alwaysVisible: !0
|
|
43
44
|
}, {
|
|
44
45
|
key: "seen",
|
|
45
|
-
label:
|
|
46
|
+
label: P("runnerColSeen"),
|
|
46
47
|
headerClassName: "py-2 w-40",
|
|
47
48
|
align: "end"
|
|
48
|
-
}], [
|
|
49
|
+
}], [P, I]), q = m(() => [{
|
|
49
50
|
value: "name",
|
|
50
|
-
label:
|
|
51
|
+
label: I("name"),
|
|
51
52
|
compare: (e, t) => e.name.localeCompare(t.name)
|
|
52
53
|
}, {
|
|
53
54
|
value: "seen",
|
|
54
|
-
label:
|
|
55
|
+
label: P("runnerColSeen"),
|
|
55
56
|
compare: (e, t) => (t.lastSeenAt ?? "").localeCompare(e.lastSeenAt ?? "")
|
|
56
|
-
}], [
|
|
57
|
+
}], [P, I]), J = j({
|
|
57
58
|
storageKey: `tandem-runners-${c}`,
|
|
58
59
|
defaultShowColumnHeaders: !1,
|
|
59
|
-
columns:
|
|
60
|
-
orderBys:
|
|
60
|
+
columns: K,
|
|
61
|
+
orderBys: q,
|
|
61
62
|
defaultOrderBy: "name",
|
|
62
63
|
facets: []
|
|
63
|
-
}),
|
|
64
|
+
}), Y = z.filter.trim().toLowerCase(), X = N.filter((e) => !Y || [
|
|
64
65
|
e.name,
|
|
65
66
|
e.group ?? "",
|
|
66
67
|
...e.harnesses,
|
|
67
68
|
...e.labels
|
|
68
|
-
].some((e) => e.toLowerCase().includes(
|
|
69
|
-
return /* @__PURE__ */
|
|
69
|
+
].some((e) => e.toLowerCase().includes(Y)));
|
|
70
|
+
return /* @__PURE__ */ v(s, {
|
|
70
71
|
wide: !0,
|
|
71
|
-
title:
|
|
72
|
-
description:
|
|
72
|
+
title: P("runners"),
|
|
73
|
+
description: P.rich("runnersDescription", { code: (e) => /* @__PURE__ */ _("code", {
|
|
73
74
|
className: "rounded bg-muted px-1 py-0.5 text-xs",
|
|
74
75
|
children: e
|
|
75
76
|
}) }),
|
|
76
|
-
toolbar:
|
|
77
|
-
view:
|
|
78
|
-
search:
|
|
79
|
-
searchLabel:
|
|
80
|
-
searchPlaceholder:
|
|
77
|
+
toolbar: N.length > 0 && /* @__PURE__ */ _(E, {
|
|
78
|
+
view: J,
|
|
79
|
+
search: z,
|
|
80
|
+
searchLabel: P("runnerSearch"),
|
|
81
|
+
searchPlaceholder: P("runnerSearch")
|
|
81
82
|
}),
|
|
82
|
-
children: [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ _("div", {
|
|
85
|
+
className: "border-t border-border",
|
|
86
|
+
children: /* @__PURE__ */ _(w, {
|
|
87
|
+
view: J,
|
|
88
|
+
total: N.length,
|
|
89
|
+
matches: X.length,
|
|
90
|
+
count: {
|
|
91
|
+
filterActive: z.filter.trim() !== "",
|
|
92
|
+
noun: P("runnerNoun"),
|
|
93
|
+
nounPlural: P("runnerNounPlural")
|
|
94
|
+
},
|
|
95
|
+
empty: {
|
|
96
|
+
icon: /* @__PURE__ */ _(i, {}),
|
|
97
|
+
title: P("noRunners")
|
|
98
|
+
},
|
|
99
|
+
noMatches: P("runnerNoMatches"),
|
|
100
|
+
children: /* @__PURE__ */ v(d, {
|
|
101
|
+
...O,
|
|
102
|
+
children: [/* @__PURE__ */ _(C, { view: J }), J.applyOrder(X).map((e) => /* @__PURE__ */ v(T, {
|
|
103
|
+
href: null,
|
|
104
|
+
goTo: B,
|
|
105
|
+
openMenu: V,
|
|
106
|
+
items: [
|
|
107
|
+
r(P("copyRunnerId"), e.id),
|
|
108
|
+
r(I("copyName"), e.name),
|
|
109
|
+
f,
|
|
110
|
+
{
|
|
111
|
+
label: P("revoke"),
|
|
112
|
+
destructive: !0,
|
|
113
|
+
onClick: () => G(e)
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
children: [/* @__PURE__ */ _(D, {
|
|
117
|
+
icon: /* @__PURE__ */ _(i, {}),
|
|
118
|
+
iconTile: !0,
|
|
119
|
+
name: e.name,
|
|
120
|
+
subtitle: F.list([
|
|
121
|
+
...e.group ? [P("runnerSharedWith", { group: e.group })] : [],
|
|
122
|
+
...e.permissionMode ? [P(M[e.permissionMode])] : [],
|
|
123
|
+
...e.harnesses,
|
|
124
|
+
...e.labels
|
|
125
|
+
], { type: "unit" }),
|
|
126
|
+
href: null
|
|
127
|
+
}), J.isVisible("seen") && /* @__PURE__ */ v(d.Item, {
|
|
128
|
+
className: "py-2.5",
|
|
129
|
+
children: [/* @__PURE__ */ _(S, { children: e.lastSeenAt ? P("runnerSeen", { seen: L.relative(e.lastSeenAt) }) : P("runnerNeverConnected") }), e.isolation && /* @__PURE__ */ v("span", {
|
|
130
|
+
className: "flex items-center justify-end gap-1.5 text-xs text-muted-foreground",
|
|
131
|
+
title: e.isolation.failures.join("\n") || void 0,
|
|
132
|
+
children: [/* @__PURE__ */ _(u, {
|
|
133
|
+
variant: e.isolation.passed ? "success" : "error",
|
|
134
|
+
size: 8
|
|
135
|
+
}), e.isolation.passed ? P("runnerIsolated") : P("runnerNotIsolated", { count: e.isolation.failures.length })]
|
|
136
|
+
})]
|
|
137
|
+
})]
|
|
138
|
+
}, e.id))]
|
|
139
|
+
})
|
|
130
140
|
})
|
|
131
|
-
})
|
|
132
|
-
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ _(l, { workspace: c }),
|
|
143
|
+
W
|
|
144
|
+
]
|
|
133
145
|
});
|
|
134
146
|
}
|
|
135
|
-
export {
|
|
147
|
+
export { N as component };
|