@overvis/hmi-workspace-ui 0.1.0 → 0.1.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/dist/alarm-list-sheAq-pb.js +414 -0
- package/dist/alarm-rule-dialog-D_ml7V0v.js +417 -0
- package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-DaA4soF4.js} +123 -125
- package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-OFjOQ-dm.js} +15 -18
- package/dist/alert-dialog-B60PF7S9.js +891 -0
- package/dist/{base-revision-YCO27zR4.js → base-revision-DYCOZS0R.js} +26 -29
- package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D2u8KZQo.js} +6 -7
- package/dist/{catalog-list-DjZojYLJ.js → catalog-list-LXuRix0-.js} +2 -4
- package/dist/{code-editor-BVimvjDV.js → code-editor-BMSyzAxu.js} +5 -6
- package/dist/dashboard-bindings.js +1 -2
- package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-wnmmLpVC.js} +335 -359
- package/dist/{de-14WdmJxZ.js → de-hkEr2usK.js} +1 -2
- package/dist/diagnostic-text-CsbENUNI.js +116 -0
- package/dist/{dialogs-B6BRnf3Q.js → dialogs-AtIYlNSy.js} +219 -227
- package/dist/{dialogs-D_v1LeH4.js → dialogs-DsHbKgZD.js} +2523 -2590
- package/dist/{display-DmOo23mi.js → display-DSyEwQt8.js} +4 -6
- package/dist/{editor-language-To9MxloY.js → editor-language-CTfJBXMs.js} +3 -5
- package/dist/editor-page-BWbVGJvU.js +1337 -0
- package/dist/{en-BgercpT0.js → en-UW_k-Bd6.js} +1 -2
- package/dist/entity-controls-BCuRx882.js +71 -0
- package/dist/errors-Cawve9yD.js +25 -0
- package/dist/{footer-DC-Q0052.js → footer-B9XdpVzq.js} +2404 -2515
- package/dist/host.js +8143 -675
- package/dist/{i18n-BgzakKoC.js → i18n-Dt6xbSK6.js} +77 -90
- package/dist/i18n.js +1 -2
- package/dist/index.js +5149 -5345
- package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
- package/dist/{list-page-CvsdZb86.js → list-page-agHupfNb.js} +116 -123
- package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-kxU6cgFl.js} +6 -6
- package/dist/{location-picker-renderer-CjCxg6ai.js → location-picker-renderer-B1_-n8lf.js} +3 -4
- package/dist/{model-B8gGi4OK.js → model-tpg_xpFB.js} +1 -2
- package/dist/{notice-card-DyGywFsW.js → notice-card-CH28rYUt.js} +54 -58
- package/dist/{page-v6LCwswN.js → page-CZPHJUmz.js} +92 -100
- package/dist/page-DpdkOGGb.js +449 -0
- package/dist/page-HCGXXGjy.js +507 -0
- package/dist/panel-BCwBlB_h.js +949 -0
- package/dist/parameter-values.js +3 -16
- package/dist/{pl-lQ9HXV9k.js → pl-BokvsP3J.js} +1 -2
- package/dist/presence-code-cT6wxlTg.js +73 -0
- package/dist/{query-gate-DVhNIkge.js → query-gate-DqmHsZ07.js} +6 -6
- package/dist/{provider-DoEpKcQ-.js → quick-report-DEqqwQxR.js} +9423 -5102
- package/dist/{retention-BYXNpYmR.js → retention-DZ0reGGe.js} +4 -6
- package/dist/retention-note-nequESpo.js +40 -0
- package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
- package/dist/{ru-qTKINoUj.js → ru-DZSlsRHq.js} +1 -2
- package/dist/run-text-DneX9rWh.js +112 -0
- package/dist/{search-D4rDnE9T.js → search-DP9_alSQ.js} +26 -29
- package/dist/{sections-kCOyc4NR.js → sections-BU7NKUOQ.js} +2 -3
- package/dist/{select-BKiOWdSr.js → select-Te6Qv1Zu.js} +17 -23
- package/dist/{spinner-C-HPNxOc.js → spinner-BRcNKwjH.js} +182 -201
- package/dist/src/version.d.ts +1 -1
- package/dist/src/workspace/local-workspace-app.d.ts +1 -1
- package/dist/src/workspace/routes.d.ts +1 -1
- package/dist/{starter-fields-BRLX0z-v.js → starter-fields-yM4B49nd.js} +154 -157
- package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
- package/dist/styles.css +1 -1
- package/dist/ui.js +334 -374
- package/dist/{uk-CwpJAxmx.js → uk-CjXPq9Lk.js} +1 -2
- package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-CC8XKBR7.js} +14 -17
- package/package.json +15 -9
- package/dist/alarm-list-BL3xQ5Lf.js +0 -423
- package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
- package/dist/alert-B8MAoIO8.js +0 -45
- package/dist/alert-dialog-CYkuMg5D.js +0 -129
- package/dist/api-error-9rQmUN5L.js +0 -93
- package/dist/breadcrumb-DzVL1yHa.js +0 -74
- package/dist/button-6SxPBYMz.js +0 -44
- package/dist/context-u9KJQmdB.js +0 -102
- package/dist/copyable-id-DYGiAcnq.js +0 -40
- package/dist/dashboard-context-CBfG6DoT.js +0 -191
- package/dist/date-time-picker-C3FhMXk6.js +0 -266
- package/dist/diagnostic-text-BAkzW0SE.js +0 -111
- package/dist/diagnostic-text-DiKd2i1w.js +0 -76
- package/dist/dialog-BIhQXcZC.js +0 -237
- package/dist/dialog-BqyIxMD-.js +0 -54
- package/dist/dropdown-menu-DSzbBq3v.js +0 -136
- package/dist/editor-page-BiSZJz5b.js +0 -1353
- package/dist/empty-B-QJ-06w.js +0 -59
- package/dist/entity-controls-D1K4Ot3O.js +0 -76
- package/dist/errors-CcsvDHu8.js +0 -26
- package/dist/history-page-sAAhG54V.js +0 -1400
- package/dist/icon-D-pR9htW.js +0 -57
- package/dist/index-page-DMH82fZe.js +0 -214
- package/dist/item-B5SaTFQU.js +0 -120
- package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
- package/dist/mutations-THtGG6Ai.js +0 -240
- package/dist/page-2KPemaAj.js +0 -328
- package/dist/page-6rIoTg2L.js +0 -459
- package/dist/page-C6giEoEd.js +0 -1935
- package/dist/page-DCbTxKsi.js +0 -313
- package/dist/page-DWO427hT.js +0 -208
- package/dist/page-LXu_2zm3.js +0 -137
- package/dist/page-aaUiVOnk.js +0 -513
- package/dist/page-header-RB2YFWlE.js +0 -55
- package/dist/page-title-CdCbiLt8.js +0 -14
- package/dist/panel-DDy8tUNR.js +0 -338
- package/dist/presence-code-BfSXr50g.js +0 -83
- package/dist/progress-C7cxNJA1.js +0 -83
- package/dist/provider-BOeYHi0n.js +0 -134
- package/dist/quick-report-CUVJnbKP.js +0 -416
- package/dist/radio-group-CZGqVbkJ.js +0 -26
- package/dist/retention-note-CHhA6gjY.js +0 -42
- package/dist/run-text-DvaO8LDF.js +0 -113
- package/dist/select-eNgZdZ30.js +0 -521
- package/dist/skeleton-6yk8Tdh5.js +0 -19
- package/dist/slider-DorDsoF8.js +0 -37
- package/dist/status-page-DAHiKM9P.js +0 -3286
- package/dist/switch-BqD0RH_G.js +0 -18
- package/dist/table-Q2-voLuw.js +0 -65
- package/dist/tabs-CSIucYFP.js +0 -57
- package/dist/theme-provider-BkRohQFU.js +0 -61
- package/dist/toggle-group-9Bs0Mm3r.js +0 -82
- package/dist/trpc-CvJUuUXp.js +0 -153
- package/dist/utils-CX-Pz5p6.js +0 -8
- package/dist/writability-BuH-spxv.js +0 -57
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
+
import { Bn as t, Kn as n, Lt as r, Qn as i, Wn as a, ii as o, zn as s } from "./quick-report-DEqqwQxR.js";
|
|
3
|
+
import { f as c, h as l, m as u, n as d } from "./i18n-Dt6xbSK6.js";
|
|
4
|
+
import { $ as f, B as p, H as m, K as h, Nt as g, R as _, U as v, V as y, X as b, Y as x, jt as S, xt as C } from "./alert-dialog-B60PF7S9.js";
|
|
5
|
+
import { G as w, V as T } from "./spinner-BRcNKwjH.js";
|
|
6
|
+
import { b as E } from "./panel-BCwBlB_h.js";
|
|
7
|
+
import { r as D, t as O } from "./query-gate-DqmHsZ07.js";
|
|
8
|
+
import { i as k, n as A, t as ee } from "./display-DSyEwQt8.js";
|
|
9
|
+
import { t as te } from "./breadcrumbs-D2u8KZQo.js";
|
|
10
|
+
import { a as ne, i as re, n as ie, r as j, t as M } from "./presence-code-cT6wxlTg.js";
|
|
11
|
+
import { a as N, c as P, d as F, i as I, l as L, n as R, o as z, r as B, s as V, t as H, u as U } from "./catalog-list-LXuRix0-.js";
|
|
12
|
+
import { t as W } from "./wireguard-docs-CC8XKBR7.js";
|
|
13
|
+
import { useState as G } from "react";
|
|
14
|
+
import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
15
|
+
import { BookOpenIcon as Y, CableIcon as ae, PencilIcon as oe, PlusIcon as se, Trash2Icon as ce } from "lucide-react";
|
|
16
|
+
import { formatAppDateTime as le, resolveLocalized as ue } from "@overvis/hmi-shared";
|
|
17
|
+
import { useNavigate as de } from "@tanstack/react-router";
|
|
18
|
+
import { endpointCreateFormSchema as fe, endpointCreateFormToInput as pe, endpointDefaultPort as me } from "@overvis/hmi-shared/endpoint";
|
|
19
|
+
// src/workspace/setup/endpoints/form-problem.ts
|
|
20
|
+
function X({ problem: e }) {
|
|
21
|
+
switch (e) {
|
|
22
|
+
case "name_required": return c("error_field_required");
|
|
23
|
+
case "hostname_invalid": return c("error_endpoint_hostname_invalid");
|
|
24
|
+
case "pin_invalid": return c("error_endpoint_pin_invalid");
|
|
25
|
+
case "public_key_invalid": return c("error_endpoint_public_key_invalid");
|
|
26
|
+
case "port_invalid": return c("error_endpoint_port_invalid");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// src/workspace/setup/endpoints/connection-indicator.tsx
|
|
30
|
+
function he(e) {
|
|
31
|
+
if (e === void 0) return c("endpoint_status_state_unknown");
|
|
32
|
+
if (e == null) return c("endpoint_status_state_disconnected");
|
|
33
|
+
switch (e) {
|
|
34
|
+
case "connecting": return c("endpoint_status_state_connecting");
|
|
35
|
+
case "connected": return c("endpoint_status_state_connected");
|
|
36
|
+
case "disconnected": return c("endpoint_status_state_disconnected");
|
|
37
|
+
case "error": return c("endpoint_status_state_error");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function Z(e) {
|
|
41
|
+
return e === "connected" ? "bg-emerald-500" : e === "error" ? "bg-destructive" : e === "connecting" ? "bg-amber-500" : "bg-muted-foreground/40";
|
|
42
|
+
}
|
|
43
|
+
function ge({ endpointId: e }) {
|
|
44
|
+
l();
|
|
45
|
+
let t = k(e), n = t === void 0 ? void 0 : t?.state ?? null, r = he(n);
|
|
46
|
+
return /* @__PURE__ */ q("span", {
|
|
47
|
+
className: "inline-flex size-5 shrink-0 items-center justify-center",
|
|
48
|
+
title: r,
|
|
49
|
+
"aria-label": r,
|
|
50
|
+
role: "img",
|
|
51
|
+
children: /* @__PURE__ */ q("span", { className: g("size-2.5 rounded-full", Z(n)) })
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
// src/workspace/setup/endpoints/enabled-switch.tsx
|
|
55
|
+
function _e({ workspaceId: e, endpoint: t, compact: n = !1, className: i }) {
|
|
56
|
+
let o = u(), s = d(), { enable: c, disable: l } = r(e), p = (e) => ({
|
|
57
|
+
onSuccess: () => {
|
|
58
|
+
s.success(e);
|
|
59
|
+
},
|
|
60
|
+
onError: (e) => {
|
|
61
|
+
s.error(a(e));
|
|
62
|
+
}
|
|
63
|
+
}), m = t.disabledSince == null, h = l.isPending || c.isPending;
|
|
64
|
+
return /* @__PURE__ */ J("div", {
|
|
65
|
+
className: i,
|
|
66
|
+
onClick: (e) => {
|
|
67
|
+
e.stopPropagation();
|
|
68
|
+
},
|
|
69
|
+
onKeyDown: (e) => {
|
|
70
|
+
e.stopPropagation();
|
|
71
|
+
},
|
|
72
|
+
children: [/* @__PURE__ */ J("div", {
|
|
73
|
+
className: "flex items-center gap-2",
|
|
74
|
+
children: [/* @__PURE__ */ q(f, {
|
|
75
|
+
checked: m,
|
|
76
|
+
disabled: h,
|
|
77
|
+
size: "sm",
|
|
78
|
+
"aria-label": o("endpoint_enabled_label"),
|
|
79
|
+
onCheckedChange: (e) => {
|
|
80
|
+
e ? c.mutate({
|
|
81
|
+
id: t.id,
|
|
82
|
+
baseRevision: t.revision
|
|
83
|
+
}, p(o("endpoint_enable_toast"))) : l.mutate({
|
|
84
|
+
id: t.id,
|
|
85
|
+
baseRevision: t.revision
|
|
86
|
+
}, p(o("endpoint_disable_toast")));
|
|
87
|
+
}
|
|
88
|
+
}), n ? null : /* @__PURE__ */ q("span", {
|
|
89
|
+
className: "text-sm text-muted-foreground",
|
|
90
|
+
children: o("endpoint_enabled_label")
|
|
91
|
+
})]
|
|
92
|
+
}), !n && t.disabledSince != null ? /* @__PURE__ */ q("p", {
|
|
93
|
+
className: "mt-1 text-xs text-muted-foreground",
|
|
94
|
+
children: o("endpoint_disabled_since", { since: le(t.disabledSince) })
|
|
95
|
+
}) : null]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function ve({ endpoint: e }) {
|
|
99
|
+
let t = u();
|
|
100
|
+
return e.disabledSince == null ? null : /* @__PURE__ */ q("span", {
|
|
101
|
+
className: "\n inline-flex shrink-0 items-center rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium\n text-muted-foreground\n ",
|
|
102
|
+
children: t("endpoint_disabled_badge")
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// src/workspace/setup/endpoints/page.tsx
|
|
106
|
+
var ye = /* @__PURE__ */ e({
|
|
107
|
+
CreateEndpointForm: () => $,
|
|
108
|
+
SetupEndpointsPage: () => Q
|
|
109
|
+
});
|
|
110
|
+
function Q({ workspaceId: e }) {
|
|
111
|
+
let t = u(), n = d(), r = l(), i = de(), s = o.endpoint.list.useQuery({ workspaceId: e }), { open: c } = W(), [f, m] = G(null);
|
|
112
|
+
return /* @__PURE__ */ J(L, { children: [
|
|
113
|
+
/* @__PURE__ */ q(E, {
|
|
114
|
+
icon: /* @__PURE__ */ q(ae, {}),
|
|
115
|
+
breadcrumbs: /* @__PURE__ */ q(te, { workspaceId: e }),
|
|
116
|
+
title: t("setup_endpoints_title"),
|
|
117
|
+
description: t("setup_endpoints_description"),
|
|
118
|
+
actions: /* @__PURE__ */ J(S, {
|
|
119
|
+
type: "button",
|
|
120
|
+
size: "sm",
|
|
121
|
+
onClick: () => {
|
|
122
|
+
i({
|
|
123
|
+
to: "/workspace/$workspaceId/setup/endpoints/new",
|
|
124
|
+
params: { workspaceId: e }
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
children: [/* @__PURE__ */ q(se, { "data-icon": "inline-start" }), t("endpoint_create_action")]
|
|
128
|
+
})
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ q(R, { children: /* @__PURE__ */ q(D, {
|
|
131
|
+
query: s,
|
|
132
|
+
loading: /* @__PURE__ */ J("div", {
|
|
133
|
+
className: "space-y-2",
|
|
134
|
+
children: [/* @__PURE__ */ q(C, { className: "h-10 w-full" }), /* @__PURE__ */ q(C, { className: "h-10 w-4/5" })]
|
|
135
|
+
}),
|
|
136
|
+
error: (e) => /* @__PURE__ */ q(O, { message: a(e) }),
|
|
137
|
+
isEmpty: (e) => e.endpoints.length === 0,
|
|
138
|
+
empty: /* @__PURE__ */ q(B, { children: t("setup_endpoints_empty") }),
|
|
139
|
+
children: ({ endpoints: n }) => /* @__PURE__ */ q(N, { children: n.map((n) => /* @__PURE__ */ J(U, {
|
|
140
|
+
"data-context-endpoint-id": n.id,
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ q(ge, { endpointId: n.id }),
|
|
143
|
+
/* @__PURE__ */ J(P, {
|
|
144
|
+
to: "/workspace/$workspaceId/setup/endpoints/$endpointId/status",
|
|
145
|
+
params: {
|
|
146
|
+
workspaceId: e,
|
|
147
|
+
endpointId: n.id
|
|
148
|
+
},
|
|
149
|
+
children: [/* @__PURE__ */ J("div", {
|
|
150
|
+
className: "flex min-w-0 items-center gap-2",
|
|
151
|
+
children: [/* @__PURE__ */ q(V, { children: ue(n.name, r) }), /* @__PURE__ */ q(ve, { endpoint: n })]
|
|
152
|
+
}), /* @__PURE__ */ q(z, { children: n.kind === "pin" ? ee(n) : n.kind === "wireguard" ? A(n.port) : `${t("endpoint_list_host")}: ${n.hostname ?? "—"}:${String(n.port)}` })]
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ J(H, { children: [/* @__PURE__ */ q(_e, {
|
|
155
|
+
workspaceId: e,
|
|
156
|
+
endpoint: n,
|
|
157
|
+
compact: !0
|
|
158
|
+
}), /* @__PURE__ */ J(I, { children: [
|
|
159
|
+
n.kind === "wireguard" ? /* @__PURE__ */ q(F, {
|
|
160
|
+
"aria-label": t("endpoint_docs_action"),
|
|
161
|
+
onClick: () => {
|
|
162
|
+
c(n.id);
|
|
163
|
+
},
|
|
164
|
+
children: /* @__PURE__ */ q(Y, {})
|
|
165
|
+
}) : null,
|
|
166
|
+
/* @__PURE__ */ q(F, {
|
|
167
|
+
"aria-label": t("endpoint_edit_action"),
|
|
168
|
+
onClick: () => {
|
|
169
|
+
i({
|
|
170
|
+
to: "/workspace/$workspaceId/setup/endpoints/$endpointId",
|
|
171
|
+
params: {
|
|
172
|
+
workspaceId: e,
|
|
173
|
+
endpointId: n.id
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
children: /* @__PURE__ */ q(oe, {})
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ q(F, {
|
|
180
|
+
tone: "destructive",
|
|
181
|
+
"aria-label": t("endpoint_delete_action"),
|
|
182
|
+
onClick: () => {
|
|
183
|
+
m(n);
|
|
184
|
+
},
|
|
185
|
+
children: /* @__PURE__ */ q(ce, {})
|
|
186
|
+
})
|
|
187
|
+
] })] })
|
|
188
|
+
]
|
|
189
|
+
}, n.id)) })
|
|
190
|
+
}) }),
|
|
191
|
+
/* @__PURE__ */ q(_, {
|
|
192
|
+
open: f != null,
|
|
193
|
+
onOpenChange: (e) => {
|
|
194
|
+
e || m(null);
|
|
195
|
+
},
|
|
196
|
+
children: /* @__PURE__ */ q(p, { children: f ? /* @__PURE__ */ q(be, {
|
|
197
|
+
workspaceId: e,
|
|
198
|
+
endpointId: f.id,
|
|
199
|
+
baseRevision: f.revision,
|
|
200
|
+
onCancel: () => {
|
|
201
|
+
m(null);
|
|
202
|
+
},
|
|
203
|
+
onDeleted: () => {
|
|
204
|
+
m(null), n.success(t("endpoint_delete_toast"));
|
|
205
|
+
}
|
|
206
|
+
}) : null })
|
|
207
|
+
})
|
|
208
|
+
] });
|
|
209
|
+
}
|
|
210
|
+
function $({ workspaceId: e, onCancel: a, onCreated: o }) {
|
|
211
|
+
let l = u(), f = d(), { open: p } = W(), g = r(e).create, _ = ne(), [C, E] = G(null), D = {
|
|
212
|
+
kind: "pin",
|
|
213
|
+
name: l("endpoint_default_name"),
|
|
214
|
+
hostname: "",
|
|
215
|
+
pinCode: "",
|
|
216
|
+
publicKey: "",
|
|
217
|
+
port: String(me),
|
|
218
|
+
authorizationCode: ""
|
|
219
|
+
}, O = n({
|
|
220
|
+
defaultValues: D,
|
|
221
|
+
validators: s({
|
|
222
|
+
schema: fe,
|
|
223
|
+
submit: async (n) => {
|
|
224
|
+
let r = pe(n, {
|
|
225
|
+
workspaceId: e,
|
|
226
|
+
defaultName: c("endpoint_default_name")
|
|
227
|
+
});
|
|
228
|
+
if (!r.ok) return t(r, X);
|
|
229
|
+
let i = r.input;
|
|
230
|
+
if (i.kind === "pin") {
|
|
231
|
+
if (C == null) {
|
|
232
|
+
let t = await _.begin({
|
|
233
|
+
workspaceId: e,
|
|
234
|
+
pinCode: i.pinCode
|
|
235
|
+
});
|
|
236
|
+
if (t === "closed") return null;
|
|
237
|
+
if (t != null) return E({
|
|
238
|
+
...t,
|
|
239
|
+
pinCode: i.pinCode
|
|
240
|
+
}), null;
|
|
241
|
+
} else {
|
|
242
|
+
let e = M(n.authorizationCode);
|
|
243
|
+
if (!e.ok) return { fields: { authorizationCode: () => c("endpoint_presence_code_invalid") } };
|
|
244
|
+
i = {
|
|
245
|
+
...i,
|
|
246
|
+
pinCode: C.pinCode,
|
|
247
|
+
challengeId: C.challengeId,
|
|
248
|
+
...e.code == null ? {} : { authorizationCode: e.code }
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
let a;
|
|
253
|
+
try {
|
|
254
|
+
a = await g.mutateAsync(i);
|
|
255
|
+
} catch (e) {
|
|
256
|
+
throw C != null && !re(e) && (_.cancel(C.challengeId), E(null), O.setFieldValue("authorizationCode", "")), e;
|
|
257
|
+
}
|
|
258
|
+
return C != null && _.settle(C.challengeId), f.success(l("endpoint_create_toast")), queueMicrotask(() => {
|
|
259
|
+
o({
|
|
260
|
+
id: a.id,
|
|
261
|
+
kind: a.kind
|
|
262
|
+
}), a.kind === "wireguard" && p(a.id);
|
|
263
|
+
}), null;
|
|
264
|
+
},
|
|
265
|
+
mapError: (e, t) => j(e, t, C?.codeDisplayed ?? !0)
|
|
266
|
+
}),
|
|
267
|
+
onSubmitInvalid: i
|
|
268
|
+
});
|
|
269
|
+
return /* @__PURE__ */ q(O.AppForm, { children: /* @__PURE__ */ J(O.FormRoot, {
|
|
270
|
+
layout: "dialog",
|
|
271
|
+
children: [
|
|
272
|
+
/* @__PURE__ */ J(v, { children: [/* @__PURE__ */ q(h, { children: l(C == null ? "endpoint_create_title" : "endpoint_presence_title") }), C == null ? /* @__PURE__ */ q(O.Subscribe, {
|
|
273
|
+
selector: (e) => e.values.kind,
|
|
274
|
+
children: (e) => /* @__PURE__ */ q(y, { children: l(e === "pin" ? "endpoint_create_description_pin" : e === "wireguard" ? "endpoint_create_description_wireguard" : "endpoint_create_description") })
|
|
275
|
+
}) : /* @__PURE__ */ q(y, { children: l("endpoint_presence_button") })] }),
|
|
276
|
+
/* @__PURE__ */ J(T, { children: [C == null ? null : /* @__PURE__ */ J(K, { children: [
|
|
277
|
+
/* @__PURE__ */ q(O.Subscribe, {
|
|
278
|
+
selector: (e) => e.isSubmitting,
|
|
279
|
+
children: (e) => /* @__PURE__ */ q(ie, {
|
|
280
|
+
challengeId: C.challengeId,
|
|
281
|
+
paused: e,
|
|
282
|
+
onDone: () => {
|
|
283
|
+
O.setFieldValue("authorizationCode", ""), O.handleSubmit();
|
|
284
|
+
}
|
|
285
|
+
})
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ q("p", {
|
|
288
|
+
className: "text-sm",
|
|
289
|
+
children: C.codeDisplayed ? l("endpoint_presence_or_code") : l("endpoint_presence_button_only")
|
|
290
|
+
}),
|
|
291
|
+
C.codeDisplayed ? /* @__PURE__ */ q(O.AppField, {
|
|
292
|
+
name: "authorizationCode",
|
|
293
|
+
children: (e) => /* @__PURE__ */ q(e.TextField, {
|
|
294
|
+
label: l("endpoint_presence_code_label"),
|
|
295
|
+
id: "endpoint-authorization-code",
|
|
296
|
+
autoComplete: "off",
|
|
297
|
+
spellCheck: !1,
|
|
298
|
+
inputMode: "numeric",
|
|
299
|
+
autoFocus: !0
|
|
300
|
+
})
|
|
301
|
+
}) : null
|
|
302
|
+
] }), C == null ? /* @__PURE__ */ q(O.Subscribe, {
|
|
303
|
+
selector: (e) => e.isSubmitting,
|
|
304
|
+
children: (e) => /* @__PURE__ */ J(w, {
|
|
305
|
+
disabled: e,
|
|
306
|
+
className: "contents",
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ q(O.AppField, {
|
|
309
|
+
name: "kind",
|
|
310
|
+
children: (e) => /* @__PURE__ */ J("div", {
|
|
311
|
+
className: "space-y-2",
|
|
312
|
+
children: [/* @__PURE__ */ q("p", {
|
|
313
|
+
className: "text-sm font-medium",
|
|
314
|
+
children: l("endpoint_field_kind")
|
|
315
|
+
}), /* @__PURE__ */ J(x, {
|
|
316
|
+
variant: "outline",
|
|
317
|
+
size: "sm",
|
|
318
|
+
spacing: 0,
|
|
319
|
+
value: [e.state.value],
|
|
320
|
+
onValueChange: (t) => {
|
|
321
|
+
let n = t[0];
|
|
322
|
+
(n === "direct" || n === "pin" || n === "wireguard") && e.handleChange(n);
|
|
323
|
+
},
|
|
324
|
+
className: "w-full",
|
|
325
|
+
children: [
|
|
326
|
+
/* @__PURE__ */ q(b, {
|
|
327
|
+
value: "pin",
|
|
328
|
+
className: "flex-1",
|
|
329
|
+
children: l("endpoint_kind_pin")
|
|
330
|
+
}),
|
|
331
|
+
/* @__PURE__ */ q(b, {
|
|
332
|
+
value: "wireguard",
|
|
333
|
+
className: "flex-1",
|
|
334
|
+
children: l("endpoint_kind_wireguard")
|
|
335
|
+
}),
|
|
336
|
+
/* @__PURE__ */ q(b, {
|
|
337
|
+
value: "direct",
|
|
338
|
+
className: "flex-1",
|
|
339
|
+
children: l("endpoint_kind_direct")
|
|
340
|
+
})
|
|
341
|
+
]
|
|
342
|
+
})]
|
|
343
|
+
})
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ q(O.AppField, {
|
|
346
|
+
name: "name",
|
|
347
|
+
children: (e) => /* @__PURE__ */ q(e.TextField, {
|
|
348
|
+
label: l("endpoint_field_name"),
|
|
349
|
+
id: "endpoint-name",
|
|
350
|
+
autoFocus: !0
|
|
351
|
+
})
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ q(O.Subscribe, {
|
|
354
|
+
selector: (e) => e.values.kind,
|
|
355
|
+
children: (e) => e === "pin" ? /* @__PURE__ */ q(O.AppField, {
|
|
356
|
+
name: "pinCode",
|
|
357
|
+
children: (e) => /* @__PURE__ */ q(e.TextField, {
|
|
358
|
+
label: l("endpoint_field_pin_code"),
|
|
359
|
+
id: "endpoint-pin",
|
|
360
|
+
autoComplete: "off",
|
|
361
|
+
spellCheck: !1
|
|
362
|
+
})
|
|
363
|
+
}) : e === "wireguard" ? /* @__PURE__ */ J("div", {
|
|
364
|
+
className: "\n grid grid-cols-1 gap-4\n sm:grid-cols-[minmax(0,1fr)_6.5rem]\n ",
|
|
365
|
+
children: [/* @__PURE__ */ q(O.AppField, {
|
|
366
|
+
name: "publicKey",
|
|
367
|
+
children: (e) => /* @__PURE__ */ q(e.TextField, {
|
|
368
|
+
label: l("endpoint_field_public_key"),
|
|
369
|
+
id: "endpoint-public-key",
|
|
370
|
+
autoComplete: "off",
|
|
371
|
+
spellCheck: !1
|
|
372
|
+
})
|
|
373
|
+
}), /* @__PURE__ */ q(O.AppField, {
|
|
374
|
+
name: "port",
|
|
375
|
+
children: (e) => /* @__PURE__ */ q(e.TextField, {
|
|
376
|
+
label: l("endpoint_field_port"),
|
|
377
|
+
id: "endpoint-port",
|
|
378
|
+
type: "number",
|
|
379
|
+
inputMode: "numeric"
|
|
380
|
+
})
|
|
381
|
+
})]
|
|
382
|
+
}) : /* @__PURE__ */ J("div", {
|
|
383
|
+
className: "\n grid grid-cols-1 gap-4\n sm:grid-cols-[minmax(0,1fr)_6.5rem]\n ",
|
|
384
|
+
children: [/* @__PURE__ */ q(O.AppField, {
|
|
385
|
+
name: "hostname",
|
|
386
|
+
children: (e) => /* @__PURE__ */ q(e.TextField, {
|
|
387
|
+
label: l("endpoint_field_hostname"),
|
|
388
|
+
id: "endpoint-hostname",
|
|
389
|
+
autoComplete: "off",
|
|
390
|
+
spellCheck: !1
|
|
391
|
+
})
|
|
392
|
+
}), /* @__PURE__ */ q(O.AppField, {
|
|
393
|
+
name: "port",
|
|
394
|
+
children: (e) => /* @__PURE__ */ q(e.TextField, {
|
|
395
|
+
label: l("endpoint_field_port"),
|
|
396
|
+
id: "endpoint-port",
|
|
397
|
+
type: "number",
|
|
398
|
+
inputMode: "numeric"
|
|
399
|
+
})
|
|
400
|
+
})]
|
|
401
|
+
})
|
|
402
|
+
})
|
|
403
|
+
]
|
|
404
|
+
})
|
|
405
|
+
}) : null] }),
|
|
406
|
+
/* @__PURE__ */ J(m, { children: [/* @__PURE__ */ q(S, {
|
|
407
|
+
type: "button",
|
|
408
|
+
variant: "outline",
|
|
409
|
+
onClick: () => {
|
|
410
|
+
a();
|
|
411
|
+
},
|
|
412
|
+
children: l("action_cancel")
|
|
413
|
+
}), /* @__PURE__ */ q(O.SubmitButton, {
|
|
414
|
+
label: C == null ? l("endpoint_create_submit") : C.codeDisplayed ? l("endpoint_presence_submit") : l("endpoint_presence_waiting"),
|
|
415
|
+
pendingLabel: l("action_creating"),
|
|
416
|
+
disabled: C != null && !C.codeDisplayed
|
|
417
|
+
})] })
|
|
418
|
+
]
|
|
419
|
+
}) });
|
|
420
|
+
}
|
|
421
|
+
function be({ workspaceId: e, endpointId: t, baseRevision: a, onCancel: o, onDeleted: c }) {
|
|
422
|
+
let l = u(), d = r(e).remove, f = n({
|
|
423
|
+
defaultValues: {},
|
|
424
|
+
validators: s({ submit: async () => (await d.mutateAsync({
|
|
425
|
+
id: t,
|
|
426
|
+
baseRevision: a
|
|
427
|
+
}), null) }),
|
|
428
|
+
onSubmitInvalid: i,
|
|
429
|
+
onSubmit: () => {
|
|
430
|
+
c();
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
return /* @__PURE__ */ q(f.AppForm, { children: /* @__PURE__ */ J(f.FormRoot, {
|
|
434
|
+
layout: "dialog",
|
|
435
|
+
children: [/* @__PURE__ */ J(v, { children: [/* @__PURE__ */ q(h, { children: l("endpoint_delete_confirm_title") }), /* @__PURE__ */ q(y, { children: l("endpoint_delete_confirm_description") })] }), /* @__PURE__ */ J(m, { children: [/* @__PURE__ */ q(S, {
|
|
436
|
+
type: "button",
|
|
437
|
+
variant: "outline",
|
|
438
|
+
onClick: () => {
|
|
439
|
+
o();
|
|
440
|
+
},
|
|
441
|
+
children: l("action_cancel")
|
|
442
|
+
}), /* @__PURE__ */ q(f.SubmitButton, {
|
|
443
|
+
label: l("endpoint_delete_confirm_submit"),
|
|
444
|
+
pendingLabel: l("action_deleting"),
|
|
445
|
+
variant: "destructive"
|
|
446
|
+
})] })]
|
|
447
|
+
}) });
|
|
448
|
+
}
|
|
449
|
+
export { X as i, Q as n, ye as r, $ as t };
|