@7365admin1/layer-common 3.2.1-staging.63 → 3.2.1-staging.64
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.
|
@@ -559,28 +559,43 @@ async function loadDashboard() {
|
|
|
559
559
|
resetDashboardData();
|
|
560
560
|
try {
|
|
561
561
|
const isAdministratorTab = activeTab.value === "administrator";
|
|
562
|
+
const isVisitorTab = activeTab.value === "visitor";
|
|
562
563
|
const [identityResponse, logResponse, hidAccessLogs, configurationResponse, roleResponse, visitorResponse, readerUserResponse] = await Promise.all([
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
564
|
+
loadDashboardSource(
|
|
565
|
+
getIdentities(selectedReaderId.value, {
|
|
566
|
+
page: 1,
|
|
567
|
+
limit: 500,
|
|
568
|
+
}),
|
|
569
|
+
null,
|
|
570
|
+
"identities",
|
|
571
|
+
),
|
|
572
|
+
loadDashboardSource(
|
|
573
|
+
getLogs(selectedReaderId.value, {
|
|
574
|
+
page: 1,
|
|
575
|
+
limit: 500,
|
|
576
|
+
}),
|
|
577
|
+
null,
|
|
578
|
+
"persisted access logs",
|
|
579
|
+
),
|
|
580
|
+
loadDashboardSource(loadLiveAccessLogs(selectedReaderId.value), [], "live access logs"),
|
|
581
|
+
loadDashboardSource(loadReaderConfiguration(selectedReaderId.value), {}, "reader configuration"),
|
|
582
|
+
isAdministratorTab
|
|
583
|
+
? loadDashboardSource(loadAdministratorRoles(selectedReaderId.value), null, "administrator roles")
|
|
582
584
|
: Promise.resolve(null),
|
|
583
|
-
|
|
585
|
+
isVisitorTab && props.org
|
|
586
|
+
? loadDashboardSource(
|
|
587
|
+
getVisitors({
|
|
588
|
+
org: props.org,
|
|
589
|
+
site: props.site,
|
|
590
|
+
page: 1,
|
|
591
|
+
limit: 500,
|
|
592
|
+
order: "desc",
|
|
593
|
+
}),
|
|
594
|
+
null,
|
|
595
|
+
"visitor records",
|
|
596
|
+
)
|
|
597
|
+
: Promise.resolve(null),
|
|
598
|
+
loadDashboardSource(loadReaderUsers(selectedReaderId.value), [], "reader users"),
|
|
584
599
|
]);
|
|
585
600
|
|
|
586
601
|
if (sequence !== loadSequence.value) return;
|
|
@@ -612,6 +627,15 @@ async function loadDashboard() {
|
|
|
612
627
|
}
|
|
613
628
|
}
|
|
614
629
|
|
|
630
|
+
async function loadDashboardSource<T>(request: Promise<T>, fallback: T, label: string): Promise<T> {
|
|
631
|
+
try {
|
|
632
|
+
return await request;
|
|
633
|
+
} catch (error) {
|
|
634
|
+
console.warn(`Unable to load HID ${label}`, error);
|
|
635
|
+
return fallback;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
615
639
|
async function loadUserImages(items: Record<string, any>[]) {
|
|
616
640
|
if (!selectedReaderId.value) return;
|
|
617
641
|
|