@7365admin1/layer-common 3.2.2-staging.181 → 3.2.2-staging.183

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.
@@ -705,7 +705,11 @@ async function loadReaderConfiguration() {
705
705
  try {
706
706
  const response = await getReaderConfiguration(form.readerId, {
707
707
  general: ["online"],
708
- identifier: ["pin_identification_enabled", "multi_factor_authentication"],
708
+ identifier: [
709
+ "card_identification_enabled",
710
+ "pin_identification_enabled",
711
+ "multi_factor_authentication",
712
+ ],
709
713
  });
710
714
  const configuration = getConfigurationData(response);
711
715
  const general = isUnknownRecord(configuration.general) ? configuration.general : {};
@@ -719,6 +723,11 @@ async function loadReaderConfiguration() {
719
723
  form.identificationMethods.pin = pinEnabled;
720
724
  form.identificationMethods.idPassword = !pinEnabled;
721
725
  }
726
+ if (identifier.card_identification_enabled !== undefined) {
727
+ form.identificationMethods.card = isEnabledConfiguration(
728
+ identifier.card_identification_enabled,
729
+ );
730
+ }
722
731
  } catch (error: unknown) {
723
732
  console.warn("Unable to load HID reader configuration:", errorConverter(error));
724
733
  }
@@ -790,7 +799,13 @@ async function saveIdentificationMethod(method: HidIdentificationMethod) {
790
799
 
791
800
  savingSection.value = `method-${method}`;
792
801
  try {
793
- if (method === "pin" || method === "idPassword") {
802
+ if (method === "card") {
803
+ await setReaderConfiguration(form.readerId, {
804
+ identifier: {
805
+ card_identification_enabled: form.identificationMethods.card ? "1" : "0",
806
+ },
807
+ });
808
+ } else if (method === "pin" || method === "idPassword") {
794
809
  if (method === "pin" && form.identificationMethods.pin) {
795
810
  form.identificationMethods.idPassword = false;
796
811
  } else if (method === "idPassword" && form.identificationMethods.idPassword) {
@@ -38,7 +38,12 @@
38
38
  <template #extension>
39
39
  <div class="app-filter-row hid-reader-filters">
40
40
  <AppField v-model="search" search placeholder="Search" />
41
- <AppSelect v-model="status" :items="statusOptions" />
41
+ <AppSelect
42
+ v-model="status"
43
+ :items="statusOptions"
44
+ placeholder="Status"
45
+ clearable
46
+ />
42
47
  </div>
43
48
  </template>
44
49
 
@@ -256,7 +261,7 @@ const {
256
261
 
257
262
  const readers = ref<Record<string, any>[]>([]);
258
263
  const search = ref("");
259
- const status = ref("Status");
264
+ const status = ref("");
260
265
  const loading = ref(false);
261
266
  const saving = ref(false);
262
267
  const actionLoading = ref(false);
@@ -280,7 +285,11 @@ const syncPreviewStats = ref({
280
285
  });
281
286
  const resultStats = ref<typeof syncPreviewStats.value | null>(null);
282
287
 
283
- const statusOptions = ["Status", "active", "inactive", "deleted", "offline"];
288
+ const statusOptions = [
289
+ { title: "Active", value: "active" },
290
+ { title: "Inactive", value: "inactive" },
291
+ { title: "Offline", value: "offline" },
292
+ ];
284
293
 
285
294
  /**
286
295
  * The columns. NO `weight`, on purpose.
@@ -324,7 +333,7 @@ const filteredReaders = computed(() => {
324
333
  resolveReaderStatus(reader),
325
334
  ].some((value) => String(value ?? "").toLowerCase().includes(query));
326
335
 
327
- const matchesStatus = status.value === "Status" || resolveReaderStatus(reader) === status.value;
336
+ const matchesStatus = !status.value || resolveReaderStatus(reader) === status.value;
328
337
 
329
338
  return matchesSearch && matchesStatus;
330
339
  });