adminforth 1.1.79 → 1.1.80
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/modules/codeInjector.js +51 -23
- package/dist/plugins/AuditLog/index.js +13 -0
- package/dist/plugins/AuditLog/types.js +1 -0
- package/dist/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
- package/dist/spa/index.html +1 -1
- package/dist/spa/package-lock.json +0 -111
- package/dist/spa/package.json +0 -1
- package/dist/spa/spa/src/App.vue +1 -1
- package/dist/spa/spa/src/components/MenuLink.vue +1 -1
- package/dist/spa/src/App.vue +133 -178
- package/dist/spa/src/components/MenuLink.vue +3 -3
- package/dist/spa/src/components/ResourceForm.vue +96 -96
- package/dist/spa/src/components/ResourceListTable.vue +84 -69
- package/dist/spa/src/components/ValueRenderer.vue +3 -2
- package/dist/spa/src/composables/useStores.ts +11 -24
- package/dist/spa/src/main.ts +1 -1
- package/dist/spa/src/router/index.ts +1 -0
- package/dist/spa/src/utils.ts +1 -1
- package/dist/spa/src/views/CreateView.vue +9 -1
- package/dist/spa/src/views/EditView.vue +9 -1
- package/dist/spa/src/views/ListView.vue +3 -12
- package/dist/spa/src/views/LoginView.vue +1 -6
- package/dist/spa/src/views/ResourceParent.vue +2 -1
- package/dist/spa/src/views/ShowView.vue +14 -6
- package/dist/spa/tailwind.config.js +1 -3
- package/modules/codeInjector.ts +56 -26
- package/package.json +1 -1
- package/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
- package/spa/src/App.vue +1 -1
- package/spa/src/components/MenuLink.vue +1 -1
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
- package/dist/spa/src/components/SkeleteLoader.vue +0 -23
- package/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert.d.ts +0 -1040
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/buffer.d.ts +0 -2363
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/child_process.d.ts +0 -1544
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/cluster.d.ts +0 -578
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/console.d.ts +0 -452
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/constants.d.ts +0 -19
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/crypto.d.ts +0 -4523
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dgram.d.ts +0 -596
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns.d.ts +0 -864
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dom-events.d.ts +0 -124
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/domain.d.ts +0 -170
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/events.d.ts +0 -931
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs/promises.d.ts +0 -1245
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs.d.ts +0 -4317
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.d.ts +0 -412
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.global.d.ts +0 -1
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http.d.ts +0 -1908
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http2.d.ts +0 -2418
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/https.d.ts +0 -550
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/index.d.ts +0 -89
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/inspector.d.ts +0 -2746
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/module.d.ts +0 -315
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/net.d.ts +0 -999
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/os.d.ts +0 -495
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/path.d.ts +0 -191
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/perf_hooks.d.ts +0 -905
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/process.d.ts +0 -1754
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/punycode.d.ts +0 -117
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/querystring.d.ts +0 -153
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline.d.ts +0 -540
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/repl.d.ts +0 -430
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/sea.d.ts +0 -153
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/web.d.ts +0 -367
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream.d.ts +0 -1707
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/test.d.ts +0 -1718
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers.d.ts +0 -240
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tls.d.ts +0 -1217
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/trace_events.d.ts +0 -197
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tty.d.ts +0 -208
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/url.d.ts +0 -952
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/util.d.ts +0 -2292
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/v8.d.ts +0 -808
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/vm.d.ts +0 -924
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/wasi.d.ts +0 -181
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/worker_threads.d.ts +0 -694
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/zlib.d.ts +0 -530
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/index.d.ts +0 -127
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.d.ts +0 -11
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.d.ts +0 -4
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.d.ts +0 -37
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.d.ts +0 -453
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/agent.d.ts +0 -31
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/api.d.ts +0 -43
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/balanced-pool.d.ts +0 -18
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cache.d.ts +0 -36
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/client.d.ts +0 -97
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/connector.d.ts +0 -34
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/content-type.d.ts +0 -21
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cookies.d.ts +0 -28
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/dispatcher.d.ts +0 -241
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/errors.d.ts +0 -128
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/fetch.d.ts +0 -209
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/file.d.ts +0 -39
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/filereader.d.ts +0 -54
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/formdata.d.ts +0 -108
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-origin.d.ts +0 -7
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/handlers.d.ts +0 -9
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/header.d.ts +0 -4
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/index.d.ts +0 -63
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/interceptors.d.ts +0 -5
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-client.d.ts +0 -25
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/patch.d.ts +0 -71
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool.d.ts +0 -28
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/proxy-agent.d.ts +0 -30
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/readable.d.ts +0 -61
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/webidl.d.ts +0 -220
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/websocket.d.ts +0 -131
|
@@ -202,7 +202,9 @@ class CodeInjector {
|
|
|
202
202
|
});
|
|
203
203
|
// copy whole custom directory
|
|
204
204
|
if ((_b = this.adminforth.config.customization) === null || _b === void 0 ? void 0 : _b.customComponentsDir) {
|
|
205
|
-
|
|
205
|
+
// resolve customComponentsDir to absolute path, so ./aa will be resolved to /path/to/current/dir/aa
|
|
206
|
+
const customCompAbsPath = path.resolve(this.adminforth.config.customization.customComponentsDir);
|
|
207
|
+
this.srcFoldersToSync[customCompAbsPath] = './';
|
|
206
208
|
}
|
|
207
209
|
// if this.adminforth.config.customization.favicon is set, copy it to assets
|
|
208
210
|
const customFav = (_c = this.adminforth.config.customization) === null || _c === void 0 ? void 0 : _c.favicon;
|
|
@@ -402,30 +404,32 @@ class CodeInjector {
|
|
|
402
404
|
const collectDirectories = (dir) => __awaiter(this, void 0, void 0, function* () {
|
|
403
405
|
const files = yield fs.promises.readdir(dir, { withFileTypes: true });
|
|
404
406
|
for (const file of files) {
|
|
405
|
-
if (
|
|
407
|
+
if (['node_modules', 'dist'].includes(file.name)) {
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
if (file.isDirectory()) {
|
|
406
411
|
directories.push(path.join(dir, file.name));
|
|
407
412
|
yield collectDirectories(path.join(dir, file.name));
|
|
408
413
|
}
|
|
409
414
|
}
|
|
410
415
|
});
|
|
411
416
|
yield collectDirectories(spaPath);
|
|
412
|
-
if (
|
|
417
|
+
if (process.env.HEAVY_DEBUG) {
|
|
413
418
|
console.log('🔎 Watching for changes in:', directories.join(','));
|
|
414
419
|
}
|
|
415
420
|
const watcher = filewatcher();
|
|
416
421
|
directories.forEach((dir) => {
|
|
417
422
|
watcher.add(dir);
|
|
418
423
|
});
|
|
419
|
-
watcher.on('change', (file) => __awaiter(this, void 0, void 0, function* () {
|
|
420
|
-
console.log(`File ${file} changed, preparing sources...`);
|
|
424
|
+
watcher.on('change', (file, x) => __awaiter(this, void 0, void 0, function* () {
|
|
425
|
+
console.log(`File ${file} changed ${x}, preparing sources...`);
|
|
421
426
|
yield this.prepareSources({ filesUpdated: [file.replace(spaPath + '/', '')] });
|
|
422
427
|
}));
|
|
423
428
|
this.allWatchers.push(watcher);
|
|
424
429
|
});
|
|
425
430
|
}
|
|
426
431
|
watchCustomComponentsForCopy(_a) {
|
|
427
|
-
return __awaiter(this, arguments, void 0, function* ({ verbose }) {
|
|
428
|
-
const customComponentsDir = this.adminforth.config.customization.customComponentsDir;
|
|
432
|
+
return __awaiter(this, arguments, void 0, function* ({ verbose, customComponentsDir, destination }) {
|
|
429
433
|
if (!customComponentsDir) {
|
|
430
434
|
return;
|
|
431
435
|
}
|
|
@@ -441,32 +445,48 @@ class CodeInjector {
|
|
|
441
445
|
}
|
|
442
446
|
// get all subdirs
|
|
443
447
|
const directories = [];
|
|
448
|
+
const files = [];
|
|
444
449
|
const collectDirectories = (dir) => __awaiter(this, void 0, void 0, function* () {
|
|
445
450
|
directories.push(dir);
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
|
|
451
|
+
const filesAndDirs = yield fs.promises.readdir(dir, { withFileTypes: true });
|
|
452
|
+
yield Promise.all(filesAndDirs.map((file) => __awaiter(this, void 0, void 0, function* () {
|
|
453
|
+
const isDir = fs.lstatSync(path.join(dir, file.name)).isDirectory();
|
|
454
|
+
if (isDir) {
|
|
449
455
|
yield collectDirectories(path.join(dir, file.name));
|
|
450
456
|
}
|
|
451
|
-
|
|
457
|
+
else {
|
|
458
|
+
files.push(path.join(dir, file.name));
|
|
459
|
+
}
|
|
460
|
+
})));
|
|
452
461
|
});
|
|
453
462
|
yield collectDirectories(customComponentsDir);
|
|
454
463
|
const watcher = filewatcher();
|
|
455
|
-
|
|
456
|
-
|
|
464
|
+
files.forEach((file) => {
|
|
465
|
+
process.env.HEAVY_DEBUG && console.log(`🔎 Watching for changes in file ${file}`);
|
|
466
|
+
watcher.add(file);
|
|
457
467
|
});
|
|
458
|
-
if (
|
|
468
|
+
if (process.env.HEAVY_DEBUG) {
|
|
459
469
|
console.log('🔎 Watching for changes in:', directories.join(','));
|
|
460
470
|
}
|
|
461
|
-
watcher.on('change', (
|
|
471
|
+
watcher.on('change', (fileOrDir) => __awaiter(this, void 0, void 0, function* () {
|
|
462
472
|
// copy one file
|
|
463
|
-
|
|
464
|
-
if (
|
|
465
|
-
console.log(`🔎
|
|
473
|
+
const relativeFilename = fileOrDir.replace(customComponentsDir + '/', '');
|
|
474
|
+
if (process.env.HEAVY_DEBUG) {
|
|
475
|
+
console.log(`🔎 fileOrDir ${fileOrDir} changed`);
|
|
476
|
+
console.log(`🔎 relativeFilename ${relativeFilename}`);
|
|
477
|
+
console.log(`🔎 customComponentsDir ${customComponentsDir}`);
|
|
478
|
+
console.log(`🔎 destination ${destination}`);
|
|
479
|
+
}
|
|
480
|
+
const isFile = fs.lstatSync(fileOrDir).isFile();
|
|
481
|
+
if (isFile) {
|
|
482
|
+
const destPath = path.join(CodeInjector.SPA_TMP_PATH, 'src', 'custom', destination, relativeFilename);
|
|
483
|
+
process.env.HEAVY_DEBUG && console.log(`🔎 Copying file ${fileOrDir} to ${destPath}`);
|
|
484
|
+
yield fsExtra.copy(fileOrDir, destPath);
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
// for now do nothing
|
|
466
489
|
}
|
|
467
|
-
yield fsExtra.copy(this.adminforth.config.customization.customComponentsDir, path.join(CodeInjector.SPA_TMP_PATH, 'src', 'custom'), {
|
|
468
|
-
recursive: true,
|
|
469
|
-
});
|
|
470
490
|
}));
|
|
471
491
|
this.allWatchers.push(watcher);
|
|
472
492
|
});
|
|
@@ -476,8 +496,16 @@ class CodeInjector {
|
|
|
476
496
|
this.adminforth.runningHotReload = hotReload;
|
|
477
497
|
yield this.prepareSources({ verbose });
|
|
478
498
|
if (hotReload) {
|
|
479
|
-
yield
|
|
480
|
-
|
|
499
|
+
yield Promise.all([
|
|
500
|
+
this.watchForReprepare({ verbose }),
|
|
501
|
+
...Object.entries(this.srcFoldersToSync).map((_b) => __awaiter(this, [_b], void 0, function* ([src, dest]) {
|
|
502
|
+
yield this.watchCustomComponentsForCopy({
|
|
503
|
+
verbose,
|
|
504
|
+
customComponentsDir: src,
|
|
505
|
+
destination: dest,
|
|
506
|
+
});
|
|
507
|
+
})),
|
|
508
|
+
]);
|
|
481
509
|
}
|
|
482
510
|
console.log('AdminForth bundling');
|
|
483
511
|
const cwd = CodeInjector.SPA_TMP_PATH;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import AdminForthPlugin from "../base.js";
|
|
2
|
+
class AuditLogPlugin extends AdminForthPlugin {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
super(options, import.meta.url);
|
|
5
|
+
this.options = options;
|
|
6
|
+
}
|
|
7
|
+
modifyResourceConfig(adminforth, resourceConfig) {
|
|
8
|
+
super.modifyResourceConfig(adminforth, resourceConfig);
|
|
9
|
+
this.adminforth = adminforth;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
AuditLogPlugin.defaultError = 'Sorry, you do not have access to this resource.';
|
|
13
|
+
export default AuditLogPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
<script setup>
|
|
28
28
|
import { computed, ref } from 'vue'
|
|
29
|
+
import { callAdminForthApi } from '@/utils'
|
|
29
30
|
|
|
30
31
|
const props = defineProps({
|
|
31
32
|
meta: String
|
|
@@ -111,7 +112,9 @@ const onFileChange = async (e) => {
|
|
|
111
112
|
method: 'POST',
|
|
112
113
|
body: {
|
|
113
114
|
originalFilename: name,
|
|
114
|
-
contentType
|
|
115
|
+
contentType: type,
|
|
116
|
+
size,
|
|
117
|
+
originalExtension: extension,
|
|
115
118
|
},
|
|
116
119
|
});
|
|
117
120
|
}
|
package/dist/spa/index.html
CHANGED
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"unhead": "^1.9.12",
|
|
20
20
|
"uuid": "^10.0.0",
|
|
21
21
|
"vue": "^3.4.21",
|
|
22
|
-
"vue-diff": "^1.2.4",
|
|
23
22
|
"vue-router": "^4.3.0",
|
|
24
23
|
"vue-slider-component": "^4.1.0-beta.7"
|
|
25
24
|
},
|
|
@@ -1903,11 +1902,6 @@
|
|
|
1903
1902
|
"integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==",
|
|
1904
1903
|
"dev": true
|
|
1905
1904
|
},
|
|
1906
|
-
"node_modules/diff-match-patch": {
|
|
1907
|
-
"version": "1.0.5",
|
|
1908
|
-
"resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.5.tgz",
|
|
1909
|
-
"integrity": "sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw=="
|
|
1910
|
-
},
|
|
1911
1905
|
"node_modules/dir-glob": {
|
|
1912
1906
|
"version": "3.0.1",
|
|
1913
1907
|
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
|
@@ -2532,14 +2526,6 @@
|
|
|
2532
2526
|
"he": "bin/he"
|
|
2533
2527
|
}
|
|
2534
2528
|
},
|
|
2535
|
-
"node_modules/highlight.js": {
|
|
2536
|
-
"version": "11.9.0",
|
|
2537
|
-
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.9.0.tgz",
|
|
2538
|
-
"integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==",
|
|
2539
|
-
"engines": {
|
|
2540
|
-
"node": ">=12.0.0"
|
|
2541
|
-
}
|
|
2542
|
-
},
|
|
2543
2529
|
"node_modules/hookable": {
|
|
2544
2530
|
"version": "5.5.3",
|
|
2545
2531
|
"resolved": "https://registry.npmjs.org/hookable/-/hookable-5.5.3.tgz",
|
|
@@ -4134,103 +4120,6 @@
|
|
|
4134
4120
|
}
|
|
4135
4121
|
}
|
|
4136
4122
|
},
|
|
4137
|
-
"node_modules/vue-diff": {
|
|
4138
|
-
"version": "1.2.4",
|
|
4139
|
-
"resolved": "https://registry.npmjs.org/vue-diff/-/vue-diff-1.2.4.tgz",
|
|
4140
|
-
"integrity": "sha512-9z+0uPHigi/DdE3Zhdg1zR3VkiBaDN4czjWa/Zznvizn4znckVqz20p1KytaWq5NJtJ7UnkqRbuWsaCuC1ZHaA==",
|
|
4141
|
-
"dependencies": {
|
|
4142
|
-
"@vueuse/core": "^8.3.1",
|
|
4143
|
-
"diff-match-patch": "^1.0.5",
|
|
4144
|
-
"highlight.js": "^11.5.1"
|
|
4145
|
-
}
|
|
4146
|
-
},
|
|
4147
|
-
"node_modules/vue-diff/node_modules/@types/web-bluetooth": {
|
|
4148
|
-
"version": "0.0.14",
|
|
4149
|
-
"resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.14.tgz",
|
|
4150
|
-
"integrity": "sha512-5d2RhCard1nQUC3aHcq/gHzWYO6K0WJmAbjO7mQJgCQKtZpgXxv1rOM6O/dBDhDYYVutk1sciOgNSe+5YyfM8A=="
|
|
4151
|
-
},
|
|
4152
|
-
"node_modules/vue-diff/node_modules/@vueuse/core": {
|
|
4153
|
-
"version": "8.9.4",
|
|
4154
|
-
"resolved": "https://registry.npmjs.org/@vueuse/core/-/core-8.9.4.tgz",
|
|
4155
|
-
"integrity": "sha512-B/Mdj9TK1peFyWaPof+Zf/mP9XuGAngaJZBwPaXBvU3aCTZlx3ltlrFFFyMV4iGBwsjSCeUCgZrtkEj9dS2Y3Q==",
|
|
4156
|
-
"dependencies": {
|
|
4157
|
-
"@types/web-bluetooth": "^0.0.14",
|
|
4158
|
-
"@vueuse/metadata": "8.9.4",
|
|
4159
|
-
"@vueuse/shared": "8.9.4",
|
|
4160
|
-
"vue-demi": "*"
|
|
4161
|
-
},
|
|
4162
|
-
"funding": {
|
|
4163
|
-
"url": "https://github.com/sponsors/antfu"
|
|
4164
|
-
},
|
|
4165
|
-
"peerDependencies": {
|
|
4166
|
-
"@vue/composition-api": "^1.1.0",
|
|
4167
|
-
"vue": "^2.6.0 || ^3.2.0"
|
|
4168
|
-
},
|
|
4169
|
-
"peerDependenciesMeta": {
|
|
4170
|
-
"@vue/composition-api": {
|
|
4171
|
-
"optional": true
|
|
4172
|
-
},
|
|
4173
|
-
"vue": {
|
|
4174
|
-
"optional": true
|
|
4175
|
-
}
|
|
4176
|
-
}
|
|
4177
|
-
},
|
|
4178
|
-
"node_modules/vue-diff/node_modules/@vueuse/metadata": {
|
|
4179
|
-
"version": "8.9.4",
|
|
4180
|
-
"resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-8.9.4.tgz",
|
|
4181
|
-
"integrity": "sha512-IwSfzH80bnJMzqhaapqJl9JRIiyQU0zsRGEgnxN6jhq7992cPUJIRfV+JHRIZXjYqbwt07E1gTEp0R0zPJ1aqw==",
|
|
4182
|
-
"funding": {
|
|
4183
|
-
"url": "https://github.com/sponsors/antfu"
|
|
4184
|
-
}
|
|
4185
|
-
},
|
|
4186
|
-
"node_modules/vue-diff/node_modules/@vueuse/shared": {
|
|
4187
|
-
"version": "8.9.4",
|
|
4188
|
-
"resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-8.9.4.tgz",
|
|
4189
|
-
"integrity": "sha512-wt+T30c4K6dGRMVqPddexEVLa28YwxW5OFIPmzUHICjphfAuBFTTdDoyqREZNDOFJZ44ARH1WWQNCUK8koJ+Ag==",
|
|
4190
|
-
"dependencies": {
|
|
4191
|
-
"vue-demi": "*"
|
|
4192
|
-
},
|
|
4193
|
-
"funding": {
|
|
4194
|
-
"url": "https://github.com/sponsors/antfu"
|
|
4195
|
-
},
|
|
4196
|
-
"peerDependencies": {
|
|
4197
|
-
"@vue/composition-api": "^1.1.0",
|
|
4198
|
-
"vue": "^2.6.0 || ^3.2.0"
|
|
4199
|
-
},
|
|
4200
|
-
"peerDependenciesMeta": {
|
|
4201
|
-
"@vue/composition-api": {
|
|
4202
|
-
"optional": true
|
|
4203
|
-
},
|
|
4204
|
-
"vue": {
|
|
4205
|
-
"optional": true
|
|
4206
|
-
}
|
|
4207
|
-
}
|
|
4208
|
-
},
|
|
4209
|
-
"node_modules/vue-diff/node_modules/vue-demi": {
|
|
4210
|
-
"version": "0.14.8",
|
|
4211
|
-
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.8.tgz",
|
|
4212
|
-
"integrity": "sha512-Uuqnk9YE9SsWeReYqK2alDI5YzciATE0r2SkA6iMAtuXvNTMNACJLJEXNXaEy94ECuBe4Sk6RzRU80kjdbIo1Q==",
|
|
4213
|
-
"hasInstallScript": true,
|
|
4214
|
-
"bin": {
|
|
4215
|
-
"vue-demi-fix": "bin/vue-demi-fix.js",
|
|
4216
|
-
"vue-demi-switch": "bin/vue-demi-switch.js"
|
|
4217
|
-
},
|
|
4218
|
-
"engines": {
|
|
4219
|
-
"node": ">=12"
|
|
4220
|
-
},
|
|
4221
|
-
"funding": {
|
|
4222
|
-
"url": "https://github.com/sponsors/antfu"
|
|
4223
|
-
},
|
|
4224
|
-
"peerDependencies": {
|
|
4225
|
-
"@vue/composition-api": "^1.0.0-rc.1",
|
|
4226
|
-
"vue": "^3.0.0-0 || ^2.6.0"
|
|
4227
|
-
},
|
|
4228
|
-
"peerDependenciesMeta": {
|
|
4229
|
-
"@vue/composition-api": {
|
|
4230
|
-
"optional": true
|
|
4231
|
-
}
|
|
4232
|
-
}
|
|
4233
|
-
},
|
|
4234
4123
|
"node_modules/vue-eslint-parser": {
|
|
4235
4124
|
"version": "9.4.2",
|
|
4236
4125
|
"resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.4.2.tgz",
|
package/dist/spa/package.json
CHANGED
package/dist/spa/spa/src/App.vue
CHANGED
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
:aria-controls="`dropdown-example${i}`"
|
|
85
85
|
:data-collapse-toggle="`dropdown-example${i}`"
|
|
86
86
|
>
|
|
87
|
-
<component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-lightSidebarIcons group-hover:text-lightSidebarIconsHover transition duration-75
|
|
87
|
+
<component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-lightSidebarIcons group-hover:text-lightSidebarIconsHover transition duration-75 dark:group-hover:text-darkSidebarIconsHover dark:text-darkSidebarIcons" ></component>
|
|
88
88
|
|
|
89
89
|
<span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">{{ item.label }}</span>
|
|
90
90
|
<svg :class="{'rotate-180': opened.includes(i) }" class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:class="{
|
|
6
6
|
'px-4': isChild,
|
|
7
7
|
'px-2': !isChild,
|
|
8
|
-
'bg-
|
|
8
|
+
'bg-sidebarActive dark:bg-gray-700': item.resourceId ?
|
|
9
9
|
($route.params.resourceId === item.resourceId && $route.name === 'resource-list') :
|
|
10
10
|
($route.name === item.path)
|
|
11
11
|
}"
|