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.
Files changed (210) hide show
  1. package/dist/modules/codeInjector.js +51 -23
  2. package/dist/plugins/AuditLog/index.js +13 -0
  3. package/dist/plugins/AuditLog/types.js +1 -0
  4. package/dist/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
  5. package/dist/spa/index.html +1 -1
  6. package/dist/spa/package-lock.json +0 -111
  7. package/dist/spa/package.json +0 -1
  8. package/dist/spa/spa/src/App.vue +1 -1
  9. package/dist/spa/spa/src/components/MenuLink.vue +1 -1
  10. package/dist/spa/src/App.vue +133 -178
  11. package/dist/spa/src/components/MenuLink.vue +3 -3
  12. package/dist/spa/src/components/ResourceForm.vue +96 -96
  13. package/dist/spa/src/components/ResourceListTable.vue +84 -69
  14. package/dist/spa/src/components/ValueRenderer.vue +3 -2
  15. package/dist/spa/src/composables/useStores.ts +11 -24
  16. package/dist/spa/src/main.ts +1 -1
  17. package/dist/spa/src/router/index.ts +1 -0
  18. package/dist/spa/src/utils.ts +1 -1
  19. package/dist/spa/src/views/CreateView.vue +9 -1
  20. package/dist/spa/src/views/EditView.vue +9 -1
  21. package/dist/spa/src/views/ListView.vue +3 -12
  22. package/dist/spa/src/views/LoginView.vue +1 -6
  23. package/dist/spa/src/views/ResourceParent.vue +2 -1
  24. package/dist/spa/src/views/ShowView.vue +14 -6
  25. package/dist/spa/tailwind.config.js +1 -3
  26. package/modules/codeInjector.ts +56 -26
  27. package/package.json +1 -1
  28. package/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
  29. package/spa/src/App.vue +1 -1
  30. package/spa/src/components/MenuLink.vue +1 -1
  31. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
  32. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
  33. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
  34. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
  35. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
  36. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
  37. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
  38. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
  39. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
  40. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
  41. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
  42. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
  43. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
  44. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
  45. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
  46. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
  47. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
  48. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
  49. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
  50. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
  51. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
  52. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
  53. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
  54. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
  55. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
  56. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
  57. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
  58. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
  59. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
  60. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
  61. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
  62. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
  63. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
  64. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
  65. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
  66. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
  67. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
  68. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
  69. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
  70. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
  71. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
  72. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
  73. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
  74. package/dist/spa/src/components/SkeleteLoader.vue +0 -23
  75. package/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
  76. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
  77. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
  78. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert/strict.d.ts +0 -8
  79. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert.d.ts +0 -1040
  80. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/async_hooks.d.ts +0 -541
  81. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/buffer.d.ts +0 -2363
  82. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/child_process.d.ts +0 -1544
  83. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/cluster.d.ts +0 -578
  84. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/console.d.ts +0 -452
  85. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/constants.d.ts +0 -19
  86. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/crypto.d.ts +0 -4523
  87. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dgram.d.ts +0 -596
  88. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  89. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns/promises.d.ts +0 -476
  90. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns.d.ts +0 -864
  91. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dom-events.d.ts +0 -124
  92. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/domain.d.ts +0 -170
  93. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/events.d.ts +0 -931
  94. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs/promises.d.ts +0 -1245
  95. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs.d.ts +0 -4317
  96. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.d.ts +0 -412
  97. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.global.d.ts +0 -1
  98. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http.d.ts +0 -1908
  99. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http2.d.ts +0 -2418
  100. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/https.d.ts +0 -550
  101. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/index.d.ts +0 -89
  102. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/inspector.d.ts +0 -2746
  103. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/module.d.ts +0 -315
  104. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/net.d.ts +0 -999
  105. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/os.d.ts +0 -495
  106. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
  107. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/path.d.ts +0 -191
  108. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/perf_hooks.d.ts +0 -905
  109. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/process.d.ts +0 -1754
  110. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/punycode.d.ts +0 -117
  111. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/querystring.d.ts +0 -153
  112. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline/promises.d.ts +0 -150
  113. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline.d.ts +0 -540
  114. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/repl.d.ts +0 -430
  115. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/sea.d.ts +0 -153
  116. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/consumers.d.ts +0 -12
  117. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/promises.d.ts +0 -83
  118. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/web.d.ts +0 -367
  119. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream.d.ts +0 -1707
  120. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/string_decoder.d.ts +0 -67
  121. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/test.d.ts +0 -1718
  122. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers/promises.d.ts +0 -97
  123. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers.d.ts +0 -240
  124. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tls.d.ts +0 -1217
  125. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/trace_events.d.ts +0 -197
  126. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tty.d.ts +0 -208
  127. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/url.d.ts +0 -952
  128. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/util.d.ts +0 -2292
  129. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/v8.d.ts +0 -808
  130. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/vm.d.ts +0 -924
  131. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/wasi.d.ts +0 -181
  132. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/worker_threads.d.ts +0 -694
  133. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/zlib.d.ts +0 -530
  134. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
  135. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
  136. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/index.d.ts +0 -127
  137. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
  138. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
  139. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
  140. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.d.ts +0 -11
  141. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
  142. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.d.ts +0 -4
  143. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
  144. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
  145. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
  146. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
  147. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
  148. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
  149. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
  150. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
  151. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
  152. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
  153. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
  154. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
  155. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
  156. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
  157. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
  158. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
  159. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
  160. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
  161. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
  162. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
  163. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
  164. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
  165. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
  166. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.d.ts +0 -37
  167. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
  168. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
  169. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
  170. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.d.ts +0 -453
  171. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
  172. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
  173. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
  174. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
  175. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
  176. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
  177. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/agent.d.ts +0 -31
  178. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/api.d.ts +0 -43
  179. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/balanced-pool.d.ts +0 -18
  180. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cache.d.ts +0 -36
  181. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/client.d.ts +0 -97
  182. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/connector.d.ts +0 -34
  183. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/content-type.d.ts +0 -21
  184. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cookies.d.ts +0 -28
  185. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
  186. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/dispatcher.d.ts +0 -241
  187. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/errors.d.ts +0 -128
  188. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/fetch.d.ts +0 -209
  189. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/file.d.ts +0 -39
  190. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/filereader.d.ts +0 -54
  191. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/formdata.d.ts +0 -108
  192. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  193. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-origin.d.ts +0 -7
  194. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/handlers.d.ts +0 -9
  195. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/header.d.ts +0 -4
  196. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/index.d.ts +0 -63
  197. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/interceptors.d.ts +0 -5
  198. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-agent.d.ts +0 -50
  199. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-client.d.ts +0 -25
  200. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-errors.d.ts +0 -12
  201. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  202. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-pool.d.ts +0 -25
  203. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
  204. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/patch.d.ts +0 -71
  205. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool-stats.d.ts +0 -19
  206. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool.d.ts +0 -28
  207. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/proxy-agent.d.ts +0 -30
  208. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/readable.d.ts +0 -61
  209. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/webidl.d.ts +0 -220
  210. 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
- this.srcFoldersToSync[this.adminforth.config.customization.customComponentsDir] = './';
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 (file.isDirectory() && ['node_modules', 'dist'].indexOf(file.name) === -1) {
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 (verbose) {
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 files = yield fs.promises.readdir(dir, { withFileTypes: true });
447
- for (const file of files) {
448
- if (file.isDirectory()) {
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
- directories.forEach((dir) => {
456
- watcher.add(dir);
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 (verbose) {
468
+ if (process.env.HEAVY_DEBUG) {
459
469
  console.log('🔎 Watching for changes in:', directories.join(','));
460
470
  }
461
- watcher.on('change', (file) => __awaiter(this, void 0, void 0, function* () {
471
+ watcher.on('change', (fileOrDir) => __awaiter(this, void 0, void 0, function* () {
462
472
  // copy one file
463
- // TODO: non optimal, copy only changed file, test on both nested and parent dir
464
- if (verbose) {
465
- console.log(`🔎 File ${file} changed, copying to spa_tmp...`);
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 this.watchForReprepare({ verbose });
480
- yield this.watchCustomComponentsForCopy({ verbose });
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, size, originalExtension
115
+ contentType: type,
116
+ size,
117
+ originalExtension: extension,
115
118
  },
116
119
  });
117
120
  }
@@ -17,7 +17,7 @@
17
17
 
18
18
  </head>
19
19
  <body class=" ">
20
- <div id="app" class="min-h-screen bg-lightHtml dark:bg-darkHtml"></div>
20
+ <div id="app" class="min-h-screen bg-html-bg dark:bg-gray-800"></div>
21
21
  <script type="module" src="/src/main.ts"></script>
22
22
  </body>
23
23
  </html>
@@ -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",
@@ -23,7 +23,6 @@
23
23
  "unhead": "^1.9.12",
24
24
  "uuid": "^10.0.0",
25
25
  "vue": "^3.4.21",
26
- "vue-diff": "^1.2.4",
27
26
  "vue-router": "^4.3.0",
28
27
  "vue-slider-component": "^4.1.0-beta.7"
29
28
  },
@@ -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 active: dark:group-hover:text-darkSidebarIconsHover dark:text-darkSidebarIcons" ></component>
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-lightSidebarItemActive dark:bg-darkSidebarItemActive': item.resourceId ?
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
  }"