adminforth 1.3.54-next.9 → 1.3.55-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/dist/auth.d.ts +31 -0
  2. package/dist/auth.d.ts.map +1 -0
  3. package/dist/auth.js +42 -56
  4. package/dist/auth.js.map +1 -0
  5. package/dist/basePlugin.d.ts +18 -0
  6. package/dist/basePlugin.d.ts.map +1 -0
  7. package/dist/basePlugin.js +1 -0
  8. package/dist/basePlugin.js.map +1 -0
  9. package/dist/dataConnectors/baseConnector.d.ts +94 -0
  10. package/dist/dataConnectors/baseConnector.d.ts.map +1 -0
  11. package/dist/dataConnectors/baseConnector.js +108 -122
  12. package/dist/dataConnectors/baseConnector.js.map +1 -0
  13. package/dist/dataConnectors/clickhouse.d.ts +92 -0
  14. package/dist/dataConnectors/clickhouse.d.ts.map +1 -0
  15. package/dist/dataConnectors/clickhouse.js +132 -149
  16. package/dist/dataConnectors/clickhouse.js.map +1 -0
  17. package/dist/dataConnectors/mongo.d.ts +93 -0
  18. package/dist/dataConnectors/mongo.d.ts.map +1 -0
  19. package/dist/dataConnectors/mongo.js +75 -101
  20. package/dist/dataConnectors/mongo.js.map +1 -0
  21. package/dist/dataConnectors/postgres.d.ts +71 -0
  22. package/dist/dataConnectors/postgres.d.ts.map +1 -0
  23. package/dist/dataConnectors/postgres.js +124 -143
  24. package/dist/dataConnectors/postgres.js.map +1 -0
  25. package/dist/dataConnectors/sqlite.d.ts +67 -0
  26. package/dist/dataConnectors/sqlite.d.ts.map +1 -0
  27. package/dist/dataConnectors/sqlite.js +113 -130
  28. package/dist/dataConnectors/sqlite.js.map +1 -0
  29. package/dist/index.d.ts +92 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +197 -217
  32. package/dist/index.js.map +1 -0
  33. package/dist/modules/codeInjector.d.ts +35 -0
  34. package/dist/modules/codeInjector.d.ts.map +1 -0
  35. package/dist/modules/codeInjector.js +480 -486
  36. package/dist/modules/codeInjector.js.map +1 -0
  37. package/dist/modules/configValidator.d.ts +12 -0
  38. package/dist/modules/configValidator.d.ts.map +1 -0
  39. package/dist/modules/configValidator.js +31 -22
  40. package/dist/modules/configValidator.js.map +1 -0
  41. package/dist/modules/operationalResource.d.ts +17 -0
  42. package/dist/modules/operationalResource.d.ts.map +1 -0
  43. package/dist/modules/operationalResource.js +50 -70
  44. package/dist/modules/operationalResource.js.map +1 -0
  45. package/dist/modules/restApi.d.ts +10 -0
  46. package/dist/modules/restApi.d.ts.map +1 -0
  47. package/dist/modules/restApi.js +104 -116
  48. package/dist/modules/restApi.js.map +1 -0
  49. package/dist/modules/styleGenerator.d.ts +9 -0
  50. package/dist/modules/styleGenerator.d.ts.map +1 -0
  51. package/dist/modules/styleGenerator.js +1 -0
  52. package/dist/modules/styleGenerator.js.map +1 -0
  53. package/dist/modules/styles.d.ts +96 -0
  54. package/dist/modules/styles.d.ts.map +1 -0
  55. package/dist/modules/styles.js +1 -0
  56. package/dist/modules/styles.js.map +1 -0
  57. package/dist/modules/utils.d.ts +39 -0
  58. package/dist/modules/utils.d.ts.map +1 -0
  59. package/dist/modules/utils.js +1 -0
  60. package/dist/modules/utils.js.map +1 -0
  61. package/dist/plugins/audit-log/types.d.ts +35 -0
  62. package/dist/plugins/audit-log/types.d.ts.map +1 -0
  63. package/dist/plugins/audit-log/types.js +2 -0
  64. package/dist/plugins/audit-log/types.js.map +1 -0
  65. package/dist/plugins/chat-gpt/types.d.ts +82 -0
  66. package/dist/plugins/chat-gpt/types.d.ts.map +1 -0
  67. package/dist/plugins/chat-gpt/types.js +2 -0
  68. package/dist/plugins/chat-gpt/types.js.map +1 -0
  69. package/dist/plugins/email-password-reset/types.d.ts +28 -0
  70. package/dist/plugins/email-password-reset/types.d.ts.map +1 -0
  71. package/dist/plugins/email-password-reset/types.js +2 -0
  72. package/dist/plugins/email-password-reset/types.js.map +1 -0
  73. package/dist/plugins/foreign-inline-list/types.d.ts +19 -0
  74. package/dist/plugins/foreign-inline-list/types.d.ts.map +1 -0
  75. package/dist/plugins/foreign-inline-list/types.js +2 -0
  76. package/dist/plugins/foreign-inline-list/types.js.map +1 -0
  77. package/dist/plugins/import-export/types.d.ts +3 -0
  78. package/dist/plugins/import-export/types.d.ts.map +1 -0
  79. package/dist/plugins/import-export/types.js +2 -0
  80. package/dist/plugins/import-export/types.js.map +1 -0
  81. package/dist/plugins/rich-editor/custom/async-queue.d.ts +8 -0
  82. package/dist/plugins/rich-editor/custom/async-queue.d.ts.map +1 -0
  83. package/dist/plugins/rich-editor/custom/async-queue.js +29 -0
  84. package/dist/plugins/rich-editor/custom/async-queue.js.map +1 -0
  85. package/dist/plugins/rich-editor/dist/custom/async-queue.d.ts +8 -0
  86. package/dist/plugins/rich-editor/dist/custom/async-queue.d.ts.map +1 -0
  87. package/dist/plugins/rich-editor/dist/custom/async-queue.js +29 -0
  88. package/dist/plugins/rich-editor/dist/custom/async-queue.js.map +1 -0
  89. package/dist/plugins/rich-editor/types.d.ts +153 -0
  90. package/dist/plugins/rich-editor/types.d.ts.map +1 -0
  91. package/dist/plugins/rich-editor/types.js +16 -0
  92. package/dist/plugins/rich-editor/types.js.map +1 -0
  93. package/dist/plugins/two-factors-auth/types.d.ts +18 -0
  94. package/dist/plugins/two-factors-auth/types.d.ts.map +1 -0
  95. package/dist/plugins/two-factors-auth/types.js +2 -0
  96. package/dist/plugins/two-factors-auth/types.js.map +1 -0
  97. package/dist/plugins/upload/types.d.ts +132 -0
  98. package/dist/plugins/upload/types.d.ts.map +1 -0
  99. package/dist/plugins/upload/types.js +2 -0
  100. package/dist/plugins/upload/types.js.map +1 -0
  101. package/dist/servers/express.d.ts +18 -0
  102. package/dist/servers/express.d.ts.map +1 -0
  103. package/dist/servers/express.js +30 -42
  104. package/dist/servers/express.js.map +1 -0
  105. package/dist/types/AdminForthConfig.d.ts +1619 -0
  106. package/dist/types/AdminForthConfig.d.ts.map +1 -0
  107. package/dist/types/AdminForthConfig.js +1 -0
  108. package/dist/types/AdminForthConfig.js.map +1 -0
  109. package/{types/FrontendAPI.ts → dist/types/FrontendAPI.d.ts} +27 -52
  110. package/dist/types/FrontendAPI.d.ts.map +1 -0
  111. package/dist/types/FrontendAPI.js +1 -0
  112. package/dist/types/FrontendAPI.js.map +1 -0
  113. package/package.json +15 -5
  114. package/auth.ts +0 -140
  115. package/basePlugin.ts +0 -70
  116. package/dataConnectors/baseConnector.ts +0 -216
  117. package/dataConnectors/clickhouse.ts +0 -338
  118. package/dataConnectors/mongo.ts +0 -202
  119. package/dataConnectors/postgres.ts +0 -306
  120. package/dataConnectors/sqlite.ts +0 -254
  121. package/dist/spa/.eslintrc.cjs +0 -14
  122. package/dist/spa/README.md +0 -39
  123. package/dist/spa/env.d.ts +0 -1
  124. package/dist/spa/index.html +0 -23
  125. package/dist/spa/package-lock.json +0 -4573
  126. package/dist/spa/package.json +0 -49
  127. package/dist/spa/postcss.config.js +0 -6
  128. package/dist/spa/public/assets/favicon.png +0 -0
  129. package/dist/spa/src/App.vue +0 -314
  130. package/dist/spa/src/assets/base.css +0 -2
  131. package/dist/spa/src/assets/logo.svg +0 -19
  132. package/dist/spa/src/components/AcceptModal.vue +0 -45
  133. package/dist/spa/src/components/Breadcrumbs.vue +0 -41
  134. package/dist/spa/src/components/BreadcrumbsWithButtons.vue +0 -26
  135. package/dist/spa/src/components/CustomDatePicker.vue +0 -176
  136. package/dist/spa/src/components/CustomDateRangePicker.vue +0 -218
  137. package/dist/spa/src/components/CustomRangePicker.vue +0 -152
  138. package/dist/spa/src/components/Dropdown.vue +0 -168
  139. package/dist/spa/src/components/Filters.vue +0 -222
  140. package/dist/spa/src/components/HelloWorld.vue +0 -17
  141. package/dist/spa/src/components/MenuLink.vue +0 -24
  142. package/dist/spa/src/components/ResourceForm.vue +0 -294
  143. package/dist/spa/src/components/ResourceListTable.vue +0 -394
  144. package/dist/spa/src/components/SingleSkeletLoader.vue +0 -13
  145. package/dist/spa/src/components/SkeleteLoader.vue +0 -23
  146. package/dist/spa/src/components/Toast.vue +0 -77
  147. package/dist/spa/src/components/ValueRenderer.vue +0 -66
  148. package/dist/spa/src/components/icons/IconCalendar.vue +0 -5
  149. package/dist/spa/src/components/icons/IconCommunity.vue +0 -7
  150. package/dist/spa/src/components/icons/IconDocumentation.vue +0 -7
  151. package/dist/spa/src/components/icons/IconEcosystem.vue +0 -7
  152. package/dist/spa/src/components/icons/IconSupport.vue +0 -7
  153. package/dist/spa/src/components/icons/IconTime.vue +0 -5
  154. package/dist/spa/src/components/icons/IconTooling.vue +0 -19
  155. package/dist/spa/src/composables/useFrontendApi.ts +0 -26
  156. package/dist/spa/src/composables/useStores.ts +0 -127
  157. package/dist/spa/src/index.scss +0 -27
  158. package/dist/spa/src/main.ts +0 -18
  159. package/dist/spa/src/router/index.ts +0 -63
  160. package/dist/spa/src/spa_types/core.ts +0 -51
  161. package/dist/spa/src/stores/core.ts +0 -144
  162. package/dist/spa/src/stores/filters.ts +0 -22
  163. package/dist/spa/src/stores/modal.ts +0 -48
  164. package/dist/spa/src/stores/toast.ts +0 -15
  165. package/dist/spa/src/stores/user.ts +0 -72
  166. package/dist/spa/src/types/AdminForthConfig.ts +0 -1477
  167. package/dist/spa/src/types/FrontendAPI.ts +0 -121
  168. package/dist/spa/src/utils.ts +0 -103
  169. package/dist/spa/src/views/CreateView.vue +0 -156
  170. package/dist/spa/src/views/EditView.vue +0 -157
  171. package/dist/spa/src/views/ListView.vue +0 -258
  172. package/dist/spa/src/views/LoginView.vue +0 -160
  173. package/dist/spa/src/views/ResourceParent.vue +0 -17
  174. package/dist/spa/src/views/ShowView.vue +0 -184
  175. package/dist/spa/tailwind.config.js +0 -17
  176. package/dist/spa/tsconfig.app.json +0 -14
  177. package/dist/spa/tsconfig.json +0 -11
  178. package/dist/spa/tsconfig.node.json +0 -19
  179. package/dist/spa/vite.config.ts +0 -56
  180. package/index.ts +0 -428
  181. package/modules/codeInjector.ts +0 -736
  182. package/modules/configValidator.ts +0 -571
  183. package/modules/operationalResource.ts +0 -98
  184. package/modules/restApi.ts +0 -718
  185. package/modules/styleGenerator.ts +0 -55
  186. package/modules/styles.ts +0 -126
  187. package/modules/utils.ts +0 -472
  188. package/servers/express.ts +0 -259
  189. package/spa/.eslintrc.cjs +0 -14
  190. package/spa/README.md +0 -39
  191. package/spa/env.d.ts +0 -1
  192. package/spa/index.html +0 -23
  193. package/spa/package-lock.json +0 -4602
  194. package/spa/package.json +0 -51
  195. package/spa/postcss.config.js +0 -6
  196. package/spa/public/assets/favicon.png +0 -0
  197. package/spa/src/App.vue +0 -418
  198. package/spa/src/assets/base.css +0 -2
  199. package/spa/src/assets/logo.svg +0 -19
  200. package/spa/src/components/AcceptModal.vue +0 -45
  201. package/spa/src/components/Breadcrumbs.vue +0 -41
  202. package/spa/src/components/BreadcrumbsWithButtons.vue +0 -26
  203. package/spa/src/components/CustomDatePicker.vue +0 -176
  204. package/spa/src/components/CustomDateRangePicker.vue +0 -218
  205. package/spa/src/components/CustomRangePicker.vue +0 -156
  206. package/spa/src/components/Dropdown.vue +0 -168
  207. package/spa/src/components/Filters.vue +0 -222
  208. package/spa/src/components/HelloWorld.vue +0 -17
  209. package/spa/src/components/MenuLink.vue +0 -27
  210. package/spa/src/components/ResourceForm.vue +0 -290
  211. package/spa/src/components/ResourceListTable.vue +0 -466
  212. package/spa/src/components/SingleSkeletLoader.vue +0 -13
  213. package/spa/src/components/SkeleteLoader.vue +0 -23
  214. package/spa/src/components/ThreeDotsMenu.vue +0 -43
  215. package/spa/src/components/Toast.vue +0 -78
  216. package/spa/src/components/ValueRenderer.vue +0 -114
  217. package/spa/src/components/icons/IconCalendar.vue +0 -5
  218. package/spa/src/components/icons/IconCommunity.vue +0 -7
  219. package/spa/src/components/icons/IconDocumentation.vue +0 -7
  220. package/spa/src/components/icons/IconEcosystem.vue +0 -7
  221. package/spa/src/components/icons/IconSupport.vue +0 -7
  222. package/spa/src/components/icons/IconTime.vue +0 -5
  223. package/spa/src/components/icons/IconTooling.vue +0 -19
  224. package/spa/src/composables/useFrontendApi.ts +0 -26
  225. package/spa/src/composables/useStores.ts +0 -131
  226. package/spa/src/index.scss +0 -31
  227. package/spa/src/main.ts +0 -18
  228. package/spa/src/renderers/CompactUUID.vue +0 -48
  229. package/spa/src/renderers/CountryFlag.vue +0 -69
  230. package/spa/src/router/index.ts +0 -59
  231. package/spa/src/spa_types/core.ts +0 -53
  232. package/spa/src/stores/core.ts +0 -148
  233. package/spa/src/stores/filters.ts +0 -27
  234. package/spa/src/stores/modal.ts +0 -48
  235. package/spa/src/stores/toast.ts +0 -31
  236. package/spa/src/stores/user.ts +0 -72
  237. package/spa/src/utils.ts +0 -160
  238. package/spa/src/views/CreateView.vue +0 -167
  239. package/spa/src/views/EditView.vue +0 -170
  240. package/spa/src/views/ListView.vue +0 -352
  241. package/spa/src/views/LoginView.vue +0 -192
  242. package/spa/src/views/ResourceParent.vue +0 -17
  243. package/spa/src/views/ShowView.vue +0 -186
  244. package/spa/tailwind.config.js +0 -17
  245. package/spa/tsconfig.app.json +0 -14
  246. package/spa/tsconfig.json +0 -11
  247. package/spa/tsconfig.node.json +0 -19
  248. package/spa/vite.config.ts +0 -56
  249. package/tsconfig.json +0 -112
  250. package/types/AdminForthConfig.ts +0 -1762
@@ -1,258 +0,0 @@
1
- <template>
2
- <div class="relative">
3
- <Teleport to="body">
4
- <Filters
5
- :columns="coreStore.resource?.columns"
6
- :columnsMinMax="columnsMinMax" :show="filtersShow"
7
- @hide="filtersShow = false"
8
- />
9
- </Teleport>
10
-
11
- <component
12
- v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.beforeBreadcrumbs || []"
13
- :is="getCustomComponent(c)"
14
- :meta="c.meta"
15
- :resource="coreStore.resource"
16
- :adminUser="coreStore.adminUser"
17
- />
18
-
19
- <BreadcrumbsWithButtons>
20
- <button
21
- @click="()=>{checkboxes = []}"
22
- v-if="checkboxes.length"
23
- data-tooltip-target="tooltip-remove-all"
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"
26
- >
27
- <IconBanOutline class="w-5 h-5 "/>
28
-
29
- <div id="tooltip-remove-all" role="tooltip"
30
- class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700">
31
- Remove selection
32
- <div class="tooltip-arrow" data-popper-arrow></div>
33
- </div>
34
- </button>
35
-
36
- <button
37
- v-if="checkboxes.length"
38
- v-for="(action,i) in coreStore.resource?.options?.bulkActions"
39
- :key="action.id"
40
- @click="startBulkAction(action.id)"
41
- class="flex gap-1 items-center py-1 px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-default 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"
42
- :class="{'bg-red-100 text-red-800 border-red-400 dark:bg-red-700 dark:text-red-400 dark:border-red-400':action.state==='danger', 'bg-green-100 text-green-800 border-green-400 dark:bg-green-700 dark:text-green-400 dark:border-green-400':action.state==='success',
43
- 'bg-blue-100 text-blue-800 border-blue-400 dark:bg-blue-700 dark:text-blue-400 dark:border-blue-400':action.state==='active',
44
- }"
45
- >
46
- <component
47
- v-if="action.icon"
48
- :is="getIcon(action.icon)"
49
- class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white"></component>
50
-
51
- {{ `${action.label} (${checkboxes.length})` }}
52
- </button>
53
-
54
- <RouterLink v-if="coreStore.resource?.options?.allowedActions?.create"
55
- :to="{ name: 'resource-create', params: { resourceId: $route.params.resourceId } }"
56
- class="flex items-center py-1 px-3 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"
57
- >
58
- <IconPlusOutline class="w-4 h-4 me-2"/>
59
- Create
60
- </RouterLink>
61
-
62
- <button
63
- 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"
64
- @click="()=>{filtersShow = !filtersShow}"
65
- v-if="coreStore.resource?.options?.allowedActions?.filter"
66
- >
67
- <IconFilterOutline class="w-4 h-4 me-2"/>
68
- Filter
69
- <span
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
- v-if="filtersStore.filters.length">
72
- {{ filtersStore.filters.length }}
73
- </span>
74
- </button>
75
- </BreadcrumbsWithButtons>
76
-
77
- <component
78
- v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.afterBreadcrumbs || []"
79
- :is="getCustomComponent(c)"
80
- :meta="c.meta"
81
- :resource="coreStore.resource"
82
- :adminUser="coreStore.adminUser"
83
- />
84
-
85
- <ResourceListTable
86
- :resource="coreStore.resource"
87
- :rows="rows"
88
- @update:page="page = $event"
89
- @update:sort="sort = $event"
90
- @update:checkboxes="checkboxes = $event"
91
- @update:records="getList"
92
- :sort="sort"
93
- :pageSize="pageSize"
94
- :totalRows="totalRows"
95
- :checkboxes="checkboxes"
96
- />
97
-
98
- <component
99
- v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.bottom || []"
100
- :is="getCustomComponent(c)"
101
- :meta="c.meta"
102
- :resource="coreStore.resource"
103
- :adminUser="coreStore.adminUser"
104
- />
105
-
106
- </div>
107
- </template>
108
-
109
- <script setup>
110
- import BreadcrumbsWithButtons from '@/components/BreadcrumbsWithButtons.vue';
111
- import ResourceListTable from '@/components/ResourceListTable.vue';
112
- import { useCoreStore } from '@/stores/core';
113
- import { useModalStore } from '@/stores/modal';
114
- import { useFiltersStore } from '@/stores/filters';
115
- import { callAdminForthApi, getIcon } from '@/utils';
116
- import { initFlowbite } from 'flowbite';
117
- import { computed, onMounted, ref, watch } from 'vue';
118
- import { useRoute } from 'vue-router';
119
- import { showErrorTost } from '@/composables/useFrontendApi'
120
-
121
- import ValueRenderer from '@/components/ValueRenderer.vue';
122
- import { getCustomComponent } from '@/utils';
123
-
124
-
125
- import {
126
- IconBanOutline,
127
- IconFilterOutline,
128
- IconPlusOutline
129
- } from '@iconify-prerendered/vue-flowbite';
130
-
131
- import Filters from '@/components/Filters.vue';
132
-
133
- const filtersShow = ref(false);
134
-
135
- const coreStore = useCoreStore();
136
- const filtersStore = useFiltersStore();
137
-
138
- const route = useRoute();
139
-
140
- const page = ref(1);
141
- const columnsMinMax = ref({});
142
- const sort = ref([]);
143
-
144
- const rows = ref(null);
145
- const totalRows = ref(0);
146
- const checkboxes = ref([]);
147
-
148
- const DEFAULT_PAGE_SIZE = 10;
149
-
150
-
151
- const pageSize = computed(() => coreStore.resource?.options?.listPageSize || DEFAULT_PAGE_SIZE);
152
-
153
-
154
- watch([page], async () => {
155
- await getList();
156
- });
157
-
158
- watch(()=>filtersStore.filters, async () => {
159
- page.value = 1;
160
- checkboxes.value = [];
161
-
162
- await getList();
163
- }, {deep: true});
164
-
165
- watch([sort], async () => {
166
- await getList();
167
- }, {deep: true});
168
-
169
-
170
- async function getList() {
171
- rows.value = null;
172
- const data = await callAdminForthApi({
173
- path: '/get_resource_data',
174
- method: 'POST',
175
- body: {
176
- source: 'list',
177
- resourceId: route.params.resourceId,
178
- limit: pageSize.value,
179
- offset: (page.value - 1) * pageSize.value,
180
- filters: filtersStore.filters,
181
- sort: sort.value,
182
- }
183
- });
184
- if (data.error) {
185
- showErrorTost(data.error);
186
- rows.value = [];
187
- totalRows.value = 0;
188
- return;
189
- }
190
- rows.value = data.data?.map(row => {
191
- row._primaryKeyValue = row[coreStore.resource.columns.find(c => c.primaryKey).name];
192
- return row;
193
- });
194
- totalRows.value = data.total;
195
- }
196
-
197
- async function startBulkAction(actionId) {
198
- const data = await callAdminForthApi({
199
- path: '/start_bulk_action',
200
- method: 'POST',
201
- body: {
202
- resourceId: route.params.resourceId,
203
- actionId: actionId,
204
- recordIds: checkboxes.value
205
-
206
- }
207
- });
208
- if (data?.ok) {
209
- checkboxes.value = [];
210
- await getList();
211
- }
212
- if (data?.error) {
213
- showErrorTost(data.error);
214
- }
215
- }
216
-
217
-
218
-
219
- async function init() {
220
-
221
- await coreStore.fetchResourceFull({
222
- resourceId: route.params.resourceId
223
- });
224
-
225
- if (coreStore.resource.options?.defaultSort) {
226
- sort.value = [{
227
- field: coreStore.resource.options.defaultSort.columnName,
228
- direction: coreStore.resource.options.defaultSort.direction
229
- }];
230
- } else {
231
- sort.value = [];
232
- }
233
-
234
- await getList();
235
- columnsMinMax.value = await callAdminForthApi({
236
- path: '/get_min_max_for_columns',
237
- method: 'POST',
238
- body: {
239
- resourceId: route.params.resourceId
240
- }
241
- });
242
- }
243
-
244
- onMounted(async () => {
245
- initFlowbite();
246
-
247
- await init();
248
-
249
- });
250
-
251
- // on route param change
252
- watch(() => route.params.resourceId, async () => {
253
- filtersStore.setFilters([]);
254
- checkboxes.value = [];
255
- await init();
256
- });
257
-
258
- </script>
@@ -1,160 +0,0 @@
1
- <template>
2
- <div class="relative flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-800"
3
- :style="coreStore.config?.loginBackgroundImage ? {
4
- 'background-image': 'url(' + loadFile(coreStore.config?.loginBackgroundImage) + ')',
5
- 'background-size': 'cover',
6
- 'background-position': 'center',
7
- 'background-blend-mode': 'darken'
8
- }: {}"
9
- >
10
-
11
- <!-- Main modal -->
12
- <div id="authentication-modal" tabindex="-1" class=" overflow-y-auto overflow-x-hidden z-50 min-w-[400px] justify-center items-center md:inset-0 h-[calc(100%-1rem)] max-h-full">
13
- <div class="relative p-4 w-full max-w-md max-h-full">
14
- <!-- Modal content -->
15
- <div class="relative bg-white rounded-lg shadow dark:bg-gray-700 dark:shadow-black" >
16
- <!-- Modal header -->
17
- <div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
18
- <h3 class="text-xl font-semibold text-gray-900 dark:text-white">
19
- Sign in to {{ coreStore.config?.brandName }}
20
- </h3>
21
-
22
- </div>
23
- <!-- Modal body -->
24
- <div class="p-4 md:p-5">
25
- <form class="space-y-4" @submit.prevent>
26
- <div>
27
- <label for="username" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Your {{ coreStore.config?.usernameFieldName?.toLowerCase() }}</label>
28
- <input type="username" name="username" id="username"
29
- ref="usernameInput"
30
- @keydown.enter="passwordInput.focus()"
31
- class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white" placeholder="name@company.com" required />
32
- </div>
33
- <div class="relative">
34
- <label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Your password</label>
35
- <input
36
- ref="passwordInput"
37
- @keydown.enter="login"
38
- :type="!showPw ? 'password': 'text'" name="password" id="password" placeholder="••••••••" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white" required />
39
- <button type="button" @click="showPw = !showPw" class="absolute top-12 right-3 -translate-y-1/2 text-gray-400 dark:text-gray-300">
40
- <IconEyeSolid class="w-5 h-5" v-if="!showPw" />
41
- <IconEyeSlashSolid class="w-5 h-5" v-else />
42
- </button>
43
- </div>
44
- <!-- <div class="flex justify-between">
45
- <div class="flex items-start"> -->
46
- <!-- <div class="flex items-center h-5">
47
- <input id="remember" type="checkbox" value="" class="w-4 h-4 border border-gray-300 rounded bg-gray-50 focus:ring-3 focus:ring-blue-300 dark:bg-gray-600 dark:border-gray-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800" required />
48
- </div>
49
- <label for="remember" class="ms-2 text-sm font-medium text-gray-900 dark:text-gray-300">Remember me</label> -->
50
- <!-- </div> -->
51
- <!-- <a href="#" class="text-sm text-blue-700 hover:underline dark:text-blue-500">Lost Password?</a> -->
52
- <!-- </div> -->
53
-
54
- <div v-if="error" class="flex items-center p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400" role="alert">
55
- <svg class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
56
- <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
57
- </svg>
58
- <span class="sr-only">Info</span>
59
- <div>
60
- {{ error }}
61
- </div>
62
- </div>
63
-
64
-
65
- <div v-if="coreStore.config?.loginPromptHTML"
66
- class="flex items-center p-4 mb-4 text-sm text-gray-800 rounded-lg bg-gray-50 dark:bg-gray-800 dark:text-gray-400" role="alert"
67
- >
68
- <svg class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
69
- <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
70
- </svg>
71
- <span class="sr-only">Info</span>
72
- <div v-html="coreStore.config?.loginPromptHTML"></div>
73
- </div>
74
-
75
- <button
76
- @click="login"
77
- type="submit" class="flex items-center justify-center gap-1 w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
78
- <svg v-if="inProgress"
79
- aria-hidden="true" class="w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/><path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/></svg>
80
-
81
- Login to your account
82
-
83
- </button>
84
- </form>
85
-
86
-
87
-
88
- </div>
89
- </div>
90
- </div>
91
- </div>
92
-
93
- </div>
94
- </template>
95
-
96
-
97
- <script setup>
98
-
99
- import { onMounted, ref, watchEffect } from 'vue';
100
- import { useCoreStore } from '@/stores/core';
101
- import { useUserStore } from '@/stores/user';
102
- import { IconEyeSolid, IconEyeSlashSolid } from '@iconify-prerendered/vue-flowbite';
103
- import { callAdminForthApi, loadFile } from '@/utils';
104
- import { useRouter } from 'vue-router';
105
-
106
- const passwordInput = ref(null);
107
- const usernameInput = ref(null);
108
-
109
- const router = useRouter();
110
- const inProgress = ref(false);
111
-
112
- const coreStore = useCoreStore();
113
- const user = useUserStore();
114
-
115
-
116
- const showPw = ref(false);
117
-
118
- const error = ref(null);
119
-
120
- onMounted(async () => {
121
- await coreStore.getPublicConfig();
122
- if (coreStore.config?.demoCredentials) {
123
- console.log('Setting demo credentials');
124
- const [username, password] = coreStore.config.demoCredentials.split(':');
125
- usernameInput.value.value = username;
126
- passwordInput.value.value = password;
127
- }
128
- usernameInput.value.focus();
129
- });
130
-
131
-
132
- async function login() {
133
- const username = usernameInput.value.value;
134
- const password = passwordInput.value.value;
135
-
136
- if (!username || !password) {
137
- return;
138
- }
139
- inProgress.value = true;
140
- const resp = await callAdminForthApi({
141
- path: '/login',
142
- method: 'POST',
143
- body: {
144
- username,
145
- password,
146
- }
147
- });
148
- inProgress.value = false;
149
- if (resp.error) {
150
- error.value = resp.error;
151
- } else if (resp.redirectTo) {
152
- router.push(resp.redirectTo);
153
- } else {
154
- error.value = null;
155
- await user.finishLogin();
156
- }
157
- }
158
-
159
-
160
- </script>
@@ -1,17 +0,0 @@
1
- <template>
2
- <div :key="`${$route?.params.resourceId}---${$route?.params.primaryKey}`" class="p-4">
3
- <RouterView/>
4
- </div>
5
- </template>
6
-
7
- <style>
8
- </style>
9
-
10
- <script setup>
11
-
12
-
13
- import { useCoreStore } from '@/stores/core';
14
-
15
- const coreStore = useCoreStore()
16
-
17
- </script>
@@ -1,184 +0,0 @@
1
- <template>
2
- <div class="relative">
3
- <component
4
- v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.beforeBreadcrumbs || []"
5
- :is="getCustomComponent(c)"
6
- :meta="c.meta"
7
- :record="coreStore.record"
8
- :resource="coreStore.resource"
9
- :adminUser="coreStore.adminUser"
10
- />
11
- <BreadcrumbsWithButtons>
12
- <RouterLink v-if="coreStore?.resourceOptions?.allowedActions?.edit" :to="{ name: 'resource-edit', params: { resourceId: $route.params.resourceId, primaryKey: $route.params.primaryKey } }"
13
- class="flex items-center py-1 px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-default 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"
14
- >
15
- <IconPenSolid class="w-4 h-4" />
16
- Edit
17
- </RouterLink>
18
-
19
- <button v-if="coreStore?.resourceOptions?.allowedActions?.delete" @click="deleteRecord"
20
- class="flex items-center py-1 px-3 text-sm font-medium rounded-default text-red-600 focus:outline-none bg-white border border-gray-300 hover:bg-gray-100 hover:text-red-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-red-500 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700"
21
- >
22
- <IconTrashBinSolid class="w-4 h-4" />
23
- Delete
24
- </button>
25
- </BreadcrumbsWithButtons>
26
-
27
- <component
28
- v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.afterBreadcrumbs || []"
29
- :is="getCustomComponent(c)"
30
- :meta="c.meta"
31
- :record="coreStore.record"
32
- :resource="coreStore.resource"
33
- :adminUser="coreStore.adminUser"
34
- />
35
-
36
- <div v-if="loading" role="status" class="max-w-sm animate-pulse">
37
- <div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-48 mb-4"></div>
38
- <div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[360px] mb-2.5"></div>
39
- <div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 mb-2.5"></div>
40
- <div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[330px] mb-2.5"></div>
41
- <div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[300px] mb-2.5"></div>
42
- <div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[360px]"></div>
43
- <span class="sr-only">Loading...</span>
44
- </div>
45
- <div
46
- v-else-if="coreStore.record"
47
- class="relative overflow-x-auto rounded-default shadow-resourseFormShadow "
48
- >
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-lightFormHeading dark:bg-gray-700 dark:text-gray-400">
51
- <tr>
52
- <th scope="col" class="px-6 py-3">
53
- Field
54
- </th>
55
- <th scope="col" class="px-6 py-3 w-5/6">
56
- Value
57
- </th>
58
- </tr>
59
- </thead>
60
- <tbody>
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"
63
- >
64
- <component
65
- v-if="column.components?.showRow"
66
- :is="getCustomComponent(column.components.showRow)"
67
- :meta="column.components.showRow.meta"
68
- :column="column"
69
- :resource="coreStore.resource"
70
- :record="coreStore.record"
71
- />
72
- <template v-else>
73
- <td class="px-6 py-4 whitespace-nowrap "> <!--align-top-->
74
- {{ column.label }}
75
- </td>
76
- <td class="px-6 py-4 whitespace-nowrap whitespace-pre-wrap">
77
- <component
78
- v-if="column?.components?.show"
79
- :is="getCustomComponent(column?.components?.show)"
80
- :resource="coreStore.resource"
81
- :meta="column.components.show.meta"
82
- :column="column"
83
- :record="coreStore.record"
84
- />
85
- <ValueRenderer v-else
86
- :column="column"
87
- :record="coreStore.record"
88
- />
89
- </td>
90
- </template>
91
- </tr>
92
- </tbody>
93
- </table>
94
- </div>
95
-
96
- <div v-else class="text-center text-gray-500 dark:text-gray-400 mt-10">
97
- Ooops. Record not found
98
- </div>
99
-
100
- <component
101
- v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.bottom || []"
102
- :is="getCustomComponent(c)"
103
- :meta="c.meta"
104
- :column="column"
105
- :record="coreStore.record"
106
- :resource="coreStore.resource"
107
- :adminUser="coreStore.adminUser"
108
- />
109
-
110
-
111
- </div>
112
- </template>
113
-
114
-
115
- <script setup>
116
-
117
- import BreadcrumbsWithButtons from '@/components/BreadcrumbsWithButtons.vue';
118
-
119
- import ValueRenderer from '@/components/ValueRenderer.vue';
120
- import { useCoreStore } from '@/stores/core';
121
- import { useModalStore } from '@/stores/modal';
122
- import { getCustomComponent, checkAcessByAllowedActions } from '@/utils';
123
- import { IconPenSolid, IconTrashBinSolid } from '@iconify-prerendered/vue-flowbite';
124
- import { onMounted, ref } from 'vue';
125
- import { useRoute,useRouter } from 'vue-router';
126
- import {callAdminForthApi} from '@/utils';
127
- import { showSuccesTost, showErrorTost } from '@/composables/useFrontendApi';
128
-
129
-
130
- const item = ref(null);
131
- const route = useRoute();
132
- const router = useRouter();
133
- const loading = ref(true);
134
-
135
- console.log(route.params,'showWiev');
136
-
137
-
138
- const coreStore = useCoreStore();
139
- const modalStore = useModalStore();
140
-
141
- onMounted(async () => {
142
- loading.value = true;
143
- await coreStore.fetchResourceFull({
144
- resourceId: route.params.resourceId
145
- });
146
- await coreStore.fetchRecord({
147
- resourceId: route.params.resourceId,
148
- primaryKey: route.params.primaryKey,
149
- });
150
- checkAcessByAllowedActions(coreStore.resourceOptions.allowedActions,'show');
151
- loading.value = false;
152
- });
153
-
154
- async function deleteRecord(row) {
155
- const data = await window.adminforth.confirm({
156
- message: 'Are you sure you want to delete this item?',
157
- yes: 'Delete',
158
- no: 'Cancel',
159
- });
160
- if (data) {
161
- try {
162
- const res = await callAdminForthApi({
163
- path: '/delete_record',
164
- method: 'POST',
165
- body: {
166
- resourceId: route.params.resourceId,
167
- primaryKey: route.params.primaryKey,
168
- }});
169
- if (!res.error){
170
- router.push({ name: 'resource-list', params: { resourceId: route.params.resourceId } });
171
- showSuccesTost('Record deleted successfully')
172
- } else {
173
- showErrorTost(res.error)
174
- }
175
-
176
- } catch (e) {
177
- console.error(e);
178
- };
179
- }
180
-
181
-
182
- }
183
-
184
- </script>
@@ -1,17 +0,0 @@
1
- /** @type {import('tailwindcss').Config} */
2
- export default {
3
- content: ["./src/**/*.{vue, js, ts, tsx}","./src/*.{vue, js, ts, tsx}", "./index.html", "./node_modules/flowbite/**/*.js"],
4
- theme: {
5
- extend: {
6
- /* IMPORTANT:ADMINFORTH TAILWIND STYLES */
7
- }
8
- },
9
-
10
- darkMode: 'class',
11
- plugins: [
12
- require('flowbite/plugin')({
13
- charts: true,
14
- }),
15
- ],
16
- }
17
-
@@ -1,14 +0,0 @@
1
- {
2
- "extends": "@vue/tsconfig/tsconfig.dom.json",
3
- "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4
- "exclude": ["src/**/__tests__/*"],
5
- "compilerOptions": {
6
- "composite": true,
7
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
8
-
9
- "baseUrl": ".",
10
- "paths": {
11
- "@/*": ["./src/*"]
12
- }
13
- }
14
- }
@@ -1,11 +0,0 @@
1
- {
2
- "files": [],
3
- "references": [
4
- {
5
- "path": "./tsconfig.node.json"
6
- },
7
- {
8
- "path": "./tsconfig.app.json"
9
- }
10
- ]
11
- }