@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
- getIdentities(selectedReaderId.value, {
564
- page: 1,
565
- limit: 500,
566
- }),
567
- getLogs(selectedReaderId.value, {
568
- page: 1,
569
- limit: 500,
570
- }),
571
- loadLiveAccessLogs(selectedReaderId.value),
572
- loadReaderConfiguration(selectedReaderId.value),
573
- isAdministratorTab ? loadAdministratorRoles(selectedReaderId.value) : Promise.resolve(null),
574
- props.org
575
- ? getVisitors({
576
- org: props.org,
577
- site: props.site,
578
- page: 1,
579
- limit: 500,
580
- order: "desc",
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
- loadReaderUsers(selectedReaderId.value),
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
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "3.2.1-staging.63",
5
+ "version": "3.2.1-staging.64",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "publishConfig": {