Replace finding filters with explicit toggles
This commit is contained in:
@@ -16,8 +16,12 @@
|
||||
"Run": "Analyse starten",
|
||||
"Running": "Analysiere...",
|
||||
"Export": "Report exportieren",
|
||||
"ScopeLabel": "Umfang",
|
||||
"ShowAll": "Alle Findings",
|
||||
"ShowWarnings": "Nur Warnungen",
|
||||
"DetailLabel": "Details",
|
||||
"GroupedOnly": "Nur Gruppen",
|
||||
"WithRaw": "Mit Einzelfällen",
|
||||
"ShowRaw": "Einzelfälle anzeigen",
|
||||
"HideRaw": "Einzelfälle ausblenden"
|
||||
},
|
||||
|
||||
@@ -16,8 +16,12 @@
|
||||
"Run": "Start Analysis",
|
||||
"Running": "Analyzing...",
|
||||
"Export": "Export Report",
|
||||
"ScopeLabel": "Scope",
|
||||
"ShowAll": "All Findings",
|
||||
"ShowWarnings": "Warnings Only",
|
||||
"DetailLabel": "Details",
|
||||
"GroupedOnly": "Grouped Only",
|
||||
"WithRaw": "With Raw Entries",
|
||||
"ShowRaw": "Show Raw Entries",
|
||||
"HideRaw": "Hide Raw Entries"
|
||||
},
|
||||
|
||||
@@ -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.20",
|
||||
"version": "0.0.21",
|
||||
"compatibility": {
|
||||
"minimum": "13",
|
||||
"verified": "13"
|
||||
|
||||
@@ -67,14 +67,52 @@ export class StorageAuditReportApp extends foundry.applications.api.ApplicationV
|
||||
<i class="fa-solid fa-file-export"></i>
|
||||
<span>${localize("KSA.Action.Export")}</span>
|
||||
</button>
|
||||
<button type="button" class="button" data-action="toggleShowAll" ${context.hasAnalysis ? "" : "disabled"}>
|
||||
<i class="fa-solid fa-filter"></i>
|
||||
<span>${context.showAll ? localize("KSA.Action.ShowWarnings") : localize("KSA.Action.ShowAll")}</span>
|
||||
</button>
|
||||
<button type="button" class="button" data-action="toggleRaw" ${context.hasAnalysis ? "" : "disabled"}>
|
||||
<i class="fa-solid fa-list"></i>
|
||||
<span>${context.showRaw ? localize("KSA.Action.HideRaw") : localize("KSA.Action.ShowRaw")}</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 class="storage-audit__toggle-group" role="group" aria-label="${escapeHtml(localize("KSA.Action.DetailLabel"))}">
|
||||
<span class="storage-audit__toggle-label">${localize("KSA.Action.DetailLabel")}</span>
|
||||
<div class="storage-audit__toggle-buttons">
|
||||
<button
|
||||
type="button"
|
||||
class="button ${context.showRaw ? "" : "active"}"
|
||||
data-action="toggleRaw"
|
||||
data-mode="grouped"
|
||||
aria-pressed="${context.showRaw ? "false" : "true"}"
|
||||
${context.hasAnalysis ? "" : "disabled"}>
|
||||
<span>${localize("KSA.Action.GroupedOnly")}</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="button ${context.showRaw ? "active" : ""}"
|
||||
data-action="toggleRaw"
|
||||
data-mode="raw"
|
||||
aria-pressed="${context.showRaw ? "true" : "false"}"
|
||||
${context.hasAnalysis ? "" : "disabled"}>
|
||||
<span>${localize("KSA.Action.WithRaw")}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
${renderProgress(context.progress, context.loading)}
|
||||
@@ -122,11 +160,21 @@ export class StorageAuditReportApp extends foundry.applications.api.ApplicationV
|
||||
return this.render({ force: true });
|
||||
}
|
||||
|
||||
setShowAll(value) {
|
||||
this.#showAll = !!value;
|
||||
return this.render({ force: true });
|
||||
}
|
||||
|
||||
toggleRaw() {
|
||||
this.#showRaw = !this.#showRaw;
|
||||
return this.render({ force: true });
|
||||
}
|
||||
|
||||
setShowRaw(value) {
|
||||
this.#showRaw = !!value;
|
||||
return this.render({ force: true });
|
||||
}
|
||||
|
||||
exportReport() {
|
||||
if (!this.#analysis) return;
|
||||
const payload = {
|
||||
@@ -187,10 +235,24 @@ export class StorageAuditReportApp extends foundry.applications.api.ApplicationV
|
||||
}
|
||||
|
||||
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 #onToggleRaw(_event, _button) {
|
||||
const mode = _button?.dataset?.mode;
|
||||
if (mode === "grouped") {
|
||||
return this.setShowRaw(false);
|
||||
}
|
||||
if (mode === "raw") {
|
||||
return this.setShowRaw(true);
|
||||
}
|
||||
return this.toggleRaw();
|
||||
}
|
||||
|
||||
|
||||
@@ -145,6 +145,32 @@
|
||||
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