Remove misleading severity filter
This commit is contained in:
11
lang/de.json
11
lang/de.json
@@ -15,10 +15,7 @@
|
||||
"Action": {
|
||||
"Run": "Analyse starten",
|
||||
"Running": "Analysiere...",
|
||||
"Export": "Report exportieren",
|
||||
"ScopeLabel": "Umfang",
|
||||
"ShowAll": "Alle Findings",
|
||||
"ShowWarnings": "Nur Warnungen"
|
||||
"Export": "Report exportieren"
|
||||
},
|
||||
"Progress": {
|
||||
"Initialize": "Initialisiere Analyse",
|
||||
@@ -61,7 +58,7 @@
|
||||
},
|
||||
"Section": {
|
||||
"WorkView": "Arbeitsansicht",
|
||||
"NoGrouped": "Keine gruppierten {scope}Findings vorhanden.",
|
||||
"NoGrouped": "Keine gruppierten Findings vorhanden.",
|
||||
"NoPrompt": "Die Analyse kann direkt aus dieser Ansicht gestartet werden.",
|
||||
"Running": "Analyse läuft...",
|
||||
"Samples": "Beispiele",
|
||||
@@ -118,10 +115,6 @@
|
||||
},
|
||||
"Export": {
|
||||
"Filename": "kosmos-storage-audit-{timestamp}.json"
|
||||
},
|
||||
"Scope": {
|
||||
"Warning": "warnenden ",
|
||||
"Empty": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
lang/en.json
11
lang/en.json
@@ -15,10 +15,7 @@
|
||||
"Action": {
|
||||
"Run": "Start Analysis",
|
||||
"Running": "Analyzing...",
|
||||
"Export": "Export Report",
|
||||
"ScopeLabel": "Scope",
|
||||
"ShowAll": "All Findings",
|
||||
"ShowWarnings": "Warnings Only"
|
||||
"Export": "Export Report"
|
||||
},
|
||||
"Progress": {
|
||||
"Initialize": "Initializing analysis",
|
||||
@@ -61,7 +58,7 @@
|
||||
},
|
||||
"Section": {
|
||||
"WorkView": "Work View",
|
||||
"NoGrouped": "No grouped {scope}findings available.",
|
||||
"NoGrouped": "No grouped findings available.",
|
||||
"NoPrompt": "The analysis can be started directly from this view.",
|
||||
"Running": "Analysis in progress...",
|
||||
"Samples": "Examples",
|
||||
@@ -118,10 +115,6 @@
|
||||
},
|
||||
"Export": {
|
||||
"Filename": "kosmos-storage-audit-{timestamp}.json"
|
||||
},
|
||||
"Scope": {
|
||||
"Warning": "warning ",
|
||||
"Empty": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.27",
|
||||
"version": "0.0.28",
|
||||
"compatibility": {
|
||||
"minimum": "13",
|
||||
"verified": "13"
|
||||
|
||||
@@ -5,7 +5,6 @@ export class StorageAuditReportApp extends foundry.applications.api.ApplicationV
|
||||
tag: "div",
|
||||
actions: {
|
||||
runAnalysis: StorageAuditReportApp.#onRunAnalysis,
|
||||
toggleShowAll: StorageAuditReportApp.#onToggleShowAll,
|
||||
exportReport: StorageAuditReportApp.#onExportReport
|
||||
},
|
||||
window: {
|
||||
@@ -21,7 +20,6 @@ export class StorageAuditReportApp extends foundry.applications.api.ApplicationV
|
||||
|
||||
#analysis = null;
|
||||
#loading = false;
|
||||
#showAll = false;
|
||||
#progress = null;
|
||||
|
||||
constructor(options = {}) {
|
||||
@@ -31,12 +29,10 @@ export class StorageAuditReportApp extends foundry.applications.api.ApplicationV
|
||||
|
||||
async _prepareContext() {
|
||||
const findings = this.#analysis?.findings ?? [];
|
||||
const visibleFindings = this.#showAll ? findings : findings.filter(f => f.severity !== "info");
|
||||
const groupedFindings = await enrichGroupedFindings(groupFindings(visibleFindings));
|
||||
const groupedFindings = await enrichGroupedFindings(groupFindings(findings));
|
||||
return {
|
||||
loading: this.#loading,
|
||||
hasAnalysis: !!this.#analysis,
|
||||
showAll: this.#showAll,
|
||||
progress: this.#progress,
|
||||
notices: this.#analysis?.notices ?? [],
|
||||
moduleVersion: game.modules.get("kosmos-storage-audit")?.version ?? null,
|
||||
@@ -68,35 +64,12 @@ export class StorageAuditReportApp extends foundry.applications.api.ApplicationV
|
||||
<i class="fa-solid fa-file-export"></i>
|
||||
<span>${localize("KSA.Action.Export")}</span>
|
||||
</button>
|
||||
<div class="storage-audit__toggle-group" role="group" aria-label="${escapeHtml(localize("KSA.Action.ScopeLabel"))}">
|
||||
<span class="storage-audit__toggle-label">${localize("KSA.Action.ScopeLabel")}</span>
|
||||
<div class="storage-audit__toggle-buttons">
|
||||
<button
|
||||
type="button"
|
||||
class="button ${context.showAll ? "" : "active"}"
|
||||
data-action="toggleShowAll"
|
||||
data-mode="warnings"
|
||||
aria-pressed="${context.showAll ? "false" : "true"}"
|
||||
${context.hasAnalysis ? "" : "disabled"}>
|
||||
<span>${localize("KSA.Action.ShowWarnings")}</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="button ${context.showAll ? "active" : ""}"
|
||||
data-action="toggleShowAll"
|
||||
data-mode="all"
|
||||
aria-pressed="${context.showAll ? "true" : "false"}"
|
||||
${context.hasAnalysis ? "" : "disabled"}>
|
||||
<span>${localize("KSA.Action.ShowAll")}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
${renderProgress(context.progress, context.loading)}
|
||||
${renderNotices(context.notices, context.loading)}
|
||||
${renderSummary(context.summary, context.loading)}
|
||||
${renderGroupedFindingList(context.groupedFindings, context.hasAnalysis, context.loading, context.showAll)}
|
||||
${renderGroupedFindingList(context.groupedFindings, context.hasAnalysis, context.loading)}
|
||||
`;
|
||||
return container;
|
||||
}
|
||||
@@ -133,16 +106,6 @@ export class StorageAuditReportApp extends foundry.applications.api.ApplicationV
|
||||
}
|
||||
}
|
||||
|
||||
toggleShowAll() {
|
||||
this.#showAll = !this.#showAll;
|
||||
return this.render({ force: true });
|
||||
}
|
||||
|
||||
setShowAll(value) {
|
||||
this.#showAll = !!value;
|
||||
return this.render({ force: true });
|
||||
}
|
||||
|
||||
exportReport() {
|
||||
if (!this.#analysis) return;
|
||||
const payload = {
|
||||
@@ -203,17 +166,6 @@ export class StorageAuditReportApp extends foundry.applications.api.ApplicationV
|
||||
return this.runAnalysis();
|
||||
}
|
||||
|
||||
static #onToggleShowAll(_event, _button) {
|
||||
const mode = _button?.dataset?.mode;
|
||||
if (mode === "warnings") {
|
||||
return this.setShowAll(false);
|
||||
}
|
||||
if (mode === "all") {
|
||||
return this.setShowAll(true);
|
||||
}
|
||||
return this.toggleShowAll();
|
||||
}
|
||||
|
||||
static #onExportReport(_event, _button) {
|
||||
return this.exportReport();
|
||||
}
|
||||
@@ -299,7 +251,7 @@ function renderSummary(summary, loading) {
|
||||
`;
|
||||
}
|
||||
|
||||
function renderGroupedFindingList(groupedFindings, hasAnalysis, loading, showAll) {
|
||||
function renderGroupedFindingList(groupedFindings, hasAnalysis, loading) {
|
||||
if (loading || !hasAnalysis) return "";
|
||||
|
||||
const sections = [];
|
||||
@@ -327,7 +279,7 @@ function renderGroupedFindingList(groupedFindings, hasAnalysis, loading, showAll
|
||||
));
|
||||
}
|
||||
|
||||
if (showAll && groupedFindings.orphans.length) {
|
||||
if (groupedFindings.orphans.length) {
|
||||
sections.push(renderGroupedSection(
|
||||
localize("KSA.Section.OrphanCandidates"),
|
||||
localize("KSA.Section.OrphanCandidatesDesc"),
|
||||
@@ -344,7 +296,7 @@ function renderGroupedFindingList(groupedFindings, hasAnalysis, loading, showAll
|
||||
<section class="storage-audit__grouped">
|
||||
<div class="storage-audit__group-header">
|
||||
<h3>${localize("KSA.Section.WorkView")}</h3>
|
||||
<p>${format("KSA.Section.NoGrouped", { scope: localize(showAll ? "KSA.Scope.Empty" : "KSA.Scope.Warning") })}</p>
|
||||
<p>${localize("KSA.Section.NoGrouped")}</p>
|
||||
</div>
|
||||
</section>
|
||||
`;
|
||||
|
||||
@@ -163,32 +163,6 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.storage-audit__toggle-group {
|
||||
display: grid;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.storage-audit__toggle-label {
|
||||
font-size: 0.9em;
|
||||
opacity: 0.8;
|
||||
padding: 0 0.2rem;
|
||||
}
|
||||
|
||||
.storage-audit__toggle-buttons {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 0.45rem;
|
||||
}
|
||||
|
||||
.storage-audit__toggle-buttons .button {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.storage-audit__toggle-buttons .button.active {
|
||||
box-shadow: inset 0 0 0 2px color-mix(in srgb, currentColor 25%, transparent);
|
||||
background: color-mix(in srgb, currentColor 10%, transparent);
|
||||
}
|
||||
|
||||
.storage-audit__actions .button[disabled] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user