adminforth 1.1.78 → 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 (206) 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/src/App.vue +133 -178
  9. package/dist/spa/src/components/MenuLink.vue +3 -3
  10. package/dist/spa/src/components/ResourceForm.vue +96 -96
  11. package/dist/spa/src/components/ResourceListTable.vue +84 -69
  12. package/dist/spa/src/components/ValueRenderer.vue +3 -2
  13. package/dist/spa/src/composables/useStores.ts +11 -24
  14. package/dist/spa/src/main.ts +1 -1
  15. package/dist/spa/src/router/index.ts +1 -0
  16. package/dist/spa/src/utils.ts +1 -1
  17. package/dist/spa/src/views/CreateView.vue +9 -1
  18. package/dist/spa/src/views/EditView.vue +9 -1
  19. package/dist/spa/src/views/ListView.vue +3 -12
  20. package/dist/spa/src/views/LoginView.vue +1 -6
  21. package/dist/spa/src/views/ResourceParent.vue +2 -1
  22. package/dist/spa/src/views/ShowView.vue +14 -6
  23. package/dist/spa/tailwind.config.js +1 -3
  24. package/modules/codeInjector.ts +56 -26
  25. package/package.json +1 -1
  26. package/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
  27. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
  28. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
  29. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
  30. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
  31. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
  32. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
  33. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
  34. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
  35. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
  36. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
  37. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
  38. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
  39. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
  40. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
  41. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
  42. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
  43. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
  44. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
  45. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
  46. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
  47. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
  48. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
  49. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
  50. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
  51. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
  52. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
  53. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
  54. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
  55. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
  56. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
  57. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
  58. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
  59. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
  60. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
  61. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
  62. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
  63. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
  64. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
  65. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
  66. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
  67. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
  68. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
  69. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
  70. package/dist/spa/src/components/SkeleteLoader.vue +0 -23
  71. package/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
  72. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
  73. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
  74. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert/strict.d.ts +0 -8
  75. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert.d.ts +0 -1040
  76. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/async_hooks.d.ts +0 -541
  77. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/buffer.d.ts +0 -2363
  78. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/child_process.d.ts +0 -1544
  79. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/cluster.d.ts +0 -578
  80. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/console.d.ts +0 -452
  81. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/constants.d.ts +0 -19
  82. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/crypto.d.ts +0 -4523
  83. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dgram.d.ts +0 -596
  84. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  85. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns/promises.d.ts +0 -476
  86. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns.d.ts +0 -864
  87. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dom-events.d.ts +0 -124
  88. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/domain.d.ts +0 -170
  89. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/events.d.ts +0 -931
  90. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs/promises.d.ts +0 -1245
  91. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs.d.ts +0 -4317
  92. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.d.ts +0 -412
  93. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.global.d.ts +0 -1
  94. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http.d.ts +0 -1908
  95. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http2.d.ts +0 -2418
  96. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/https.d.ts +0 -550
  97. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/index.d.ts +0 -89
  98. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/inspector.d.ts +0 -2746
  99. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/module.d.ts +0 -315
  100. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/net.d.ts +0 -999
  101. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/os.d.ts +0 -495
  102. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
  103. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/path.d.ts +0 -191
  104. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/perf_hooks.d.ts +0 -905
  105. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/process.d.ts +0 -1754
  106. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/punycode.d.ts +0 -117
  107. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/querystring.d.ts +0 -153
  108. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline/promises.d.ts +0 -150
  109. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline.d.ts +0 -540
  110. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/repl.d.ts +0 -430
  111. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/sea.d.ts +0 -153
  112. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/consumers.d.ts +0 -12
  113. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/promises.d.ts +0 -83
  114. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/web.d.ts +0 -367
  115. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream.d.ts +0 -1707
  116. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/string_decoder.d.ts +0 -67
  117. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/test.d.ts +0 -1718
  118. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers/promises.d.ts +0 -97
  119. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers.d.ts +0 -240
  120. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tls.d.ts +0 -1217
  121. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/trace_events.d.ts +0 -197
  122. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tty.d.ts +0 -208
  123. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/url.d.ts +0 -952
  124. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/util.d.ts +0 -2292
  125. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/v8.d.ts +0 -808
  126. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/vm.d.ts +0 -924
  127. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/wasi.d.ts +0 -181
  128. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/worker_threads.d.ts +0 -694
  129. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/zlib.d.ts +0 -530
  130. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
  131. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
  132. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/index.d.ts +0 -127
  133. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
  134. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
  135. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
  136. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.d.ts +0 -11
  137. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
  138. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.d.ts +0 -4
  139. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
  140. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
  141. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
  142. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
  143. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
  144. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
  145. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
  146. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
  147. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
  148. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
  149. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
  150. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
  151. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
  152. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
  153. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
  154. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
  155. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
  156. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
  157. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
  158. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
  159. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
  160. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
  161. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
  162. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.d.ts +0 -37
  163. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
  164. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
  165. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
  166. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.d.ts +0 -453
  167. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
  168. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
  169. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
  170. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
  171. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
  172. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
  173. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/agent.d.ts +0 -31
  174. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/api.d.ts +0 -43
  175. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/balanced-pool.d.ts +0 -18
  176. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cache.d.ts +0 -36
  177. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/client.d.ts +0 -97
  178. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/connector.d.ts +0 -34
  179. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/content-type.d.ts +0 -21
  180. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cookies.d.ts +0 -28
  181. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
  182. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/dispatcher.d.ts +0 -241
  183. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/errors.d.ts +0 -128
  184. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/fetch.d.ts +0 -209
  185. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/file.d.ts +0 -39
  186. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/filereader.d.ts +0 -54
  187. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/formdata.d.ts +0 -108
  188. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  189. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-origin.d.ts +0 -7
  190. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/handlers.d.ts +0 -9
  191. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/header.d.ts +0 -4
  192. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/index.d.ts +0 -63
  193. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/interceptors.d.ts +0 -5
  194. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-agent.d.ts +0 -50
  195. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-client.d.ts +0 -25
  196. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-errors.d.ts +0 -12
  197. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  198. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-pool.d.ts +0 -25
  199. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
  200. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/patch.d.ts +0 -71
  201. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool-stats.d.ts +0 -19
  202. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool.d.ts +0 -28
  203. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/proxy-agent.d.ts +0 -30
  204. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/readable.d.ts +0 -61
  205. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/webidl.d.ts +0 -220
  206. 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
  },