Highlight module names in notices
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"id": "kosmos-storage-audit",
|
||||
"title": "Kosmos Storage Audit",
|
||||
"description": "Analyzes media references and risky storage locations across Foundry data and public roots.",
|
||||
"version": "0.0.26",
|
||||
"version": "0.0.27",
|
||||
"compatibility": {
|
||||
"minimum": "13",
|
||||
"verified": "13"
|
||||
|
||||
@@ -241,7 +241,7 @@ function renderProgress(progress, loading) {
|
||||
|
||||
function renderNotices(notices, loading) {
|
||||
if (loading || !notices?.length) return "";
|
||||
const items = notices.map(notice => `<li>${escapeHtml(notice.message ?? "")}</li>`).join("");
|
||||
const items = notices.map(notice => `<li>${renderNoticeMessage(notice)}</li>`).join("");
|
||||
return `
|
||||
<section class="storage-audit__summary storage-audit__summary--notices">
|
||||
<h3>${localize("KSA.Notice.Title")}</h3>
|
||||
@@ -250,6 +250,15 @@ function renderNotices(notices, loading) {
|
||||
`;
|
||||
}
|
||||
|
||||
function renderNoticeMessage(notice) {
|
||||
const moduleLabels = Array.isArray(notice?.moduleLabels) ? notice.moduleLabels : [];
|
||||
if (!moduleLabels.length) return escapeHtml(notice?.message ?? "");
|
||||
|
||||
const plainModules = moduleLabels.join(", ");
|
||||
const highlightedModules = moduleLabels.map(label => `<strong>${escapeHtml(label)}</strong>`).join(", ");
|
||||
return escapeHtml(notice?.message ?? "").replace(escapeHtml(plainModules), highlightedModules);
|
||||
}
|
||||
|
||||
function renderSummary(summary, loading) {
|
||||
if (loading) return "";
|
||||
if (!summary) {
|
||||
|
||||
Reference in New Issue
Block a user