@7365admin1/layer-common 4.17.1-staging.331 → 4.18.0
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.
- package/CHANGELOG.md +10 -4
- package/components/DocumentForm.vue +112 -407
- package/components/DocumentManagement.vue +12 -213
- package/components/EntryPass/QrTemplatePreview.vue +25 -21
- package/components/EntryPassInformation.vue +24 -119
- package/components/Facility/BookingSetup.vue +0 -63
- package/components/HidIntercomManagement.vue +43 -193
- package/components/HidReaderManagement.vue +0 -26
- package/components/HidReaderUserRoster.vue +2 -32
- package/components/HidUserEnrollment.vue +213 -779
- package/components/InvitationClientForm.vue +1 -19
- package/components/Layout/Header.vue +0 -26
- package/components/VisitorManagement.vue +5 -267
- package/composables/useAccessManagement.ts +0 -5
- package/composables/useDocument.ts +0 -7
- package/composables/useFacility.ts +0 -11
- package/composables/useHidAmico.ts +0 -97
- package/composables/useHidNavigation.ts +1 -25
- package/composables/usePeople.ts +0 -19
- package/composables/useSecurityPermission.ts +7 -8
- package/composables/useWebUsb.ts +11 -14
- package/package.json +1 -1
- package/pages/[org]/[site]/access-mgmt/administrator/index.vue +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-cards/index.vue +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
- package/types/document.d.ts +0 -14
- package/types/facility.d.ts +0 -4
- package/types/people.d.ts +1 -4
- package/utils/materialSymbols.ts +0 -3
- package/components/HidAccessPermissions.vue +0 -424
- package/components/HidProfileQrCode.vue +0 -323
- package/components/NotificationBell.vue +0 -321
- package/composables/useNotification.ts +0 -78
- package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +0 -23
- package/utils/hid-permission-assignments.ts +0 -190
|
@@ -132,18 +132,15 @@
|
|
|
132
132
|
</template>
|
|
133
133
|
|
|
134
134
|
<template #[`item.contactStatus`]="{ item }">
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
@click="testContactSipStatus(item)"
|
|
145
|
-
/>
|
|
146
|
-
</span>
|
|
135
|
+
<v-btn
|
|
136
|
+
size="small"
|
|
137
|
+
variant="outlined"
|
|
138
|
+
class="text-none"
|
|
139
|
+
:loading="testingContactReaderId === item.readerId"
|
|
140
|
+
@click="testContactSipStatus(item)"
|
|
141
|
+
>
|
|
142
|
+
{{ getContactReaderStatus(item) }}
|
|
143
|
+
</v-btn>
|
|
147
144
|
</template>
|
|
148
145
|
|
|
149
146
|
<template #[`item.action-table`]="{ item }">
|
|
@@ -151,26 +148,24 @@
|
|
|
151
148
|
<template #activator="{ props: menuProps }">
|
|
152
149
|
<AppButton v-bind="menuProps" variant="row" icon="mdi-dots-vertical" />
|
|
153
150
|
</template>
|
|
154
|
-
<v-list v-if="activeTab === 'intercom'" density="compact" class="
|
|
155
|
-
<v-list-item
|
|
151
|
+
<v-list v-if="activeTab === 'intercom'" density="compact" class="row-menu">
|
|
152
|
+
<v-list-item title="View" @click="openViewDialog(item)" />
|
|
156
153
|
<v-list-item
|
|
157
|
-
class="screen-menu__item"
|
|
158
154
|
title="Test Connection with SIP"
|
|
159
|
-
prepend-icon="mdi-lan-check"
|
|
160
155
|
:disabled="testingSipReaderId === item.reader._id"
|
|
161
156
|
@click="testSipConnection(item)"
|
|
162
157
|
/>
|
|
163
|
-
<v-list-item
|
|
164
|
-
<v-list-item
|
|
165
|
-
<v-list-item
|
|
166
|
-
<v-list-item
|
|
158
|
+
<v-list-item title="Call Settings" @click="openCallDialog(item)" />
|
|
159
|
+
<v-list-item title="Dial Code" @click="openDialCodeDialog(item)" />
|
|
160
|
+
<v-list-item title="Make a call" @click="openMakeCallDialog(item)" />
|
|
161
|
+
<v-list-item title="Web call" @click="openWebPhoneDialog(item)" />
|
|
167
162
|
</v-list>
|
|
168
|
-
<v-list v-else density="compact" class="
|
|
169
|
-
<v-list-item
|
|
170
|
-
<v-list-item
|
|
171
|
-
<v-list-item
|
|
172
|
-
<v-list-item
|
|
173
|
-
<v-list-item
|
|
163
|
+
<v-list v-else density="compact" class="row-menu">
|
|
164
|
+
<v-list-item title="Call" prepend-icon="mdi-phone" @click="openContactCall(item)" />
|
|
165
|
+
<v-list-item title="Check reader SIP status" prepend-icon="mdi-lan-check" @click="testContactSipStatus(item)" />
|
|
166
|
+
<v-list-item title="View" @click="openContactView(item)" />
|
|
167
|
+
<v-list-item title="Edit" @click="openContactDialog(item)" />
|
|
168
|
+
<v-list-item title="Delete" @click="openDeleteContact(item)" />
|
|
174
169
|
</v-list>
|
|
175
170
|
</v-menu>
|
|
176
171
|
</template>
|
|
@@ -579,7 +574,7 @@
|
|
|
579
574
|
</v-dialog>
|
|
580
575
|
|
|
581
576
|
<v-dialog v-model="contactDialog" max-width="360" persistent>
|
|
582
|
-
<v-card class="form-dialog
|
|
577
|
+
<v-card class="form-dialog" rounded="lg">
|
|
583
578
|
<v-card-title class="dialog-title">{{ contactForm.id ? 'Edit Contact' : 'Add Contact' }}</v-card-title>
|
|
584
579
|
<v-card-text class="dialog-body">
|
|
585
580
|
<FieldLabel text="HID Reader" required />
|
|
@@ -589,10 +584,9 @@
|
|
|
589
584
|
:disabled="Boolean(contactForm.id)"
|
|
590
585
|
/>
|
|
591
586
|
<FieldLabel text="Name" required />
|
|
592
|
-
<AppField v-model="contactForm.name" placeholder="
|
|
593
|
-
<FieldLabel text="Address" required />
|
|
594
|
-
<AppField v-model="contactForm.serverAddress"
|
|
595
|
-
<p class="field-hint">{{ contactAddressHint }}</p>
|
|
587
|
+
<AppField v-model="contactForm.name" placeholder="Enter name" />
|
|
588
|
+
<FieldLabel text="SIP Number / Address" required />
|
|
589
|
+
<AppField v-model="contactForm.serverAddress" placeholder="7100 or user@example.com" />
|
|
596
590
|
</v-card-text>
|
|
597
591
|
<v-card-actions class="dialog-actions pa-0">
|
|
598
592
|
<v-btn class="text-none action-cancel" variant="flat" height="44" @click="contactDialog = false">Cancel</v-btn>
|
|
@@ -732,7 +726,6 @@ const {
|
|
|
732
726
|
makeIntercomCall,
|
|
733
727
|
finalizeIntercomCall,
|
|
734
728
|
ensureSipAccount,
|
|
735
|
-
notifyIntercomCall,
|
|
736
729
|
} = useHidAmico();
|
|
737
730
|
|
|
738
731
|
const activeTab = ref<IntercomTab>("intercom");
|
|
@@ -965,26 +958,6 @@ const webPhoneButtonClass = computed(() => ({
|
|
|
965
958
|
"has-incoming-call": webPhone.callState.value === "incoming",
|
|
966
959
|
}));
|
|
967
960
|
const isPeerToPeerMode = computed(() => sipForm.operatingMode === "peer-to-peer");
|
|
968
|
-
|
|
969
|
-
/**
|
|
970
|
-
* The user guide (6.3 Intercom contacts) gives a contact ONE address field
|
|
971
|
-
* whose meaning follows the reader's operating mode: an extension number in
|
|
972
|
-
* SIP Client mode, a local IP address in Peer-to-Peer mode. The reader chosen
|
|
973
|
-
* in the contact dialog decides which one the field asks for.
|
|
974
|
-
*/
|
|
975
|
-
const contactReaderRow = computed(() =>
|
|
976
|
-
intercomRows.value.find((row) => row.reader._id === contactForm.readerId)
|
|
977
|
-
);
|
|
978
|
-
const isContactReaderPeerToPeer = computed(() => contactReaderRow.value?.operatingMode === "Peer-to-Peer");
|
|
979
|
-
const contactAddressPlaceholder = computed(() => (isContactReaderPeerToPeer.value ? "192.168.0.129" : "7100"));
|
|
980
|
-
const contactAddressHint = computed(() => {
|
|
981
|
-
if (!contactReaderRow.value) {
|
|
982
|
-
return "Extension number (SIP Client) or local IP address (Peer-to-Peer), depending on the reader's operating mode.";
|
|
983
|
-
}
|
|
984
|
-
return isContactReaderPeerToPeer.value
|
|
985
|
-
? "Peer-to-Peer mode: enter the contact's local IP address."
|
|
986
|
-
: "SIP Client mode: enter the contact's extension number.";
|
|
987
|
-
});
|
|
988
961
|
const areSipCredentialFieldsDisabled = computed(() => !sipForm.enabled || isPeerToPeerMode.value);
|
|
989
962
|
const intercomDetailSections = computed(() => {
|
|
990
963
|
const row = selectedRow.value;
|
|
@@ -1443,10 +1416,8 @@ async function disconnectWebPhone() {
|
|
|
1443
1416
|
|
|
1444
1417
|
async function startWebCall() {
|
|
1445
1418
|
webPhoneActionLoading.value = true;
|
|
1446
|
-
const destination = webPhoneForm.destination;
|
|
1447
1419
|
try {
|
|
1448
|
-
await webPhone.call(destination);
|
|
1449
|
-
void ringResidentPhone(destination);
|
|
1420
|
+
await webPhone.call(webPhoneForm.destination);
|
|
1450
1421
|
} catch (error: unknown) {
|
|
1451
1422
|
showMessage(getErrorMessage(error), "error");
|
|
1452
1423
|
} finally {
|
|
@@ -1454,50 +1425,6 @@ async function startWebCall() {
|
|
|
1454
1425
|
}
|
|
1455
1426
|
}
|
|
1456
1427
|
|
|
1457
|
-
/**
|
|
1458
|
-
* Wake the called resident's mobile so they are there to answer.
|
|
1459
|
-
*
|
|
1460
|
-
* Deliberately fired AFTER the INVITE and never awaited. The SIP leg is the
|
|
1461
|
-
* call: it is already ringing by the time this runs, and a resident whose
|
|
1462
|
-
* phone is asleep is the only thing this fixes. So a failure here is logged
|
|
1463
|
-
* and dropped rather than shown — telling the operator "call failed" for a
|
|
1464
|
-
* call that is ringing would be worse than a silent miss.
|
|
1465
|
-
*
|
|
1466
|
-
* A destination with no resident behind it (a staff extension, an external SIP
|
|
1467
|
-
* address) comes back `notified: false` with a reason and is not an error.
|
|
1468
|
-
*/
|
|
1469
|
-
async function ringResidentPhone(destination: string) {
|
|
1470
|
-
if (!props.org || !props.site) return;
|
|
1471
|
-
|
|
1472
|
-
try {
|
|
1473
|
-
// No `readerId`: this call came from the web phone, not a door station.
|
|
1474
|
-
// The reader selected in the table above is whatever the operator happens
|
|
1475
|
-
// to be looking at, and sending it would tell the resident's app the call
|
|
1476
|
-
// arrived at a door it never touched.
|
|
1477
|
-
await notifyIntercomCall(props.site, {
|
|
1478
|
-
orgId: props.org,
|
|
1479
|
-
destination,
|
|
1480
|
-
callId: createCallId(),
|
|
1481
|
-
});
|
|
1482
|
-
} catch (error: unknown) {
|
|
1483
|
-
console.warn("[intercom] could not send the incoming-call push", error);
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
|
-
/**
|
|
1488
|
-
* A per-call id, so a second push for the same call replaces the first on the
|
|
1489
|
-
* resident's lock screen rather than stacking a second ringing card.
|
|
1490
|
-
* `randomUUID` needs a secure context, which the web phone already requires —
|
|
1491
|
-
* getUserMedia does not run without one — but the fallback keeps a call from
|
|
1492
|
-
* failing on that account alone.
|
|
1493
|
-
*/
|
|
1494
|
-
function createCallId() {
|
|
1495
|
-
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
1496
|
-
return crypto.randomUUID();
|
|
1497
|
-
}
|
|
1498
|
-
return `call-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
1499
|
-
}
|
|
1500
|
-
|
|
1501
1428
|
async function answerWebCall() {
|
|
1502
1429
|
webPhoneActionLoading.value = true;
|
|
1503
1430
|
try {
|
|
@@ -1539,14 +1466,7 @@ function toggleWebMute() {
|
|
|
1539
1466
|
}
|
|
1540
1467
|
}
|
|
1541
1468
|
|
|
1542
|
-
function hasReaderContactId(contact: ContactRow) {
|
|
1543
|
-
if (contact.id !== undefined) return true;
|
|
1544
|
-
showMessage("This contact has no identifier on the HID reader. Refresh the list and try again.", "error");
|
|
1545
|
-
return false;
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
1469
|
function openContactDialog(contact?: ContactRow) {
|
|
1549
|
-
if (contact && !hasReaderContactId(contact)) return;
|
|
1550
1470
|
selectedContact.value = contact || null;
|
|
1551
1471
|
contactForm.id = contact?.id;
|
|
1552
1472
|
contactForm.readerId = contact?.readerId || selectedReaderId.value || readers.value[0]?._id || "";
|
|
@@ -1596,20 +1516,10 @@ function openContactCall(contact: ContactRow) {
|
|
|
1596
1516
|
}
|
|
1597
1517
|
|
|
1598
1518
|
function openDeleteContact(contact: ContactRow) {
|
|
1599
|
-
if (!hasReaderContactId(contact)) return;
|
|
1600
1519
|
selectedContact.value = contact;
|
|
1601
1520
|
deleteContactDialog.value = true;
|
|
1602
1521
|
}
|
|
1603
1522
|
|
|
1604
|
-
/**
|
|
1605
|
-
* modify_objects and destroy_objects answer { changes: n } (API guide, Modify
|
|
1606
|
-
* Objects / Delete Objects). Zero means the where clause matched nothing on the
|
|
1607
|
-
* reader - typically a contact already removed from the touchscreen.
|
|
1608
|
-
*/
|
|
1609
|
-
function readChanges(response: unknown) {
|
|
1610
|
-
return toNumber(toRecord(toRecord(response).data ?? response).changes, Number.NaN);
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
1523
|
async function saveSipSettings() {
|
|
1614
1524
|
if (!selectedRow.value) return;
|
|
1615
1525
|
const isPeerToPeer = sipForm.operatingMode === "peer-to-peer";
|
|
@@ -1710,17 +1620,6 @@ function isSipCallTarget(value = "") {
|
|
|
1710
1620
|
return /^(?:sip:)?[A-Za-z0-9_.+-]+(?:@[A-Za-z0-9.-]+(?::\d{1,5})?)?$/.test(value.trim());
|
|
1711
1621
|
}
|
|
1712
1622
|
|
|
1713
|
-
function isIpv4Address(value = "") {
|
|
1714
|
-
const [host, port, ...rest] = value.trim().split(":");
|
|
1715
|
-
if (rest.length || (port !== undefined && !/^\d{1,5}$/.test(port))) return false;
|
|
1716
|
-
const octets = host.split(".");
|
|
1717
|
-
return octets.length === 4 && octets.every((octet) => /^\d{1,3}$/.test(octet) && Number(octet) <= 255);
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
function isContactAddress(value: string, peerToPeer: boolean) {
|
|
1721
|
-
return peerToPeer ? isIpv4Address(value) : isSipCallTarget(value);
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
1623
|
async function runHangupCall() {
|
|
1725
1624
|
if (!selectedRow.value) return;
|
|
1726
1625
|
hangingUp.value = true;
|
|
@@ -1809,20 +1708,15 @@ async function saveContact() {
|
|
|
1809
1708
|
return;
|
|
1810
1709
|
}
|
|
1811
1710
|
|
|
1812
|
-
if (!
|
|
1813
|
-
showMessage(
|
|
1814
|
-
isContactReaderPeerToPeer.value
|
|
1815
|
-
? "Enter the contact's local IPv4 address for a Peer-to-Peer reader."
|
|
1816
|
-
: "Enter a valid extension number or SIP address.",
|
|
1817
|
-
"warning",
|
|
1818
|
-
);
|
|
1711
|
+
if (!isSipCallTarget(contactForm.serverAddress)) {
|
|
1712
|
+
showMessage("Enter a valid extension, SIP address, or IPv4 address.", "warning");
|
|
1819
1713
|
return;
|
|
1820
1714
|
}
|
|
1821
1715
|
|
|
1822
1716
|
contactsSaving.value = true;
|
|
1823
1717
|
try {
|
|
1824
|
-
if (contactForm.id
|
|
1825
|
-
|
|
1718
|
+
if (contactForm.id) {
|
|
1719
|
+
await runObjectOperation(contactForm.readerId, {
|
|
1826
1720
|
operation: "modify",
|
|
1827
1721
|
object: "contacts",
|
|
1828
1722
|
values: {
|
|
@@ -1831,14 +1725,8 @@ async function saveContact() {
|
|
|
1831
1725
|
},
|
|
1832
1726
|
where: { contacts: { id: contactForm.id } },
|
|
1833
1727
|
});
|
|
1834
|
-
if (readChanges(response) === 0) {
|
|
1835
|
-
contactDialog.value = false;
|
|
1836
|
-
await loadContacts();
|
|
1837
|
-
showMessage("The HID reader no longer has this contact. The list has been refreshed.", "warning");
|
|
1838
|
-
return;
|
|
1839
|
-
}
|
|
1840
1728
|
} else {
|
|
1841
|
-
|
|
1729
|
+
await runObjectOperation(contactForm.readerId, {
|
|
1842
1730
|
operation: "create",
|
|
1843
1731
|
object: "contacts",
|
|
1844
1732
|
values: [{
|
|
@@ -1846,15 +1734,6 @@ async function saveContact() {
|
|
|
1846
1734
|
number: contactForm.serverAddress.trim(),
|
|
1847
1735
|
}],
|
|
1848
1736
|
});
|
|
1849
|
-
// create_objects answers { ids: [...] } with the id of each created
|
|
1850
|
-
// object. No id means the reader accepted the request but created nothing.
|
|
1851
|
-
const created = toRecord(response?.data ?? response).ids;
|
|
1852
|
-
if (!Array.isArray(created) || created.length === 0) {
|
|
1853
|
-
contactDialog.value = false;
|
|
1854
|
-
await loadContacts();
|
|
1855
|
-
showMessage("The HID reader did not confirm the new contact. Check the contact list.", "warning");
|
|
1856
|
-
return;
|
|
1857
|
-
}
|
|
1858
1737
|
}
|
|
1859
1738
|
contactDialog.value = false;
|
|
1860
1739
|
await loadContacts();
|
|
@@ -1867,21 +1746,16 @@ async function saveContact() {
|
|
|
1867
1746
|
}
|
|
1868
1747
|
|
|
1869
1748
|
async function deleteContact() {
|
|
1870
|
-
|
|
1871
|
-
if (!contact || !hasReaderContactId(contact)) return;
|
|
1749
|
+
if (!selectedContact.value?.id) return;
|
|
1872
1750
|
contactsSaving.value = true;
|
|
1873
1751
|
try {
|
|
1874
|
-
|
|
1752
|
+
await runObjectOperation(selectedContact.value.readerId, {
|
|
1875
1753
|
operation: "destroy",
|
|
1876
1754
|
object: "contacts",
|
|
1877
|
-
where: { contacts: { id:
|
|
1755
|
+
where: { contacts: { id: selectedContact.value.id } },
|
|
1878
1756
|
});
|
|
1879
1757
|
deleteContactDialog.value = false;
|
|
1880
1758
|
await loadContacts();
|
|
1881
|
-
if (readChanges(response) === 0) {
|
|
1882
|
-
showMessage("The HID reader had already removed this contact. The list has been refreshed.", "warning");
|
|
1883
|
-
return;
|
|
1884
|
-
}
|
|
1885
1759
|
showMessage("Intercom contact deleted.", "success");
|
|
1886
1760
|
} catch (error: unknown) {
|
|
1887
1761
|
showMessage(getErrorMessage(error), "error");
|
|
@@ -2069,14 +1943,9 @@ export default {
|
|
|
2069
1943
|
|
|
2070
1944
|
|
|
2071
1945
|
|
|
2072
|
-
.
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
gap: 4px;
|
|
2076
|
-
}
|
|
2077
|
-
|
|
2078
|
-
.contact-status-refresh {
|
|
2079
|
-
color: var(--text2);
|
|
1946
|
+
.row-menu {
|
|
1947
|
+
min-width: 160px;
|
|
1948
|
+
border-radius: 6px;
|
|
2080
1949
|
}
|
|
2081
1950
|
|
|
2082
1951
|
.link-text {
|
|
@@ -2136,27 +2005,10 @@ export default {
|
|
|
2136
2005
|
color: var(--err);
|
|
2137
2006
|
}
|
|
2138
2007
|
|
|
2139
|
-
.field-hint {
|
|
2140
|
-
margin: 6px 0 0;
|
|
2141
|
-
color: var(--text2);
|
|
2142
|
-
font-size: 11px;
|
|
2143
|
-
line-height: 1.4;
|
|
2144
|
-
}
|
|
2145
|
-
|
|
2146
2008
|
.sip-settings-dialog .field-label {
|
|
2147
2009
|
margin-top: 14px;
|
|
2148
2010
|
}
|
|
2149
2011
|
|
|
2150
|
-
/* Room between the contact dialog's three inputs; the first label sits
|
|
2151
|
-
against the body padding. */
|
|
2152
|
-
.contact-dialog .field-label {
|
|
2153
|
-
margin-top: 18px;
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
.contact-dialog .field-label:first-child {
|
|
2157
|
-
margin-top: 0;
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
2012
|
.sip-label {
|
|
2161
2013
|
margin: 12px 0 6px;
|
|
2162
2014
|
color: var(--text);
|
|
@@ -2854,18 +2706,14 @@ export default {
|
|
|
2854
2706
|
margin-top: 0;
|
|
2855
2707
|
}
|
|
2856
2708
|
|
|
2857
|
-
.detail-dialog .dialog-title {
|
|
2858
|
-
font-size: var(--fs-card-title);
|
|
2859
|
-
}
|
|
2860
|
-
|
|
2861
2709
|
.detail-row {
|
|
2862
2710
|
display: flex;
|
|
2863
2711
|
align-items: center;
|
|
2864
2712
|
justify-content: space-between;
|
|
2865
2713
|
gap: 16px;
|
|
2866
|
-
min-height:
|
|
2714
|
+
min-height: 26px;
|
|
2867
2715
|
color: var(--muted);
|
|
2868
|
-
font-size:
|
|
2716
|
+
font-size: 11px;
|
|
2869
2717
|
}
|
|
2870
2718
|
|
|
2871
2719
|
.detail-row strong {
|
|
@@ -2877,11 +2725,13 @@ export default {
|
|
|
2877
2725
|
.dialog-actions {
|
|
2878
2726
|
display: grid;
|
|
2879
2727
|
grid-template-columns: 1fr 1fr;
|
|
2880
|
-
gap: 0;
|
|
2881
|
-
min-height: 0;
|
|
2882
2728
|
border-top: 1px solid var(--border);
|
|
2883
2729
|
}
|
|
2884
2730
|
|
|
2731
|
+
.sip-settings-dialog .dialog-actions {
|
|
2732
|
+
min-height: 46px;
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2885
2735
|
/* The split footer bar, as panels 2, 4 and 5 keep it: the SHAPE is the
|
|
2886
2736
|
screen's own (the handoff draws no such bar); only the colours change. The
|
|
2887
2737
|
navy was a fixed hex that sat on the dark card unchanged. */
|
|
@@ -87,7 +87,6 @@
|
|
|
87
87
|
|
|
88
88
|
<v-list density="compact" min-width="180">
|
|
89
89
|
<v-list-item title="View" @click="openView(item)" />
|
|
90
|
-
<v-list-item title="Access Permissions" @click="openPermissions(item)" />
|
|
91
90
|
<v-list-item title="Sync HID Reader" @click="openSyncConfirm(item)" />
|
|
92
91
|
<v-list-item title="Test Connection" @click="openTestConfirm(item)" />
|
|
93
92
|
<v-list-item title="Edit" @click="openEdit(item)" />
|
|
@@ -242,18 +241,6 @@
|
|
|
242
241
|
</v-card-actions>
|
|
243
242
|
</v-card>
|
|
244
243
|
</v-dialog>
|
|
245
|
-
|
|
246
|
-
<!-- Who may actually pass this reader. Enrolment makes a person
|
|
247
|
-
RECOGNISABLE; this is what puts them in the group the access rule is
|
|
248
|
-
attached to, and without it a recognised person is refused at the
|
|
249
|
-
door. Reloads the list on save so the reader's own counts stay true. -->
|
|
250
|
-
<HidAccessPermissions
|
|
251
|
-
v-model="permissionsDialog"
|
|
252
|
-
:site="props.site"
|
|
253
|
-
:org="props.org"
|
|
254
|
-
:reader="selectedReader"
|
|
255
|
-
@saved="loadReaders"
|
|
256
|
-
/>
|
|
257
244
|
</section>
|
|
258
245
|
</template>
|
|
259
246
|
|
|
@@ -335,13 +322,6 @@ const props = defineProps({
|
|
|
335
322
|
type: String,
|
|
336
323
|
required: true,
|
|
337
324
|
},
|
|
338
|
-
// The permission endpoints are org-scoped (`assertOrganizationSiteAccess`),
|
|
339
|
-
// and this component previously had no reason to know the org. Passed from
|
|
340
|
-
// the page, as `HidQrCodeConfiguration` already does.
|
|
341
|
-
org: {
|
|
342
|
-
type: String,
|
|
343
|
-
required: true,
|
|
344
|
-
},
|
|
345
325
|
});
|
|
346
326
|
|
|
347
327
|
const {
|
|
@@ -367,7 +347,6 @@ const viewDialog = ref(false);
|
|
|
367
347
|
const confirmDialog = ref(false);
|
|
368
348
|
const resultDialog = ref(false);
|
|
369
349
|
const selectedReader = ref<HidRecord | null>(null);
|
|
370
|
-
const permissionsDialog = ref(false);
|
|
371
350
|
const pendingAction = ref<"test" | "sync" | "delete" | null>(null);
|
|
372
351
|
const actionStage = ref<"confirm" | "review" | "loading">("confirm");
|
|
373
352
|
const resultSuccess = ref(true);
|
|
@@ -505,11 +484,6 @@ function openView(reader: HidRecord) {
|
|
|
505
484
|
viewDialog.value = true;
|
|
506
485
|
}
|
|
507
486
|
|
|
508
|
-
function openPermissions(reader: HidRecord) {
|
|
509
|
-
selectedReader.value = reader;
|
|
510
|
-
permissionsDialog.value = true;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
487
|
function openTestConfirm(reader?: HidRecord | null) {
|
|
514
488
|
if (reader) selectedReader.value = reader;
|
|
515
489
|
pendingAction.value = "test";
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
v-model="search"
|
|
28
28
|
search
|
|
29
29
|
placeholder="Search Amico user, UID or registration"
|
|
30
|
-
@keyup.enter="
|
|
30
|
+
@keyup.enter="reloadFromFirstPage"
|
|
31
31
|
/>
|
|
32
32
|
<AppSelect
|
|
33
33
|
v-model="userType"
|
|
@@ -284,8 +284,6 @@ async function loadUsers() {
|
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
const sequence = loadUsersSequence.value + 1;
|
|
288
|
-
loadUsersSequence.value = sequence;
|
|
289
287
|
loading.value = true;
|
|
290
288
|
try {
|
|
291
289
|
let clientFiltersUserType = false;
|
|
@@ -321,7 +319,6 @@ async function loadUsers() {
|
|
|
321
319
|
const pageItems = clientFiltersUserType
|
|
322
320
|
? matchingItems.slice(pageStart, pageStart + 10)
|
|
323
321
|
: matchingItems;
|
|
324
|
-
if (sequence !== loadUsersSequence.value) return;
|
|
325
322
|
users.value = pageItems.map(toReaderUser);
|
|
326
323
|
total.value = clientFiltersUserType
|
|
327
324
|
? matchingItems.length
|
|
@@ -333,15 +330,13 @@ async function loadUsers() {
|
|
|
333
330
|
? ""
|
|
334
331
|
: toText(response.pageRange ?? data.pageRange);
|
|
335
332
|
} catch (error: unknown) {
|
|
336
|
-
if (sequence !== loadUsersSequence.value) return;
|
|
337
333
|
users.value = [];
|
|
338
334
|
total.value = 0;
|
|
339
335
|
pages.value = 1;
|
|
340
336
|
serverPageRange.value = "";
|
|
341
337
|
showToast(getErrorMessage(error), "error");
|
|
342
338
|
} finally {
|
|
343
|
-
|
|
344
|
-
if (sequence === loadUsersSequence.value) loading.value = false;
|
|
339
|
+
loading.value = false;
|
|
345
340
|
}
|
|
346
341
|
}
|
|
347
342
|
|
|
@@ -355,31 +350,6 @@ function reloadFromFirstPage() {
|
|
|
355
350
|
loadUsers();
|
|
356
351
|
}
|
|
357
352
|
|
|
358
|
-
/**
|
|
359
|
-
* Typing is the search. It used to reload on `@keyup.enter` and on nothing
|
|
360
|
-
* else, so unless you guessed Enter was required the screen sent no request at
|
|
361
|
-
* all. Debounced, because each reload is a login/load/logout round trip to a
|
|
362
|
-
* reader over a VPN; Enter still works and skips the wait.
|
|
363
|
-
*/
|
|
364
|
-
const SEARCH_DEBOUNCE_MS = 400;
|
|
365
|
-
let searchDebounce: ReturnType<typeof setTimeout> | undefined;
|
|
366
|
-
|
|
367
|
-
function onSearchInput() {
|
|
368
|
-
clearTimeout(searchDebounce);
|
|
369
|
-
searchDebounce = setTimeout(reloadFromFirstPage, SEARCH_DEBOUNCE_MS);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
function onSearchSubmit() {
|
|
373
|
-
clearTimeout(searchDebounce);
|
|
374
|
-
reloadFromFirstPage();
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
watch(search, onSearchInput);
|
|
378
|
-
onBeforeUnmount(() => clearTimeout(searchDebounce));
|
|
379
|
-
|
|
380
|
-
/** Discards a load whose answer arrives after a newer one started. */
|
|
381
|
-
const loadUsersSequence = ref(0);
|
|
382
|
-
|
|
383
353
|
function hasFacialData(user: HidReaderUser) {
|
|
384
354
|
return user.metadata?.facialEnrolled === true || Boolean(toText(user.metadata?.facialData));
|
|
385
355
|
}
|