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