dsh-vpn 0.1.9 → 0.1.10
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/lib/client.js +5 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1274,6 +1274,7 @@ function VpnSettingsPage({ view, t, api }) {
|
|
|
1274
1274
|
const [form, setForm] = (0, import_react.useState)(null);
|
|
1275
1275
|
const [busy, setBusy] = (0, import_react.useState)(null);
|
|
1276
1276
|
const [notice, setNotice] = (0, import_react.useState)(null);
|
|
1277
|
+
const [noticeFrom, setNoticeFrom] = (0, import_react.useState)(null);
|
|
1277
1278
|
const [links, setLinks] = (0, import_react.useState)(null);
|
|
1278
1279
|
const [refreshedAt, setRefreshedAt] = (0, import_react.useState)(null);
|
|
1279
1280
|
const [regenerate, setRegenerate] = (0, import_react.useState)(false);
|
|
@@ -1303,6 +1304,7 @@ function VpnSettingsPage({ view, t, api }) {
|
|
|
1303
1304
|
async function op(name, call, onOk) {
|
|
1304
1305
|
setBusy(name);
|
|
1305
1306
|
setNotice(null);
|
|
1307
|
+
setNoticeFrom(name);
|
|
1306
1308
|
try {
|
|
1307
1309
|
const r = await call();
|
|
1308
1310
|
setNotice(r.ok ? onOk(r) : { tone: "error", text: errorText(t, r) });
|
|
@@ -1376,6 +1378,7 @@ ${t("cloudHint")}`;
|
|
|
1376
1378
|
return null;
|
|
1377
1379
|
});
|
|
1378
1380
|
const disabled = busy !== null;
|
|
1381
|
+
const noticeBox = (busy !== null || notice) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `dshvpn-notice dshvpn-${busy !== null ? "info" : notice?.tone}`, role: "status", children: busy !== null ? busy === "detect" ? t("detecting") : t("working") : notice?.text });
|
|
1379
1382
|
const needsSave = dirty || !saved.configured;
|
|
1380
1383
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dshvpn", children: [
|
|
1381
1384
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { children: [
|
|
@@ -1432,6 +1435,7 @@ ${t("cloudHint")}`;
|
|
|
1432
1435
|
}, children: busy === "detect" ? t("detecting") : t("detect") }),
|
|
1433
1436
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { className: "dshvpn-muted", children: t("detectHint") })
|
|
1434
1437
|
] }),
|
|
1438
|
+
noticeFrom === "detect" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dshvpn-wide", children: noticeBox }),
|
|
1435
1439
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "dshvpn-wide", children: [
|
|
1436
1440
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("linkAddress") }),
|
|
1437
1441
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Input, { value: form.linkAddress, placeholder: form.host, onChange: (e) => {
|
|
@@ -1599,7 +1603,7 @@ ${fw.backend === "none" ? t("fwNone") : t("fwStatus", { backend: fw.backend, cou
|
|
|
1599
1603
|
}, children: t("uninstall") })
|
|
1600
1604
|
] })
|
|
1601
1605
|
] }),
|
|
1602
|
-
|
|
1606
|
+
noticeFrom !== "detect" && noticeBox,
|
|
1603
1607
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dshvpn-qr-section", children: [
|
|
1604
1608
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dshvpn-row", children: [
|
|
1605
1609
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { children: t("qrSection") }),
|
package/package.json
CHANGED