Release 0.0.9
This commit is contained in:
@@ -78,7 +78,7 @@ export class StorageAuditReportApp extends foundry.applications.api.ApplicationV
|
||||
</div>
|
||||
</section>
|
||||
${renderProgress(context.progress, context.loading)}
|
||||
${renderSummary(context.summary)}
|
||||
${renderSummary(context.summary, context.loading)}
|
||||
${renderGroupedFindingList(context.groupedFindings, context.hasAnalysis, context.loading, context.showAll)}
|
||||
${renderFindingList(context.findings, context.hasAnalysis, context.loading, context.showAll, context.showRaw)}
|
||||
`;
|
||||
@@ -228,7 +228,8 @@ function renderProgress(progress, loading) {
|
||||
`;
|
||||
}
|
||||
|
||||
function renderSummary(summary) {
|
||||
function renderSummary(summary, loading) {
|
||||
if (loading) return "";
|
||||
if (!summary) {
|
||||
return `
|
||||
<section class="storage-audit__summary">
|
||||
@@ -447,7 +448,8 @@ function groupByTarget(findings) {
|
||||
current.sources.set(key, {
|
||||
sourceLabel: finding.source.sourceLabel,
|
||||
sourceName: finding.source.sourceName ?? null,
|
||||
sourceUuid: finding.source.sourceUuid ?? null
|
||||
sourceUuid: finding.source.sourceUuid ?? null,
|
||||
sourceTrail: finding.source.sourceTrail ?? null
|
||||
});
|
||||
}
|
||||
grouped.set(target, current);
|
||||
@@ -507,6 +509,7 @@ function serializeFinding(finding) {
|
||||
sourceLabel: finding.source.sourceLabel,
|
||||
sourceName: finding.source.sourceName,
|
||||
sourceUuid: finding.source.sourceUuid,
|
||||
sourceTrail: finding.source.sourceTrail,
|
||||
sourceScope: finding.source.sourceScope,
|
||||
rawValue: finding.source.rawValue,
|
||||
normalized: finding.source.normalized
|
||||
@@ -550,9 +553,14 @@ function renderLocalizedCodeText(key, data, codeValues) {
|
||||
}
|
||||
|
||||
function renderSourceLink(source) {
|
||||
const trail = Array.isArray(source.sourceTrail) && source.sourceTrail.length ? source.sourceTrail : null;
|
||||
if (trail) {
|
||||
return trail.map(renderTrailNode).join(' <span class="storage-audit__trail-separator">-></span> ');
|
||||
}
|
||||
|
||||
const label = source.sourceName ? `${source.sourceLabel} (${source.sourceName})` : source.sourceLabel;
|
||||
if (!source.sourceUuid) return escapeHtml(label);
|
||||
return `<a class="content-link" draggable="true" data-link data-uuid="${escapeHtml(source.sourceUuid)}" data-tooltip="${escapeHtml(label)}"><i class="fa-solid fa-file-lines"></i><code>${escapeHtml(source.sourceUuid)}</code></a>${label ? ` <span>${escapeHtml(label)}</span>` : ""}`;
|
||||
return renderUuidLink(source.sourceUuid, label);
|
||||
}
|
||||
|
||||
async function openSourceUuid(uuid) {
|
||||
@@ -568,3 +576,12 @@ async function openSourceUuid(uuid) {
|
||||
}
|
||||
ui.notifications.warn(format("KSA.Notify.OpenSourceFailed", { uuid }));
|
||||
}
|
||||
|
||||
function renderTrailNode(node) {
|
||||
if (!node?.uuid) return escapeHtml(node?.label ?? "");
|
||||
return renderUuidLink(node.uuid, node.label ?? node.uuid);
|
||||
}
|
||||
|
||||
function renderUuidLink(uuid, label) {
|
||||
return `<a class="content-link" draggable="true" data-link data-uuid="${escapeHtml(uuid)}" data-tooltip="${escapeHtml(label)}"><i class="fa-solid fa-file-lines"></i><span>${escapeHtml(label)}</span></a>`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user