@hostlink/nuxt-light 1.71.0 → 1.73.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/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -254,12 +254,19 @@ export default defineNuxtPlugin(() => {
|
|
|
254
254
|
// Allow the page to override the required permission via definePageMeta({ permission: '...' })
|
|
255
255
|
let right = to.meta.permission;
|
|
256
256
|
if (!right) {
|
|
257
|
+
// Convert PascalCase/camelCase folder names (e.g. "EventLog") to snake_case
|
|
258
|
+
// so that "/EventLog/:id/view" becomes "event_log.view" instead of "eventlog.view".
|
|
259
|
+
const toSnakeCase = (str) =>
|
|
260
|
+
str
|
|
261
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2")
|
|
262
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1_$2")
|
|
263
|
+
.toLowerCase();
|
|
257
264
|
const segments = to.path
|
|
258
265
|
.replace(/\\/+$/, "")
|
|
259
266
|
.split("/")
|
|
260
267
|
.filter(Boolean)
|
|
261
268
|
.filter((segment) => !segment.startsWith(":") && !/^\\d+$/.test(segment))
|
|
262
|
-
.map((segment) => segment
|
|
269
|
+
.map((segment) => toSnakeCase(segment));
|
|
263
270
|
right = segments.join(".");
|
|
264
271
|
// If the matched route (or any nested match) is an index.vue
|
|
265
272
|
// leaf, treat the URL as a folder-index page and append .index.
|
|
@@ -280,9 +280,28 @@ const onRenameNode = (node) => {
|
|
|
280
280
|
};
|
|
281
281
|
const openUploadDialog = () => {
|
|
282
282
|
showUploadFilesDialog(selectedLocation.value).onOk((files2) => {
|
|
283
|
-
loadItems()
|
|
283
|
+
loadItems().then(() => {
|
|
284
|
+
selectUploadedFiles(files2);
|
|
285
|
+
});
|
|
284
286
|
});
|
|
285
287
|
};
|
|
288
|
+
const selectUploadedFiles = (uploadedFiles) => {
|
|
289
|
+
if (!uploadedFiles || uploadedFiles.length === 0) return;
|
|
290
|
+
const uploadedNames = new Set(
|
|
291
|
+
uploadedFiles.map((f) => f && f.name ? f.name : null).filter(Boolean)
|
|
292
|
+
);
|
|
293
|
+
if (uploadedNames.size === 0) return;
|
|
294
|
+
const matches = files.value.filter((f) => f && f.name && uploadedNames.has(f.name));
|
|
295
|
+
if (matches.length === 0) return;
|
|
296
|
+
const existingLocs = new Set(selected.value.map((s) => s.location));
|
|
297
|
+
const merged = [...selected.value];
|
|
298
|
+
for (const m of matches) {
|
|
299
|
+
if (!existingLocs.has(m.location)) {
|
|
300
|
+
merged.push(m);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
selected.value = merged;
|
|
304
|
+
};
|
|
286
305
|
const preview = ref(null);
|
|
287
306
|
const moveToFolder = async (folder) => {
|
|
288
307
|
try {
|
|
@@ -439,7 +458,9 @@ const onDrop = (event) => {
|
|
|
439
458
|
if (files2.length > 0) {
|
|
440
459
|
const fileList = Array.from(files2);
|
|
441
460
|
showUploadFilesDialog(selectedLocation.value, fileList).onOk((uploadedFiles) => {
|
|
442
|
-
loadItems()
|
|
461
|
+
loadItems().then(() => {
|
|
462
|
+
selectUploadedFiles(uploadedFiles);
|
|
463
|
+
});
|
|
443
464
|
});
|
|
444
465
|
}
|
|
445
466
|
dragzone.value.style.border = "none";
|
|
@@ -549,7 +570,7 @@ const getFileIcon = (file) => {
|
|
|
549
570
|
</q-drawer>
|
|
550
571
|
|
|
551
572
|
<q-page-container :style="{ height }">
|
|
552
|
-
<div @drop="onDrop" @dragover="onDragover" ref="dragzone" @dragleave="onDragLeave" style="height: 100%;">
|
|
573
|
+
<div @drop="onDrop" @dragover="onDragover" ref="dragzone" @dragleave="onDragLeave" style="height: 100%; display: flex; flex-direction: column; overflow: hidden;">
|
|
553
574
|
|
|
554
575
|
<q-dialog v-model="showPreviewImgDialog" full-width full-height auto-close>
|
|
555
576
|
<q-card>
|
|
@@ -583,6 +604,7 @@ const getFileIcon = (file) => {
|
|
|
583
604
|
</q-btn>
|
|
584
605
|
</q-toolbar>
|
|
585
606
|
|
|
607
|
+
<div class="file-list-scroll" style="flex: 1 1 auto; overflow-y: auto; min-height: 0;">
|
|
586
608
|
<template v-if="grid">
|
|
587
609
|
<q-table :title="$t('Folders')" flat grid :columns="columns" :rows="folders" hide-pagination
|
|
588
610
|
:pagination="{ rowsPerPage: 0 }" row-key="location">
|
|
@@ -713,6 +735,7 @@ const getFileIcon = (file) => {
|
|
|
713
735
|
</template>
|
|
714
736
|
</q-table>
|
|
715
737
|
</template>
|
|
738
|
+
</div>
|
|
716
739
|
</div>
|
|
717
740
|
</q-page-container>
|
|
718
741
|
</q-layout>
|
|
@@ -48,11 +48,11 @@ const reset2fa = async () => {
|
|
|
48
48
|
<l-user-overview :id="id" />
|
|
49
49
|
</l-tab>
|
|
50
50
|
<l-tab name="userlog" icon="sym_o_description" :label="$t('User log')"
|
|
51
|
-
v-if="$light.isGranted('
|
|
51
|
+
v-if="$light.isGranted('user_log.list')">
|
|
52
52
|
<l-user-userlog :id="id" />
|
|
53
53
|
</l-tab>
|
|
54
54
|
<l-tab name="eventlog" icon="sym_o_description" :label="$t('Event log')"
|
|
55
|
-
v-if="$light.isGranted('
|
|
55
|
+
v-if="$light.isGranted('event_log.list')">
|
|
56
56
|
<l-user-eventlog :id="id" />
|
|
57
57
|
</l-tab>
|
|
58
58
|
</l-tabs>
|