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
@@ -46,7 +46,7 @@
46
46
  @update:record="onUpdateRecord"
47
47
  @update:isValid="isValid = $event"
48
48
  :validating="validating"
49
- :source="'edit'"
49
+ :customComponentsPerColumn="editComponentsPerColumn"
50
50
  >
51
51
  </ResourceForm>
52
52
 
@@ -88,6 +88,7 @@ const loading = ref(false);
88
88
  const saving = ref(false);
89
89
 
90
90
  const record = ref({});
91
+ let editComponentsPerColumn = {};
91
92
 
92
93
  async function onUpdateRecord(newRecord) {
93
94
  record.value = newRecord;
@@ -118,6 +119,13 @@ onMounted(async () => {
118
119
  primaryKey: route.params.primaryKey,
119
120
  });
120
121
  checkAcessByAllowedActions(coreStore.resourceOptions.allowedActions,'edit');
122
+
123
+ editComponentsPerColumn = coreStore.resource.columns.reduce((acc, column) => {
124
+ if (column.components?.edit) {
125
+ acc[column.name] = getCustomComponent(column.components.edit);
126
+ }
127
+ return acc;
128
+ }, {});
121
129
  loading.value = false;
122
130
  });
123
131
 
@@ -22,7 +22,7 @@
22
22
  v-if="checkboxes.length"
23
23
  data-tooltip-target="tooltip-remove-all"
24
24
  data-tooltip-placement="bottom"
25
- class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-darkListTable dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 rounded-default"
25
+ class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 rounded-default"
26
26
  >
27
27
  <IconBanOutline class="w-5 h-5 "/>
28
28
 
@@ -70,7 +70,7 @@
70
70
  class="bg-red-100 text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400"
71
71
  v-if="filtersStore.filters.length">
72
72
  {{ filtersStore.filters.length }}
73
- </span>
73
+ </span>
74
74
  </button>
75
75
  </BreadcrumbsWithButtons>
76
76
 
@@ -89,7 +89,6 @@
89
89
  @update:sort="sort = $event"
90
90
  @update:checkboxes="checkboxes = $event"
91
91
  @update:records="getList"
92
- :sort="sort"
93
92
  :pageSize="pageSize"
94
93
  :totalRows="totalRows"
95
94
  :checkboxes="checkboxes"
@@ -230,15 +229,6 @@ async function init() {
230
229
  resourceId: route.params.resourceId
231
230
  });
232
231
 
233
- if (coreStore.resource.options?.defaultSort) {
234
- sort.value = [{
235
- field: coreStore.resource.options.defaultSort.columnName,
236
- direction: coreStore.resource.options.defaultSort.direction
237
- }];
238
- } else {
239
- sort.value = [];
240
- }
241
-
242
232
  await getList();
243
233
  columnsMinMax.value = await callAdminForthApi({
244
234
  path: '/get_min_max_for_columns',
@@ -260,6 +250,7 @@ onMounted(async () => {
260
250
  watch(() => route.params.resourceId, async () => {
261
251
  filtersStore.setFilters([]);
262
252
  checkboxes.value = [];
253
+ sort.value = [];
263
254
  await init();
264
255
  });
265
256
 
@@ -103,8 +103,6 @@ onMounted(() => {
103
103
  coreStore.getPublicConfig()
104
104
  });
105
105
 
106
-
107
-
108
106
  async function login() {
109
107
  inProgress.value = true;
110
108
  const resp = await callAdminForthApi({
@@ -118,10 +116,7 @@ async function login() {
118
116
  inProgress.value = false;
119
117
  if (resp.error) {
120
118
  error.value = resp.error;
121
- } else if (resp.redirectTo) {
122
- router.push(resp.redirectTo);
123
- }
124
- else {
119
+ } else {
125
120
  error.value = null;
126
121
  user.authorize()
127
122
  router.push('/');
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :key="`${$route?.params.resourceId}---${$route?.params.primaryKey}`" class="p-4">
2
+ <div :key="`${$route?.params.resourceId}---${$route?.params.primaryKey}`">
3
3
  <RouterView/>
4
4
  </div>
5
5
  </template>
@@ -11,6 +11,7 @@
11
11
 
12
12
 
13
13
  import { useCoreStore } from '@/stores/core';
14
+ import { onMounted } from 'vue';
14
15
 
15
16
  const coreStore = useCoreStore()
16
17
 
@@ -44,10 +44,10 @@
44
44
  </div>
45
45
  <div
46
46
  v-else
47
- class="relative overflow-x-auto shadow-resourseFormShadow "
47
+ class="relative overflow-x-auto shadow-resourse-form-shadow "
48
48
  >
49
49
  <table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 rounded-default">
50
- <thead class="text-xs text-gray-700 uppercase bg-lightormHeading dark:bg-gray-700 dark:text-gray-400">
50
+ <thead class="text-xs text-gray-700 uppercase bg-form-view-heading dark:bg-gray-700 dark:text-gray-400">
51
51
  <tr>
52
52
  <th scope="col" class="px-6 py-3">
53
53
  Field
@@ -59,7 +59,7 @@
59
59
  </thead>
60
60
  <tbody>
61
61
  <tr v-for="column in coreStore.resource?.columns.filter(c => c.showIn.includes('show'))" :key="column.name"
62
- class="bg-lightForm bg-darkForm odd:dark:bg-gray-900 even:dark:bg-gray-800 border-b dark:border-gray-700"
62
+ class="bg-form-view-bg odd:dark:bg-gray-900 even:dark:bg-gray-800 border-b dark:border-gray-700"
63
63
  >
64
64
  <component
65
65
  v-if="column.components?.showRow"
@@ -75,8 +75,8 @@
75
75
  </td>
76
76
  <td class="px-6 py-4 whitespace-nowrap whitespace-pre-wrap">
77
77
  <component
78
- v-if="column?.components?.show"
79
- :is="getCustomComponent(column?.components?.show)"
78
+ v-if="showComponentsPerColumn[column.name]"
79
+ :is="showComponentsPerColumn[column.name]"
80
80
  :resource="coreStore.resource"
81
81
  :meta="column.components.show.meta"
82
82
  :column="column"
@@ -126,7 +126,8 @@ import {showSuccesTost} from '@/composables/useFrontendApi';
126
126
  const item = ref(null);
127
127
  const route = useRoute();
128
128
  const router = useRouter();
129
- const loading = ref(true);
129
+ const loading = ref(false);
130
+ let showComponentsPerColumn = {};
130
131
 
131
132
  console.log(route.params,'showWiev');
132
133
 
@@ -144,6 +145,13 @@ onMounted(async () => {
144
145
  primaryKey: route.params.primaryKey,
145
146
  });
146
147
  checkAcessByAllowedActions(coreStore.resourceOptions.allowedActions,'show');
148
+
149
+ showComponentsPerColumn = coreStore.resource.columns.reduce((acc, column) => {
150
+ if (column.components?.show) {
151
+ acc[column.name] = getCustomComponent(column.components.show);
152
+ }
153
+ return acc;
154
+ }, {});
147
155
  loading.value = false;
148
156
  });
149
157
 
@@ -9,9 +9,7 @@ export default {
9
9
 
10
10
  darkMode: 'class',
11
11
  plugins: [
12
- require('flowbite/plugin')({
13
- charts: true,
14
- }),
12
+ require('flowbite/plugin'),
15
13
  ],
16
14
  }
17
15
 
@@ -217,7 +217,9 @@ class CodeInjector implements CodeInjectorType {
217
217
 
218
218
  // copy whole custom directory
219
219
  if (this.adminforth.config.customization?.customComponentsDir) {
220
- this.srcFoldersToSync[this.adminforth.config.customization.customComponentsDir] = './'
220
+ // resolve customComponentsDir to absolute path, so ./aa will be resolved to /path/to/current/dir/aa
221
+ const customCompAbsPath = path.resolve(this.adminforth.config.customization.customComponentsDir);
222
+ this.srcFoldersToSync[customCompAbsPath] = './'
221
223
  }
222
224
 
223
225
  // if this.adminforth.config.customization.favicon is set, copy it to assets
@@ -461,7 +463,10 @@ async watchForReprepare({ verbose }) {
461
463
  const collectDirectories = async (dir) => {
462
464
  const files = await fs.promises.readdir(dir, { withFileTypes: true });
463
465
  for (const file of files) {
464
- if (file.isDirectory() && ['node_modules', 'dist'].indexOf(file.name) === -1) {
466
+ if (['node_modules', 'dist'].includes(file.name)) {
467
+ continue;
468
+ }
469
+ if (file.isDirectory()) {
465
470
  directories.push(path.join(dir, file.name));
466
471
  await collectDirectories(path.join(dir, file.name));
467
472
  }
@@ -469,11 +474,10 @@ async watchForReprepare({ verbose }) {
469
474
  };
470
475
  await collectDirectories(spaPath);
471
476
 
472
- if (verbose) {
477
+ if (process.env.HEAVY_DEBUG) {
473
478
  console.log('🔎 Watching for changes in:', directories.join(','));
474
479
  }
475
480
 
476
-
477
481
  const watcher = filewatcher();
478
482
  directories.forEach((dir) => {
479
483
  watcher.add(dir);
@@ -481,16 +485,15 @@ async watchForReprepare({ verbose }) {
481
485
 
482
486
  watcher.on(
483
487
  'change',
484
- async (file) => {
485
- console.log(`File ${file} changed, preparing sources...`);
488
+ async (file, x) => {
489
+ console.log(`File ${file} changed ${x}, preparing sources...`);
486
490
  await this.prepareSources({ filesUpdated: [file.replace(spaPath + '/', '')] });
487
491
  }
488
492
  )
489
493
  this.allWatchers.push(watcher);
490
494
  }
491
495
 
492
- async watchCustomComponentsForCopy({ verbose }) {
493
- const customComponentsDir = this.adminforth.config.customization.customComponentsDir;
496
+ async watchCustomComponentsForCopy({ verbose, customComponentsDir, destination }) {
494
497
  if (!customComponentsDir) {
495
498
  return;
496
499
  }
@@ -506,39 +509,57 @@ async watchForReprepare({ verbose }) {
506
509
 
507
510
  // get all subdirs
508
511
  const directories = [];
512
+ const files = []
509
513
  const collectDirectories = async (dir) => {
510
514
  directories.push(dir);
511
515
 
512
- const files = await fs.promises.readdir(dir, { withFileTypes: true });
513
- for (const file of files) {
514
- if (file.isDirectory()) {
515
- await collectDirectories(path.join(dir, file.name));
516
- }
517
- }
516
+ const filesAndDirs = await fs.promises.readdir(dir, { withFileTypes: true });
517
+ await Promise.all(
518
+ filesAndDirs.map(
519
+ async (file) => {
520
+ const isDir = fs.lstatSync(path.join(dir, file.name)).isDirectory();
521
+ if (isDir) {
522
+ await collectDirectories(path.join(dir, file.name));
523
+ } else {
524
+ files.push(path.join(dir, file.name));
525
+ }
526
+ }
527
+ )
528
+ )
518
529
  };
519
530
 
520
531
  await collectDirectories(customComponentsDir);
521
532
 
522
533
  const watcher = filewatcher();
523
- directories.forEach((dir) => {
524
- watcher.add(dir);
534
+ files.forEach((file) => {
535
+ process.env.HEAVY_DEBUG && console.log(`🔎 Watching for changes in file ${file}`);
536
+ watcher.add(file);
525
537
  });
526
538
 
527
- if (verbose) {
539
+ if (process.env.HEAVY_DEBUG) {
528
540
  console.log('🔎 Watching for changes in:', directories.join(','));
529
541
  }
530
542
 
531
543
  watcher.on(
532
544
  'change',
533
- async (file) => {
545
+ async (fileOrDir) => {
534
546
  // copy one file
535
- // TODO: non optimal, copy only changed file, test on both nested and parent dir
536
- if (verbose) {
537
- console.log(`🔎 File ${file} changed, copying to spa_tmp...`);
547
+ const relativeFilename = fileOrDir.replace(customComponentsDir + '/', '');
548
+ if (process.env.HEAVY_DEBUG) {
549
+ console.log(`🔎 fileOrDir ${fileOrDir} changed`);
550
+ console.log(`🔎 relativeFilename ${relativeFilename}`);
551
+ console.log(`🔎 customComponentsDir ${customComponentsDir}`);
552
+ console.log(`🔎 destination ${destination}`);
553
+ }
554
+ const isFile = fs.lstatSync(fileOrDir).isFile();
555
+ if (isFile) {
556
+ const destPath = path.join(CodeInjector.SPA_TMP_PATH, 'src', 'custom', destination, relativeFilename);
557
+ process.env.HEAVY_DEBUG && console.log(`🔎 Copying file ${fileOrDir} to ${destPath}`);
558
+ await fsExtra.copy(fileOrDir, destPath);
559
+ return;
560
+ } else {
561
+ // for now do nothing
538
562
  }
539
- await fsExtra.copy(this.adminforth.config.customization.customComponentsDir, path.join(CodeInjector.SPA_TMP_PATH, 'src', 'custom'), {
540
- recursive: true,
541
- });
542
563
  }
543
564
  )
544
565
  this.allWatchers.push(watcher);
@@ -550,8 +571,17 @@ async watchForReprepare({ verbose }) {
550
571
  await this.prepareSources({ verbose });
551
572
 
552
573
  if (hotReload) {
553
- await this.watchForReprepare({ verbose });
554
- await this.watchCustomComponentsForCopy({ verbose });
574
+ await Promise.all([
575
+ this.watchForReprepare({ verbose }),
576
+ ...Object.entries(this.srcFoldersToSync).map(async ([src, dest]) => {
577
+
578
+ await this.watchCustomComponentsForCopy({
579
+ verbose,
580
+ customComponentsDir: src,
581
+ destination: dest,
582
+ });
583
+ }),
584
+ ]);
555
585
  }
556
586
 
557
587
  console.log('AdminForth bundling');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.1.79",
3
+ "version": "1.1.80",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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
  }
package/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 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
  }"
@@ -1,61 +0,0 @@
1
- {
2
- "name": "twofactorsauthplugin",
3
- "version": "1.0.0",
4
- "lockfileVersion": 3,
5
- "requires": true,
6
- "packages": {
7
- "node_modules/@types/node": {
8
- "version": "20.14.9",
9
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz",
10
- "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==",
11
- "dependencies": {
12
- "undici-types": "~5.26.4"
13
- }
14
- },
15
- "node_modules/@types/notp": {
16
- "version": "2.0.5",
17
- "resolved": "https://registry.npmjs.org/@types/notp/-/notp-2.0.5.tgz",
18
- "integrity": "sha512-ZsZS0PYUa6ZE4K3yOGerBvaxCp4ePf6ZmkFbPeilcqz2Ui/lmXox7KlRt7XZkXzqUgXhFLkc09ixyVmFLCU3gQ==",
19
- "dependencies": {
20
- "@types/node": "*"
21
- }
22
- },
23
- "node_modules/node-2fa": {
24
- "version": "2.0.3",
25
- "resolved": "https://registry.npmjs.org/node-2fa/-/node-2fa-2.0.3.tgz",
26
- "integrity": "sha512-PQldrOhjuoZyoydMvMSctllPN1ZPZ1/NwkEcgYwY9faVqE/OymxR+3awPpbWZxm6acLKqvmNqQmdqTsqYyflFw==",
27
- "dependencies": {
28
- "@types/notp": "^2.0.0",
29
- "notp": "^2.0.3",
30
- "thirty-two": "1.0.2",
31
- "tslib": "^2.1.0"
32
- }
33
- },
34
- "node_modules/notp": {
35
- "version": "2.0.3",
36
- "resolved": "https://registry.npmjs.org/notp/-/notp-2.0.3.tgz",
37
- "integrity": "sha512-oBig/2uqkjQ5AkBuw4QJYwkEWa/q+zHxI5/I5z6IeP2NT0alpJFsP/trrfCC+9xOAgQSZXssNi962kp5KBmypQ==",
38
- "engines": {
39
- "node": "> v0.6.0"
40
- }
41
- },
42
- "node_modules/thirty-two": {
43
- "version": "1.0.2",
44
- "resolved": "https://registry.npmjs.org/thirty-two/-/thirty-two-1.0.2.tgz",
45
- "integrity": "sha512-OEI0IWCe+Dw46019YLl6V10Us5bi574EvlJEOcAkB29IzQ/mYD1A6RyNHLjZPiHCmuodxvgF6U+vZO1L15lxVA==",
46
- "engines": {
47
- "node": ">=0.2.6"
48
- }
49
- },
50
- "node_modules/tslib": {
51
- "version": "2.6.3",
52
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz",
53
- "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ=="
54
- },
55
- "node_modules/undici-types": {
56
- "version": "5.26.5",
57
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
58
- "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
59
- }
60
- }
61
- }
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE
@@ -1,15 +0,0 @@
1
- # Installation
2
- > `npm install --save @types/node`
3
-
4
- # Summary
5
- This package contains type definitions for node (https://nodejs.org/).
6
-
7
- # Details
8
- Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
-
10
- ### Additional Details
11
- * Last updated: Tue, 25 Jun 2024 22:07:01 GMT
12
- * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
-
14
- # Credits
15
- These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).