@webx-ui/module-audit 0.5.1 → 0.5.2

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.
Files changed (21) hide show
  1. package/dist/{AuditHostsPage-YFRORYHZ.js → AuditHostsPage-CSAlf3jK.js} +3 -3
  2. package/dist/{AuditHostsPage-YFRORYHZ.js.map → AuditHostsPage-CSAlf3jK.js.map} +1 -1
  3. package/dist/AuditIssuesPage-DtEJ9Sgq.js +718 -0
  4. package/dist/AuditIssuesPage-DtEJ9Sgq.js.map +1 -0
  5. package/dist/{AuditLayout.vue_vue_type_script_setup_true_lang-C8H5jlTe.js → AuditLayout.vue_vue_type_script_setup_true_lang-C39k6JNr.js} +2 -2
  6. package/dist/{AuditLayout.vue_vue_type_script_setup_true_lang-C8H5jlTe.js.map → AuditLayout.vue_vue_type_script_setup_true_lang-C39k6JNr.js.map} +1 -1
  7. package/dist/{AuditOverviewPage-gVpdBOAY.js → AuditOverviewPage-B5mexNDW.js} +3 -3
  8. package/dist/{AuditOverviewPage-gVpdBOAY.js.map → AuditOverviewPage-B5mexNDW.js.map} +1 -1
  9. package/dist/{AuditPagesPage-DNgZo-K-.js → AuditPagesPage-C1Akv4Ql.js} +3 -3
  10. package/dist/{AuditPagesPage-DNgZo-K-.js.map → AuditPagesPage-C1Akv4Ql.js.map} +1 -1
  11. package/dist/{AuditRunsPage-BbWsuATw.js → AuditRunsPage-SlBisvcG.js} +3 -3
  12. package/dist/{AuditRunsPage-BbWsuATw.js.map → AuditRunsPage-SlBisvcG.js.map} +1 -1
  13. package/dist/{AuditSettingsPage-HwfdLU_s.js → AuditSettingsPage-ADutjdIO.js} +3 -3
  14. package/dist/{AuditSettingsPage-HwfdLU_s.js.map → AuditSettingsPage-ADutjdIO.js.map} +1 -1
  15. package/dist/{index-BFYHJYU_.js → index-_DgRf2O6.js} +8 -8
  16. package/dist/{index-BFYHJYU_.js.map → index-_DgRf2O6.js.map} +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/style.css +1 -1
  19. package/package.json +4 -4
  20. package/dist/AuditIssuesPage-BjTPgAnD.js +0 -693
  21. package/dist/AuditIssuesPage-BjTPgAnD.js.map +0 -1
@@ -0,0 +1,718 @@
1
+ import { defineComponent as K, useModel as ve, ref as w, watch as oe, openBlock as t, createBlock as u, unref as e, withCtx as n, createElementVNode as y, createTextVNode as f, toDisplayString as o, createCommentVNode as x, createElementBlock as C, Fragment as M, renderList as N, createVNode as k, mergeModels as se, computed as q, onMounted as de, normalizeClass as ge, withModifiers as _e } from "vue";
2
+ import { useAdmin as te, useTranslate as R, useErrorText as le } from "@webx-ui/module-admin";
3
+ import { WxDialog as xe, WxText as L, WxSkeleton as ee, WxButton as T, toast as j, WxIcon as me, WxBadge as O, WxSegmented as ye, WxTooltip as ke, WxTable as we, WxPopover as he, WxDescriptions as be, WxDescriptionsItem as Y, WxSelect as Z } from "@webx-ui/core";
4
+ import { c as ae, u as Q, _ as X, A as J, d as $e, a as ie, b as ze, e as Ce, f as Ae } from "./index-_DgRf2O6.js";
5
+ import { useRouter as We } from "vue-router";
6
+ import { _ as Ie } from "./AuditLayout.vue_vue_type_script_setup_true_lang-C39k6JNr.js";
7
+ const De = { class: "wx-audit-fix" }, Ve = { class: "wx-audit-fix__changes" }, Be = {
8
+ key: 0,
9
+ class: "wx-audit-fix__field"
10
+ }, Se = { class: "wx-audit-fix__value" }, Ue = {
11
+ key: 0,
12
+ class: "wx-audit-fix__count"
13
+ }, qe = { class: "wx-audit-fix__value" }, Le = { class: "wx-audit-fix__actions" }, Me = /* @__PURE__ */ K({
14
+ __name: "AuditFixDialog",
15
+ props: /* @__PURE__ */ se({
16
+ run: {},
17
+ issue: {}
18
+ }, {
19
+ open: { type: Boolean, default: !1 },
20
+ openModifiers: {}
21
+ }),
22
+ emits: /* @__PURE__ */ se(["fixed"], ["update:open"]),
23
+ setup(V, { emit: E }) {
24
+ const h = V, d = E, I = ve(V, "open"), B = ae(te());
25
+ Q();
26
+ const r = R("webx-audit"), $ = le(), S = We(), l = w(null), _ = w(null), a = w(null);
27
+ async function v() {
28
+ l.value = null, _.value = null;
29
+ try {
30
+ l.value = await B.fixes(h.run, h.issue.id);
31
+ } catch (c) {
32
+ _.value = $(c);
33
+ }
34
+ }
35
+ async function W(c) {
36
+ a.value = c.id;
37
+ try {
38
+ await B.fix(h.run, h.issue.id, c.id), j.success(r("page.fix-applied")), d("fixed", c.id), I.value = !1;
39
+ } catch (z) {
40
+ j.danger($(z));
41
+ } finally {
42
+ a.value = null;
43
+ }
44
+ }
45
+ function U(c) {
46
+ I.value = !1, S.push(c);
47
+ }
48
+ return oe(
49
+ [I, () => h.issue.id],
50
+ ([c]) => {
51
+ c && v();
52
+ },
53
+ { immediate: !0 }
54
+ ), (c, z) => (t(), u(e(xe), {
55
+ open: I.value,
56
+ "onUpdate:open": z[0] || (z[0] = (m) => I.value = m),
57
+ title: e(r)("page.fix-button"),
58
+ width: 640
59
+ }, {
60
+ default: n(() => [
61
+ y("div", De, [
62
+ _.value ? (t(), u(e(L), {
63
+ key: 0,
64
+ size: "sm",
65
+ tone: "danger"
66
+ }, {
67
+ default: n(() => [
68
+ f(o(_.value), 1)
69
+ ]),
70
+ _: 1
71
+ })) : l.value ? l.value.length === 0 ? (t(), u(e(L), {
72
+ key: 2,
73
+ size: "sm",
74
+ tone: "muted"
75
+ }, {
76
+ default: n(() => [
77
+ f(o(e(r)("page.fix-none")), 1)
78
+ ]),
79
+ _: 1
80
+ })) : x("", !0) : (t(), u(e(ee), {
81
+ key: 1,
82
+ rows: 3
83
+ })),
84
+ (t(!0), C(M, null, N(l.value ?? [], (m) => (t(), C("section", {
85
+ key: m.id,
86
+ class: "wx-audit-fix__offer"
87
+ }, [
88
+ k(e(L), { weight: "semibold" }, {
89
+ default: n(() => [
90
+ f(o(m.title), 1)
91
+ ]),
92
+ _: 2
93
+ }, 1024),
94
+ m.description ? (t(), u(e(L), {
95
+ key: 0,
96
+ size: "sm",
97
+ tone: "muted"
98
+ }, {
99
+ default: n(() => [
100
+ f(o(m.description), 1)
101
+ ]),
102
+ _: 2
103
+ }, 1024)) : x("", !0),
104
+ y("table", Ve, [
105
+ y("thead", null, [
106
+ y("tr", null, [
107
+ y("th", null, o(e(r)("page.fix-changes")), 1),
108
+ y("th", null, o(e(r)("page.fix-before")), 1),
109
+ y("th", null, o(e(r)("page.fix-after")), 1),
110
+ z[1] || (z[1] = y("th", null, null, -1))
111
+ ])
112
+ ]),
113
+ y("tbody", null, [
114
+ (t(!0), C(M, null, N(m.changes, (b, P) => (t(), C("tr", { key: P }, [
115
+ y("td", null, [
116
+ y("div", null, o(b.label), 1),
117
+ b.field ? (t(), C("div", Be, o(b.field), 1)) : x("", !0)
118
+ ]),
119
+ y("td", Se, [
120
+ f(o(b.before ?? "") + " ", 1),
121
+ b.count ? (t(), C("span", Ue, "× " + o(b.count), 1)) : x("", !0)
122
+ ]),
123
+ y("td", qe, o(b.after ?? ""), 1),
124
+ y("td", null, [
125
+ b.edit_url ? (t(), u(e(T), {
126
+ key: 0,
127
+ size: "sm",
128
+ variant: "text",
129
+ icon: "edit",
130
+ "aria-label": e(r)("page.open-editor"),
131
+ onClick: (F) => U(b.edit_url)
132
+ }, null, 8, ["aria-label", "onClick"])) : x("", !0)
133
+ ])
134
+ ]))), 128))
135
+ ])
136
+ ]),
137
+ m.note ? (t(), u(e(L), {
138
+ key: 1,
139
+ size: "sm",
140
+ tone: "muted"
141
+ }, {
142
+ default: n(() => [
143
+ f(o(m.note), 1)
144
+ ]),
145
+ _: 2
146
+ }, 1024)) : x("", !0),
147
+ y("div", Le, [
148
+ k(e(T), {
149
+ type: "primary",
150
+ size: "sm",
151
+ loading: a.value === m.id,
152
+ disabled: a.value !== null,
153
+ onClick: (b) => W(m)
154
+ }, {
155
+ default: n(() => [
156
+ f(o(e(r)("page.fix-apply")), 1)
157
+ ]),
158
+ _: 1
159
+ }, 8, ["loading", "disabled", "onClick"])
160
+ ])
161
+ ]))), 128))
162
+ ])
163
+ ]),
164
+ _: 1
165
+ }, 8, ["open", "title"]));
166
+ }
167
+ }), Te = /* @__PURE__ */ X(Me, [["__scopeId", "data-v-28525af3"]]), Ee = { class: "wx-audit-links" }, Fe = { class: "wx-audit-links__head" }, Ne = { class: "wx-audit-links__pages" }, ue = 5, Oe = /* @__PURE__ */ K({
168
+ __name: "AuditLinkGroups",
169
+ props: {
170
+ issues: {}
171
+ },
172
+ setup(V) {
173
+ const E = V;
174
+ Q();
175
+ const h = R("webx-audit"), d = w(/* @__PURE__ */ new Set()), I = q(() => {
176
+ const l = /* @__PURE__ */ new Map();
177
+ for (const _ of E.issues)
178
+ for (const a of _.details.table?.rows ?? []) {
179
+ const v = String(a.url ?? ""), W = String(a.location ?? ""), U = `${v}
180
+ ${W}`, c = l.get(U) ?? { url: v, location: W, status: null, pages: [], mixed: !1 }, z = { page: _.url ?? "", rel: B(a.rel), target: B(a.target) }, m = c.pages[0];
181
+ c.status ??= typeof a.status == "number" ? a.status : null, m && (m.rel !== z.rel || m.target !== z.target) && (c.mixed = !0), z.page && !c.pages.some((b) => b.page === z.page) && c.pages.push(z), l.set(U, c);
182
+ }
183
+ return [...l.values()].sort((_, a) => a.pages.length - _.pages.length);
184
+ });
185
+ function B(l) {
186
+ return typeof l == "string" && l !== "" ? l : null;
187
+ }
188
+ function r(l) {
189
+ return `${l.url}
190
+ ${l.location}`;
191
+ }
192
+ function $(l) {
193
+ return d.value.has(r(l)) ? l.pages : l.pages.slice(0, ue);
194
+ }
195
+ function S(l) {
196
+ const _ = new Set(d.value);
197
+ _.delete(r(l)) || _.add(r(l)), d.value = _;
198
+ }
199
+ return (l, _) => (t(), C("div", Ee, [
200
+ (t(!0), C(M, null, N(I.value, (a) => (t(), C("div", {
201
+ key: r(a),
202
+ class: "wx-audit-links__card"
203
+ }, [
204
+ y("div", Fe, [
205
+ k(J, {
206
+ href: a.url,
207
+ type: "muted",
208
+ class: "wx-audit-links__from"
209
+ }, null, 8, ["href"]),
210
+ k(e(me), {
211
+ name: "arrow-right",
212
+ size: "1em",
213
+ class: "wx-audit-links__arrow",
214
+ label: e(h)("page.leads-to")
215
+ }, null, 8, ["label"]),
216
+ k(J, {
217
+ href: a.location,
218
+ strong: "",
219
+ class: "wx-audit-links__to"
220
+ }, null, 8, ["href"]),
221
+ (t(!0), C(M, null, N(e($e)(a.url, a.location), (v) => (t(), u(e(O), {
222
+ key: v,
223
+ type: "default",
224
+ size: "sm"
225
+ }, {
226
+ default: n(() => [
227
+ f(o(e(h)(`page.change-${v}`)), 1)
228
+ ]),
229
+ _: 2
230
+ }, 1024))), 128)),
231
+ !a.mixed && a.pages[0] ? (t(), u(ie, {
232
+ key: 0,
233
+ rel: a.pages[0].rel,
234
+ target: a.pages[0].target,
235
+ class: "wx-audit-links__fixed"
236
+ }, null, 8, ["rel", "target"])) : x("", !0),
237
+ a.status !== null ? (t(), u(ze, {
238
+ key: 1,
239
+ code: a.status
240
+ }, null, 8, ["code"])) : x("", !0),
241
+ k(e(L), {
242
+ size: "sm",
243
+ tone: "muted",
244
+ class: "wx-audit-links__count"
245
+ }, {
246
+ default: n(() => [
247
+ f(o(e(h)("page.link-pages", { count: a.pages.length })), 1)
248
+ ]),
249
+ _: 2
250
+ }, 1024)
251
+ ]),
252
+ y("ul", Ne, [
253
+ (t(!0), C(M, null, N($(a), (v) => (t(), C("li", {
254
+ key: v.page
255
+ }, [
256
+ k(J, {
257
+ href: v.page
258
+ }, null, 8, ["href"]),
259
+ a.mixed ? (t(), u(ie, {
260
+ key: 0,
261
+ rel: v.rel,
262
+ target: v.target,
263
+ class: "wx-audit-links__fixed"
264
+ }, null, 8, ["rel", "target"])) : x("", !0)
265
+ ]))), 128))
266
+ ]),
267
+ a.pages.length > ue ? (t(), u(e(T), {
268
+ key: 0,
269
+ size: "sm",
270
+ variant: "text",
271
+ class: "wx-audit-links__more",
272
+ onClick: (v) => S(a)
273
+ }, {
274
+ default: n(() => [
275
+ f(o(d.value.has(r(a)) ? e(h)("page.link-collapse") : e(h)("page.link-show-all")), 1)
276
+ ]),
277
+ _: 2
278
+ }, 1032, ["onClick"])) : x("", !0)
279
+ ]))), 128))
280
+ ]));
281
+ }
282
+ }), Pe = /* @__PURE__ */ X(Oe, [["__scopeId", "data-v-e8cc2899"]]), Ge = { class: "wx-audit-issues" }, He = { class: "wx-audit-issues__head" }, Re = { class: "wx-audit-issues__body" }, je = /* @__PURE__ */ K({
283
+ __name: "AuditIssueList",
284
+ props: {
285
+ run: {},
286
+ query: {},
287
+ fixable: { type: Boolean },
288
+ title: {}
289
+ },
290
+ emits: ["changed"],
291
+ setup(V, { emit: E }) {
292
+ const h = V, d = E, I = te(), B = ae(I), r = I.can("audit.manage");
293
+ Q();
294
+ const $ = R("webx-audit"), S = le(), l = w(null), _ = w(!1), a = w(1), v = w(null), W = w(null), U = w(!1), c = w(null), z = w(!1), m = w("pages"), b = w(null), P = q(
295
+ () => (l.value?.[0]?.details.table?.columns ?? []).some((p) => p.key === "location")
296
+ ), F = q(() => [
297
+ { value: "pages", label: $("page.view-pages") },
298
+ { value: "links", label: $("page.view-links") }
299
+ ]);
300
+ async function G() {
301
+ if (!b.value)
302
+ try {
303
+ const p = [];
304
+ let i = 1, s = 1;
305
+ do {
306
+ const H = await B.issues(h.run, { ...h.query, page: i, per_page: 200 });
307
+ p.push(...H.data), s = H.last_page, i++;
308
+ } while (i <= s);
309
+ b.value = p;
310
+ } catch (p) {
311
+ v.value = S(p);
312
+ }
313
+ }
314
+ function A(p) {
315
+ m.value = p, p === "links" && G();
316
+ }
317
+ function D(p) {
318
+ c.value = p, z.value = !0;
319
+ }
320
+ function g(p) {
321
+ l.value && !p.pattern ? l.value = [] : l.value && c.value && (l.value = l.value.filter((i) => i.id !== c.value?.id)), d("changed");
322
+ }
323
+ async function re(p) {
324
+ if (p.ignore)
325
+ try {
326
+ await B.unhide(p.ignore.id), j.success($("page.unhidden")), d("changed");
327
+ } catch (i) {
328
+ j.danger(S(i));
329
+ }
330
+ }
331
+ function ce(p) {
332
+ const i = p.ignore;
333
+ return i ? i.created_by ? $("page.hidden-by", { who: i.created_by, reason: i.reason }) : $("page.hidden-reason", { reason: i.reason }) : "";
334
+ }
335
+ function pe(p) {
336
+ W.value = p, U.value = !0;
337
+ }
338
+ function fe(p) {
339
+ W.value && (W.value.fixed_with = p);
340
+ }
341
+ async function ne(p = 1) {
342
+ try {
343
+ const i = await B.issues(h.run, { ...h.query, page: p, per_page: 50 });
344
+ l.value = p === 1 ? i.data : [...l.value ?? [], ...i.data], a.value = i.current_page, _.value = i.current_page < i.last_page;
345
+ } catch (i) {
346
+ v.value = S(i);
347
+ }
348
+ }
349
+ return de(() => ne()), (p, i) => (t(), C("div", Ge, [
350
+ v.value ? (t(), u(e(L), {
351
+ key: 0,
352
+ size: "sm",
353
+ tone: "danger"
354
+ }, {
355
+ default: n(() => [
356
+ f(o(v.value), 1)
357
+ ]),
358
+ _: 1
359
+ })) : l.value ? (t(), C(M, { key: 2 }, [
360
+ P.value ? (t(), u(e(ye), {
361
+ key: 0,
362
+ "model-value": m.value,
363
+ options: F.value,
364
+ size: "sm",
365
+ class: "wx-audit-issues__view",
366
+ "onUpdate:modelValue": i[0] || (i[0] = (s) => A(s))
367
+ }, null, 8, ["model-value", "options"])) : x("", !0),
368
+ m.value === "links" ? (t(), C(M, { key: 1 }, [
369
+ b.value ? (t(), u(Pe, {
370
+ key: 0,
371
+ issues: b.value
372
+ }, null, 8, ["issues"])) : (t(), u(e(ee), {
373
+ key: 1,
374
+ rows: 2
375
+ }))
376
+ ], 64)) : (t(), C(M, { key: 2 }, [
377
+ (t(!0), C(M, null, N(l.value, (s) => (t(), C("div", {
378
+ key: s.id,
379
+ class: "wx-audit-issues__item"
380
+ }, [
381
+ y("div", He, [
382
+ s.url ? (t(), u(J, {
383
+ key: 0,
384
+ href: s.url,
385
+ strong: "",
386
+ class: "wx-audit-issues__url"
387
+ }, null, 8, ["href"])) : x("", !0),
388
+ s.state === "new" ? (t(), u(e(O), {
389
+ key: 1,
390
+ type: "primary",
391
+ size: "sm"
392
+ }, {
393
+ default: n(() => [
394
+ f(o(e($)("page.state-new")), 1)
395
+ ]),
396
+ _: 1
397
+ })) : x("", !0),
398
+ s.details.count != null && s.details.table ? (t(), u(e(ke), {
399
+ key: 2,
400
+ content: s.details.summary ?? void 0,
401
+ disabled: !s.details.summary
402
+ }, {
403
+ default: n(() => [
404
+ k(e(O), {
405
+ round: "",
406
+ size: "sm",
407
+ class: "wx-audit-issues__count"
408
+ }, {
409
+ default: n(() => [
410
+ f(o(s.details.count), 1)
411
+ ]),
412
+ _: 2
413
+ }, 1024)
414
+ ]),
415
+ _: 2
416
+ }, 1032, ["content", "disabled"])) : x("", !0),
417
+ s.fixed_with ? (t(), u(e(O), {
418
+ key: 3,
419
+ type: "success",
420
+ size: "sm"
421
+ }, {
422
+ default: n(() => [
423
+ f(o(e($)("page.fix-pressed")), 1)
424
+ ]),
425
+ _: 1
426
+ })) : V.fixable && e(r) && !s.ignored ? (t(), u(e(T), {
427
+ key: 4,
428
+ size: "sm",
429
+ variant: "outline",
430
+ icon: "check",
431
+ class: "wx-audit-issues__fix",
432
+ onClick: (H) => pe(s)
433
+ }, {
434
+ default: n(() => [
435
+ f(o(e($)("page.fix-button")), 1)
436
+ ]),
437
+ _: 1
438
+ }, 8, ["onClick"])) : x("", !0),
439
+ e(r) && s.ignored && s.ignore ? (t(), u(e(T), {
440
+ key: 5,
441
+ size: "sm",
442
+ variant: "text",
443
+ icon: "eye",
444
+ class: "wx-audit-issues__end",
445
+ onClick: (H) => re(s)
446
+ }, {
447
+ default: n(() => [
448
+ f(o(e($)("page.unhide")), 1)
449
+ ]),
450
+ _: 1
451
+ }, 8, ["onClick"])) : e(r) && !s.ignored ? (t(), u(e(T), {
452
+ key: 6,
453
+ size: "sm",
454
+ variant: "text",
455
+ icon: "eye-off",
456
+ class: ge({ "wx-audit-issues__end": !V.fixable || s.fixed_with }),
457
+ onClick: (H) => D(s)
458
+ }, {
459
+ default: n(() => [
460
+ f(o(e($)("page.hide")), 1)
461
+ ]),
462
+ _: 1
463
+ }, 8, ["class", "onClick"])) : x("", !0)
464
+ ]),
465
+ y("div", Re, [
466
+ s.ignore ? (t(), u(e(L), {
467
+ key: 0,
468
+ size: "sm",
469
+ tone: "muted"
470
+ }, {
471
+ default: n(() => [
472
+ f(o(ce(s)), 1)
473
+ ]),
474
+ _: 2
475
+ }, 1024)) : x("", !0),
476
+ k(Ce, {
477
+ details: s.details,
478
+ counted: s.details.count != null && !!s.details.table
479
+ }, null, 8, ["details", "counted"])
480
+ ])
481
+ ]))), 128)),
482
+ _.value ? (t(), u(e(T), {
483
+ key: 0,
484
+ size: "sm",
485
+ variant: "text",
486
+ onClick: i[1] || (i[1] = (s) => ne(a.value + 1))
487
+ }, {
488
+ default: n(() => [...i[4] || (i[4] = [
489
+ f("…", -1)
490
+ ])]),
491
+ _: 1
492
+ })) : x("", !0)
493
+ ], 64))
494
+ ], 64)) : (t(), u(e(ee), {
495
+ key: 1,
496
+ rows: 2
497
+ })),
498
+ W.value ? (t(), u(Te, {
499
+ key: 3,
500
+ open: U.value,
501
+ "onUpdate:open": i[2] || (i[2] = (s) => U.value = s),
502
+ run: V.run,
503
+ issue: W.value,
504
+ onFixed: fe
505
+ }, null, 8, ["open", "run", "issue"])) : x("", !0),
506
+ c.value ? (t(), u(Ae, {
507
+ key: 4,
508
+ open: z.value,
509
+ "onUpdate:open": i[3] || (i[3] = (s) => z.value = s),
510
+ issue: c.value,
511
+ title: h.title ?? c.value.check,
512
+ onHidden: g
513
+ }, null, 8, ["open", "issue", "title"])) : x("", !0)
514
+ ]));
515
+ }
516
+ }), Je = /* @__PURE__ */ X(je, [["__scopeId", "data-v-ebf11b20"]]), Ke = { class: "wx-audit-findings__filters" }, Qe = { class: "wx-audit-findings__title" }, Xe = /* @__PURE__ */ K({
517
+ __name: "AuditIssuesPage",
518
+ props: {
519
+ base: {}
520
+ },
521
+ setup(V) {
522
+ const E = V, h = ae(te());
523
+ Q();
524
+ const d = R("webx-audit"), I = R("webx-admin"), B = le(), r = w(null), $ = w(null), S = w(!1), l = w([]), _ = w(null), a = w(null), v = w(null), W = q(() => ({ severity: _.value, group: a.value, state: v.value })), U = q(
525
+ () => [_.value, a.value, v.value].filter(Boolean).length
526
+ ), c = {
527
+ error: "danger",
528
+ warning: "warning",
529
+ notice: "info"
530
+ }, z = q(() => [
531
+ { key: "severity", label: d("page.severity"), width: 130 },
532
+ { key: "title", label: d("page.check") },
533
+ { key: "count", label: d("page.count"), width: 110, align: "right" }
534
+ ]), m = q(
535
+ () => ["error", "warning", "notice"].map((A) => ({
536
+ value: A,
537
+ label: d(`page.severity-${A}`)
538
+ }))
539
+ ), b = q(
540
+ () => [
541
+ "config",
542
+ "host",
543
+ "hosts",
544
+ "indexing",
545
+ "page",
546
+ "content",
547
+ "links",
548
+ "images",
549
+ "a11y",
550
+ "structure"
551
+ ].map((A) => ({ value: A, label: d(`page.group-${A}`) }))
552
+ ), P = q(
553
+ () => ["new", "persisting", "hidden"].map((A) => ({
554
+ value: A,
555
+ label: d(`page.state-${A}`)
556
+ }))
557
+ );
558
+ function F(A) {
559
+ return typeof A == "string" && A !== "" ? A : null;
560
+ }
561
+ async function G() {
562
+ S.value = !0;
563
+ try {
564
+ r.value === null && (r.value = (await h.latest()).done?.id ?? null), $.value = r.value === null ? [] : await h.checks(r.value, W.value), l.value = [];
565
+ } catch (A) {
566
+ j.danger(B(A));
567
+ } finally {
568
+ S.value = !1;
569
+ }
570
+ }
571
+ return oe(W, () => {
572
+ G();
573
+ }), de(G), (A, D) => (t(), u(Ie, {
574
+ base: E.base,
575
+ current: "issues"
576
+ }, {
577
+ default: n(() => [
578
+ k(e(we), {
579
+ expanded: l.value,
580
+ "onUpdate:expanded": D[4] || (D[4] = (g) => l.value = g),
581
+ data: $.value ?? [],
582
+ columns: z.value,
583
+ "row-key": "id",
584
+ expandable: "",
585
+ flush: "",
586
+ loading: S.value,
587
+ "filters-count": U.value,
588
+ "filters-label": e(I)("filters.title"),
589
+ "empty-text": r.value === null ? e(d)("page.never") : e(d)("page.empty")
590
+ }, {
591
+ filters: n(() => [
592
+ y("div", Ke, [
593
+ k(e(Z), {
594
+ "model-value": _.value,
595
+ options: m.value,
596
+ placeholder: e(d)("page.any-severity"),
597
+ clearable: "",
598
+ "onUpdate:modelValue": D[0] || (D[0] = (g) => _.value = F(g))
599
+ }, null, 8, ["model-value", "options", "placeholder"]),
600
+ k(e(Z), {
601
+ "model-value": a.value,
602
+ options: b.value,
603
+ placeholder: e(d)("page.any-group"),
604
+ clearable: "",
605
+ "onUpdate:modelValue": D[1] || (D[1] = (g) => a.value = F(g))
606
+ }, null, 8, ["model-value", "options", "placeholder"]),
607
+ k(e(Z), {
608
+ "model-value": v.value,
609
+ options: P.value,
610
+ placeholder: e(d)("page.any-state"),
611
+ clearable: "",
612
+ "onUpdate:modelValue": D[2] || (D[2] = (g) => v.value = F(g))
613
+ }, null, 8, ["model-value", "options", "placeholder"])
614
+ ])
615
+ ]),
616
+ "cell-severity": n(({ row: g }) => [
617
+ k(e(O), {
618
+ type: c[g.severity],
619
+ dot: ""
620
+ }, {
621
+ default: n(() => [
622
+ f(o(e(d)(`page.severity-${g.severity}`)), 1)
623
+ ]),
624
+ _: 2
625
+ }, 1032, ["type"])
626
+ ]),
627
+ "cell-title": n(({ row: g }) => [
628
+ y("span", Qe, [
629
+ k(e(L), { size: "sm" }, {
630
+ default: n(() => [
631
+ f(o(g.title), 1)
632
+ ]),
633
+ _: 2
634
+ }, 1024),
635
+ g.new > 0 ? (t(), u(e(O), {
636
+ key: 0,
637
+ type: "primary",
638
+ size: "sm"
639
+ }, {
640
+ default: n(() => [
641
+ f(o(e(d)("page.state-new")), 1)
642
+ ]),
643
+ _: 1
644
+ })) : x("", !0),
645
+ k(e(he), {
646
+ title: g.title,
647
+ width: "360"
648
+ }, {
649
+ trigger: n(() => [
650
+ k(e(T), {
651
+ size: "sm",
652
+ variant: "text",
653
+ icon: "question",
654
+ "aria-label": e(d)("page.explain"),
655
+ onClick: D[3] || (D[3] = _e(() => {
656
+ }, ["stop"]))
657
+ }, null, 8, ["aria-label"])
658
+ ]),
659
+ default: n(() => [
660
+ k(e(be), {
661
+ columns: 1,
662
+ layout: "vertical",
663
+ size: "sm"
664
+ }, {
665
+ default: n(() => [
666
+ k(e(Y), {
667
+ label: e(d)("page.found")
668
+ }, {
669
+ default: n(() => [
670
+ f(o(g.found), 1)
671
+ ]),
672
+ _: 2
673
+ }, 1032, ["label"]),
674
+ k(e(Y), {
675
+ label: e(d)("page.why")
676
+ }, {
677
+ default: n(() => [
678
+ f(o(g.why), 1)
679
+ ]),
680
+ _: 2
681
+ }, 1032, ["label"]),
682
+ k(e(Y), {
683
+ label: e(d)("page.fix")
684
+ }, {
685
+ default: n(() => [
686
+ f(o(g.fix), 1)
687
+ ]),
688
+ _: 2
689
+ }, 1032, ["label"])
690
+ ]),
691
+ _: 2
692
+ }, 1024)
693
+ ]),
694
+ _: 2
695
+ }, 1032, ["title"])
696
+ ])
697
+ ]),
698
+ expanded: n(({ row: g }) => [
699
+ r.value !== null ? (t(), u(Je, {
700
+ key: 0,
701
+ run: r.value,
702
+ query: { ...W.value, check: g.id },
703
+ fixable: (g.fixes ?? []).length > 0,
704
+ title: g.title,
705
+ onChanged: G
706
+ }, null, 8, ["run", "query", "fixable", "title"])) : x("", !0)
707
+ ]),
708
+ _: 1
709
+ }, 8, ["expanded", "data", "columns", "loading", "filters-count", "filters-label", "empty-text"])
710
+ ]),
711
+ _: 1
712
+ }, 8, ["base"]));
713
+ }
714
+ }), nt = /* @__PURE__ */ X(Xe, [["__scopeId", "data-v-29bac002"]]);
715
+ export {
716
+ nt as default
717
+ };
718
+ //# sourceMappingURL=AuditIssuesPage-DtEJ9Sgq.js.map