@7365admin1/layer-common 4.2.5 → 4.2.7-staging.274
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/AddPassKeyToVisitor.vue +0 -1
- package/components/AttendanceCheckInOutDialog.vue +0 -1
- package/components/AttendanceMain.vue +0 -1
- package/components/BtnUploadFile.vue +1 -3
- package/components/BuildingForm.vue +0 -1
- package/components/BuildingUnitFormEdit.vue +0 -1
- package/components/BulletinBoardManagement.vue +1 -1
- package/components/CameraForm.vue +0 -1
- package/components/CameraMain.vue +0 -1
- package/components/CameraWall.vue +15 -3
- package/components/Carousel.vue +0 -1
- package/components/Chat/Information.vue +1 -1
- package/components/Chat/Message.vue +2 -1
- package/components/DrawImage.vue +0 -1
- package/components/Facility/BookingSetup.vue +1 -2
- package/components/FeedbackDetail.vue +1 -2
- package/components/FeedbackMain.vue +0 -2
- package/components/Input/File.vue +1 -6
- package/components/ListItem.vue +2 -2
- package/components/PasswordConfirmation.vue +1 -1
- package/components/ScanVisitorQRCode.vue +0 -2
- package/components/ServiceProviderMain.vue +0 -2
- package/components/SiteSettings.vue +0 -2
- package/components/VisitorForm.vue +2 -18
- package/components/VisitorManagement.vue +1 -1
- package/components/VisitorPassKeyQRScanner.vue +0 -1
- package/components/WorkOrder/Detail.vue +1 -2
- package/components/WorkOrder/Main.vue +1 -1
- package/composables/useComment.ts +1 -1
- package/composables/useKey.ts +0 -3
- package/composables/usePassKey.ts +0 -1
- package/composables/useRole.ts +1 -1
- package/composables/useUploadFiles.ts +1 -1
- package/composables/useUtils.ts +1 -2
- package/composables/useVerification.ts +0 -1
- package/composables/useWebUsb.ts +0 -10
- package/middleware/01.auth.ts +0 -1
- package/middleware/02.org.ts +0 -2
- package/package.json +1 -1
- package/plugins/vuetify.ts +0 -2
- package/utils/camera-wall.ts +27 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @iservice365/layer-common
|
|
2
2
|
|
|
3
|
+
## 4.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a7631fe: Remove stray debug `console.log` calls from shipped components, composables, middleware and plugins, and move the ones on failure paths to `console.error`. No behaviour change.
|
|
8
|
+
|
|
3
9
|
## 4.2.5
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -507,11 +513,11 @@
|
|
|
507
513
|
`utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
|
|
508
514
|
own rule from two endpoints the console already calls, unprojected:
|
|
509
515
|
|
|
510
|
-
|
|
511
|
-
|
|
516
|
+
GET /api/members/user/:user/app/admin the Seven365 staff membership
|
|
517
|
+
GET /api/roles/id/:role that membership's role document
|
|
512
518
|
|
|
513
|
-
|
|
514
|
-
|
|
519
|
+
owner = member.type === "admin" && role.type === "admin" && role.default === true
|
|
520
|
+
staff = member.type === "admin" && role.type === "admin"
|
|
515
521
|
|
|
516
522
|
`role.default` is the marker because it is the only property of a platform
|
|
517
523
|
staff role no API caller can set - `role.controller.ts` validates create and
|
|
@@ -104,10 +104,8 @@ async function uploadAttachment(e: Event) {
|
|
|
104
104
|
value.value = res.id as string;
|
|
105
105
|
await emit("upload", res);
|
|
106
106
|
} catch (error) {
|
|
107
|
-
console.
|
|
107
|
+
console.error(error);
|
|
108
108
|
}
|
|
109
|
-
} else {
|
|
110
|
-
console.log("No file selected");
|
|
111
109
|
}
|
|
112
110
|
loading.value = false;
|
|
113
111
|
}
|
|
@@ -414,7 +414,6 @@ async function submit() {
|
|
|
414
414
|
|
|
415
415
|
if (prop.mode === "edit") {
|
|
416
416
|
|
|
417
|
-
console.log('Updating building with levels:', building.value.levels);
|
|
418
417
|
|
|
419
418
|
if (JSON.stringify(initialBuildingLevels.value) !== JSON.stringify(building.value.levels)) {
|
|
420
419
|
await batchUpdateLevels(building.value.levels as { _id: string; name: string }[]);
|
|
@@ -535,7 +535,6 @@ async function submit() {
|
|
|
535
535
|
const handleUpdateOwner = async ({ person, isOwner }: { person: TPeople; isOwner: boolean }) => {
|
|
536
536
|
const owners = peopleItems.value.filter(p => p.isOwner)
|
|
537
537
|
message.value = ""
|
|
538
|
-
// console.log('Updating owner status for', person._id, 'to', isOwner)
|
|
539
538
|
|
|
540
539
|
const userId = person._id ?? null;
|
|
541
540
|
|
|
@@ -304,7 +304,7 @@ async function handleProceedDeleteAnnouncement() {
|
|
|
304
304
|
}
|
|
305
305
|
} catch (error: any) {
|
|
306
306
|
const errorMessage = error?.response?._data?.message;
|
|
307
|
-
console.
|
|
307
|
+
console.error("[ERROR]", error);
|
|
308
308
|
showMessage(
|
|
309
309
|
errorMessage || "Something went wrong. Please try again later.",
|
|
310
310
|
"error"
|
|
@@ -288,7 +288,6 @@ camera.value.site = prop.site;
|
|
|
288
288
|
if (prop.mode === "edit") {
|
|
289
289
|
camera.value = JSON.parse(JSON.stringify(prop.camera));
|
|
290
290
|
}
|
|
291
|
-
console.log("prop.camera", prop?.camera);
|
|
292
291
|
camera.value.site = prop.site;
|
|
293
292
|
camera.value.type = prop.type;
|
|
294
293
|
camera.value.category =
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
v-else
|
|
166
166
|
class="vms__grid"
|
|
167
167
|
:style="{
|
|
168
|
-
gridTemplateColumns: `repeat(${
|
|
168
|
+
gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
|
|
169
169
|
gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`,
|
|
170
170
|
}"
|
|
171
171
|
>
|
|
@@ -336,6 +336,7 @@
|
|
|
336
336
|
|
|
337
337
|
<script setup lang="ts">
|
|
338
338
|
import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
|
339
|
+
import { useDisplay } from "vuetify";
|
|
339
340
|
|
|
340
341
|
import {
|
|
341
342
|
capabilityView,
|
|
@@ -348,6 +349,7 @@ import {
|
|
|
348
349
|
pickerView,
|
|
349
350
|
sharedCapabilityNote,
|
|
350
351
|
wallCameras,
|
|
352
|
+
wallColumns,
|
|
351
353
|
wallLayout,
|
|
352
354
|
wallPageCount,
|
|
353
355
|
wallRows,
|
|
@@ -455,7 +457,17 @@ watch(() => props.site, () => {
|
|
|
455
457
|
|
|
456
458
|
const layoutKey = ref<TWallLayoutKey>(DEFAULT_WALL_LAYOUT);
|
|
457
459
|
const layout = computed(() => wallLayout(layoutKey.value));
|
|
458
|
-
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* PHONE OVERRIDE. `smAndDown` is Vuetify's own phone/small-tablet cutoff
|
|
463
|
+
* (<960px) — the same composable `NavigationDrawer.vue` already reads its
|
|
464
|
+
* breakpoint from. Below it the wall always draws one column, whatever
|
|
465
|
+
* layout button is selected; the pure column/dense/row rules live in
|
|
466
|
+
* `camera-wall.ts` (see `wallColumns`) so they stay testable there.
|
|
467
|
+
*/
|
|
468
|
+
const { smAndDown } = useDisplay();
|
|
469
|
+
const columns = computed(() => wallColumns(layoutKey.value, smAndDown.value));
|
|
470
|
+
const dense = computed(() => isDenseLayout(layoutKey.value, smAndDown.value));
|
|
459
471
|
|
|
460
472
|
const selectedIds = ref<string[]>([]);
|
|
461
473
|
const showPicker = ref(false);
|
|
@@ -479,7 +491,7 @@ const tiles = computed(() =>
|
|
|
479
491
|
* four empty rectangles. Nothing can be done with an empty cell from here
|
|
480
492
|
* anyway: cameras are added in Site Settings.
|
|
481
493
|
*/
|
|
482
|
-
const rows = computed(() => wallRows(tiles.value.length, layoutKey.value));
|
|
494
|
+
const rows = computed(() => wallRows(tiles.value.length, layoutKey.value, smAndDown.value));
|
|
483
495
|
|
|
484
496
|
/**
|
|
485
497
|
* A layout change resizes the page, so the old page NUMBER no longer means
|
package/components/Carousel.vue
CHANGED
|
@@ -305,7 +305,6 @@ watchEffect(async (onCleanup) => {
|
|
|
305
305
|
isConverting.value = false;
|
|
306
306
|
// Replace the entire array at once to avoid "doubling" or partial updates
|
|
307
307
|
mediaItems.value = newMediaItems;
|
|
308
|
-
console.log("watchEffect mediaItems updated:", mediaItems.value);
|
|
309
308
|
}
|
|
310
309
|
});
|
|
311
310
|
|
|
@@ -154,8 +154,9 @@ const quickChatOptions = [
|
|
|
154
154
|
"We are here to help.",
|
|
155
155
|
];
|
|
156
156
|
|
|
157
|
+
// Placeholder: choosing a quick-chat option is not wired to anything yet.
|
|
157
158
|
const selectQuickChat = (msg: string) => {
|
|
158
|
-
|
|
159
|
+
void msg;
|
|
159
160
|
};
|
|
160
161
|
</script>
|
|
161
162
|
|
package/components/DrawImage.vue
CHANGED
|
@@ -939,7 +939,7 @@ const upsertChecklist = () => {
|
|
|
939
939
|
} else if (Array.isArray(facility.value.securityCheckList)) {
|
|
940
940
|
facility.value.securityCheckList.push(newItem);
|
|
941
941
|
} else {
|
|
942
|
-
console.
|
|
942
|
+
console.error("Error in adding security checklist");
|
|
943
943
|
}
|
|
944
944
|
} else {
|
|
945
945
|
isEditing.value = false;
|
|
@@ -981,7 +981,6 @@ const confirmRemarks = () => {
|
|
|
981
981
|
};
|
|
982
982
|
|
|
983
983
|
const deleteChecklist = (index: string) => {
|
|
984
|
-
console.log("delete checklist", index);
|
|
985
984
|
selectedIndex.value = index;
|
|
986
985
|
isDeleteItem.value = true;
|
|
987
986
|
};
|
|
@@ -330,7 +330,6 @@ async function handleCompletionFileAdded(file: File) {
|
|
|
330
330
|
// }
|
|
331
331
|
// }
|
|
332
332
|
|
|
333
|
-
console.log("completionAttachments.value", completionAttachments.value);
|
|
334
333
|
} catch (error) {
|
|
335
334
|
console.error("Error uploading completion file:", error);
|
|
336
335
|
showMessage("Failed to upload file", "error");
|
|
@@ -347,7 +346,7 @@ async function handleCompletionFileDeleted(value: string) {
|
|
|
347
346
|
(file) => file !== value
|
|
348
347
|
);
|
|
349
348
|
} catch (error) {
|
|
350
|
-
console.
|
|
349
|
+
console.error(error);
|
|
351
350
|
showMessage("Failed to delete file", "error");
|
|
352
351
|
}
|
|
353
352
|
}
|
|
@@ -927,7 +927,6 @@ const { addFile, deleteFile: _deleteFile } = useFile();
|
|
|
927
927
|
// (file) => file !== value
|
|
928
928
|
// );
|
|
929
929
|
// } catch (error) {
|
|
930
|
-
// console.log(error);
|
|
931
930
|
// showMessage("Failed to delete file", "error");
|
|
932
931
|
// }
|
|
933
932
|
// }
|
|
@@ -943,7 +942,6 @@ const categories = computed(() =>
|
|
|
943
942
|
);
|
|
944
943
|
|
|
945
944
|
function tableRowClickHandler(_: any, data: any) {
|
|
946
|
-
// console.log(data.item);
|
|
947
945
|
selectedFeedback.value = data.item;
|
|
948
946
|
dialogPreview.value = true;
|
|
949
947
|
}
|
|
@@ -168,10 +168,6 @@ function selectAttachment() {
|
|
|
168
168
|
|
|
169
169
|
function onFileChange() {
|
|
170
170
|
if (files.value.length) {
|
|
171
|
-
console.log(
|
|
172
|
-
"onFileChange triggered with files:",
|
|
173
|
-
files.value.map((f) => f.name)
|
|
174
|
-
);
|
|
175
171
|
|
|
176
172
|
const maxFiles = props.maxFiles || 5;
|
|
177
173
|
if (files.value.length > maxFiles) {
|
|
@@ -181,7 +177,6 @@ function onFileChange() {
|
|
|
181
177
|
}
|
|
182
178
|
|
|
183
179
|
files.value.forEach((file) => {
|
|
184
|
-
console.log(`Emitting 'add' event for file: ${file.name}`);
|
|
185
180
|
// For each file, we'll also need to store its original name
|
|
186
181
|
// This will be associated with the file URL in the parent component
|
|
187
182
|
emit("add", file);
|
|
@@ -192,7 +187,7 @@ function onFileChange() {
|
|
|
192
187
|
}
|
|
193
188
|
|
|
194
189
|
function onImageError(file: string) {
|
|
195
|
-
console.
|
|
190
|
+
console.error(`Image error for file: ${file}`);
|
|
196
191
|
emit("errored", file);
|
|
197
192
|
}
|
|
198
193
|
|
package/components/ListItem.vue
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
<template>
|
|
14
14
|
<v-list-item :class="props.divider ? border : defaultBorder">
|
|
15
15
|
<v-row>
|
|
16
|
-
<v-col cols="4" class="app-list-row__label">
|
|
16
|
+
<v-col cols="12" sm="4" class="app-list-row__label">
|
|
17
17
|
<slot name="title"> List Title </slot>
|
|
18
18
|
</v-col>
|
|
19
19
|
|
|
20
|
-
<v-col cols="8" class="app-list-row__value">
|
|
20
|
+
<v-col cols="12" sm="8" class="app-list-row__value">
|
|
21
21
|
<slot name="value"> value </slot>
|
|
22
22
|
</v-col>
|
|
23
23
|
</v-row>
|
|
@@ -97,7 +97,7 @@ async function handleConfirm() {
|
|
|
97
97
|
|
|
98
98
|
} catch (err: any) {
|
|
99
99
|
const errMessage = err?.response?._data?.message || 'Something went wrong. Please try again.';
|
|
100
|
-
console.
|
|
100
|
+
console.error('[ERROR]', err)
|
|
101
101
|
errorMessage.value = errMessage;
|
|
102
102
|
} finally {
|
|
103
103
|
processingPassword.value = false;
|
|
@@ -77,8 +77,6 @@ const showNotFoundMessage = ref<boolean>(false);
|
|
|
77
77
|
const errorMessage = ref<string>("");
|
|
78
78
|
|
|
79
79
|
const handleScanVisitorQRCode = async () => {
|
|
80
|
-
console.log("startScanner cameraFacingMode", cameraFacingMode.value);
|
|
81
|
-
console.log("STARTING QR Code Scanner...");
|
|
82
80
|
if (html5QrCodeInstance.value) return;
|
|
83
81
|
const config = { fps: 10, qrbox: { width: 250, height: 250 } };
|
|
84
82
|
html5QrCodeInstance.value = new $Html5Qrcode("reader");
|
|
@@ -929,7 +929,6 @@ if (!user?._id) return;
|
|
|
929
929
|
siteId: props.siteId,
|
|
930
930
|
});
|
|
931
931
|
|
|
932
|
-
console.log("serviceProviders", serviceProviders);
|
|
933
932
|
|
|
934
933
|
if (serviceProviders?.length) {
|
|
935
934
|
messageServiceProvider.value =
|
|
@@ -980,7 +979,6 @@ const canSubmitInvite = computed(() => {
|
|
|
980
979
|
watch(
|
|
981
980
|
() => serviceProviderInvite.value.email,
|
|
982
981
|
async (value) => {
|
|
983
|
-
console.log("typing:", value);
|
|
984
982
|
await checkExistingAccount(value);
|
|
985
983
|
}
|
|
986
984
|
);
|
|
@@ -410,7 +410,6 @@ await useLazyAsyncData(`anpr-settings-${props.siteId}`, async () => {
|
|
|
410
410
|
site: props.siteId,
|
|
411
411
|
userType: "site",
|
|
412
412
|
});
|
|
413
|
-
console.log("data", data);
|
|
414
413
|
if (typeof data?.ANPRSwitches == "object") {
|
|
415
414
|
ANPRSwitches.value = data?.ANPRSwitches;
|
|
416
415
|
}
|
|
@@ -431,7 +430,6 @@ const saveANPRSettings = async () => {
|
|
|
431
430
|
updatedBy: props.createdBy,
|
|
432
431
|
userType: "site",
|
|
433
432
|
};
|
|
434
|
-
console.log("saveANPRSettings data:", data);
|
|
435
433
|
await createUpdateANPRSettings(data);
|
|
436
434
|
show("Saved successfully", "success");
|
|
437
435
|
} catch (error) {
|
|
@@ -1397,7 +1397,7 @@ async function proceedNonCheckedOutCheckout(visitorId: string) {
|
|
|
1397
1397
|
}
|
|
1398
1398
|
} catch (error: any) {
|
|
1399
1399
|
const checkoutErrorMessage = error?.response?._data?.message;
|
|
1400
|
-
console.
|
|
1400
|
+
console.error("[ERROR]", error);
|
|
1401
1401
|
errorMessage.value =
|
|
1402
1402
|
checkoutErrorMessage || "An error occurred while checking out the vehicle.";
|
|
1403
1403
|
} finally {
|
|
@@ -1425,7 +1425,7 @@ async function handleNfcReturnCheckout() {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
} catch (error: any) {
|
|
1427
1427
|
const checkoutErrorMessage = error?.response?._data?.message;
|
|
1428
|
-
console.
|
|
1428
|
+
console.error("[ERROR]", error);
|
|
1429
1429
|
errorMessage.value =
|
|
1430
1430
|
checkoutErrorMessage || "An error occurred while returning the NFC card.";
|
|
1431
1431
|
} finally {
|
|
@@ -2085,12 +2085,6 @@ async function submit(options: { skipNonCheckedOutCheck?: boolean } = {}) {
|
|
|
2085
2085
|
);
|
|
2086
2086
|
continue;
|
|
2087
2087
|
}
|
|
2088
|
-
console.log(
|
|
2089
|
-
"[QR Print] Sending to printer — accessLevel:",
|
|
2090
|
-
qrCode.accessLevel,
|
|
2091
|
-
"liftLevel:",
|
|
2092
|
-
qrCode.liftAccessLevel
|
|
2093
|
-
);
|
|
2094
2088
|
const printResult = await testConnection(
|
|
2095
2089
|
vendorId,
|
|
2096
2090
|
productId,
|
|
@@ -2101,12 +2095,6 @@ async function submit(options: { skipNonCheckedOutCheck?: boolean } = {}) {
|
|
|
2101
2095
|
companyName,
|
|
2102
2096
|
address
|
|
2103
2097
|
);
|
|
2104
|
-
console.log(
|
|
2105
|
-
"[QR Print] Print result for card",
|
|
2106
|
-
qrCode._id,
|
|
2107
|
-
":",
|
|
2108
|
-
printResult
|
|
2109
|
-
);
|
|
2110
2098
|
}
|
|
2111
2099
|
}
|
|
2112
2100
|
}
|
|
@@ -2395,10 +2383,6 @@ onMounted(() => {
|
|
|
2395
2383
|
currentAutofillSource.value = null;
|
|
2396
2384
|
|
|
2397
2385
|
if (prop.mode === "register" && prop.visitorData) {
|
|
2398
|
-
console.log(
|
|
2399
|
-
"Register mode, prefill visitor data",
|
|
2400
|
-
prop.visitorData?.plateNumber
|
|
2401
|
-
);
|
|
2402
2386
|
visitor.plateNumber = prop.visitorData?.plateNumber || "";
|
|
2403
2387
|
}
|
|
2404
2388
|
});
|
|
@@ -2370,7 +2370,7 @@ async function proceedCheckout() {
|
|
|
2370
2370
|
}
|
|
2371
2371
|
} catch (error: any) {
|
|
2372
2372
|
const errorMessage = error?.response?._data?.message;
|
|
2373
|
-
console.
|
|
2373
|
+
console.error("[ERROR]", error);
|
|
2374
2374
|
showMessage(
|
|
2375
2375
|
errorMessage || "Something went wrong. Please try again later.",
|
|
2376
2376
|
"error"
|
|
@@ -72,7 +72,6 @@ const handleScanVisitorQRCode = async () => {
|
|
|
72
72
|
async (qrCodeMessage: string) => {
|
|
73
73
|
showNotFoundMessage.value = false;
|
|
74
74
|
scannedValue.value = qrCodeMessage;
|
|
75
|
-
console.log(`QR Code scanned: ${qrCodeMessage}`);
|
|
76
75
|
setTimeout(() => {
|
|
77
76
|
closeDialog();
|
|
78
77
|
}, 100);
|
|
@@ -199,7 +199,7 @@ async function deleteFile(value: string) {
|
|
|
199
199
|
(file) => file !== value
|
|
200
200
|
);
|
|
201
201
|
} catch (error) {
|
|
202
|
-
console.
|
|
202
|
+
console.error(error);
|
|
203
203
|
showMessage("Failed to delete file", "error");
|
|
204
204
|
}
|
|
205
205
|
}
|
|
@@ -227,7 +227,6 @@ async function submitWorkOrder() {
|
|
|
227
227
|
let res: Record<string, any> = {};
|
|
228
228
|
|
|
229
229
|
if (isEditMode.value) {
|
|
230
|
-
console.log("updating...");
|
|
231
230
|
res = await updateWorkOrder(workOrder.value._id as string, payload);
|
|
232
231
|
} else {
|
|
233
232
|
res = await createWorkOrder(payload);
|
|
@@ -114,7 +114,7 @@ export default function useComment() {
|
|
|
114
114
|
const seenBy = await updateSeenBy(updateSeenIds, currentUser.value?._id);
|
|
115
115
|
}
|
|
116
116
|
} catch (error) {
|
|
117
|
-
console.
|
|
117
|
+
console.error("error :", error);
|
|
118
118
|
} finally {
|
|
119
119
|
isCommentsLoaded.value = false;
|
|
120
120
|
}
|
package/composables/useKey.ts
CHANGED
|
@@ -129,7 +129,6 @@ export default function useKey() {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
function setKey(data?: TKeyLog) {
|
|
132
|
-
console.log("data", data);
|
|
133
132
|
keyLog.value = data || new MKeyLog();
|
|
134
133
|
}
|
|
135
134
|
|
|
@@ -329,7 +328,6 @@ export default function useKey() {
|
|
|
329
328
|
},
|
|
330
329
|
});
|
|
331
330
|
keyList.value = response;
|
|
332
|
-
console.log("keyList", keyList.value);
|
|
333
331
|
return response;
|
|
334
332
|
}
|
|
335
333
|
|
|
@@ -351,7 +349,6 @@ export default function useKey() {
|
|
|
351
349
|
},
|
|
352
350
|
});
|
|
353
351
|
keyList.value = response;
|
|
354
|
-
console.log("keyList", keyList.value);
|
|
355
352
|
return response;
|
|
356
353
|
}
|
|
357
354
|
return {
|
package/composables/useRole.ts
CHANGED
|
@@ -69,7 +69,7 @@ export default function useUploadFiles() {
|
|
|
69
69
|
results.push(fileId); // Collect the file ID
|
|
70
70
|
files.value = [];
|
|
71
71
|
} catch (e) {
|
|
72
|
-
console.
|
|
72
|
+
console.error("Error occurred while attaching images.", e);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
package/composables/useUtils.ts
CHANGED
|
@@ -407,7 +407,6 @@ export default function useUtils() {
|
|
|
407
407
|
const desiredDurationInSeconds = 24 * 60 * 60;
|
|
408
408
|
const remainingTimeInSeconds =
|
|
409
409
|
desiredDurationInSeconds - differenceInSeconds;
|
|
410
|
-
console.log(remainingTimeInSeconds);
|
|
411
410
|
return remainingTimeInSeconds;
|
|
412
411
|
}
|
|
413
412
|
|
|
@@ -497,7 +496,7 @@ export default function useUtils() {
|
|
|
497
496
|
const response = await fetch(url, { method: "GET" });
|
|
498
497
|
return response.blob();
|
|
499
498
|
} catch (error: any) {
|
|
500
|
-
console.
|
|
499
|
+
console.error(error);
|
|
501
500
|
}
|
|
502
501
|
}
|
|
503
502
|
|
package/composables/useWebUsb.ts
CHANGED
|
@@ -191,19 +191,15 @@ export default function useWebUsb() {
|
|
|
191
191
|
}
|
|
192
192
|
try {
|
|
193
193
|
let devices = await navigator.usb.getDevices();
|
|
194
|
-
console.log("[WebUSB] Available devices:", devices.map((d: USBDevice) => `${d.vendorId}:${d.productId}`));
|
|
195
194
|
let device = devices.find(
|
|
196
195
|
(d: USBDevice) => d.vendorId === vendorId && d.productId === productId,
|
|
197
196
|
);
|
|
198
197
|
if (!device) {
|
|
199
|
-
console.log("[WebUSB] Device not in granted list, requesting permission for", vendorId, productId);
|
|
200
198
|
device = await navigator.usb.requestDevice({
|
|
201
199
|
filters: [{ vendorId, productId }],
|
|
202
200
|
});
|
|
203
201
|
}
|
|
204
|
-
console.log("[WebUSB] Opening device:", device.vendorId, device.productId);
|
|
205
202
|
await preparePrinterDevice(device);
|
|
206
|
-
console.log("[WebUSB] Device opened and interface claimed.");
|
|
207
203
|
return device;
|
|
208
204
|
} catch (error: unknown) {
|
|
209
205
|
console.error("Error connecting to USB device:", error);
|
|
@@ -511,9 +507,7 @@ export default function useWebUsb() {
|
|
|
511
507
|
qrSubText?: string,
|
|
512
508
|
) => {
|
|
513
509
|
try {
|
|
514
|
-
console.log("[WebUSB] printQrCode start — doorLevel:", doorLevel, "liftLevel:", liftLevel, "company:", companyName, "address:", address);
|
|
515
510
|
const { endpointNumber } = getPrinterConnection(device);
|
|
516
|
-
console.log("[WebUSB] Using endpoint:", endpointNumber);
|
|
517
511
|
|
|
518
512
|
const canvas = await createReceiptLayout(
|
|
519
513
|
urlImage,
|
|
@@ -524,16 +518,12 @@ export default function useWebUsb() {
|
|
|
524
518
|
qrHeader,
|
|
525
519
|
qrSubText,
|
|
526
520
|
);
|
|
527
|
-
console.log("[WebUSB] Canvas created:", canvas.width, "x", canvas.height);
|
|
528
521
|
const rasterData = canvasToRaster(canvas);
|
|
529
|
-
console.log("[WebUSB] Raster data size:", rasterData.byteLength, "bytes");
|
|
530
522
|
|
|
531
523
|
await device.transferOut(endpointNumber, rasterData.buffer);
|
|
532
|
-
console.log("[WebUSB] Raster data sent.");
|
|
533
524
|
|
|
534
525
|
const CUT = new Uint8Array([0x1d, 0x56, 0x41, 0x10]);
|
|
535
526
|
await device.transferOut(endpointNumber, CUT.buffer);
|
|
536
|
-
console.log("[WebUSB] Cut command sent.");
|
|
537
527
|
|
|
538
528
|
return { success: true, message: "QR print sent successfully" };
|
|
539
529
|
} catch (error: unknown) {
|
package/middleware/01.auth.ts
CHANGED
package/middleware/02.org.ts
CHANGED
|
@@ -9,10 +9,8 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
|
9
9
|
|
|
10
10
|
const { organization, org } = to.params;
|
|
11
11
|
|
|
12
|
-
// console.log('org-aut-middleware running', hexSchema.safeParse(organization).success)
|
|
13
12
|
|
|
14
13
|
if (!hexSchema.safeParse(organization || org).success) {
|
|
15
|
-
console.log('[02.org] middleware run')
|
|
16
14
|
return navigateTo(
|
|
17
15
|
{ name: "require-organization-membership" },
|
|
18
16
|
{ replace: true }
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "4.2.
|
|
5
|
+
"version": "4.2.7-staging.274",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
|
package/plugins/vuetify.ts
CHANGED
|
@@ -234,9 +234,7 @@ export default defineNuxtPlugin((app) => {
|
|
|
234
234
|
// hiddenTabs: ['upload'],
|
|
235
235
|
divider: true,
|
|
236
236
|
// upload(file: File) {
|
|
237
|
-
// console.log("file :>> ", file);
|
|
238
237
|
// const url = URL.createObjectURL(file);
|
|
239
|
-
// console.log("mock upload api :>> ", url);
|
|
240
238
|
// return Promise.resolve(url);
|
|
241
239
|
// },
|
|
242
240
|
upload(file: File) {
|
package/utils/camera-wall.ts
CHANGED
|
@@ -101,6 +101,21 @@ export function wallLayout(key: string | undefined) {
|
|
|
101
101
|
return WALL_LAYOUTS.find((l) => l.key === key) ?? WALL_LAYOUTS[1];
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* The columns the wall actually draws, after the phone override.
|
|
106
|
+
*
|
|
107
|
+
* A phone rendering three columns of a nine-tile wall is the unusable case:
|
|
108
|
+
* each tile shrinks past the point its status text — or the picture itself —
|
|
109
|
+
* is legible. So on a phone the wall always draws one column, whatever layout
|
|
110
|
+
* button is selected; the button still means "this many tiles", it stops
|
|
111
|
+
* meaning "this many columns" below the phone breakpoint. Tablet and desktop
|
|
112
|
+
* are untouched — `isPhone` is the caller's own `smAndDown` (or equivalent),
|
|
113
|
+
* this file has no notion of viewport width itself.
|
|
114
|
+
*/
|
|
115
|
+
export function wallColumns(key: string | undefined, isPhone = false): number {
|
|
116
|
+
return isPhone ? 1 : wallLayout(key).columns;
|
|
117
|
+
}
|
|
118
|
+
|
|
104
119
|
/**
|
|
105
120
|
* At three columns a tile is small enough that the chrome starts eating the
|
|
106
121
|
* picture, so the type shrinks and the recorder line loses its timestamp.
|
|
@@ -111,9 +126,12 @@ export function wallLayout(key: string | undefined) {
|
|
|
111
126
|
* from furthest away and the one where a camera is most likely to be missed.
|
|
112
127
|
* Whether a camera is alive is the tile's whole job; it is not the thing that
|
|
113
128
|
* gets cut for room.
|
|
129
|
+
*
|
|
130
|
+
* A phone forced to one column (see `wallColumns`) is never dense — a single
|
|
131
|
+
* full-width tile is the opposite problem.
|
|
114
132
|
*/
|
|
115
|
-
export function isDenseLayout(key: string | undefined) {
|
|
116
|
-
return
|
|
133
|
+
export function isDenseLayout(key: string | undefined, isPhone = false) {
|
|
134
|
+
return wallColumns(key, isPhone) >= 3;
|
|
117
135
|
}
|
|
118
136
|
|
|
119
137
|
/* -------------------------------------------------------------------------- */
|
|
@@ -302,8 +320,13 @@ export function focusedCamera(
|
|
|
302
320
|
*
|
|
303
321
|
* Never more rows than the layout would have had, and never fewer than one.
|
|
304
322
|
*/
|
|
305
|
-
export function wallRows(
|
|
306
|
-
|
|
323
|
+
export function wallRows(
|
|
324
|
+
count: number,
|
|
325
|
+
layoutKey: string | undefined,
|
|
326
|
+
isPhone = false
|
|
327
|
+
): number {
|
|
328
|
+
const { tiles } = wallLayout(layoutKey);
|
|
329
|
+
const columns = wallColumns(layoutKey, isPhone);
|
|
307
330
|
const capped = Math.min(Math.max(0, Math.floor(count)), tiles);
|
|
308
331
|
return Math.min(Math.ceil(tiles / columns), Math.max(1, Math.ceil(capped / columns)));
|
|
309
332
|
}
|