@parallelworks/tandem-web 0.158.0 → 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 +22 -1
- package/_virtual/_virtual_i18n/es/common.js +22 -1
- package/_virtual/_virtual_i18n/ja/common.js +22 -1
- package/_virtual/_virtual_i18n/ko/common.js +22 -1
- package/_virtual/_virtual_i18n/zh/common.js +22 -1
- package/api/queries.js +12 -1
- package/components/ComputeTargets.js +117 -0
- package/package.json +1 -1
- package/routes/_workspace/settings/runners2.js +99 -87
|
@@ -176,7 +176,9 @@ var e = {
|
|
|
176
176
|
tokenNotUsed: "Never used",
|
|
177
177
|
theme: "Theme",
|
|
178
178
|
themeDescription: "How Tandem looks in this browser.",
|
|
179
|
-
themeTandem: "Tandem (match device)"
|
|
179
|
+
themeTandem: "Tandem (match device)",
|
|
180
|
+
runnerIsolated: "Pods isolated",
|
|
181
|
+
runnerNotIsolated: "{count, plural, one {# isolation check failed} other {# isolation checks failed}}"
|
|
180
182
|
},
|
|
181
183
|
notificationSettings: {
|
|
182
184
|
description: "Choose where Tandem tells you about work that needs you, and about what.",
|
|
@@ -3871,6 +3873,25 @@ var e = {
|
|
|
3871
3873
|
snoozed: "Snoozed",
|
|
3872
3874
|
closed: "Closed"
|
|
3873
3875
|
}
|
|
3876
|
+
},
|
|
3877
|
+
compute: {
|
|
3878
|
+
title: "Cluster compute",
|
|
3879
|
+
description: "Compute your organization's admins granted Tandem, such as a Kubernetes cluster. Turned on, agents run in isolated pods there, as the person who assigned them.",
|
|
3880
|
+
noneTitle: "No compute granted",
|
|
3881
|
+
noneDescription: "Your organization's admins haven't granted Tandem a cluster yet.",
|
|
3882
|
+
grant: "Grant compute",
|
|
3883
|
+
healthy: "Ready",
|
|
3884
|
+
unhealthy: "Not ready",
|
|
3885
|
+
useFor: "Run agents on {name}",
|
|
3886
|
+
teams: "Teams",
|
|
3887
|
+
teamsHelp: "Runs on these teams' issues go here.",
|
|
3888
|
+
allTeams: "All teams",
|
|
3889
|
+
labels: "Runner labels",
|
|
3890
|
+
labelsHelp: "Agents that need labels run here only when it has them all.",
|
|
3891
|
+
labelsPlaceholder: "gpu, large",
|
|
3892
|
+
save: "Save",
|
|
3893
|
+
use: "Run agents here",
|
|
3894
|
+
useHelp: "Agents in this workspace run in pods on this cluster."
|
|
3874
3895
|
}
|
|
3875
3896
|
};
|
|
3876
3897
|
export { e as default };
|
|
@@ -176,7 +176,9 @@ var e = {
|
|
|
176
176
|
tokenNotUsed: "Nunca usado",
|
|
177
177
|
theme: "Tema",
|
|
178
178
|
themeDescription: "Cómo se ve Tandem en este navegador.",
|
|
179
|
-
themeTandem: "Tandem (igual que el dispositivo)"
|
|
179
|
+
themeTandem: "Tandem (igual que el dispositivo)",
|
|
180
|
+
runnerIsolated: "Pods aislados",
|
|
181
|
+
runnerNotIsolated: "{count, plural, one {# comprobación de aislamiento falló} other {# comprobaciones de aislamiento fallaron}}"
|
|
180
182
|
},
|
|
181
183
|
notificationSettings: {
|
|
182
184
|
description: "Elige dónde te avisa Tandem del trabajo que te necesita, y de qué.",
|
|
@@ -3871,6 +3873,25 @@ var e = {
|
|
|
3871
3873
|
snoozed: "Pospuesta",
|
|
3872
3874
|
closed: "Cerrada"
|
|
3873
3875
|
}
|
|
3876
|
+
},
|
|
3877
|
+
compute: {
|
|
3878
|
+
title: "Cómputo del clúster",
|
|
3879
|
+
description: "Cómputo que los administradores de tu organización concedieron a Tandem, como un clúster de Kubernetes. Activado, los agentes se ejecutan allí en pods aislados, como la persona que los asignó.",
|
|
3880
|
+
noneTitle: "No hay cómputo concedido",
|
|
3881
|
+
noneDescription: "Los administradores de tu organización aún no han concedido un clúster a Tandem.",
|
|
3882
|
+
grant: "Conceder cómputo",
|
|
3883
|
+
healthy: "Listo",
|
|
3884
|
+
unhealthy: "No está listo",
|
|
3885
|
+
useFor: "Ejecutar agentes en {name}",
|
|
3886
|
+
teams: "Equipos",
|
|
3887
|
+
teamsHelp: "Las ejecuciones en incidencias de estos equipos van aquí.",
|
|
3888
|
+
allTeams: "Todos los equipos",
|
|
3889
|
+
labels: "Etiquetas de ejecutor",
|
|
3890
|
+
labelsHelp: "Los agentes que necesitan etiquetas se ejecutan aquí solo si las tiene todas.",
|
|
3891
|
+
labelsPlaceholder: "gpu, grande",
|
|
3892
|
+
save: "Guardar",
|
|
3893
|
+
use: "Ejecutar agentes aquí",
|
|
3894
|
+
useHelp: "Los agentes de este espacio de trabajo se ejecutan en pods de este clúster."
|
|
3874
3895
|
}
|
|
3875
3896
|
};
|
|
3876
3897
|
export { e as default };
|
|
@@ -176,7 +176,9 @@ var e = {
|
|
|
176
176
|
tokenNotUsed: "未使用",
|
|
177
177
|
theme: "テーマ",
|
|
178
178
|
themeDescription: "このブラウザーでの Tandem の表示です。",
|
|
179
|
-
themeTandem: "Tandem (デバイスに合わせる)"
|
|
179
|
+
themeTandem: "Tandem (デバイスに合わせる)",
|
|
180
|
+
runnerIsolated: "ポッドは分離されています",
|
|
181
|
+
runnerNotIsolated: "{count} 件の分離チェックが失敗しました"
|
|
180
182
|
},
|
|
181
183
|
notificationSettings: {
|
|
182
184
|
description: "対応が必要な作業について、Tandem がどこに、何を通知するかを選択します。",
|
|
@@ -3871,6 +3873,25 @@ var e = {
|
|
|
3871
3873
|
snoozed: "スヌーズ中",
|
|
3872
3874
|
closed: "クローズ"
|
|
3873
3875
|
}
|
|
3876
|
+
},
|
|
3877
|
+
compute: {
|
|
3878
|
+
title: "クラスターのコンピュート",
|
|
3879
|
+
description: "組織の管理者が Tandem に許可したコンピュート(Kubernetes クラスターなど)。オンにすると、エージェントは割り当てた人として、そこにある分離されたポッドで実行されます。",
|
|
3880
|
+
noneTitle: "許可されたコンピュートはありません",
|
|
3881
|
+
noneDescription: "組織の管理者はまだ Tandem にクラスターを許可していません。",
|
|
3882
|
+
grant: "コンピュートを許可",
|
|
3883
|
+
healthy: "準備完了",
|
|
3884
|
+
unhealthy: "準備ができていません",
|
|
3885
|
+
useFor: "{name} でエージェントを実行",
|
|
3886
|
+
teams: "チーム",
|
|
3887
|
+
teamsHelp: "これらのチームの課題の実行はここで行われます。",
|
|
3888
|
+
allTeams: "すべてのチーム",
|
|
3889
|
+
labels: "ランナーのラベル",
|
|
3890
|
+
labelsHelp: "ラベルが必要なエージェントは、すべてのラベルがある場合にのみここで実行されます。",
|
|
3891
|
+
labelsPlaceholder: "gpu, large",
|
|
3892
|
+
save: "保存",
|
|
3893
|
+
use: "ここでエージェントを実行",
|
|
3894
|
+
useHelp: "このワークスペースのエージェントは、このクラスターのポッドで実行されます。"
|
|
3874
3895
|
}
|
|
3875
3896
|
};
|
|
3876
3897
|
export { e as default };
|
|
@@ -176,7 +176,9 @@ var e = {
|
|
|
176
176
|
tokenNotUsed: "사용한 적 없음",
|
|
177
177
|
theme: "테마",
|
|
178
178
|
themeDescription: "이 브라우저에서 Tandem이 보이는 방식입니다.",
|
|
179
|
-
themeTandem: "Tandem (기기 설정 따르기)"
|
|
179
|
+
themeTandem: "Tandem (기기 설정 따르기)",
|
|
180
|
+
runnerIsolated: "파드 격리됨",
|
|
181
|
+
runnerNotIsolated: "격리 검사 {count}개 실패"
|
|
180
182
|
},
|
|
181
183
|
notificationSettings: {
|
|
182
184
|
description: "회원님이 필요한 작업을 Tandem이 어디로, 어떤 내용으로 알릴지 선택하세요.",
|
|
@@ -3871,6 +3873,25 @@ var e = {
|
|
|
3871
3873
|
snoozed: "다시 알림",
|
|
3872
3874
|
closed: "종료됨"
|
|
3873
3875
|
}
|
|
3876
|
+
},
|
|
3877
|
+
compute: {
|
|
3878
|
+
title: "클러스터 컴퓨트",
|
|
3879
|
+
description: "조직 관리자가 Tandem에 허용한 컴퓨트(예: Kubernetes 클러스터)입니다. 켜면 에이전트가 할당한 사람으로서 그곳의 격리된 파드에서 실행됩니다.",
|
|
3880
|
+
noneTitle: "허용된 컴퓨트 없음",
|
|
3881
|
+
noneDescription: "조직 관리자가 아직 Tandem에 클러스터를 허용하지 않았습니다.",
|
|
3882
|
+
grant: "컴퓨트 허용",
|
|
3883
|
+
healthy: "준비됨",
|
|
3884
|
+
unhealthy: "준비 안 됨",
|
|
3885
|
+
useFor: "{name}에서 에이전트 실행",
|
|
3886
|
+
teams: "팀",
|
|
3887
|
+
teamsHelp: "이 팀 이슈의 실행이 여기로 옵니다.",
|
|
3888
|
+
allTeams: "모든 팀",
|
|
3889
|
+
labels: "러너 레이블",
|
|
3890
|
+
labelsHelp: "레이블이 필요한 에이전트는 모든 레이블이 있을 때만 여기서 실행됩니다.",
|
|
3891
|
+
labelsPlaceholder: "gpu, large",
|
|
3892
|
+
save: "저장",
|
|
3893
|
+
use: "여기서 에이전트 실행",
|
|
3894
|
+
useHelp: "이 워크스페이스의 에이전트가 이 클러스터의 파드에서 실행됩니다."
|
|
3874
3895
|
}
|
|
3875
3896
|
};
|
|
3876
3897
|
export { e as default };
|
|
@@ -176,7 +176,9 @@ var e = {
|
|
|
176
176
|
tokenNotUsed: "从未使用",
|
|
177
177
|
theme: "主题",
|
|
178
178
|
themeDescription: "Tandem 在此浏览器中的外观。",
|
|
179
|
-
themeTandem: "Tandem(跟随设备)"
|
|
179
|
+
themeTandem: "Tandem(跟随设备)",
|
|
180
|
+
runnerIsolated: "Pod 已隔离",
|
|
181
|
+
runnerNotIsolated: "{count} 项隔离检查未通过"
|
|
180
182
|
},
|
|
181
183
|
notificationSettings: {
|
|
182
184
|
description: "选择 Tandem 在哪里、就哪些事项通知您需要您处理的工作。",
|
|
@@ -3871,6 +3873,25 @@ var e = {
|
|
|
3871
3873
|
snoozed: "已延后",
|
|
3872
3874
|
closed: "已关闭"
|
|
3873
3875
|
}
|
|
3876
|
+
},
|
|
3877
|
+
compute: {
|
|
3878
|
+
title: "集群计算",
|
|
3879
|
+
description: "组织管理员授予 Tandem 的计算资源,例如 Kubernetes 集群。开启后,智能体会以指派它们的人的身份在其中的隔离 Pod 里运行。",
|
|
3880
|
+
noneTitle: "尚未授予计算资源",
|
|
3881
|
+
noneDescription: "你的组织管理员还没有向 Tandem 授予集群。",
|
|
3882
|
+
grant: "授予计算资源",
|
|
3883
|
+
healthy: "就绪",
|
|
3884
|
+
unhealthy: "未就绪",
|
|
3885
|
+
useFor: "在 {name} 上运行智能体",
|
|
3886
|
+
teams: "团队",
|
|
3887
|
+
teamsHelp: "这些团队事项的运行会在这里进行。",
|
|
3888
|
+
allTeams: "所有团队",
|
|
3889
|
+
labels: "运行器标签",
|
|
3890
|
+
labelsHelp: "需要标签的智能体仅在这里具备全部标签时运行。",
|
|
3891
|
+
labelsPlaceholder: "gpu, large",
|
|
3892
|
+
save: "保存",
|
|
3893
|
+
use: "在此运行智能体",
|
|
3894
|
+
useHelp: "此工作区的智能体会在该集群的 Pod 中运行。"
|
|
3874
3895
|
}
|
|
3875
3896
|
};
|
|
3876
3897
|
export { e as default };
|
package/api/queries.js
CHANGED
|
@@ -1442,5 +1442,16 @@ var Ke = (e) => i({
|
|
|
1442
1442
|
signal: i
|
|
1443
1443
|
})),
|
|
1444
1444
|
staleTime: 12e4
|
|
1445
|
+
}), gt = (e) => i({
|
|
1446
|
+
queryKey: [
|
|
1447
|
+
"workspace",
|
|
1448
|
+
e,
|
|
1449
|
+
"compute-targets"
|
|
1450
|
+
],
|
|
1451
|
+
queryFn: async ({ signal: r }) => n(await t.GET("/api/v1/workspaces/{workspace}/compute-targets", {
|
|
1452
|
+
params: s(e),
|
|
1453
|
+
signal: r
|
|
1454
|
+
})),
|
|
1455
|
+
retry: !1
|
|
1445
1456
|
});
|
|
1446
|
-
export { U as agentQuery, H as agentsQuery, Ve as allDecisionsQuery, De as areaThreadQuery, Oe as areasQuery, b as attachmentsQuery, ot as auditLogQuery, $ as availableRepositoriesQuery, it as branchesQuery, et as codeHostAccountsQuery, $e as codeHostQuery, y as commentsQuery, Ee as countsQuery, V as customerRequestsQuery, B as customersQuery, ct as cycleReportQuery, Xe as cyclesQuery, I as dashboardQuery, F as dashboardsQuery, Pe as docBacklinksQuery, me as docCommentsQuery, ae as docDecisionsQuery, ve as docGraphQuery, Me as docIssuesQuery, _e as docQuery, pe as docTemplatesQuery, ge as docVersionQuery, he as docVersionsQuery, fe as docsQuery, x as eventsQuery, se as favoritesQuery, ht as figmaPreviewQuery, Ge as followQuery, He as githubAccountQuery, We as githubSettingsQuery, A as gitlabQuery, R as groupsQuery, oe as inboxQuery, ft as intercomQuery, ie as issueDecisionsQuery, Ne as issueDocsQuery, mt as issueFigmaQuery, pt as issueIntercomQuery, Qe as issueLinksQuery, g as issueQuery, m as issueSearchQuery, dt as issueSentryQuery, d as issueTemplatesQuery, rt as issueZendeskQuery, p as issuesQuery, j as jiraImportQuery, Ie as knowledgeEntryQuery, Re as knowledgeEventsQuery, Ae as knowledgeGraphQuery, Le as knowledgeMentionsQuery, Fe as knowledgeQuery, ne as labelsQuery, M as linearImportQuery, Se as lostSectionsQuery, a as meQuery, we as measuresQuery, u as membersQuery, Be as myAllDecisionsQuery, ze as myDecisionsQuery, z as myModelsQuery, ue as notificationSettingsQuery, le as notificationsQuery, Te as pageLinkQuery, L as panelQuery, q as parallelWorksBucketsQuery, K as parallelWorksQuery, w as peopleQuery, O as permissionsQuery, at as personActivityQuery, re as personCardQuery, k as projectAccessQuery, Je as projectEventsQuery, Q as projectOf, Ye as projectQuery, qe as projectUpdatesQuery, Ke as projectsQuery, o as providersQuery, nt as pullRequestsQuery, de as pushSettingsQuery, v as reactionsQuery, Ze as relatedIssuesQuery, tt as repositoriesQuery, D as rolesQuery, Y as runActivityQuery, Ce as runReadsQuery, J as runnersQuery, X as runsQuery, ut as sentryProjectsQuery, lt as sentryQuery, G as sessionsQuery, ye as shareLinksQuery, xe as sharedDocQuery, be as sharedQuery, N as slackQuery, Ue as ssoQuery, st as statusHistoryQuery, te as statusesQuery, _ as subscriptionQuery, E as teamAccessQuery, S as teamMembersQuery, C as teamRotationQuery, ee as teamsQuery, W as tokensQuery, ke as unfiledQuery, ce as viewsQuery, l as webhooksQuery, T as workspaceAccessQuery, je as workspaceGraphQuery, c as workspaceQuery, P as zendeskQuery };
|
|
1457
|
+
export { U as agentQuery, H as agentsQuery, Ve as allDecisionsQuery, De as areaThreadQuery, Oe as areasQuery, b as attachmentsQuery, ot as auditLogQuery, $ as availableRepositoriesQuery, it as branchesQuery, et as codeHostAccountsQuery, $e as codeHostQuery, y as commentsQuery, gt as computeTargetsQuery, Ee as countsQuery, V as customerRequestsQuery, B as customersQuery, ct as cycleReportQuery, Xe as cyclesQuery, I as dashboardQuery, F as dashboardsQuery, Pe as docBacklinksQuery, me as docCommentsQuery, ae as docDecisionsQuery, ve as docGraphQuery, Me as docIssuesQuery, _e as docQuery, pe as docTemplatesQuery, ge as docVersionQuery, he as docVersionsQuery, fe as docsQuery, x as eventsQuery, se as favoritesQuery, ht as figmaPreviewQuery, Ge as followQuery, He as githubAccountQuery, We as githubSettingsQuery, A as gitlabQuery, R as groupsQuery, oe as inboxQuery, ft as intercomQuery, ie as issueDecisionsQuery, Ne as issueDocsQuery, mt as issueFigmaQuery, pt as issueIntercomQuery, Qe as issueLinksQuery, g as issueQuery, m as issueSearchQuery, dt as issueSentryQuery, d as issueTemplatesQuery, rt as issueZendeskQuery, p as issuesQuery, j as jiraImportQuery, Ie as knowledgeEntryQuery, Re as knowledgeEventsQuery, Ae as knowledgeGraphQuery, Le as knowledgeMentionsQuery, Fe as knowledgeQuery, ne as labelsQuery, M as linearImportQuery, Se as lostSectionsQuery, a as meQuery, we as measuresQuery, u as membersQuery, Be as myAllDecisionsQuery, ze as myDecisionsQuery, z as myModelsQuery, ue as notificationSettingsQuery, le as notificationsQuery, Te as pageLinkQuery, L as panelQuery, q as parallelWorksBucketsQuery, K as parallelWorksQuery, w as peopleQuery, O as permissionsQuery, at as personActivityQuery, re as personCardQuery, k as projectAccessQuery, Je as projectEventsQuery, Q as projectOf, Ye as projectQuery, qe as projectUpdatesQuery, Ke as projectsQuery, o as providersQuery, nt as pullRequestsQuery, de as pushSettingsQuery, v as reactionsQuery, Ze as relatedIssuesQuery, tt as repositoriesQuery, D as rolesQuery, Y as runActivityQuery, Ce as runReadsQuery, J as runnersQuery, X as runsQuery, ut as sentryProjectsQuery, lt as sentryQuery, G as sessionsQuery, ye as shareLinksQuery, xe as sharedDocQuery, be as sharedQuery, N as slackQuery, Ue as ssoQuery, st as statusHistoryQuery, te as statusesQuery, _ as subscriptionQuery, E as teamAccessQuery, S as teamMembersQuery, C as teamRotationQuery, ee as teamsQuery, W as tokensQuery, ke as unfiledQuery, ce as viewsQuery, l as webhooksQuery, T as workspaceAccessQuery, je as workspaceGraphQuery, c as workspaceQuery, P as zendeskQuery };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
+
import { computeTargetsQuery as n, teamsQuery as r } from "../api/queries.js";
|
|
3
|
+
import { WorkerIcon as i } from "./icons.js";
|
|
4
|
+
import { Button as a, Combobox as o, EmptyState as s, ErrorText as c, Input as l, SettingRow as u, SettingsCard as d, StatusDot as f, Switch as p } from "@parallelworks/ui";
|
|
5
|
+
import { useState as m } from "react";
|
|
6
|
+
import { useErrorMessage as h } from "@parallelworks/problem/react";
|
|
7
|
+
import { useTranslations as g } from "use-intl";
|
|
8
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
9
|
+
import { useMutation as b, useQuery as x, useQueryClient as S } from "@tanstack/react-query";
|
|
10
|
+
// src/components/ComputeTargets.tsx
|
|
11
|
+
function C({ workspace: e }) {
|
|
12
|
+
let t = g("compute"), { data: r } = x(n(e));
|
|
13
|
+
return r?.available ? /* @__PURE__ */ y("section", {
|
|
14
|
+
"aria-labelledby": "compute-title",
|
|
15
|
+
className: "space-y-3 px-4 pt-8",
|
|
16
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h2", {
|
|
17
|
+
id: "compute-title",
|
|
18
|
+
className: "text-base font-semibold",
|
|
19
|
+
children: t("title")
|
|
20
|
+
}), /* @__PURE__ */ v("p", {
|
|
21
|
+
className: "mt-1 text-sm text-muted-foreground text-pretty",
|
|
22
|
+
children: t("description")
|
|
23
|
+
})] }), r.targets.length === 0 ? /* @__PURE__ */ v(s, {
|
|
24
|
+
icon: /* @__PURE__ */ v(i, {}),
|
|
25
|
+
title: t("noneTitle"),
|
|
26
|
+
description: t("noneDescription"),
|
|
27
|
+
action: r.grantUrl && /* @__PURE__ */ v(a, {
|
|
28
|
+
render: /* @__PURE__ */ v("a", { href: r.grantUrl }),
|
|
29
|
+
nativeButton: !1,
|
|
30
|
+
children: t("grant")
|
|
31
|
+
})
|
|
32
|
+
}) : r.targets.map((t) => /* @__PURE__ */ v(w, {
|
|
33
|
+
workspace: e,
|
|
34
|
+
target: t
|
|
35
|
+
}, t.id))]
|
|
36
|
+
}) : null;
|
|
37
|
+
}
|
|
38
|
+
function w({ workspace: i, target: s }) {
|
|
39
|
+
let C = g("compute"), w = h(), T = S(), { data: E = [] } = x(r(i)), [D, O] = m(s.labels.join(", ")), k = b({
|
|
40
|
+
mutationFn: async (n) => t(await e.PUT("/api/v1/workspaces/{workspace}/compute-targets/{target}", {
|
|
41
|
+
params: { path: {
|
|
42
|
+
workspace: i,
|
|
43
|
+
target: s.id
|
|
44
|
+
} },
|
|
45
|
+
body: n
|
|
46
|
+
})),
|
|
47
|
+
onSettled: () => T.invalidateQueries({ queryKey: n(i).queryKey })
|
|
48
|
+
}), A = {
|
|
49
|
+
on: s.on,
|
|
50
|
+
labels: s.labels,
|
|
51
|
+
teamIds: s.teamIds
|
|
52
|
+
}, j = D.split(",").map((e) => e.trim()).filter(Boolean);
|
|
53
|
+
return /* @__PURE__ */ y(d, {
|
|
54
|
+
title: s.name,
|
|
55
|
+
description: /* @__PURE__ */ y("span", {
|
|
56
|
+
className: "flex items-center gap-1.5",
|
|
57
|
+
children: [/* @__PURE__ */ v(f, { variant: s.healthy ? "success" : "warning" }), s.healthy ? C("healthy") : s.problem ?? C("unhealthy")]
|
|
58
|
+
}),
|
|
59
|
+
error: k.error && /* @__PURE__ */ v(c, { children: w(k.error) }),
|
|
60
|
+
children: [/* @__PURE__ */ v(u, {
|
|
61
|
+
label: C("use"),
|
|
62
|
+
helpText: C("useHelp"),
|
|
63
|
+
children: /* @__PURE__ */ v(p, {
|
|
64
|
+
"aria-label": C("useFor", { name: s.name }),
|
|
65
|
+
checked: s.on,
|
|
66
|
+
disabled: k.isPending,
|
|
67
|
+
onCheckedChange: (e) => k.mutate({
|
|
68
|
+
...A,
|
|
69
|
+
on: e
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
}), s.on && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(u, {
|
|
73
|
+
label: C("teams"),
|
|
74
|
+
helpText: C("teamsHelp"),
|
|
75
|
+
children: /* @__PURE__ */ v(o, {
|
|
76
|
+
multiple: !0,
|
|
77
|
+
items: E.map((e) => ({
|
|
78
|
+
value: e.id,
|
|
79
|
+
label: e.name
|
|
80
|
+
})),
|
|
81
|
+
value: s.teamIds,
|
|
82
|
+
onValueChange: (e) => k.mutate({
|
|
83
|
+
...A,
|
|
84
|
+
teamIds: e
|
|
85
|
+
}),
|
|
86
|
+
align: "end",
|
|
87
|
+
placeholder: C("allTeams"),
|
|
88
|
+
"aria-label": C("teams")
|
|
89
|
+
})
|
|
90
|
+
}), /* @__PURE__ */ v(u, {
|
|
91
|
+
label: C("labels"),
|
|
92
|
+
helpText: C("labelsHelp"),
|
|
93
|
+
children: /* @__PURE__ */ y("form", {
|
|
94
|
+
className: "flex gap-2",
|
|
95
|
+
onSubmit: (e) => {
|
|
96
|
+
e.preventDefault(), k.mutate({
|
|
97
|
+
...A,
|
|
98
|
+
labels: j
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
children: [/* @__PURE__ */ v(l, {
|
|
102
|
+
value: D,
|
|
103
|
+
onChange: (e) => O(e.target.value),
|
|
104
|
+
placeholder: C("labelsPlaceholder"),
|
|
105
|
+
"aria-label": C("labels"),
|
|
106
|
+
className: "w-48"
|
|
107
|
+
}), /* @__PURE__ */ v(a, {
|
|
108
|
+
type: "submit",
|
|
109
|
+
disabled: j.join(",") === s.labels.join(","),
|
|
110
|
+
loading: k.isPending,
|
|
111
|
+
children: C("save")
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
})] })]
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
export { C as ComputeTargets };
|
package/package.json
CHANGED
|
@@ -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 };
|