adminforth 2.4.0-next.1 → 2.4.0-next.100
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/cli.js +12 -4
- package/commands/createApp/templates/.env.local.hbs +2 -2
- package/commands/createApp/templates/custom/tsconfig.json.hbs +2 -3
- package/commands/createApp/templates/index.ts.hbs +9 -5
- package/commands/createApp/templates/package.json.hbs +1 -1
- package/commands/createApp/utils.js +40 -7
- package/commands/createCustomComponent/configLoader.js +3 -0
- package/commands/createCustomComponent/configUpdater.js +25 -21
- package/commands/createCustomComponent/fileGenerator.js +1 -1
- package/commands/createCustomComponent/main.js +2 -1
- package/commands/createCustomComponent/templates/login/beforeLogin.vue.hbs +18 -0
- package/dist/dataConnectors/baseConnector.d.ts.map +1 -1
- package/dist/dataConnectors/baseConnector.js +16 -3
- package/dist/dataConnectors/baseConnector.js.map +1 -1
- package/dist/dataConnectors/mongo.d.ts.map +1 -1
- package/dist/dataConnectors/mongo.js +14 -14
- package/dist/dataConnectors/mongo.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -9
- package/dist/index.js.map +1 -1
- package/dist/modules/codeInjector.d.ts.map +1 -1
- package/dist/modules/codeInjector.js +25 -9
- package/dist/modules/codeInjector.js.map +1 -1
- package/dist/modules/configValidator.d.ts.map +1 -1
- package/dist/modules/configValidator.js +50 -2
- package/dist/modules/configValidator.js.map +1 -1
- package/dist/modules/restApi.d.ts.map +1 -1
- package/dist/modules/restApi.js +145 -25
- package/dist/modules/restApi.js.map +1 -1
- package/dist/modules/styles.d.ts +451 -13
- package/dist/modules/styles.d.ts.map +1 -1
- package/dist/modules/styles.js +507 -31
- package/dist/modules/styles.js.map +1 -1
- package/dist/modules/utils.d.ts +1 -0
- package/dist/modules/utils.d.ts.map +1 -1
- package/dist/modules/utils.js +9 -0
- package/dist/modules/utils.js.map +1 -1
- package/dist/spa/index.html +1 -1
- package/dist/spa/src/App.vue +24 -14
- package/dist/spa/src/afcl/Button.vue +6 -6
- 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 +6 -6
- package/dist/spa/src/afcl/Dropzone.vue +13 -11
- package/dist/spa/src/afcl/Input.vue +9 -7
- package/dist/spa/src/afcl/JsonViewer.vue +25 -0
- package/dist/spa/src/afcl/Link.vue +1 -1
- package/dist/spa/src/afcl/LinkButton.vue +1 -1
- package/dist/spa/src/afcl/ProgressBar.vue +7 -7
- package/dist/spa/src/afcl/Select.vue +52 -23
- package/dist/spa/src/afcl/Skeleton.vue +6 -6
- package/dist/spa/src/afcl/Table.vue +13 -13
- 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 +2 -2
- package/dist/spa/src/afcl/VerticalTabs.vue +3 -3
- package/dist/spa/src/afcl/index.ts +4 -3
- package/dist/spa/src/components/AcceptModal.vue +6 -6
- package/dist/spa/src/components/Breadcrumbs.vue +5 -5
- package/dist/spa/src/components/ColumnValueInput.vue +37 -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 -8
- package/dist/spa/src/components/Filters.vue +76 -31
- package/dist/spa/src/components/GroupsTable.vue +9 -8
- package/dist/spa/src/components/ResourceForm.vue +94 -51
- package/dist/spa/src/components/ResourceListTable.vue +38 -40
- package/dist/spa/src/components/ResourceListTableVirtual.vue +31 -33
- package/dist/spa/src/components/ShowTable.vue +17 -12
- package/dist/spa/src/components/SingleSkeletLoader.vue +6 -6
- package/dist/spa/src/components/SkeleteLoader.vue +1 -1
- package/dist/spa/src/components/ThreeDotsMenu.vue +34 -7
- package/dist/spa/src/components/Toast.vue +2 -7
- package/dist/spa/src/components/ValueRenderer.vue +4 -4
- package/dist/spa/src/controls/BoolToggle.vue +34 -0
- package/dist/spa/src/i18n.ts +1 -1
- package/dist/spa/src/shims-vue.d.ts +5 -0
- package/dist/spa/src/spa_types/core.ts +7 -0
- package/dist/spa/src/stores/core.ts +1 -1
- package/dist/spa/src/types/Back.ts +84 -21
- package/dist/spa/src/types/Common.ts +26 -10
- package/dist/spa/src/types/adapters/CompletionAdapter.ts +25 -0
- package/dist/spa/src/types/adapters/EmailAdapter.ts +27 -0
- package/dist/spa/src/types/adapters/ImageGenerationAdapter.ts +50 -0
- package/dist/spa/src/types/adapters/ImageVisionAdapter.ts +30 -0
- package/dist/spa/src/types/adapters/OAuth2Adapter.ts +34 -0
- package/dist/spa/src/types/adapters/StorageAdapter.ts +73 -0
- package/dist/spa/src/types/adapters/index.ts +6 -0
- package/dist/spa/src/utils.ts +217 -7
- package/dist/spa/src/views/CreateView.vue +21 -16
- package/dist/spa/src/views/EditView.vue +29 -19
- package/dist/spa/src/views/ListView.vue +51 -49
- package/dist/spa/src/views/LoginView.vue +57 -45
- package/dist/spa/src/views/ResourceParent.vue +1 -1
- package/dist/spa/src/views/ShowView.vue +17 -13
- package/dist/spa/src/websocket.ts +6 -1
- package/dist/spa/tsconfig.app.json +1 -1
- package/dist/spa/vite.config.ts +44 -1
- package/dist/types/Back.d.ts +63 -14
- package/dist/types/Back.d.ts.map +1 -1
- package/dist/types/Back.js.map +1 -1
- package/dist/types/Common.d.ts +24 -8
- package/dist/types/Common.d.ts.map +1 -1
- package/dist/types/Common.js.map +1 -1
- package/dist/types/adapters/CompletionAdapter.d.ts +20 -0
- package/dist/types/adapters/CompletionAdapter.d.ts.map +1 -0
- package/dist/types/adapters/CompletionAdapter.js +2 -0
- package/dist/types/adapters/CompletionAdapter.js.map +1 -0
- package/dist/types/adapters/EmailAdapter.d.ts +20 -0
- package/dist/types/adapters/EmailAdapter.d.ts.map +1 -0
- package/dist/types/adapters/EmailAdapter.js +2 -0
- package/dist/types/adapters/EmailAdapter.js.map +1 -0
- package/dist/types/adapters/ImageGenerationAdapter.d.ts +37 -0
- package/dist/types/adapters/ImageGenerationAdapter.d.ts.map +1 -0
- package/dist/types/adapters/ImageGenerationAdapter.js +2 -0
- package/dist/types/adapters/ImageGenerationAdapter.js.map +1 -0
- 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/OAuth2Adapter.d.ts +32 -0
- package/dist/types/adapters/OAuth2Adapter.d.ts.map +1 -0
- package/dist/types/adapters/OAuth2Adapter.js +2 -0
- package/dist/types/adapters/OAuth2Adapter.js.map +1 -0
- package/dist/types/adapters/StorageAdapter.d.ts +63 -0
- package/dist/types/adapters/StorageAdapter.d.ts.map +1 -0
- package/dist/types/adapters/StorageAdapter.js +2 -0
- package/dist/types/adapters/StorageAdapter.js.map +1 -0
- package/dist/types/adapters/index.d.ts +7 -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 +2 -2
- package/dist/spa/src/types/Adapters.ts +0 -213
- package/dist/types/Adapters.d.ts +0 -168
- package/dist/types/Adapters.d.ts.map +0 -1
- package/dist/types/Adapters.js +0 -2
- package/dist/types/Adapters.js.map +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<component
|
|
4
4
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.edit?.beforeBreadcrumbs || []"
|
|
5
5
|
:is="getCustomComponent(c)"
|
|
6
|
-
:meta="c.meta"
|
|
6
|
+
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
7
7
|
:record="editableRecord"
|
|
8
8
|
:resource="coreStore.resource"
|
|
9
9
|
:adminUser="coreStore.adminUser"
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
<BreadcrumbsWithButtons>
|
|
13
13
|
<!-- save and cancle -->
|
|
14
14
|
<button @click="$router.back()"
|
|
15
|
-
class="flex items-center py-1 px-3 me-2 text-sm font-medium text-
|
|
15
|
+
class="flex items-center py-1 px-3 me-2 text-sm font-medium text-lightEditViewButtonText rounded-default focus:outline-none bg-lightEditViewButtonBackground rounded border border-lightEditViewButtonBorder hover:bg-lightEditViewButtonBackgroundHover hover:text-lightEditViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightEditViewButtonFocusRing dark:focus:ring-darkEditViewButtonFocusRing dark:bg-darkEditViewButtonBackground dark:text-darkEditViewButtonText dark:border-darkEditViewButtonBorder dark:hover:text-darkEditViewButtonTextHover dark:hover:bg-darkEditViewButtonBackgroundHover"
|
|
16
16
|
>
|
|
17
17
|
{{ $t('Cancel') }}
|
|
18
18
|
</button>
|
|
19
19
|
|
|
20
20
|
<button
|
|
21
21
|
@click="saveRecord"
|
|
22
|
-
class="flex items-center py-1 px-3 text-sm font-medium rounded-default text-
|
|
22
|
+
class="flex items-center py-1 px-3 text-sm font-medium rounded-default text-lightEditViewSaveButtonText focus:outline-none bg-lightEditViewButtonBackground rounded border border-lightEditViewButtonBorder hover:bg-lightEditViewButtonBackgroundHover hover:text-lightEditViewSaveButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightEditViewButtonFocusRing dark:focus:ring-darkEditViewButtonFocusRing dark:bg-darkEditViewButtonBackground dark:text-darkEditViewSaveButtonText dark:border-darkEditViewButtonBorder dark:hover:text-darkEditViewSaveButtonTextHover dark:hover:bg-darkEditViewButtonBackgroundHover disabled:opacity-50"
|
|
23
23
|
:disabled="saving || (validating && !isValid)"
|
|
24
24
|
>
|
|
25
25
|
<IconFloppyDiskSolid class="w-4 h-4" />
|
|
@@ -27,7 +27,11 @@
|
|
|
27
27
|
</button>
|
|
28
28
|
|
|
29
29
|
<ThreeDotsMenu
|
|
30
|
-
:threeDotsDropdownItems="coreStore.resourceOptions?.pageInjections?.edit?.threeDotsDropdownItems
|
|
30
|
+
:threeDotsDropdownItems="Array.isArray(coreStore.resourceOptions?.pageInjections?.edit?.threeDotsDropdownItems)
|
|
31
|
+
? coreStore.resourceOptions.pageInjections.edit.threeDotsDropdownItems
|
|
32
|
+
: coreStore.resourceOptions?.pageInjections?.edit?.threeDotsDropdownItems
|
|
33
|
+
? [coreStore.resourceOptions.pageInjections.edit.threeDotsDropdownItems]
|
|
34
|
+
: undefined"
|
|
31
35
|
></ThreeDotsMenu>
|
|
32
36
|
|
|
33
37
|
</BreadcrumbsWithButtons>
|
|
@@ -35,16 +39,16 @@
|
|
|
35
39
|
<component
|
|
36
40
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.edit?.afterBreadcrumbs || []"
|
|
37
41
|
:is="getCustomComponent(c)"
|
|
38
|
-
:meta="c.meta"
|
|
42
|
+
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
39
43
|
:record="coreStore.record"
|
|
40
44
|
:resource="coreStore.resource"
|
|
41
45
|
:adminUser="coreStore.adminUser"
|
|
42
46
|
/>
|
|
43
47
|
|
|
44
48
|
<SingleSkeletLoader v-if="loading"></SingleSkeletLoader>
|
|
45
|
-
|
|
49
|
+
|
|
46
50
|
<ResourceForm
|
|
47
|
-
v-else
|
|
51
|
+
v-else-if="coreStore.resource"
|
|
48
52
|
:record="editableRecord"
|
|
49
53
|
:resource="coreStore.resource"
|
|
50
54
|
:adminUser="coreStore.adminUser"
|
|
@@ -58,7 +62,7 @@
|
|
|
58
62
|
<component
|
|
59
63
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.edit?.bottom || []"
|
|
60
64
|
:is="getCustomComponent(c)"
|
|
61
|
-
:meta="c.meta"
|
|
65
|
+
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
62
66
|
:record="coreStore.record"
|
|
63
67
|
:resource="coreStore.resource"
|
|
64
68
|
:adminUser="coreStore.adminUser"
|
|
@@ -76,12 +80,13 @@ import SingleSkeletLoader from '@/components/SingleSkeletLoader.vue';
|
|
|
76
80
|
import { useCoreStore } from '@/stores/core';
|
|
77
81
|
import { callAdminForthApi, getCustomComponent,checkAcessByAllowedActions, initThreeDotsDropdown } from '@/utils';
|
|
78
82
|
import { IconFloppyDiskSolid } from '@iconify-prerendered/vue-flowbite';
|
|
79
|
-
import { computed, onMounted, ref } from 'vue';
|
|
83
|
+
import { computed, onMounted, ref, type Ref } from 'vue';
|
|
80
84
|
import { useRoute, useRouter } from 'vue-router';
|
|
81
85
|
import { showErrorTost } from '@/composables/useFrontendApi';
|
|
82
86
|
import ThreeDotsMenu from '@/components/ThreeDotsMenu.vue';
|
|
83
87
|
import adminforth from '@/adminforth';
|
|
84
88
|
import { useI18n } from 'vue-i18n';
|
|
89
|
+
import { type AdminForthComponentDeclarationFull } from '@/types/Common.js';
|
|
85
90
|
|
|
86
91
|
const { t } = useI18n();
|
|
87
92
|
const coreStore = useCoreStore();
|
|
@@ -96,9 +101,9 @@ const loading = ref(true);
|
|
|
96
101
|
|
|
97
102
|
const saving = ref(false);
|
|
98
103
|
|
|
99
|
-
const record = ref({});
|
|
104
|
+
const record: Ref<Record<string, any>> = ref({});
|
|
100
105
|
|
|
101
|
-
async function onUpdateRecord(newRecord) {
|
|
106
|
+
async function onUpdateRecord(newRecord: Record<string, any>) {
|
|
102
107
|
record.value = newRecord;
|
|
103
108
|
}
|
|
104
109
|
|
|
@@ -110,7 +115,7 @@ const editableRecord = computed(() => {
|
|
|
110
115
|
coreStore.resource.columns.forEach(column => {
|
|
111
116
|
if (column.foreignResource) {
|
|
112
117
|
if (column.isArray?.enabled) {
|
|
113
|
-
newRecord[column.name] = newRecord[column.name]?.map(fr => fr.pk);
|
|
118
|
+
newRecord[column.name] = newRecord[column.name]?.map((fr: { pk: any }) => fr.pk);
|
|
114
119
|
} else {
|
|
115
120
|
newRecord[column.name] = newRecord[column.name]?.pk;
|
|
116
121
|
}
|
|
@@ -123,16 +128,20 @@ onMounted(async () => {
|
|
|
123
128
|
loading.value = true;
|
|
124
129
|
|
|
125
130
|
await coreStore.fetchResourceFull({
|
|
126
|
-
resourceId: route.params.resourceId
|
|
131
|
+
resourceId: route.params.resourceId as string
|
|
127
132
|
});
|
|
128
133
|
initThreeDotsDropdown();
|
|
129
134
|
|
|
130
135
|
await coreStore.fetchRecord({
|
|
131
|
-
resourceId: route.params.resourceId,
|
|
132
|
-
primaryKey: route.params.primaryKey,
|
|
136
|
+
resourceId: route.params.resourceId as string,
|
|
137
|
+
primaryKey: route.params.primaryKey as string,
|
|
133
138
|
source: 'edit',
|
|
134
139
|
});
|
|
135
|
-
|
|
140
|
+
|
|
141
|
+
if (coreStore.resourceOptions) {
|
|
142
|
+
checkAcessByAllowedActions(coreStore.resourceOptions.allowedActions,'edit');
|
|
143
|
+
}
|
|
144
|
+
|
|
136
145
|
loading.value = false;
|
|
137
146
|
});
|
|
138
147
|
|
|
@@ -145,7 +154,7 @@ async function saveRecord() {
|
|
|
145
154
|
}
|
|
146
155
|
|
|
147
156
|
saving.value = true;
|
|
148
|
-
const updates = {};
|
|
157
|
+
const updates: Record<string, any> = {};
|
|
149
158
|
for (const key in record.value) {
|
|
150
159
|
let columnIsUpdated = false;
|
|
151
160
|
|
|
@@ -157,7 +166,8 @@ async function saveRecord() {
|
|
|
157
166
|
columnIsUpdated = record.value[key] !== coreStore.record[key];
|
|
158
167
|
}
|
|
159
168
|
|
|
160
|
-
|
|
169
|
+
if (!coreStore.resource) return;
|
|
170
|
+
const column = coreStore.resource.columns.find((c) => c.name === key);
|
|
161
171
|
|
|
162
172
|
if (column?.foreignResource) {
|
|
163
173
|
columnIsUpdated = record.value[key] !== coreStore.record[key]?.pk;
|
|
@@ -177,7 +187,7 @@ async function saveRecord() {
|
|
|
177
187
|
record: updates,
|
|
178
188
|
},
|
|
179
189
|
});
|
|
180
|
-
if (resp.error) {
|
|
190
|
+
if (resp.error && resp.error !== 'Operation aborted by hook') {
|
|
181
191
|
showErrorTost(resp.error);
|
|
182
192
|
} else {
|
|
183
193
|
adminforth.alert({
|
|
@@ -21,67 +21,65 @@
|
|
|
21
21
|
@click="()=>{checkboxes = []}"
|
|
22
22
|
v-if="checkboxes.length"
|
|
23
23
|
data-tooltip-target="tooltip-remove-all"
|
|
24
|
-
class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-
|
|
24
|
+
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
25
|
>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</div>
|
|
26
|
+
<Tooltip>
|
|
27
|
+
<IconBanOutline class="w-5 h-5 "/>
|
|
28
|
+
<template #tooltip >
|
|
29
|
+
Remove selection
|
|
30
|
+
</template>
|
|
31
|
+
</Tooltip>
|
|
33
32
|
</button>
|
|
34
33
|
|
|
35
|
-
<
|
|
36
|
-
v-if="checkboxes.length"
|
|
34
|
+
<div
|
|
35
|
+
v-if="checkboxes.length"
|
|
37
36
|
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
37
|
>
|
|
47
|
-
<
|
|
48
|
-
v-if="action.
|
|
49
|
-
:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
38
|
+
<button
|
|
39
|
+
v-if="!action.showInThreeDotsDropdown || action.showInThreeDotsDropdown===false"
|
|
40
|
+
:key="action.id"
|
|
41
|
+
@click="startBulkAction(action.id)"
|
|
42
|
+
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"
|
|
43
|
+
:class="action.buttonCustomCssClass || ''"
|
|
44
|
+
>
|
|
45
|
+
<component
|
|
46
|
+
v-if="action.icon && !bulkActionLoadingStates[action.id]"
|
|
47
|
+
:is="getIcon(action.icon)"
|
|
48
|
+
class="w-5 h-5 transition duration-75 group-hover:text-gray-900 dark:group-hover:text-white"></component>
|
|
49
|
+
<div v-if="bulkActionLoadingStates[action.id]">
|
|
50
|
+
<svg
|
|
51
|
+
aria-hidden="true"
|
|
52
|
+
class="w-5 h-5 animate-spin"
|
|
53
|
+
:class="{
|
|
54
|
+
'text-gray-200 dark:text-gray-500 fill-gray-500 dark:fill-gray-300': action.state !== 'danger',
|
|
55
|
+
'text-red-200 dark:text-red-800 fill-red-600 dark:fill-red-500': action.state === 'danger'
|
|
56
|
+
}"
|
|
57
|
+
viewBox="0 0 100 101"
|
|
58
|
+
fill="none"
|
|
59
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
60
|
+
>
|
|
61
|
+
<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"/>
|
|
62
|
+
<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"/>
|
|
63
|
+
</svg>
|
|
64
|
+
<span class="sr-only">Loading...</span>
|
|
65
|
+
</div>
|
|
66
|
+
{{ `${action.label} (${checkboxes.length})` }}
|
|
67
|
+
<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
|
|
68
|
+
font-medium rounded-sm text-xs px-1 ml-1 text-center ">
|
|
69
|
+
{{ action.badge }}
|
|
70
|
+
</div>
|
|
71
|
+
</button>
|
|
72
|
+
</div>
|
|
75
73
|
<RouterLink v-if="coreStore.resource?.options?.allowedActions?.create"
|
|
76
74
|
:to="{ name: 'resource-create', params: { resourceId: $route.params.resourceId } }"
|
|
77
|
-
class="flex items-center py-1 px-3 text-sm font-medium text-
|
|
75
|
+
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"
|
|
78
76
|
>
|
|
79
77
|
<IconPlusOutline class="w-4 h-4 me-2"/>
|
|
80
78
|
{{ $t('Create') }}
|
|
81
79
|
</RouterLink>
|
|
82
80
|
|
|
83
81
|
<button
|
|
84
|
-
class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-
|
|
82
|
+
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
83
|
@click="()=>{filtersShow = !filtersShow}"
|
|
86
84
|
v-if="coreStore.resource?.options?.allowedActions?.filter"
|
|
87
85
|
>
|
|
@@ -96,6 +94,9 @@
|
|
|
96
94
|
|
|
97
95
|
<ThreeDotsMenu
|
|
98
96
|
:threeDotsDropdownItems="coreStore.resourceOptions?.pageInjections?.list?.threeDotsDropdownItems"
|
|
97
|
+
:bulkActions="coreStore.resource?.options?.bulkActions"
|
|
98
|
+
:checkboxes="checkboxes"
|
|
99
|
+
@startBulkAction="startBulkAction"
|
|
99
100
|
></ThreeDotsMenu>
|
|
100
101
|
</BreadcrumbsWithButtons>
|
|
101
102
|
|
|
@@ -125,6 +126,7 @@
|
|
|
125
126
|
:item-height="52.5"
|
|
126
127
|
:buffer-size="listBufferSize"
|
|
127
128
|
/>
|
|
129
|
+
|
|
128
130
|
<ResourceListTable
|
|
129
131
|
v-else
|
|
130
132
|
:resource="coreStore.resource"
|
|
@@ -165,7 +167,7 @@ import { useRoute } from 'vue-router';
|
|
|
165
167
|
import { showErrorTost } from '@/composables/useFrontendApi'
|
|
166
168
|
import { getCustomComponent, initThreeDotsDropdown } from '@/utils';
|
|
167
169
|
import ThreeDotsMenu from '@/components/ThreeDotsMenu.vue';
|
|
168
|
-
|
|
170
|
+
import { Tooltip } from '@/afcl'
|
|
169
171
|
|
|
170
172
|
import {
|
|
171
173
|
IconBanOutline,
|
|
@@ -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
|
|
|
@@ -23,44 +23,57 @@
|
|
|
23
23
|
|
|
24
24
|
<!-- Main modal -->
|
|
25
25
|
<div id="authentication-modal" tabindex="-1"
|
|
26
|
-
class="overflow-y-auto flex flex-grow
|
|
26
|
+
class="af-login-modal overflow-y-auto flex flex-grow
|
|
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="relative bg-
|
|
30
|
+
<div class="af-login-modal-content relative bg-lightLoginViewBackground rounded-lg shadow dark:bg-darkLoginViewBackground dark:shadow-black" >
|
|
31
31
|
<!-- Modal header -->
|
|
32
|
-
<div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
|
|
33
|
-
|
|
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
|
+
|
|
34
|
+
<template v-if="coreStore?.config?.loginPageInjections?.panelHeader.length > 0">
|
|
35
|
+
<component
|
|
36
|
+
v-for="(c, index) in coreStore?.config?.loginPageInjections?.panelHeader || []"
|
|
37
|
+
:key="index"
|
|
38
|
+
:is="getCustomComponent(c)"
|
|
39
|
+
:meta="c.meta"
|
|
40
|
+
/>
|
|
41
|
+
</template>
|
|
42
|
+
<h3 v-else class="text-xl font-semibold text-lightLoginViewText dark:text-darkLoginViewTextColor">
|
|
34
43
|
{{ $t('Sign in to') }} {{ coreStore.config?.brandName }}
|
|
35
44
|
</h3>
|
|
36
45
|
</div>
|
|
37
46
|
<!-- Modal body -->
|
|
38
|
-
<div class="p-4 md:p-5">
|
|
47
|
+
<div class="af-login-modal-body p-4 md:p-5">
|
|
39
48
|
<form class="space-y-4" @submit.prevent>
|
|
40
49
|
<div>
|
|
41
|
-
<label for="username" class="block mb-2 text-sm font-medium text-
|
|
42
|
-
<
|
|
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
|
+
<Input
|
|
52
|
+
v-model="username"
|
|
43
53
|
autocomplete="username"
|
|
44
54
|
type="username"
|
|
45
55
|
name="username"
|
|
46
56
|
id="username"
|
|
47
57
|
ref="usernameInput"
|
|
48
|
-
oninput="setCustomValidity('')"
|
|
49
58
|
@keydown.enter="passwordInput.focus()"
|
|
50
|
-
class="
|
|
59
|
+
class="w-full"
|
|
60
|
+
placeholder="name@company.com" required />
|
|
51
61
|
</div>
|
|
52
|
-
<div class="
|
|
53
|
-
<label for="password" class="block mb-2 text-sm font-medium text-
|
|
54
|
-
<
|
|
62
|
+
<div class="">
|
|
63
|
+
<label for="password" class="block mb-2 text-sm font-medium text-lightLoginViewText dark:text-darkLoginViewTextColor">{{ $t('Your password') }}</label>
|
|
64
|
+
<Input
|
|
65
|
+
v-model="password"
|
|
55
66
|
ref="passwordInput"
|
|
56
67
|
autocomplete="current-password"
|
|
57
|
-
oninput="setCustomValidity('')"
|
|
58
68
|
@keydown.enter="login"
|
|
59
|
-
:type="!showPw ? 'password': 'text'" name="password" id="password" placeholder="••••••••" class="
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
:type="!showPw ? 'password': 'text'" name="password" id="password" placeholder="••••••••" class="w-full" required>
|
|
70
|
+
<template #rightIcon>
|
|
71
|
+
<button type="button" @click="showPw = !showPw" class="text-lightLoginViewSubTextColor dark:text-darkLoginViewSubTextColor">
|
|
72
|
+
<IconEyeSolid class="w-5 h-5" v-if="!showPw" />
|
|
73
|
+
<IconEyeSlashSolid class="w-5 h-5" v-else />
|
|
74
|
+
</button>
|
|
75
|
+
</template>
|
|
76
|
+
</Input>
|
|
64
77
|
</div>
|
|
65
78
|
|
|
66
79
|
<div v-if="coreStore.config.rememberMeDays"
|
|
@@ -79,7 +92,7 @@
|
|
|
79
92
|
:meta="c.meta"
|
|
80
93
|
/>
|
|
81
94
|
|
|
82
|
-
<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">
|
|
95
|
+
<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">
|
|
83
96
|
<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">
|
|
84
97
|
<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"/>
|
|
85
98
|
</svg>
|
|
@@ -88,15 +101,15 @@
|
|
|
88
101
|
{{ error }}
|
|
89
102
|
</div>
|
|
90
103
|
</div>
|
|
91
|
-
|
|
92
|
-
<div v-if="
|
|
93
|
-
class="flex items-center p-4 mb-4 text-sm text-
|
|
104
|
+
|
|
105
|
+
<div v-if="loginPromptHTML"
|
|
106
|
+
class="flex items-center p-4 mb-4 text-sm text-lightLoginViewPromptText rounded-lg bg-lightLoginViewPromptBackground dark:bg-darkLoginViewPromptBackground dark:text-darkLoginViewPromptText" role="alert"
|
|
94
107
|
>
|
|
95
108
|
<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">
|
|
96
109
|
<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"/>
|
|
97
110
|
</svg>
|
|
98
111
|
<span class="sr-only">{{ $t('Info') }}</span>
|
|
99
|
-
<div v-html="
|
|
112
|
+
<div v-html="loginPromptHTML"></div>
|
|
100
113
|
</div>
|
|
101
114
|
<Button @click="login" :loader="inProgress" :disabled="inProgress" class="w-full">
|
|
102
115
|
{{ $t('Login to your account') }}
|
|
@@ -121,7 +134,7 @@ import { useUserStore } from '@/stores/user';
|
|
|
121
134
|
import { IconEyeSolid, IconEyeSlashSolid } from '@iconify-prerendered/vue-flowbite';
|
|
122
135
|
import { callAdminForthApi, loadFile } from '@/utils';
|
|
123
136
|
import { useRoute, useRouter } from 'vue-router';
|
|
124
|
-
import { Button, Checkbox } from '@/afcl';
|
|
137
|
+
import { Button, Checkbox, Input } from '@/afcl';
|
|
125
138
|
import { useI18n } from 'vue-i18n';
|
|
126
139
|
|
|
127
140
|
const { t } = useI18n();
|
|
@@ -129,11 +142,13 @@ const { t } = useI18n();
|
|
|
129
142
|
const passwordInput = ref(null);
|
|
130
143
|
const usernameInput = ref(null);
|
|
131
144
|
const rememberMeValue= ref(false);
|
|
145
|
+
const username = ref('');
|
|
146
|
+
const password = ref('');
|
|
132
147
|
|
|
133
148
|
const route = useRoute();
|
|
134
149
|
const router = useRouter();
|
|
135
150
|
const inProgress = ref(false);
|
|
136
|
-
|
|
151
|
+
const loginPromptHTML = ref()
|
|
137
152
|
const coreStore = useCoreStore();
|
|
138
153
|
const user = useUserStore();
|
|
139
154
|
|
|
@@ -145,6 +160,15 @@ const backgroundPosition = computed(() => {
|
|
|
145
160
|
return coreStore.config?.loginBackgroundPosition || '1/2';
|
|
146
161
|
});
|
|
147
162
|
|
|
163
|
+
|
|
164
|
+
async function getLoginFormConfig() {
|
|
165
|
+
const response = await callAdminForthApi({
|
|
166
|
+
path: '/get_login_form_config',
|
|
167
|
+
method: 'GET',
|
|
168
|
+
});
|
|
169
|
+
loginPromptHTML.value = response.loginPromptHTML;
|
|
170
|
+
}
|
|
171
|
+
|
|
148
172
|
onBeforeMount(() => {
|
|
149
173
|
if (localStorage.getItem('isAuthorized') === 'true') {
|
|
150
174
|
// if route has next param, redirect
|
|
@@ -158,29 +182,17 @@ onBeforeMount(() => {
|
|
|
158
182
|
})
|
|
159
183
|
|
|
160
184
|
onMounted(async () => {
|
|
185
|
+
getLoginFormConfig();
|
|
161
186
|
if (coreStore.config?.demoCredentials) {
|
|
162
|
-
const [
|
|
163
|
-
|
|
164
|
-
|
|
187
|
+
const [demoUsername, demoPassword] = coreStore.config.demoCredentials.split(':');
|
|
188
|
+
username.value = demoUsername;
|
|
189
|
+
password.value = demoPassword;
|
|
165
190
|
}
|
|
166
191
|
usernameInput.value.focus();
|
|
167
192
|
});
|
|
168
193
|
|
|
169
194
|
|
|
170
195
|
async function login() {
|
|
171
|
-
|
|
172
|
-
const username = usernameInput.value.value;
|
|
173
|
-
const password = passwordInput.value.value;
|
|
174
|
-
|
|
175
|
-
if (!username) {
|
|
176
|
-
usernameInput.value.setCustomValidity(t('Please fill out this field.'));
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
if (!password) {
|
|
180
|
-
passwordInput.value.setCustomValidity(t('Please fill out this field.'));
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
196
|
if (inProgress.value) {
|
|
185
197
|
return;
|
|
186
198
|
}
|
|
@@ -189,8 +201,8 @@ async function login() {
|
|
|
189
201
|
path: '/login',
|
|
190
202
|
method: 'POST',
|
|
191
203
|
body: {
|
|
192
|
-
username,
|
|
193
|
-
password,
|
|
204
|
+
username: username.value,
|
|
205
|
+
password: password.value,
|
|
194
206
|
rememberMe: rememberMeValue.value,
|
|
195
207
|
}
|
|
196
208
|
});
|
|
@@ -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/>
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
v-if="!loading"
|
|
5
5
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.beforeBreadcrumbs || []"
|
|
6
6
|
:is="getCustomComponent(c)"
|
|
7
|
-
:meta="c.meta"
|
|
7
|
+
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
8
8
|
:record="coreStore.record"
|
|
9
9
|
:resource="coreStore.resource"
|
|
10
10
|
:adminUser="coreStore.adminUser"
|
|
11
11
|
/>
|
|
12
12
|
<BreadcrumbsWithButtons>
|
|
13
|
-
<template v-if="coreStore.resource?.options?.
|
|
13
|
+
<template v-if="coreStore.resource?.options?.bulkActions">
|
|
14
14
|
<button
|
|
15
|
-
v-for="action in coreStore.resource.options.
|
|
15
|
+
v-for="action in coreStore.resource.options.bulkActions.filter(a => a.showIn?.showButton)"
|
|
16
16
|
:key="action.id"
|
|
17
17
|
@click="startCustomAction(action.id)"
|
|
18
18
|
:disabled="actionLoadingStates[action.id]"
|
|
@@ -28,36 +28,40 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
<RouterLink v-if="coreStore.resource?.options?.allowedActions?.create"
|
|
30
30
|
:to="{ name: 'resource-create', params: { resourceId: $route.params.resourceId } }"
|
|
31
|
-
class="flex items-center py-1 px-3 text-sm font-medium text-
|
|
31
|
+
class="af-add-new-button flex items-center py-1 px-3 text-sm font-medium text-lightShowViewButtonText focus:outline-none bg-lightShowViewButtonBackground rounded border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-lightShowViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-darkShowViewButtonText dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover rounded-default"
|
|
32
32
|
>
|
|
33
33
|
<IconPlusOutline class="w-4 h-4 me-2"/>
|
|
34
34
|
{{ $t('Add new') }}
|
|
35
35
|
</RouterLink>
|
|
36
36
|
|
|
37
37
|
<RouterLink v-if="coreStore?.resourceOptions?.allowedActions?.edit" :to="{ name: 'resource-edit', params: { resourceId: $route.params.resourceId, primaryKey: $route.params.primaryKey } }"
|
|
38
|
-
class="flex items-center py-1 px-3 text-sm font-medium text-
|
|
38
|
+
class="flex items-center af-edit-button py-1 px-3 text-sm font-medium text-lightShowViewButtonText focus:outline-none bg-lightShowViewButtonBackground rounded-default border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-lightShowViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-darkShowViewButtonText dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover"
|
|
39
39
|
>
|
|
40
40
|
<IconPenSolid class="w-4 h-4" />
|
|
41
41
|
{{ $t('Edit') }}
|
|
42
42
|
</RouterLink>
|
|
43
43
|
|
|
44
44
|
<button v-if="coreStore?.resourceOptions?.allowedActions?.delete" @click="deleteRecord"
|
|
45
|
-
class="flex items-center py-1 px-3 text-sm font-medium rounded-default text-red-600 focus:outline-none bg-
|
|
45
|
+
class="flex items-center af-delete-button py-1 px-3 text-sm font-medium rounded-default text-red-600 focus:outline-none bg-lightShowViewButtonBackground border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-red-700 focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-red-500 dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover"
|
|
46
46
|
>
|
|
47
47
|
<IconTrashBinSolid class="w-4 h-4" />
|
|
48
48
|
{{ $t('Delete') }}
|
|
49
49
|
</button>
|
|
50
50
|
|
|
51
51
|
<ThreeDotsMenu
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
:threeDotsDropdownItems="Array.isArray(coreStore.resourceOptions?.pageInjections?.show?.threeDotsDropdownItems)
|
|
53
|
+
? coreStore.resourceOptions.pageInjections.show.threeDotsDropdownItems
|
|
54
|
+
: coreStore.resourceOptions?.pageInjections?.show?.threeDotsDropdownItems
|
|
55
|
+
? [coreStore.resourceOptions.pageInjections.show.threeDotsDropdownItems]
|
|
56
|
+
: undefined"
|
|
57
|
+
:customActions="customActions"
|
|
54
58
|
></ThreeDotsMenu>
|
|
55
59
|
</BreadcrumbsWithButtons>
|
|
56
60
|
|
|
57
61
|
<component
|
|
58
62
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.afterBreadcrumbs || []"
|
|
59
63
|
:is="getCustomComponent(c)"
|
|
60
|
-
:meta="c.meta"
|
|
64
|
+
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
61
65
|
:record="coreStore.record"
|
|
62
66
|
:resource="coreStore.resource"
|
|
63
67
|
:adminUser="coreStore.adminUser"
|
|
@@ -78,9 +82,9 @@
|
|
|
78
82
|
>
|
|
79
83
|
<div v-if="!groups.length && allColumns.length">
|
|
80
84
|
<ShowTable
|
|
81
|
-
:columns="allColumns"
|
|
82
85
|
:resource="coreStore.resource"
|
|
83
86
|
:record="coreStore.record"
|
|
87
|
+
:columns="allColumns as Array<{ name: string; label?: string; components?: any }>"
|
|
84
88
|
/>
|
|
85
89
|
</div>
|
|
86
90
|
<template v-else>
|
|
@@ -95,10 +99,10 @@
|
|
|
95
99
|
</template>
|
|
96
100
|
<template v-if="otherColumns.length > 0">
|
|
97
101
|
<ShowTable
|
|
98
|
-
:columns="otherColumns"
|
|
99
102
|
groupName="Other Fields"
|
|
100
103
|
:resource="coreStore.resource"
|
|
101
104
|
:record="coreStore.record"
|
|
105
|
+
:columns="otherColumns as Array<{ name: string; label?: string; components?: any }>"
|
|
102
106
|
/>
|
|
103
107
|
</template>
|
|
104
108
|
</template>
|
|
@@ -112,8 +116,7 @@
|
|
|
112
116
|
v-if="!loading"
|
|
113
117
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.bottom || []"
|
|
114
118
|
:is="getCustomComponent(c)"
|
|
115
|
-
:meta="c.meta"
|
|
116
|
-
:column="column"
|
|
119
|
+
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
117
120
|
:record="coreStore.record"
|
|
118
121
|
:resource="coreStore.resource"
|
|
119
122
|
:adminUser="coreStore.adminUser"
|
|
@@ -140,6 +143,7 @@ import ShowTable from '@/components/ShowTable.vue';
|
|
|
140
143
|
import adminforth from "@/adminforth";
|
|
141
144
|
import { useI18n } from 'vue-i18n';
|
|
142
145
|
import { getIcon } from '@/utils';
|
|
146
|
+
import { type AdminForthComponentDeclarationFull } from '@/types/Common.js';
|
|
143
147
|
|
|
144
148
|
const route = useRoute();
|
|
145
149
|
const router = useRouter();
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
const subscriptions: { [topic: string]: ((data: any) => void)[] } = {};
|
|
3
|
+
|
|
4
|
+
interface ExtendedWebSocket extends WebSocket {
|
|
5
|
+
connected?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
const state: {
|
|
4
9
|
status: 'connecting' | 'connected' | 'disconnected';
|
|
5
|
-
ws:
|
|
10
|
+
ws: ExtendedWebSocket | null;
|
|
6
11
|
} = {
|
|
7
12
|
status: 'connecting',
|
|
8
13
|
ws: null
|