@webx-ui/module-notifications 0.2.1 → 0.3.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/dist/{ChannelPage-C47YoMPO.js → ChannelPage-DB6cyt1W.js} +148 -144
- package/dist/ChannelPage-DB6cyt1W.js.map +1 -0
- package/dist/MessagePreview.d.ts +3 -1
- package/dist/{NotificationsPage-qWdhMayl.js → NotificationsPage-CtP9bFgU.js} +2 -2
- package/dist/{NotificationsPage-qWdhMayl.js.map → NotificationsPage-CtP9bFgU.js.map} +1 -1
- package/dist/TemplateField.d.ts +9 -0
- package/dist/context.d.ts +10 -0
- package/dist/defaults.d.ts +25 -0
- package/dist/index-Bki9dkMd.js +1414 -0
- package/dist/index-Bki9dkMd.js.map +1 -0
- package/dist/index.js +4 -4
- package/dist/render.d.ts +9 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +10 -5
- package/package.json +4 -4
- package/dist/ChannelPage-C47YoMPO.js.map +0 -1
- package/dist/index-DIeEPPSh.js +0 -1279
- package/dist/index-DIeEPPSh.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { useModal as
|
|
4
|
-
import { useAdmin as
|
|
5
|
-
import { c as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as ne, ref as v, computed as f, openBlock as o, createBlock as m, unref as a, isRef as xe, withCtx as y, createVNode as b, createTextVNode as B, toDisplayString as A, createCommentVNode as _, createElementBlock as O, Fragment as D, renderList as le, onMounted as Se, onBeforeUnmount as We, createSlots as $e, createElementVNode as Ne } from "vue";
|
|
2
|
+
import { useRoute as Ce, useRouter as Te, onBeforeRouteLeave as Ve } from "vue-router";
|
|
3
|
+
import { useModal as Be, WxDialog as Ae, WxText as ae, WxFormItem as Me, WxSelect as je, WxAlert as W, WxSpace as Oe, WxButton as K, useLocales as De, createModal as Ee, confirm as te, WxSkeleton as Le, WxBadge as qe, WxActionBar as Pe, toast as p } from "@webx-ui/core";
|
|
4
|
+
import { useAdmin as ie, useTranslate as se, useErrorText as re, provideHistorySubject as Ke, useBodyKeys as Re, WxScreenHead as Ue, WxScreen as ze, WxSaveState as Je } from "@webx-ui/module-admin";
|
|
5
|
+
import { c as oe, u as ue, p as Fe, f as He, M as Ie, s as Ge, _ as Qe } from "./index-Bki9dkMd.js";
|
|
6
|
+
const Xe = /* @__PURE__ */ ne({
|
|
7
7
|
name: "WxNotificationsTestDialog",
|
|
8
8
|
__name: "TestDialog",
|
|
9
9
|
props: {
|
|
@@ -11,20 +11,20 @@ const Qe = /* @__PURE__ */ le({
|
|
|
11
11
|
values: {},
|
|
12
12
|
recipients: { default: () => [] }
|
|
13
13
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const w =
|
|
16
|
-
|
|
17
|
-
const d = se("webx-notifications"),
|
|
14
|
+
setup(E) {
|
|
15
|
+
const w = E, { open: C, dismiss: h } = Be(), k = oe(ie());
|
|
16
|
+
ue();
|
|
17
|
+
const d = se("webx-notifications"), L = re(), t = v(""), x = v(!1), s = v(null), S = v(null), l = f(() => [
|
|
18
18
|
{ value: "", label: d("panel.test-everybody") },
|
|
19
19
|
...w.recipients
|
|
20
20
|
]);
|
|
21
21
|
async function i() {
|
|
22
22
|
x.value = !0, S.value = null;
|
|
23
23
|
try {
|
|
24
|
-
|
|
24
|
+
s.value = await k.test(w.channel, w.values, t.value === "" ? null : t.value);
|
|
25
25
|
} catch (u) {
|
|
26
26
|
const c = u.body;
|
|
27
|
-
S.value = c?.errors ? Object.values(c.errors).flat().join(" ") :
|
|
27
|
+
S.value = c?.errors ? Object.values(c.errors).flat().join(" ") : L(u);
|
|
28
28
|
} finally {
|
|
29
29
|
x.value = !1;
|
|
30
30
|
}
|
|
@@ -36,31 +36,31 @@ const Qe = /* @__PURE__ */ le({
|
|
|
36
36
|
error: u.error ?? (u.reason ? d(`module.reasons.${u.reason}`) : u.status)
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
return (u, c) => (o(),
|
|
39
|
+
return (u, c) => (o(), m(a(Ae), {
|
|
40
40
|
open: a(C),
|
|
41
|
-
"onUpdate:open": c[2] || (c[2] = (
|
|
41
|
+
"onUpdate:open": c[2] || (c[2] = (g) => xe(C) ? C.value = g : null),
|
|
42
42
|
title: a(d)("panel.test-title"),
|
|
43
43
|
width: 480
|
|
44
44
|
}, {
|
|
45
|
-
footer:
|
|
46
|
-
|
|
47
|
-
default:
|
|
48
|
-
|
|
45
|
+
footer: y(() => [
|
|
46
|
+
b(a(Oe), { size: "sm" }, {
|
|
47
|
+
default: y(() => [
|
|
48
|
+
b(a(K), {
|
|
49
49
|
variant: "outline",
|
|
50
|
-
onClick: c[1] || (c[1] = (
|
|
50
|
+
onClick: c[1] || (c[1] = (g) => a(h)())
|
|
51
51
|
}, {
|
|
52
|
-
default:
|
|
53
|
-
|
|
52
|
+
default: y(() => [
|
|
53
|
+
B(A(a(d)("panel.cancel")), 1)
|
|
54
54
|
]),
|
|
55
55
|
_: 1
|
|
56
56
|
}),
|
|
57
|
-
|
|
57
|
+
b(a(K), {
|
|
58
58
|
type: "primary",
|
|
59
59
|
loading: x.value,
|
|
60
60
|
onClick: i
|
|
61
61
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
|
|
62
|
+
default: y(() => [
|
|
63
|
+
B(A(a(d)("panel.test-send")), 1)
|
|
64
64
|
]),
|
|
65
65
|
_: 1
|
|
66
66
|
}, 8, ["loading"])
|
|
@@ -68,80 +68,80 @@ const Qe = /* @__PURE__ */ le({
|
|
|
68
68
|
_: 1
|
|
69
69
|
})
|
|
70
70
|
]),
|
|
71
|
-
default:
|
|
72
|
-
|
|
71
|
+
default: y(() => [
|
|
72
|
+
b(a(ae), {
|
|
73
73
|
size: "sm",
|
|
74
74
|
tone: "muted"
|
|
75
75
|
}, {
|
|
76
|
-
default:
|
|
77
|
-
|
|
76
|
+
default: y(() => [
|
|
77
|
+
B(A(a(d)("panel.test-help")), 1)
|
|
78
78
|
]),
|
|
79
79
|
_: 1
|
|
80
80
|
}),
|
|
81
|
-
|
|
81
|
+
b(a(Me), {
|
|
82
82
|
label: a(d)("panel.test-to")
|
|
83
83
|
}, {
|
|
84
|
-
default:
|
|
85
|
-
|
|
84
|
+
default: y(() => [
|
|
85
|
+
b(a(je), {
|
|
86
86
|
modelValue: t.value,
|
|
87
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
87
|
+
"onUpdate:modelValue": c[0] || (c[0] = (g) => t.value = g),
|
|
88
88
|
options: l.value,
|
|
89
89
|
disabled: x.value
|
|
90
90
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
91
91
|
]),
|
|
92
92
|
_: 1
|
|
93
93
|
}, 8, ["label"]),
|
|
94
|
-
S.value ? (o(),
|
|
94
|
+
S.value ? (o(), m(a(W), {
|
|
95
95
|
key: 0,
|
|
96
96
|
type: "danger",
|
|
97
97
|
variant: "soft",
|
|
98
98
|
description: S.value
|
|
99
99
|
}, null, 8, ["description"])) : _("", !0),
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
s.value ? (o(), O(D, { key: 1 }, [
|
|
101
|
+
s.value.length === 0 ? (o(), m(a(ae), {
|
|
102
102
|
key: 0,
|
|
103
103
|
size: "sm",
|
|
104
104
|
tone: "muted"
|
|
105
105
|
}, {
|
|
106
|
-
default:
|
|
107
|
-
|
|
106
|
+
default: y(() => [
|
|
107
|
+
B(A(a(d)("panel.test-none")), 1)
|
|
108
108
|
]),
|
|
109
109
|
_: 1
|
|
110
110
|
})) : _("", !0),
|
|
111
|
-
(o(!0),
|
|
111
|
+
(o(!0), O(D, null, le(s.value, (g, $) => (o(), m(a(W), {
|
|
112
112
|
key: $,
|
|
113
|
-
type:
|
|
113
|
+
type: g.status === "sent" ? "success" : "danger",
|
|
114
114
|
variant: "soft",
|
|
115
|
-
description: N(
|
|
115
|
+
description: N(g)
|
|
116
116
|
}, null, 8, ["type", "description"]))), 128))
|
|
117
117
|
], 64)) : _("", !0)
|
|
118
118
|
]),
|
|
119
119
|
_: 1
|
|
120
120
|
}, 8, ["open", "title"]));
|
|
121
121
|
}
|
|
122
|
-
}),
|
|
122
|
+
}), Ye = { class: "wx-notifications-channel__body" }, Ze = /* @__PURE__ */ ne({
|
|
123
123
|
__name: "ChannelPage",
|
|
124
124
|
props: {
|
|
125
125
|
base: { default: "/notifications" }
|
|
126
126
|
},
|
|
127
|
-
setup(
|
|
128
|
-
const w =
|
|
129
|
-
|
|
130
|
-
const t = se("webx-notifications"), x =
|
|
127
|
+
setup(E) {
|
|
128
|
+
const w = E, C = ie(), h = oe(C), k = Ce(), d = Te(), L = De();
|
|
129
|
+
ue();
|
|
130
|
+
const t = se("webx-notifications"), x = re(), s = v(
|
|
131
131
|
typeof k.params.id == "string" && k.params.id !== "" ? Number(k.params.id) : null
|
|
132
|
-
), S = v(null), l = v(null), i = v({}), N = v(""), u = v([]), c = v({}),
|
|
133
|
-
|
|
134
|
-
const T =
|
|
132
|
+
), S = v(null), l = v(null), i = v({}), N = v(""), u = v([]), c = v({}), g = v(!0), $ = v(!1), q = v(!1), P = Fe(S, i, s);
|
|
133
|
+
Ke({ id: f(() => l.value?.id ?? null) });
|
|
134
|
+
const T = f(() => C.can("notifications.manage")), R = f(() => JSON.stringify(i.value)), M = f(() => N.value !== "" && R.value !== N.value), ce = f(() => $.value ? "saving" : M.value || s.value === null ? "unsaved" : "saved"), U = f(() => {
|
|
135
135
|
const e = typeof i.value.name == "string" ? i.value.name.trim() : "";
|
|
136
|
-
return e !== "" ? e :
|
|
137
|
-
}), z =
|
|
136
|
+
return e !== "" ? e : s.value === null ? t("panel.new") : t("panel.untitled");
|
|
137
|
+
}), z = f(
|
|
138
138
|
() => Array.isArray(i.value.forget) ? i.value.forget : []
|
|
139
|
-
), J =
|
|
140
|
-
() => (
|
|
139
|
+
), J = f(
|
|
140
|
+
() => (P.provider.value?.fields ?? []).filter((e) => e.secret).map((e) => ({
|
|
141
141
|
field: e,
|
|
142
142
|
set: l.value?.credentials_set[e.name] === !0 && !z.value.includes(e.name)
|
|
143
143
|
}))
|
|
144
|
-
),
|
|
144
|
+
), de = f(() => [
|
|
145
145
|
{ op: "set", target: "provider", props: { disabled: !0 } },
|
|
146
146
|
...J.value.filter((e) => e.set).map((e) => ({
|
|
147
147
|
op: "set",
|
|
@@ -153,52 +153,56 @@ const Qe = /* @__PURE__ */ le({
|
|
|
153
153
|
function F(e) {
|
|
154
154
|
l.value = e.channel, i.value = e.values, N.value = JSON.stringify(e.values), u.value = e.warnings;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
const n = typeof k.query.provider == "string" ? k.query.provider : "email",
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
function ve(e) {
|
|
157
|
+
const n = typeof k.query.provider == "string" ? k.query.provider : "email", r = typeof k.query.event == "string" && k.query.event !== "" ? k.query.event : null, V = Ge(
|
|
158
|
+
e.events.find((j) => j.key === r),
|
|
159
|
+
n
|
|
160
|
+
), Z = L.list.value[0]?.code ?? "en", ee = {};
|
|
161
|
+
for (const j of e.providers.find((we) => we.key === n)?.fields ?? [])
|
|
162
|
+
ee[j.name] = j.secret ? "" : j.default ?? "";
|
|
160
163
|
return {
|
|
161
164
|
name: "",
|
|
162
165
|
provider: n,
|
|
163
|
-
event:
|
|
166
|
+
event: r,
|
|
164
167
|
enabled: !1,
|
|
165
168
|
recipients: [],
|
|
166
|
-
...
|
|
167
|
-
template: { [
|
|
168
|
-
subject: { [
|
|
169
|
+
...ee,
|
|
170
|
+
template: V ? { ...V.template } : { [Z]: "" },
|
|
171
|
+
subject: V?.subject ? { ...V.subject } : { [Z]: "" }
|
|
169
172
|
};
|
|
170
173
|
}
|
|
174
|
+
He(P, g, () => p.info(t("panel.default-inserted")));
|
|
171
175
|
const H = v([]);
|
|
172
|
-
async function
|
|
173
|
-
|
|
176
|
+
async function pe() {
|
|
177
|
+
g.value = !0;
|
|
174
178
|
try {
|
|
175
179
|
const [e, n] = await Promise.all([
|
|
176
180
|
h.meta(),
|
|
177
|
-
|
|
181
|
+
s.value === null ? Promise.resolve(null) : h.get(s.value)
|
|
178
182
|
]);
|
|
179
183
|
if (S.value = e, n === null) {
|
|
180
|
-
const
|
|
181
|
-
i.value =
|
|
184
|
+
const r = ve(e);
|
|
185
|
+
i.value = r, N.value = JSON.stringify(r);
|
|
182
186
|
} else
|
|
183
187
|
F(n);
|
|
184
188
|
} catch (e) {
|
|
185
|
-
|
|
189
|
+
p.danger(x(e)), d.push(w.base);
|
|
186
190
|
} finally {
|
|
187
|
-
|
|
191
|
+
g.value = !1;
|
|
188
192
|
}
|
|
189
193
|
i.value.provider === "email" && T.value && h.administrators().then((e) => H.value = e).catch(() => {
|
|
190
194
|
});
|
|
191
195
|
}
|
|
192
196
|
function I(e) {
|
|
193
197
|
const n = e.body;
|
|
194
|
-
n?.errors ? (c.value = n.errors,
|
|
198
|
+
n?.errors ? (c.value = n.errors, p.danger(t("panel.save-failed"))) : p.danger(x(e));
|
|
195
199
|
}
|
|
196
200
|
async function G() {
|
|
197
201
|
if (!($.value || !T.value)) {
|
|
198
202
|
$.value = !0, c.value = {};
|
|
199
203
|
try {
|
|
200
|
-
const e =
|
|
201
|
-
F(n), n.warnings.length > 0 ?
|
|
204
|
+
const e = s.value === null, n = e ? await h.create(i.value) : await h.save(s.value, i.value);
|
|
205
|
+
F(n), n.warnings.length > 0 ? p.warning(t("panel.saved-warning", { warning: n.warnings.join(" ") })) : p.success(t("panel.saved")), e && (s.value = n.channel.id, d.replace(`${w.base}/channels/${n.channel.id}`));
|
|
202
206
|
} catch (e) {
|
|
203
207
|
I(e);
|
|
204
208
|
} finally {
|
|
@@ -206,41 +210,41 @@ const Qe = /* @__PURE__ */ le({
|
|
|
206
210
|
}
|
|
207
211
|
}
|
|
208
212
|
}
|
|
209
|
-
async function
|
|
210
|
-
|
|
213
|
+
async function fe() {
|
|
214
|
+
q.value = !0;
|
|
211
215
|
try {
|
|
212
|
-
const e = await h.check(
|
|
213
|
-
e.ok ?
|
|
216
|
+
const e = await h.check(s.value, i.value);
|
|
217
|
+
e.ok ? p.success(e.message || t("panel.check-ok")) : p.warning(e.message);
|
|
214
218
|
} catch (e) {
|
|
215
219
|
I(e);
|
|
216
220
|
} finally {
|
|
217
|
-
|
|
221
|
+
q.value = !1;
|
|
218
222
|
}
|
|
219
223
|
}
|
|
220
|
-
const
|
|
224
|
+
const me = Ee(Xe), ye = f(() => (Array.isArray(i.value.recipients) ? i.value.recipients : []).flatMap((n) => {
|
|
221
225
|
if (n.chat_id)
|
|
222
226
|
return [
|
|
223
227
|
{ value: n.chat_id, label: n.label ? `${n.label} · ${n.chat_id}` : n.chat_id }
|
|
224
228
|
];
|
|
225
229
|
if (n.email) return [{ value: n.email, label: n.email }];
|
|
226
|
-
const
|
|
227
|
-
return
|
|
230
|
+
const r = H.value.find((V) => V.id === n.admin_id);
|
|
231
|
+
return r ? [{ value: r.email, label: `${r.name} · ${r.email}` }] : [];
|
|
228
232
|
}));
|
|
229
|
-
async function
|
|
230
|
-
await
|
|
233
|
+
async function ge() {
|
|
234
|
+
await me({ channel: s.value, values: i.value, recipients: ye.value });
|
|
231
235
|
}
|
|
232
|
-
async function
|
|
233
|
-
if (
|
|
236
|
+
async function be() {
|
|
237
|
+
if (s.value !== null)
|
|
234
238
|
try {
|
|
235
|
-
const e = await h.copy(
|
|
236
|
-
|
|
239
|
+
const e = await h.copy(s.value);
|
|
240
|
+
p.success(t("panel.copied", { name: e.channel.name })), d.push(`${w.base}/channels/${e.channel.id}`);
|
|
237
241
|
} catch (e) {
|
|
238
|
-
|
|
242
|
+
p.danger(x(e));
|
|
239
243
|
}
|
|
240
244
|
}
|
|
241
|
-
async function
|
|
245
|
+
async function he() {
|
|
242
246
|
const e = l.value;
|
|
243
|
-
if (!(!e || !await
|
|
247
|
+
if (!(!e || !await te({
|
|
244
248
|
title: t("panel.delete-title", { title: U.value }),
|
|
245
249
|
message: t("panel.delete-text"),
|
|
246
250
|
confirmText: t("panel.delete"),
|
|
@@ -248,45 +252,45 @@ const Qe = /* @__PURE__ */ le({
|
|
|
248
252
|
tone: "danger"
|
|
249
253
|
})))
|
|
250
254
|
try {
|
|
251
|
-
await h.remove(e.id),
|
|
252
|
-
} catch (
|
|
253
|
-
|
|
255
|
+
await h.remove(e.id), p.success(t("panel.deleted")), N.value = R.value, d.push(w.base);
|
|
256
|
+
} catch (r) {
|
|
257
|
+
p.danger(x(r));
|
|
254
258
|
}
|
|
255
259
|
}
|
|
256
|
-
function
|
|
257
|
-
i.value = { ...i.value, forget: [...z.value, e], [e]: "" },
|
|
260
|
+
function ke(e, n) {
|
|
261
|
+
i.value = { ...i.value, forget: [...z.value, e], [e]: "" }, p.info(t("panel.forgotten", { field: n }));
|
|
258
262
|
}
|
|
259
263
|
function Q(e) {
|
|
260
|
-
|
|
264
|
+
M.value && e.preventDefault();
|
|
261
265
|
}
|
|
262
266
|
function X(e) {
|
|
263
|
-
(e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "s" && (e.preventDefault(), (
|
|
267
|
+
(e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "s" && (e.preventDefault(), (M.value || s.value === null) && G());
|
|
264
268
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}),
|
|
269
|
+
Re(X), Se(() => {
|
|
270
|
+
pe(), window.addEventListener("beforeunload", Q);
|
|
271
|
+
}), We(() => {
|
|
268
272
|
window.removeEventListener("beforeunload", Q);
|
|
269
|
-
}),
|
|
273
|
+
}), Ve(async () => !M.value || !T.value ? !0 : await te({
|
|
270
274
|
title: t("panel.leave-title"),
|
|
271
275
|
message: t("panel.leave-text"),
|
|
272
276
|
confirmText: t("panel.leave"),
|
|
273
277
|
cancelText: t("panel.cancel"),
|
|
274
278
|
tone: "danger"
|
|
275
279
|
}));
|
|
276
|
-
const
|
|
280
|
+
const _e = f(() => {
|
|
277
281
|
if (!T.value) return [];
|
|
278
282
|
const e = [
|
|
279
283
|
{
|
|
280
284
|
key: "check",
|
|
281
285
|
label: t("panel.check"),
|
|
282
286
|
icon: "check-circle",
|
|
283
|
-
loading:
|
|
287
|
+
loading: q.value,
|
|
284
288
|
run: () => {
|
|
285
|
-
|
|
289
|
+
fe();
|
|
286
290
|
}
|
|
287
291
|
},
|
|
288
292
|
{ key: "test", label: t("panel.test"), icon: "send", run: () => {
|
|
289
|
-
|
|
293
|
+
ge();
|
|
290
294
|
} }
|
|
291
295
|
];
|
|
292
296
|
l.value !== null && e.push({
|
|
@@ -295,16 +299,16 @@ const Qe = /* @__PURE__ */ le({
|
|
|
295
299
|
icon: "copy",
|
|
296
300
|
menu: !0,
|
|
297
301
|
run: () => {
|
|
298
|
-
|
|
302
|
+
be();
|
|
299
303
|
}
|
|
300
304
|
});
|
|
301
|
-
for (const n of J.value.filter((
|
|
305
|
+
for (const n of J.value.filter((r) => r.set))
|
|
302
306
|
e.push({
|
|
303
307
|
key: `forget-${n.field.name}`,
|
|
304
308
|
label: t("panel.forget", { field: n.field.label }),
|
|
305
309
|
icon: "unlock",
|
|
306
310
|
menu: !0,
|
|
307
|
-
run: () =>
|
|
311
|
+
run: () => ke(n.field.name, n.field.label)
|
|
308
312
|
});
|
|
309
313
|
return l.value !== null && e.push({
|
|
310
314
|
key: "delete",
|
|
@@ -312,33 +316,33 @@ const Qe = /* @__PURE__ */ le({
|
|
|
312
316
|
icon: "trash",
|
|
313
317
|
danger: !0,
|
|
314
318
|
run: () => {
|
|
315
|
-
|
|
319
|
+
he();
|
|
316
320
|
}
|
|
317
321
|
}), e;
|
|
318
|
-
}), Y =
|
|
319
|
-
return (e, n) => (o(),
|
|
322
|
+
}), Y = f(() => S.value?.environment ?? "production");
|
|
323
|
+
return (e, n) => (o(), O("div", {
|
|
320
324
|
class: "wx-notifications-channel",
|
|
321
325
|
onKeydown: X
|
|
322
326
|
}, [
|
|
323
|
-
|
|
327
|
+
g.value ? (o(), m(a(Le), {
|
|
324
328
|
key: 0,
|
|
325
329
|
class: "wx-notifications-channel__ghost",
|
|
326
330
|
title: "",
|
|
327
331
|
rows: 8
|
|
328
|
-
})) : (o(),
|
|
329
|
-
|
|
332
|
+
})) : (o(), O(D, { key: 1 }, [
|
|
333
|
+
b(a(Ue), {
|
|
330
334
|
back: w.base,
|
|
331
335
|
"back-label": a(t)("panel.channels"),
|
|
332
336
|
title: U.value,
|
|
333
|
-
subtitle: l.value?.provider_label ?? a(
|
|
334
|
-
actions:
|
|
335
|
-
},
|
|
337
|
+
subtitle: l.value?.provider_label ?? a(P).provider.value?.label,
|
|
338
|
+
actions: _e.value
|
|
339
|
+
}, $e({ _: 2 }, [
|
|
336
340
|
l.value && !l.value.enabled ? {
|
|
337
341
|
name: "title-after",
|
|
338
|
-
fn:
|
|
339
|
-
|
|
340
|
-
default:
|
|
341
|
-
|
|
342
|
+
fn: y(() => [
|
|
343
|
+
b(a(qe), { dot: "" }, {
|
|
344
|
+
default: y(() => [
|
|
345
|
+
B(A(a(t)("panel.off")), 1)
|
|
342
346
|
]),
|
|
343
347
|
_: 1
|
|
344
348
|
})
|
|
@@ -346,71 +350,71 @@ const Qe = /* @__PURE__ */ le({
|
|
|
346
350
|
key: "0"
|
|
347
351
|
} : void 0
|
|
348
352
|
]), 1032, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
349
|
-
Y.value !== "production" ? (o(),
|
|
353
|
+
Y.value !== "production" ? (o(), m(a(W), {
|
|
350
354
|
key: 0,
|
|
351
355
|
type: "info",
|
|
352
356
|
variant: "soft",
|
|
353
357
|
description: a(t)("panel.environment", { environment: Y.value })
|
|
354
358
|
}, null, 8, ["description"])) : _("", !0),
|
|
355
|
-
S.value?.mode === "after_response" ? (o(),
|
|
359
|
+
S.value?.mode === "after_response" ? (o(), m(a(W), {
|
|
356
360
|
key: 1,
|
|
357
361
|
type: "warning",
|
|
358
362
|
variant: "soft",
|
|
359
363
|
description: a(t)("panel.mode-after-response")
|
|
360
364
|
}, null, 8, ["description"])) : _("", !0),
|
|
361
|
-
l.value && !l.value.provider_declared ? (o(),
|
|
365
|
+
l.value && !l.value.provider_declared ? (o(), m(a(W), {
|
|
362
366
|
key: 2,
|
|
363
367
|
type: "danger",
|
|
364
368
|
title: a(t)("panel.provider-undeclared"),
|
|
365
369
|
description: a(t)("panel.provider-undeclared-text", { provider: l.value.provider })
|
|
366
370
|
}, null, 8, ["title", "description"])) : _("", !0),
|
|
367
|
-
l.value && !l.value.event_declared ? (o(),
|
|
371
|
+
l.value && !l.value.event_declared ? (o(), m(a(W), {
|
|
368
372
|
key: 3,
|
|
369
373
|
type: "warning",
|
|
370
374
|
title: a(t)("panel.event-undeclared"),
|
|
371
375
|
description: a(t)("panel.event-undeclared-text", { event: l.value.event ?? "" })
|
|
372
376
|
}, null, 8, ["title", "description"])) : _("", !0),
|
|
373
|
-
l.value && !l.value.credentials_readable ? (o(),
|
|
377
|
+
l.value && !l.value.credentials_readable ? (o(), m(a(W), {
|
|
374
378
|
key: 4,
|
|
375
379
|
type: "danger",
|
|
376
380
|
description: a(t)("panel.unreadable")
|
|
377
381
|
}, null, 8, ["description"])) : _("", !0),
|
|
378
|
-
l.value?.copied_from ? (o(),
|
|
382
|
+
l.value?.copied_from ? (o(), m(a(W), {
|
|
379
383
|
key: 5,
|
|
380
384
|
type: "info",
|
|
381
385
|
variant: "soft",
|
|
382
386
|
description: a(t)("panel.copied-from", { id: String(l.value.copied_from) })
|
|
383
387
|
}, null, 8, ["description"])) : _("", !0),
|
|
384
|
-
(o(!0),
|
|
385
|
-
key:
|
|
388
|
+
(o(!0), O(D, null, le(u.value, (r) => (o(), m(a(W), {
|
|
389
|
+
key: r,
|
|
386
390
|
type: "warning",
|
|
387
|
-
description:
|
|
391
|
+
description: r
|
|
388
392
|
}, null, 8, ["description"]))), 128)),
|
|
389
|
-
|
|
390
|
-
|
|
393
|
+
Ne("div", Ye, [
|
|
394
|
+
b(a(ze), {
|
|
391
395
|
modelValue: i.value,
|
|
392
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
396
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => i.value = r),
|
|
393
397
|
class: "wx-notifications-channel__form",
|
|
394
398
|
name: "notifications.channel",
|
|
395
399
|
errors: c.value,
|
|
396
|
-
patch:
|
|
400
|
+
patch: de.value,
|
|
397
401
|
disabled: !T.value || $.value
|
|
398
402
|
}, null, 8, ["modelValue", "errors", "patch", "disabled"]),
|
|
399
|
-
|
|
403
|
+
b(Ie, { class: "wx-notifications-channel__preview" })
|
|
400
404
|
]),
|
|
401
|
-
T.value ? (o(),
|
|
402
|
-
state:
|
|
403
|
-
|
|
405
|
+
T.value ? (o(), m(a(Pe), { key: 6 }, {
|
|
406
|
+
state: y(() => [
|
|
407
|
+
b(a(Je), { state: ce.value }, null, 8, ["state"])
|
|
404
408
|
]),
|
|
405
|
-
default:
|
|
406
|
-
|
|
409
|
+
default: y(() => [
|
|
410
|
+
b(a(K), {
|
|
407
411
|
type: "primary",
|
|
408
412
|
loading: $.value,
|
|
409
|
-
disabled: !
|
|
413
|
+
disabled: !M.value && s.value !== null,
|
|
410
414
|
onClick: G
|
|
411
415
|
}, {
|
|
412
|
-
default:
|
|
413
|
-
|
|
416
|
+
default: y(() => [
|
|
417
|
+
B(A(a(t)("panel.save")), 1)
|
|
414
418
|
]),
|
|
415
419
|
_: 1
|
|
416
420
|
}, 8, ["loading", "disabled"])
|
|
@@ -420,8 +424,8 @@ const Qe = /* @__PURE__ */ le({
|
|
|
420
424
|
], 64))
|
|
421
425
|
], 32));
|
|
422
426
|
}
|
|
423
|
-
}),
|
|
427
|
+
}), ia = /* @__PURE__ */ Qe(Ze, [["__scopeId", "data-v-d3c11d46"]]);
|
|
424
428
|
export {
|
|
425
|
-
|
|
429
|
+
ia as default
|
|
426
430
|
};
|
|
427
|
-
//# sourceMappingURL=ChannelPage-
|
|
431
|
+
//# sourceMappingURL=ChannelPage-DB6cyt1W.js.map
|