adminforth 2.4.0-next.31 → 2.4.0-next.310
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/callTsProxy.js +14 -4
- package/commands/createApp/templates/api.ts.hbs +10 -0
- package/commands/createApp/templates/custom/tsconfig.json.hbs +2 -3
- package/commands/createApp/templates/index.ts.hbs +12 -1
- package/commands/createApp/templates/package.json.hbs +1 -1
- package/commands/createApp/templates/prisma.config.ts.hbs +8 -0
- package/commands/createApp/templates/schema.prisma.hbs +0 -1
- package/commands/createApp/utils.js +10 -0
- package/commands/createCustomComponent/configLoader.js +17 -4
- package/commands/createCustomComponent/main.js +13 -7
- package/commands/createCustomComponent/templates/customCrud/beforeActionButtons.vue.hbs +38 -0
- package/commands/createCustomComponent/templates/customCrud/saveButton.vue.hbs +28 -0
- package/commands/createPlugin/templates/custom/tsconfig.json.hbs +2 -5
- package/commands/createPlugin/templates/package.json.hbs +1 -1
- package/commands/generateModels.js +30 -22
- package/dist/auth.d.ts +9 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +21 -2
- package/dist/auth.js.map +1 -1
- package/dist/dataConnectors/baseConnector.d.ts +1 -1
- package/dist/dataConnectors/baseConnector.d.ts.map +1 -1
- package/dist/dataConnectors/baseConnector.js +69 -17
- package/dist/dataConnectors/baseConnector.js.map +1 -1
- package/dist/dataConnectors/clickhouse.d.ts.map +1 -1
- package/dist/dataConnectors/clickhouse.js +15 -0
- package/dist/dataConnectors/clickhouse.js.map +1 -1
- package/dist/dataConnectors/mongo.d.ts.map +1 -1
- package/dist/dataConnectors/mongo.js +50 -15
- package/dist/dataConnectors/mongo.js.map +1 -1
- package/dist/dataConnectors/mysql.d.ts.map +1 -1
- package/dist/dataConnectors/mysql.js +11 -0
- package/dist/dataConnectors/mysql.js.map +1 -1
- package/dist/dataConnectors/postgres.d.ts.map +1 -1
- package/dist/dataConnectors/postgres.js +43 -14
- package/dist/dataConnectors/postgres.js.map +1 -1
- package/dist/dataConnectors/sqlite.d.ts.map +1 -1
- package/dist/dataConnectors/sqlite.js +11 -0
- package/dist/dataConnectors/sqlite.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -22
- package/dist/index.js.map +1 -1
- package/dist/modules/codeInjector.d.ts +2 -0
- package/dist/modules/codeInjector.d.ts.map +1 -1
- package/dist/modules/codeInjector.js +62 -6
- package/dist/modules/codeInjector.js.map +1 -1
- package/dist/modules/configValidator.d.ts +6 -0
- package/dist/modules/configValidator.d.ts.map +1 -1
- package/dist/modules/configValidator.js +202 -25
- package/dist/modules/configValidator.js.map +1 -1
- package/dist/modules/restApi.d.ts +1 -1
- package/dist/modules/restApi.d.ts.map +1 -1
- package/dist/modules/restApi.js +172 -31
- package/dist/modules/restApi.js.map +1 -1
- package/dist/modules/styles.d.ts +499 -13
- package/dist/modules/styles.d.ts.map +1 -1
- package/dist/modules/styles.js +555 -31
- package/dist/modules/styles.js.map +1 -1
- package/dist/modules/utils.d.ts +7 -15
- package/dist/modules/utils.d.ts.map +1 -1
- package/dist/modules/utils.js +45 -68
- package/dist/modules/utils.js.map +1 -1
- package/dist/servers/express.d.ts +5 -0
- package/dist/servers/express.d.ts.map +1 -1
- package/dist/servers/express.js +40 -1
- package/dist/servers/express.js.map +1 -1
- package/dist/spa/index.html +1 -1
- package/dist/spa/package-lock.json +1208 -708
- package/dist/spa/package.json +34 -34
- package/dist/spa/src/App.vue +59 -174
- package/dist/spa/src/adminforth.ts +42 -18
- package/dist/spa/src/afcl/AreaChart.vue +0 -1
- package/dist/spa/src/afcl/BarChart.vue +2 -2
- package/dist/spa/src/afcl/Button.vue +6 -6
- package/dist/spa/src/afcl/ButtonGroup.vue +91 -0
- package/dist/spa/src/afcl/Card.vue +25 -0
- package/dist/spa/src/afcl/Checkbox.vue +21 -13
- package/dist/spa/src/afcl/CountryFlag.vue +4 -1
- package/dist/spa/src/{components/CustomDatePicker.vue → afcl/DatePicker.vue} +95 -9
- package/dist/spa/src/afcl/Dialog.vue +47 -27
- package/dist/spa/src/afcl/Dropzone.vue +127 -48
- package/dist/spa/src/afcl/Input.vue +14 -6
- package/dist/spa/src/afcl/JsonViewer.vue +25 -0
- package/dist/spa/src/afcl/LinkButton.vue +3 -3
- package/dist/spa/src/afcl/PieChart.vue +5 -5
- package/dist/spa/src/afcl/ProgressBar.vue +7 -7
- package/dist/spa/src/afcl/Select.vue +82 -34
- package/dist/spa/src/afcl/Skeleton.vue +6 -6
- package/dist/spa/src/afcl/Table.vue +315 -73
- package/dist/spa/src/afcl/Textarea.vue +31 -0
- package/dist/spa/src/afcl/Toggle.vue +32 -0
- package/dist/spa/src/afcl/Tooltip.vue +28 -18
- package/dist/spa/src/afcl/VerticalTabs.vue +16 -7
- package/dist/spa/src/afcl/index.ts +6 -3
- package/dist/spa/src/components/AcceptModal.vue +48 -14
- package/dist/spa/src/components/Breadcrumbs.vue +5 -5
- package/dist/spa/src/components/CallActionWrapper.vue +15 -0
- package/dist/spa/src/components/ColumnValueInput.vue +38 -18
- package/dist/spa/src/components/ColumnValueInputWrapper.vue +4 -3
- package/dist/spa/src/components/CustomDateRangePicker.vue +9 -8
- package/dist/spa/src/components/CustomRangePicker.vue +37 -21
- package/dist/spa/src/components/ErrorMessage.vue +21 -0
- package/dist/spa/src/components/Filters.vue +195 -132
- package/dist/spa/src/components/GroupsTable.vue +9 -8
- package/dist/spa/src/components/MenuLink.vue +90 -23
- package/dist/spa/src/components/ResourceForm.vue +94 -51
- package/dist/spa/src/components/ResourceListTable.vue +115 -85
- package/dist/spa/src/components/ResourceListTableVirtual.vue +114 -80
- package/dist/spa/src/components/ShowTable.vue +21 -15
- package/dist/spa/src/components/Sidebar.vue +470 -0
- package/dist/spa/src/components/SingleSkeletLoader.vue +6 -6
- package/dist/spa/src/components/SkeleteLoader.vue +3 -3
- package/dist/spa/src/components/ThreeDotsMenu.vue +84 -15
- package/dist/spa/src/components/Toast.vue +40 -29
- package/dist/spa/src/components/UserMenuSettingsButton.vue +69 -0
- package/dist/spa/src/components/ValueRenderer.vue +44 -17
- package/dist/spa/src/controls/BoolToggle.vue +34 -0
- package/dist/spa/src/i18n.ts +5 -3
- package/dist/spa/src/main.ts +1 -1
- package/dist/spa/src/renderers/CompactField.vue +1 -1
- package/dist/spa/src/renderers/CompactUUID.vue +1 -1
- package/dist/spa/src/router/index.ts +8 -0
- package/dist/spa/src/shims-vue.d.ts +5 -0
- package/dist/spa/src/spa_types/core.ts +13 -1
- package/dist/spa/src/stores/core.ts +13 -1
- package/dist/spa/src/stores/filters.ts +33 -2
- package/dist/spa/src/stores/modal.ts +6 -1
- package/dist/spa/src/stores/toast.ts +22 -3
- package/dist/spa/src/types/Back.ts +163 -23
- package/dist/spa/src/types/Common.ts +91 -32
- package/dist/spa/src/types/FrontendAPI.ts +31 -5
- package/dist/spa/src/types/adapters/CaptchaAdapter.ts +34 -0
- package/dist/spa/src/types/adapters/EmailAdapter.ts +2 -2
- package/dist/spa/src/types/adapters/ImageVisionAdapter.ts +30 -0
- package/dist/spa/src/types/adapters/KeyValueAdapter.ts +16 -0
- package/dist/spa/src/types/adapters/index.ts +8 -0
- package/dist/spa/src/utils.ts +291 -11
- package/dist/spa/src/views/CreateView.vue +63 -21
- package/dist/spa/src/views/EditView.vue +55 -22
- package/dist/spa/src/views/ListView.vue +144 -87
- package/dist/spa/src/views/LoginView.vue +26 -35
- package/dist/spa/src/views/ResourceParent.vue +2 -2
- package/dist/spa/src/views/SettingsView.vue +121 -0
- package/dist/spa/src/views/ShowView.vue +83 -53
- package/dist/spa/src/websocket.ts +6 -1
- package/dist/spa/tsconfig.app.json +1 -1
- package/dist/spa/vite.config.ts +45 -2
- package/dist/types/Back.d.ts +146 -14
- package/dist/types/Back.d.ts.map +1 -1
- package/dist/types/Back.js +15 -0
- package/dist/types/Back.js.map +1 -1
- package/dist/types/Common.d.ts +106 -29
- package/dist/types/Common.d.ts.map +1 -1
- package/dist/types/Common.js.map +1 -1
- package/dist/types/FrontendAPI.d.ts +31 -3
- package/dist/types/FrontendAPI.d.ts.map +1 -1
- package/dist/types/FrontendAPI.js.map +1 -1
- package/dist/types/adapters/CaptchaAdapter.d.ts +30 -0
- package/dist/types/adapters/CaptchaAdapter.d.ts.map +1 -0
- package/dist/types/adapters/CaptchaAdapter.js +5 -0
- package/dist/types/adapters/CaptchaAdapter.js.map +1 -0
- package/dist/types/adapters/EmailAdapter.d.ts +1 -1
- package/dist/types/adapters/ImageVisionAdapter.d.ts +25 -0
- package/dist/types/adapters/ImageVisionAdapter.d.ts.map +1 -0
- package/dist/types/adapters/ImageVisionAdapter.js +2 -0
- package/dist/types/adapters/ImageVisionAdapter.js.map +1 -0
- package/dist/types/adapters/KeyValueAdapter.d.ts +10 -0
- package/dist/types/adapters/KeyValueAdapter.d.ts.map +1 -0
- package/dist/types/adapters/KeyValueAdapter.js +2 -0
- package/dist/types/adapters/KeyValueAdapter.js.map +1 -0
- package/dist/types/adapters/index.d.ts +9 -0
- package/dist/types/adapters/index.d.ts.map +1 -0
- package/dist/types/adapters/index.js +2 -0
- package/dist/types/adapters/index.js.map +1 -0
- package/package.json +4 -2
- package/dist/spa/src/types/adapters/index.js +0 -5
|
@@ -3,106 +3,118 @@
|
|
|
3
3
|
<Teleport to="body">
|
|
4
4
|
<Filters
|
|
5
5
|
:columns="coreStore.resource?.columns"
|
|
6
|
-
:columnsMinMax="columnsMinMax"
|
|
6
|
+
:columnsMinMax="columnsMinMax"
|
|
7
|
+
:show="filtersShow"
|
|
7
8
|
@hide="filtersShow = false"
|
|
8
9
|
/>
|
|
9
10
|
</Teleport>
|
|
10
11
|
|
|
11
12
|
<component
|
|
13
|
+
v-if="!coreStore.isResourceFetching && !initInProcess"
|
|
12
14
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.beforeBreadcrumbs || []"
|
|
13
15
|
:is="getCustomComponent(c)"
|
|
14
|
-
:meta="c.meta"
|
|
16
|
+
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
15
17
|
:resource="coreStore.resource"
|
|
16
18
|
:adminUser="coreStore.adminUser"
|
|
17
19
|
/>
|
|
18
20
|
|
|
19
21
|
<BreadcrumbsWithButtons>
|
|
22
|
+
<component
|
|
23
|
+
v-if="!coreStore.isResourceFetching && !initInProcess"
|
|
24
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.beforeActionButtons || []"
|
|
25
|
+
:is="getCustomComponent(c)"
|
|
26
|
+
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
27
|
+
:resource="coreStore.resource"
|
|
28
|
+
:adminUser="coreStore.adminUser"
|
|
29
|
+
/>
|
|
20
30
|
<button
|
|
21
31
|
@click="()=>{checkboxes = []}"
|
|
22
32
|
v-if="checkboxes.length"
|
|
23
33
|
data-tooltip-target="tooltip-remove-all"
|
|
24
|
-
class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-
|
|
34
|
+
class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-lightListViewButtonText focus:outline-none bg-lightListViewButtonBackground rounded border border-lightListViewButtonBorder hover:bg-lightListViewButtonBackgroundHover hover:text-lightListViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightListViewButtonFocusRing dark:focus:ring-darkListViewButtonFocusRing dark:bg-darkListViewButtonBackground dark:text-darkListViewButtonText dark:border-darkListViewButtonBorder dark:hover:text-darkListViewButtonTextHover dark:hover:bg-darkListViewButtonBackgroundHover rounded-default"
|
|
25
35
|
>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</div>
|
|
36
|
+
<Tooltip>
|
|
37
|
+
<IconBanOutline class="w-5 h-5 "/>
|
|
38
|
+
<template #tooltip >
|
|
39
|
+
Remove selection
|
|
40
|
+
</template>
|
|
41
|
+
</Tooltip>
|
|
33
42
|
</button>
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
v-if="checkboxes.length"
|
|
44
|
+
<div
|
|
45
|
+
v-if="checkboxes.length"
|
|
37
46
|
v-for="(action,i) in coreStore.resource?.options?.bulkActions"
|
|
38
|
-
:key="action.id"
|
|
39
|
-
@click="startBulkAction(action.id)"
|
|
40
|
-
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-lightPrimary 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"
|
|
41
|
-
:class="{
|
|
42
|
-
'bg-red-100 text-red-800 border-red-400 dark:bg-red-700 dark:text-red-400 dark:border-red-400':action.state==='danger',
|
|
43
|
-
'bg-green-100 text-green-800 border-green-400 dark:bg-green-700 dark:text-green-400 dark:border-green-400':action.state==='success',
|
|
44
|
-
'bg-lightPrimaryOpacity text-lightPrimary border-blue-400 dark:bg-blue-700 dark:text-blue-400 dark:border-blue-400':action.state==='active',
|
|
45
|
-
}"
|
|
46
47
|
>
|
|
47
|
-
<
|
|
48
|
-
v-if="
|
|
49
|
-
:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
{{ action.
|
|
72
|
-
|
|
73
|
-
|
|
48
|
+
<button
|
|
49
|
+
v-if="!action.showInThreeDotsDropdown"
|
|
50
|
+
:key="action.id"
|
|
51
|
+
@click="startBulkAction(action.id!)"
|
|
52
|
+
class="flex gap-1 items-center py-1 px-3 text-sm font-medium text-lightListViewButtonText focus:outline-none bg-lightListViewButtonBackground rounded-default border border-lightListViewButtonBorder hover:bg-lightListViewButtonBackgroundHover hover:text-lightListViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightListViewButtonFocusRing dark:focus:ring-darkListViewButtonFocusRing dark:bg-darkListViewButtonBackground dark:text-darkListViewButtonText dark:border-darkListViewButtonBorder dark:hover:text-darkListViewButtonTextHover dark:hover:bg-darkListViewButtonBackgroundHover"
|
|
53
|
+
:class="action.buttonCustomCssClass || ''"
|
|
54
|
+
>
|
|
55
|
+
<component
|
|
56
|
+
v-if="action.icon && !bulkActionLoadingStates[action.id!]"
|
|
57
|
+
:is="getIcon(action.icon)"
|
|
58
|
+
class="w-5 h-5 transition duration-75 group-hover:text-gray-900 dark:group-hover:text-white"></component>
|
|
59
|
+
<div v-if="bulkActionLoadingStates[action.id!]">
|
|
60
|
+
<svg
|
|
61
|
+
aria-hidden="true"
|
|
62
|
+
class="w-5 h-5 animate-spin text-gray-200 dark:text-gray-500 fill-gray-500 dark:fill-gray-300"
|
|
63
|
+
viewBox="0 0 100 101"
|
|
64
|
+
fill="none"
|
|
65
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
66
|
+
>
|
|
67
|
+
<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"/>
|
|
68
|
+
<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"/>
|
|
69
|
+
</svg>
|
|
70
|
+
<span class="sr-only">Loading...</span>
|
|
71
|
+
</div>
|
|
72
|
+
{{ `${action.label} (${checkboxes.length})` }}
|
|
73
|
+
<div v-if="action.badge" class="text-white bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-purple-300 dark:focus:ring-purple-800
|
|
74
|
+
font-medium rounded-sm text-xs px-1 ml-1 text-center ">
|
|
75
|
+
{{ action.badge }}
|
|
76
|
+
</div>
|
|
77
|
+
</button>
|
|
78
|
+
</div>
|
|
74
79
|
|
|
75
80
|
<RouterLink v-if="coreStore.resource?.options?.allowedActions?.create"
|
|
76
81
|
:to="{ name: 'resource-create', params: { resourceId: $route.params.resourceId } }"
|
|
77
|
-
class="af-create-button flex items-center py-1 px-3 text-sm font-medium text-
|
|
82
|
+
class="af-create-button flex items-center py-1 px-3 text-sm font-medium text-lightListViewButtonText focus:outline-none bg-lightListViewButtonBackground rounded border border-lightListViewButtonBorder hover:bg-lightListViewButtonBackgroundHover hover:text-lightListViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightListViewButtonFocusRing dark:focus:ring-darkListViewButtonFocusRing dark:bg-darkListViewButtonBackground dark:text-darkListViewButtonText dark:border-darkListViewButtonBorder dark:hover:text-darkListViewButtonTextHover dark:hover:bg-darkListViewButtonBackgroundHover rounded-default gap-1"
|
|
78
83
|
>
|
|
79
|
-
<IconPlusOutline class="w-4 h-4
|
|
84
|
+
<IconPlusOutline class="w-4 h-4"/>
|
|
80
85
|
{{ $t('Create') }}
|
|
81
86
|
</RouterLink>
|
|
82
87
|
|
|
83
88
|
<button
|
|
84
|
-
class="af-filter-button flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-
|
|
89
|
+
class="af-filter-button flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-lightListViewButtonText focus:outline-none bg-lightListViewButtonBackground rounded border border-lightListViewButtonBorder hover:bg-lightListViewButtonBackgroundHover hover:text-lightListViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightListViewButtonFocusRing dark:focus:ring-darkListViewButtonFocusRing dark:bg-darkListViewButtonBackground dark:text-darkListViewButtonText dark:border-darkListViewButtonBorder dark:hover:text-darkListViewButtonTextHover dark:hover:bg-darkListViewButtonBackgroundHover rounded-default"
|
|
85
90
|
@click="()=>{filtersShow = !filtersShow}"
|
|
86
91
|
v-if="coreStore.resource?.options?.allowedActions?.filter"
|
|
87
92
|
>
|
|
88
|
-
<IconFilterOutline class="w-4 h-4
|
|
93
|
+
<IconFilterOutline class="w-4 h-4"/>
|
|
89
94
|
{{ $t('Filter') }}
|
|
90
95
|
<span
|
|
91
96
|
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"
|
|
92
|
-
v-if="filtersStore.
|
|
93
|
-
{{ filtersStore.
|
|
97
|
+
v-if="filtersStore.visibleFiltersCount">
|
|
98
|
+
{{ filtersStore.visibleFiltersCount }}
|
|
94
99
|
</span>
|
|
95
100
|
</button>
|
|
96
101
|
|
|
97
102
|
<ThreeDotsMenu
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
v-if="!coreStore.isResourceFetching"
|
|
104
|
+
:threeDotsDropdownItems="(coreStore.resourceOptions?.pageInjections?.list?.threeDotsDropdownItems as [])"
|
|
105
|
+
:bulkActions="coreStore.resource?.options?.bulkActions"
|
|
106
|
+
:checkboxes="checkboxes"
|
|
107
|
+
@startBulkAction="startBulkAction"
|
|
108
|
+
:updateList="getList"
|
|
109
|
+
:clearCheckboxes="clearCheckboxes"
|
|
110
|
+
></ThreeDotsMenu>
|
|
100
111
|
</BreadcrumbsWithButtons>
|
|
101
112
|
|
|
102
113
|
<component
|
|
114
|
+
v-if="!coreStore.isResourceFetching && !initInProcess"
|
|
103
115
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.afterBreadcrumbs || []"
|
|
104
116
|
:is="getCustomComponent(c)"
|
|
105
|
-
:meta="c.meta"
|
|
117
|
+
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
106
118
|
:resource="coreStore.resource"
|
|
107
119
|
:adminUser="coreStore.adminUser"
|
|
108
120
|
/>
|
|
@@ -119,12 +131,23 @@
|
|
|
119
131
|
:pageSize="pageSize"
|
|
120
132
|
:totalRows="totalRows"
|
|
121
133
|
:checkboxes="checkboxes"
|
|
122
|
-
:customActionsInjection="coreStore.resourceOptions?.pageInjections?.list?.customActionIcons
|
|
123
|
-
|
|
134
|
+
:customActionsInjection="Array.isArray(coreStore.resourceOptions?.pageInjections?.list?.customActionIcons)
|
|
135
|
+
? coreStore.resourceOptions.pageInjections.list.customActionIcons
|
|
136
|
+
: coreStore.resourceOptions?.pageInjections?.list?.customActionIcons
|
|
137
|
+
? [coreStore.resourceOptions.pageInjections.list.customActionIcons]
|
|
138
|
+
: []
|
|
139
|
+
"
|
|
140
|
+
:tableBodyStartInjection="Array.isArray(coreStore.resourceOptions?.pageInjections?.list?.tableBodyStart)
|
|
141
|
+
? coreStore.resourceOptions.pageInjections.list.tableBodyStart
|
|
142
|
+
: coreStore.resourceOptions?.pageInjections?.list?.tableBodyStart
|
|
143
|
+
? [coreStore.resourceOptions.pageInjections.list.tableBodyStart]
|
|
144
|
+
: []
|
|
145
|
+
"
|
|
124
146
|
:container-height="1100"
|
|
125
147
|
:item-height="52.5"
|
|
126
148
|
:buffer-size="listBufferSize"
|
|
127
149
|
/>
|
|
150
|
+
|
|
128
151
|
<ResourceListTable
|
|
129
152
|
v-else
|
|
130
153
|
:resource="coreStore.resource"
|
|
@@ -138,14 +161,24 @@
|
|
|
138
161
|
:pageSize="pageSize"
|
|
139
162
|
:totalRows="totalRows"
|
|
140
163
|
:checkboxes="checkboxes"
|
|
141
|
-
:customActionsInjection="coreStore.resourceOptions?.pageInjections?.list?.customActionIcons
|
|
142
|
-
|
|
164
|
+
:customActionsInjection="Array.isArray(coreStore.resourceOptions?.pageInjections?.list?.customActionIcons)
|
|
165
|
+
? coreStore.resourceOptions.pageInjections.list.customActionIcons
|
|
166
|
+
: coreStore.resourceOptions?.pageInjections?.list?.customActionIcons
|
|
167
|
+
? [coreStore.resourceOptions.pageInjections.list.customActionIcons]
|
|
168
|
+
: []
|
|
169
|
+
"
|
|
170
|
+
:tableBodyStartInjection="Array.isArray(coreStore.resourceOptions?.pageInjections?.list?.tableBodyStart)
|
|
171
|
+
? coreStore.resourceOptions.pageInjections.list.tableBodyStart
|
|
172
|
+
: coreStore.resourceOptions?.pageInjections?.list?.tableBodyStart
|
|
173
|
+
? [coreStore.resourceOptions.pageInjections.list.tableBodyStart]
|
|
174
|
+
: []
|
|
175
|
+
"
|
|
143
176
|
/>
|
|
144
177
|
|
|
145
178
|
<component
|
|
146
179
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.bottom || []"
|
|
147
180
|
:is="getCustomComponent(c)"
|
|
148
|
-
:meta="c.meta"
|
|
181
|
+
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
149
182
|
:resource="coreStore.resource"
|
|
150
183
|
:adminUser="coreStore.adminUser"
|
|
151
184
|
/>
|
|
@@ -160,11 +193,13 @@ import ResourceListTable from '@/components/ResourceListTable.vue';
|
|
|
160
193
|
import { useCoreStore } from '@/stores/core';
|
|
161
194
|
import { useFiltersStore } from '@/stores/filters';
|
|
162
195
|
import { callAdminForthApi, currentQuery, getIcon, setQuery } from '@/utils';
|
|
163
|
-
import { computed, onMounted, ref, watch, nextTick, type Ref } from 'vue';
|
|
196
|
+
import { computed, onMounted, onUnmounted, ref, watch, nextTick, type Ref } from 'vue';
|
|
164
197
|
import { useRoute } from 'vue-router';
|
|
165
198
|
import { showErrorTost } from '@/composables/useFrontendApi'
|
|
166
199
|
import { getCustomComponent, initThreeDotsDropdown } from '@/utils';
|
|
167
200
|
import ThreeDotsMenu from '@/components/ThreeDotsMenu.vue';
|
|
201
|
+
import { Tooltip } from '@/afcl'
|
|
202
|
+
import type { AdminForthComponentDeclarationFull } from '@/types/Common';
|
|
168
203
|
|
|
169
204
|
|
|
170
205
|
import {
|
|
@@ -185,7 +220,7 @@ const route = useRoute();
|
|
|
185
220
|
|
|
186
221
|
const page = ref(1);
|
|
187
222
|
const columnsMinMax = ref({});
|
|
188
|
-
const sort = ref(
|
|
223
|
+
const sort = ref();
|
|
189
224
|
|
|
190
225
|
watch(() => sort, async (to, from) => {
|
|
191
226
|
// in store sort might be needed for plugins
|
|
@@ -229,11 +264,11 @@ async function getList() {
|
|
|
229
264
|
totalRows.value = 0;
|
|
230
265
|
return {error: data.error};
|
|
231
266
|
}
|
|
232
|
-
rows.value = data.data?.map(row => {
|
|
233
|
-
if (coreStore.resource
|
|
234
|
-
row._primaryKeyValue = row[coreStore.resource.columns.find(c => c.primaryKey)
|
|
235
|
-
} else {
|
|
236
|
-
row._primaryKeyValue = row[coreStore.resource.columns.find(c => c.primaryKey)
|
|
267
|
+
rows.value = data.data?.map((row: any) => {
|
|
268
|
+
if (coreStore.resource?.columns?.find(c => c.primaryKey)?.foreignResource) {
|
|
269
|
+
row._primaryKeyValue = row[coreStore.resource.columns.find(c => c.primaryKey)!.name].pk;
|
|
270
|
+
} else if (coreStore.resource) {
|
|
271
|
+
row._primaryKeyValue = row[coreStore.resource.columns.find(c => c.primaryKey)!.name];
|
|
237
272
|
}
|
|
238
273
|
return row;
|
|
239
274
|
});
|
|
@@ -245,6 +280,10 @@ async function getList() {
|
|
|
245
280
|
return {}
|
|
246
281
|
}
|
|
247
282
|
|
|
283
|
+
function clearCheckboxes() {
|
|
284
|
+
checkboxes.value = [];
|
|
285
|
+
}
|
|
286
|
+
|
|
248
287
|
async function refreshExistingList(pk?: any) {
|
|
249
288
|
const currentData = rows.value;
|
|
250
289
|
if (!currentData) {
|
|
@@ -297,9 +336,9 @@ async function refreshExistingList(pk?: any) {
|
|
|
297
336
|
}
|
|
298
337
|
|
|
299
338
|
|
|
300
|
-
async function startBulkAction(actionId) {
|
|
301
|
-
const action = coreStore.resource
|
|
302
|
-
if (action
|
|
339
|
+
async function startBulkAction(actionId: string) {
|
|
340
|
+
const action = coreStore.resource?.options?.bulkActions?.find(a => a.id === actionId);
|
|
341
|
+
if (action?.confirm) {
|
|
303
342
|
const confirmed = await adminforth.confirm({
|
|
304
343
|
message: action.confirm,
|
|
305
344
|
});
|
|
@@ -339,10 +378,10 @@ async function startBulkAction(actionId) {
|
|
|
339
378
|
|
|
340
379
|
|
|
341
380
|
class SortQuerySerializer {
|
|
342
|
-
static serialize(sort) {
|
|
381
|
+
static serialize(sort: {field: string, direction: 'asc' | 'desc'}[]) {
|
|
343
382
|
return sort.map(s => `${s.field}__${s.direction}`).join(',');
|
|
344
383
|
}
|
|
345
|
-
static deserialize(str) {
|
|
384
|
+
static deserialize(str: string) {
|
|
346
385
|
return str.split(',').map(s => {
|
|
347
386
|
const [field, direction] = s.split('__');
|
|
348
387
|
return { field, direction };
|
|
@@ -352,10 +391,17 @@ class SortQuerySerializer {
|
|
|
352
391
|
|
|
353
392
|
let listAutorefresher: any = null;
|
|
354
393
|
|
|
394
|
+
function clearAutoRefresher() {
|
|
395
|
+
if (listAutorefresher) {
|
|
396
|
+
clearInterval(listAutorefresher);
|
|
397
|
+
listAutorefresher = null;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
355
401
|
async function init() {
|
|
356
402
|
|
|
357
403
|
await coreStore.fetchResourceFull({
|
|
358
|
-
resourceId: route.params.resourceId
|
|
404
|
+
resourceId: route.params.resourceId as string
|
|
359
405
|
});
|
|
360
406
|
isPageLoaded.value = true;
|
|
361
407
|
// !!! clear filters should be in same tick with sort assignment so that watch can catch it as one change
|
|
@@ -366,7 +412,7 @@ async function init() {
|
|
|
366
412
|
return {
|
|
367
413
|
field,
|
|
368
414
|
operator,
|
|
369
|
-
value: JSON.parse(
|
|
415
|
+
value: JSON.parse((route.query[k] as string))
|
|
370
416
|
}
|
|
371
417
|
});
|
|
372
418
|
if (filters.length) {
|
|
@@ -376,8 +422,8 @@ async function init() {
|
|
|
376
422
|
}
|
|
377
423
|
|
|
378
424
|
if (route.query.sort) {
|
|
379
|
-
sort.value = SortQuerySerializer.deserialize(route.query.sort);
|
|
380
|
-
} else if (coreStore
|
|
425
|
+
sort.value = SortQuerySerializer.deserialize(route.query.sort as string);
|
|
426
|
+
} else if (coreStore?.resource?.options?.defaultSort) {
|
|
381
427
|
sort.value = [{
|
|
382
428
|
field: coreStore.resource.options.defaultSort.columnName,
|
|
383
429
|
direction: coreStore.resource.options.defaultSort.direction
|
|
@@ -387,7 +433,7 @@ async function init() {
|
|
|
387
433
|
}
|
|
388
434
|
// page init should be also in same tick
|
|
389
435
|
if (route.query.page) {
|
|
390
|
-
page.value = parseInt(route.query.page);
|
|
436
|
+
page.value = parseInt(route.query.page as string);
|
|
391
437
|
}
|
|
392
438
|
|
|
393
439
|
// getList(); - Not needed here, watch will trigger it
|
|
@@ -399,10 +445,7 @@ async function init() {
|
|
|
399
445
|
}
|
|
400
446
|
});
|
|
401
447
|
|
|
402
|
-
|
|
403
|
-
clearInterval(listAutorefresher);
|
|
404
|
-
listAutorefresher = null;
|
|
405
|
-
}
|
|
448
|
+
clearAutoRefresher();
|
|
406
449
|
if (coreStore.resource!.options?.listRowsAutoRefreshSeconds) {
|
|
407
450
|
listAutorefresher = setInterval(async () => {
|
|
408
451
|
await adminforth.list.silentRefresh();
|
|
@@ -416,8 +459,18 @@ watch([page, sort, () => filtersStore.filters], async () => {
|
|
|
416
459
|
}, { deep: true });
|
|
417
460
|
|
|
418
461
|
adminforth.list.refresh = async () => {
|
|
419
|
-
|
|
420
|
-
|
|
462
|
+
const result = await getList();
|
|
463
|
+
|
|
464
|
+
if (!result) {
|
|
465
|
+
return {};
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
if ('error' in result && result.error != null) {
|
|
469
|
+
return { error: String(result.error) };
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
return {};
|
|
473
|
+
};
|
|
421
474
|
|
|
422
475
|
adminforth.list.silentRefresh = async () => {
|
|
423
476
|
return await refreshExistingList();
|
|
@@ -437,11 +490,11 @@ watch(() => filtersStore.filters, async (to, from) => {
|
|
|
437
490
|
page.value = 1;
|
|
438
491
|
checkboxes.value = []; // TODO: not sure absolutely needed here
|
|
439
492
|
// update query param for each filter as filter_<column_name>=value
|
|
440
|
-
const query = {};
|
|
493
|
+
const query: Record<string, string | undefined> = {};
|
|
441
494
|
const currentQ = currentQuery();
|
|
442
495
|
filtersStore.filters.forEach(f => {
|
|
443
|
-
if (f.value) {
|
|
444
|
-
query[`filter__${f.field}__${f.operator}`] =
|
|
496
|
+
if (f.value !== undefined && f.value !== null && f.value !== '') {
|
|
497
|
+
query[`filter__${f.field}__${f.operator}`] = (JSON.stringify(f.value));
|
|
445
498
|
}
|
|
446
499
|
});
|
|
447
500
|
// set every key in currentQ which starts with filter_ to undefined if it is not in query
|
|
@@ -460,6 +513,10 @@ onMounted(async () => {
|
|
|
460
513
|
initInProcess = false;
|
|
461
514
|
});
|
|
462
515
|
|
|
516
|
+
onUnmounted(() => {
|
|
517
|
+
clearAutoRefresher();
|
|
518
|
+
});
|
|
519
|
+
|
|
463
520
|
watch([page], async () => {
|
|
464
521
|
setQuery({ page: page.value });
|
|
465
522
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="relative flex items-center justify-center min-h-screen bg-
|
|
2
|
+
<div class="relative flex items-center justify-center min-h-screen bg-lightHtml dark:bg-darkHtml w-screen h-screen"
|
|
3
3
|
:style="coreStore.config?.loginBackgroundImage && backgroundPosition === 'over' ? {
|
|
4
4
|
'background-image': 'url(' + loadFile(coreStore.config?.loginBackgroundImage) + ')',
|
|
5
5
|
'background-size': 'cover',
|
|
6
6
|
'background-position': 'center',
|
|
7
|
-
'background-blend-mode': 'darken'
|
|
7
|
+
'background-blend-mode': coreStore.config?.removeBackgroundBlendMode ? 'normal' : 'darken'
|
|
8
8
|
}: {}"
|
|
9
9
|
>
|
|
10
10
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
overflow-x-hidden z-50 min-w-[350px] justify-center items-center md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
|
28
28
|
<div class="relative p-4 w-full max-h-full max-w-[400px]">
|
|
29
29
|
<!-- Modal content -->
|
|
30
|
-
<div class="af-login-modal-content relative bg-
|
|
30
|
+
<div class="af-login-popup af-login-modal-content relative bg-lightLoginViewBackground rounded-lg shadow dark:bg-darkLoginViewBackground dark:shadow-black" :class=" { 'rounded-b-none overflow-hidden': error } ">
|
|
31
31
|
<!-- Modal header -->
|
|
32
32
|
<div class="af-login-modal-header flex items-center justify-between flex-col p-4 md:p-5 border-b rounded-t dark:border-gray-600">
|
|
33
33
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
:meta="c.meta"
|
|
40
40
|
/>
|
|
41
41
|
</template>
|
|
42
|
-
<h3 v-else class="text-xl font-semibold text-
|
|
42
|
+
<h3 v-else class="text-xl font-semibold text-lightLoginViewText dark:text-darkLoginViewTextColor">
|
|
43
43
|
{{ $t('Sign in to') }} {{ coreStore.config?.brandName }}
|
|
44
44
|
</h3>
|
|
45
45
|
</div>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<div class="af-login-modal-body p-4 md:p-5">
|
|
48
48
|
<form class="space-y-4" @submit.prevent>
|
|
49
49
|
<div>
|
|
50
|
-
<label for="username" class="block mb-2 text-sm font-medium text-
|
|
50
|
+
<label for="username" class="block mb-2 text-sm font-medium text-lightLoginViewText dark:text-darkLoginViewTextColor">{{ $t('Your') }} {{ coreStore.config?.usernameFieldName?.toLowerCase() }}</label>
|
|
51
51
|
<Input
|
|
52
52
|
v-model="username"
|
|
53
53
|
autocomplete="username"
|
|
@@ -55,22 +55,20 @@
|
|
|
55
55
|
name="username"
|
|
56
56
|
id="username"
|
|
57
57
|
ref="usernameInput"
|
|
58
|
-
oninput="setCustomValidity('')"
|
|
59
58
|
@keydown.enter="passwordInput.focus()"
|
|
60
59
|
class="w-full"
|
|
61
60
|
placeholder="name@company.com" required />
|
|
62
61
|
</div>
|
|
63
62
|
<div class="">
|
|
64
|
-
<label for="password" class="block mb-2 text-sm font-medium text-
|
|
63
|
+
<label for="password" class="block mb-2 text-sm font-medium text-lightLoginViewText dark:text-darkLoginViewTextColor">{{ $t('Your password') }}</label>
|
|
65
64
|
<Input
|
|
66
65
|
v-model="password"
|
|
67
66
|
ref="passwordInput"
|
|
68
67
|
autocomplete="current-password"
|
|
69
|
-
oninput="setCustomValidity('')"
|
|
70
68
|
@keydown.enter="login"
|
|
71
69
|
:type="!showPw ? 'password': 'text'" name="password" id="password" placeholder="••••••••" class="w-full" required>
|
|
72
70
|
<template #rightIcon>
|
|
73
|
-
<button type="button" @click="showPw = !showPw" class="text-
|
|
71
|
+
<button type="button" @click="showPw = !showPw" class="text-lightLoginViewSubTextColor dark:text-darkLoginViewSubTextColor">
|
|
74
72
|
<IconEyeSolid class="w-5 h-5" v-if="!showPw" />
|
|
75
73
|
<IconEyeSlashSolid class="w-5 h-5" v-else />
|
|
76
74
|
</button>
|
|
@@ -92,20 +90,11 @@
|
|
|
92
90
|
v-for="c in coreStore?.config?.loginPageInjections?.underInputs || []"
|
|
93
91
|
:is="getCustomComponent(c)"
|
|
94
92
|
:meta="c.meta"
|
|
93
|
+
@update:disableLoginButton="setDisableLoginButton($event)"
|
|
95
94
|
/>
|
|
96
|
-
|
|
97
|
-
<div v-if="error" class="af-login-modal-error 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">
|
|
98
|
-
<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">
|
|
99
|
-
<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"/>
|
|
100
|
-
</svg>
|
|
101
|
-
<span class="sr-only">{{ $t('Info') }}</span>
|
|
102
|
-
<div>
|
|
103
|
-
{{ error }}
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
|
|
95
|
+
|
|
107
96
|
<div v-if="coreStore.config?.loginPromptHTML"
|
|
108
|
-
class="flex items-center p-4 mb-4 text-sm text-
|
|
97
|
+
class="flex items-center p-4 mb-4 text-sm text-lightLoginViewPromptText rounded-lg bg-lightLoginViewPromptBackground dark:bg-darkLoginViewPromptBackground dark:text-darkLoginViewPromptText" role="alert"
|
|
109
98
|
>
|
|
110
99
|
<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">
|
|
111
100
|
<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"/>
|
|
@@ -113,13 +102,19 @@
|
|
|
113
102
|
<span class="sr-only">{{ $t('Info') }}</span>
|
|
114
103
|
<div v-html="coreStore.config?.loginPromptHTML"></div>
|
|
115
104
|
</div>
|
|
116
|
-
<Button @click="login" :loader="inProgress" :disabled="inProgress" class="w-full">
|
|
105
|
+
<Button @click="login" :loader="inProgress" :disabled="inProgress || disableLoginButton" class="w-full">
|
|
117
106
|
{{ $t('Login to your account') }}
|
|
118
107
|
</Button>
|
|
108
|
+
<component
|
|
109
|
+
v-for="c in coreStore?.config?.loginPageInjections?.underLoginButton || []"
|
|
110
|
+
:is="getCustomComponent(c)"
|
|
111
|
+
:meta="c.meta"
|
|
112
|
+
@update:disableLoginButton="setDisableLoginButton($event)"
|
|
113
|
+
/>
|
|
119
114
|
</form>
|
|
120
|
-
|
|
121
115
|
</div>
|
|
122
116
|
</div>
|
|
117
|
+
<ErrorMessage v-if="error" :error="error" class="absolute left-4 right-4 rounded-t-none mb-0 shadow px-9" />
|
|
123
118
|
</div>
|
|
124
119
|
</div>
|
|
125
120
|
|
|
@@ -127,7 +122,7 @@
|
|
|
127
122
|
</template>
|
|
128
123
|
|
|
129
124
|
|
|
130
|
-
<script setup>
|
|
125
|
+
<script setup lang="ts">
|
|
131
126
|
|
|
132
127
|
import { getCustomComponent } from '@/utils';
|
|
133
128
|
import { onBeforeMount, onMounted, ref, computed } from 'vue';
|
|
@@ -138,6 +133,7 @@ import { callAdminForthApi, loadFile } from '@/utils';
|
|
|
138
133
|
import { useRoute, useRouter } from 'vue-router';
|
|
139
134
|
import { Button, Checkbox, Input } from '@/afcl';
|
|
140
135
|
import { useI18n } from 'vue-i18n';
|
|
136
|
+
import ErrorMessage from '@/components/ErrorMessage.vue';
|
|
141
137
|
|
|
142
138
|
const { t } = useI18n();
|
|
143
139
|
|
|
@@ -150,18 +146,19 @@ const password = ref('');
|
|
|
150
146
|
const route = useRoute();
|
|
151
147
|
const router = useRouter();
|
|
152
148
|
const inProgress = ref(false);
|
|
153
|
-
|
|
154
149
|
const coreStore = useCoreStore();
|
|
155
150
|
const user = useUserStore();
|
|
156
151
|
|
|
157
152
|
const showPw = ref(false);
|
|
158
153
|
|
|
159
154
|
const error = ref(null);
|
|
155
|
+
const disableLoginButton = ref(false);
|
|
160
156
|
|
|
161
157
|
const backgroundPosition = computed(() => {
|
|
162
158
|
return coreStore.config?.loginBackgroundPosition || '1/2';
|
|
163
159
|
});
|
|
164
160
|
|
|
161
|
+
|
|
165
162
|
onBeforeMount(() => {
|
|
166
163
|
if (localStorage.getItem('isAuthorized') === 'true') {
|
|
167
164
|
// if route has next param, redirect
|
|
@@ -175,6 +172,7 @@ onBeforeMount(() => {
|
|
|
175
172
|
})
|
|
176
173
|
|
|
177
174
|
onMounted(async () => {
|
|
175
|
+
coreStore.getLoginFormConfig();
|
|
178
176
|
if (coreStore.config?.demoCredentials) {
|
|
179
177
|
const [demoUsername, demoPassword] = coreStore.config.demoCredentials.split(':');
|
|
180
178
|
username.value = demoUsername;
|
|
@@ -185,16 +183,6 @@ onMounted(async () => {
|
|
|
185
183
|
|
|
186
184
|
|
|
187
185
|
async function login() {
|
|
188
|
-
|
|
189
|
-
if (!username.value) {
|
|
190
|
-
usernameInput.value.setCustomValidity(t('Please fill out this field.'));
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
if (!password.value) {
|
|
194
|
-
passwordInput.value.setCustomValidity(t('Please fill out this field.'));
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
186
|
if (inProgress.value) {
|
|
199
187
|
return;
|
|
200
188
|
}
|
|
@@ -220,5 +208,8 @@ async function login() {
|
|
|
220
208
|
|
|
221
209
|
}
|
|
222
210
|
|
|
211
|
+
function setDisableLoginButton(value: boolean) {
|
|
212
|
+
disableLoginButton.value = value;
|
|
213
|
+
}
|
|
223
214
|
|
|
224
215
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :key="`${$route?.params.resourceId}---${$route?.params.primaryKey}`" class="p-4 flex"
|
|
2
|
+
<div :key="`${$route?.params.resourceId}---${$route?.params.primaryKey}`" class="af-resource-parent p-4 flex"
|
|
3
3
|
:class="limitHeightToPage ? 'h-[calc(100dvh-3.5rem)]': undefined"
|
|
4
4
|
>
|
|
5
5
|
<RouterView/>
|
|
@@ -33,7 +33,7 @@ const limitHeightToPage = computed(() => {
|
|
|
33
33
|
}
|
|
34
34
|
const listPageInjects = coreStore.resource.options.pageInjections.list;
|
|
35
35
|
|
|
36
|
-
for (const pi of [listPageInjects.beforeBreadcrumbs, listPageInjects.afterBreadcrumbs, listPageInjects.bottom]) {
|
|
36
|
+
for (const pi of [listPageInjects.beforeBreadcrumbs, listPageInjects.beforeActionButtons, listPageInjects.afterBreadcrumbs, listPageInjects.bottom]) {
|
|
37
37
|
if (pi) {
|
|
38
38
|
for (const piItem of pi) {
|
|
39
39
|
if (!piItem.meta?.thinEnoughToShrinkTable) {
|