adminforth 1.5.8-next.2 โ 1.5.8-next.20
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/utils.js +35 -17
- package/dist/dataConnectors/postgres.d.ts.map +1 -1
- package/dist/dataConnectors/postgres.js +1 -1
- package/dist/dataConnectors/postgres.js.map +1 -1
- package/dist/dataConnectors/sqlite.d.ts.map +1 -1
- package/dist/dataConnectors/sqlite.js +12 -0
- package/dist/dataConnectors/sqlite.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/codeInjector.d.ts.map +1 -1
- package/dist/modules/codeInjector.js +12 -10
- package/dist/modules/codeInjector.js.map +1 -1
- package/dist/modules/configValidator.d.ts.map +1 -1
- package/dist/modules/configValidator.js +7 -0
- package/dist/modules/configValidator.js.map +1 -1
- package/dist/modules/restApi.d.ts.map +1 -1
- package/dist/modules/restApi.js +74 -24
- package/dist/modules/restApi.js.map +1 -1
- package/dist/modules/socketBroker.d.ts +2 -1
- package/dist/modules/socketBroker.d.ts.map +1 -1
- package/dist/modules/socketBroker.js +28 -13
- package/dist/modules/socketBroker.js.map +1 -1
- package/dist/servers/express.d.ts +1 -0
- package/dist/servers/express.d.ts.map +1 -1
- package/dist/servers/express.js +11 -1
- package/dist/servers/express.js.map +1 -1
- package/dist/spa/src/App.vue +15 -5
- package/dist/spa/src/afcl/Select.vue +1 -1
- package/dist/spa/src/components/Breadcrumbs.vue +1 -1
- package/dist/spa/src/components/CustomDatePicker.vue +3 -2
- package/dist/spa/src/components/CustomDateRangePicker.vue +3 -3
- package/dist/spa/src/components/CustomRangePicker.vue +2 -2
- package/dist/spa/src/components/Filters.vue +10 -5
- package/dist/spa/src/components/GroupsTable.vue +10 -7
- package/dist/spa/src/components/MenuLink.vue +16 -2
- package/dist/spa/src/components/ResourceForm.vue +12 -8
- package/dist/spa/src/components/ResourceListTable.vue +12 -7
- package/dist/spa/src/i18n.ts +55 -0
- package/dist/spa/src/main.ts +5 -6
- package/dist/spa/src/renderers/CountryFlag.vue +2 -2
- package/dist/spa/src/stores/core.ts +31 -5
- package/dist/spa/src/types/Adapters.ts +11 -2
- package/dist/spa/src/types/Back.ts +20 -5
- package/dist/spa/src/types/Common.ts +8 -1
- package/dist/spa/src/utils.ts +2 -0
- package/dist/spa/src/views/ListView.vue +21 -2
- package/dist/spa/src/views/LoginView.vue +1 -1
- package/dist/types/Adapters.d.ts +5 -2
- package/dist/types/Adapters.d.ts.map +1 -1
- package/dist/types/Back.d.ts +19 -5
- package/dist/types/Back.d.ts.map +1 -1
- package/dist/types/Back.js.map +1 -1
- package/dist/types/Common.d.ts +5 -1
- package/dist/types/Common.d.ts.map +1 -1
- package/package.json +2 -3
package/dist/servers/express.js
CHANGED
|
@@ -211,6 +211,14 @@ class ExpressServer {
|
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
|
+
translatable(handler) {
|
|
215
|
+
// same as authorize, but injects tr function into request
|
|
216
|
+
return async (req, res, next) => {
|
|
217
|
+
const tr = (msg, category, params) => this.adminforth.tr(msg, category, req.headers['accept-language'], params);
|
|
218
|
+
req.tr = tr;
|
|
219
|
+
handler(req, res, next);
|
|
220
|
+
};
|
|
221
|
+
}
|
|
214
222
|
endpoint({ method = 'GET', path, handler, noAuth = false }) {
|
|
215
223
|
if (!path.startsWith('/')) {
|
|
216
224
|
throw new Error(`Path must start with /, got: ${path}`);
|
|
@@ -248,7 +256,9 @@ class ExpressServer {
|
|
|
248
256
|
return res;
|
|
249
257
|
}
|
|
250
258
|
};
|
|
251
|
-
const
|
|
259
|
+
const acceptLang = headers['accept-language'];
|
|
260
|
+
const tr = (msg, category, params) => this.adminforth.tr(msg, category, acceptLang, params);
|
|
261
|
+
const input = { body, query, headers, cookies, adminUser, response, _raw_express_req: req, _raw_express_res: res, tr };
|
|
252
262
|
let output;
|
|
253
263
|
try {
|
|
254
264
|
output = await handler(input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.js","sourceRoot":"","sources":["../../servers/express.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,SAAS,cAAc,CAAC,MAAM,EAAE,SAAS;IACvC,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,GAAG,EAAE,GAAG;IAC7B,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,kBAAkB,CAAC,aAAqB;IAI/C,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACr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O,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;gBACzC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;YACH,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC5B,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACrB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBAC3B,OAAO;YACT,CAAC;YACD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBACpB,qCAAqC;gBACrC,OAAO;YACT,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,CAAC,CAAA;QAED,OAAO,CAAC,GAAG,CAAC,mBAAmB,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAC;QACrD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;IAC5G,CAAC;CAEF;AAED,eAAe,aAAa,CAAC"}
|
package/dist/spa/src/App.vue
CHANGED
|
@@ -102,8 +102,18 @@
|
|
|
102
102
|
|
|
103
103
|
<span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">{{ item.label }}
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
fill-lightAnnouncementText dark:fill-darkAccent text-lightAnnouncementText dark:text-darkAccent">
|
|
105
|
+
<span v-if="item.badge" class="inline-flex items-center justify-center w-3 h-3 p-3 ms-3 text-sm font-medium rounded-full bg-lightAnnouncementBG dark:bg-darkAnnouncementBG
|
|
106
|
+
fill-lightAnnouncementText dark:fill-darkAccent text-lightAnnouncementText dark:text-darkAccent">
|
|
107
|
+
<Tooltip v-if="item.badgeTooltip">
|
|
108
|
+
{{ item.badge }}
|
|
109
|
+
<template #tooltip>
|
|
110
|
+
{{ item.badgeTooltip }}
|
|
111
|
+
</template>
|
|
112
|
+
</Tooltip>
|
|
113
|
+
<template v-else>
|
|
114
|
+
{{ item.badge }}
|
|
115
|
+
</template>
|
|
116
|
+
</span>
|
|
107
117
|
</span>
|
|
108
118
|
|
|
109
119
|
<svg :class="{'rotate-180': opened.includes(i) }" class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
|
|
@@ -236,16 +246,16 @@ import AcceptModal from './components/AcceptModal.vue';
|
|
|
236
246
|
import MenuLink from './components/MenuLink.vue';
|
|
237
247
|
import { useRoute, useRouter } from 'vue-router';
|
|
238
248
|
import { getIcon, verySimpleHash } from '@/utils';
|
|
239
|
-
import { useHead } from 'unhead'
|
|
240
249
|
import { createHead } from 'unhead'
|
|
241
250
|
import { loadFile } from '@/utils';
|
|
242
251
|
import Toast from './components/Toast.vue';
|
|
243
252
|
import {useToastStore} from '@/stores/toast';
|
|
244
253
|
import { FrontendAPI } from '@/composables/useStores';
|
|
245
254
|
import { getCustomComponent } from '@/utils';
|
|
246
|
-
import type { AnnouncementBadgeResponse } from './types/Common';
|
|
255
|
+
import type { AdminForthConfigMenuItem, AnnouncementBadgeResponse } from './types/Common';
|
|
256
|
+
import { Tooltip } from '@/afcl';
|
|
257
|
+
|
|
247
258
|
|
|
248
|
-
// import { link } from 'fs';
|
|
249
259
|
const coreStore = useCoreStore();
|
|
250
260
|
const toastStore = useToastStore();
|
|
251
261
|
const userStore = useUserStore();
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@input="inputInput"
|
|
10
10
|
class="block w-full pl-3 pr-10 py-2.5 border border-gray-300 rounded-md leading-5 bg-gray-50 placeholder-gray-500 sm:text-sm transition duration-150 ease-in-out dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white focus:ring-lightPrimary focus:border-lightPrimary dark:focus:ring-darkPrimary dark:focus:border-darkPrimary"
|
|
11
11
|
:placeholder="
|
|
12
|
-
selectedItems.length && !multiple ? '' : (showDropdown ? 'Search' : placeholder || 'Select...')
|
|
12
|
+
selectedItems.length && !multiple ? '' : (showDropdown ? $t('Search') : placeholder || $t('Select...'))
|
|
13
13
|
"
|
|
14
14
|
/>
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</svg>
|
|
26
26
|
<span class="ms-1 text-sm font-medium text-gray-500 md:ms-2 dark:text-gray-400
|
|
27
27
|
max-w-80 truncate">
|
|
28
|
-
{{ $route.name === 'resource-edit' ? 'Edit' : 'Show' }} {{ coreStore.record?._label }}</span>
|
|
28
|
+
{{ $route.name === 'resource-edit' ? $t('Edit') : $t('Show') }} {{ coreStore.record?._label }}</span>
|
|
29
29
|
</div>
|
|
30
30
|
</li>
|
|
31
31
|
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
<input ref="datepickerStartEl" type="text"
|
|
13
13
|
class="bg-gray-50 border leading-none 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-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
14
|
-
|
|
14
|
+
:placeholder="$t('Select date')"
|
|
15
|
+
>
|
|
15
16
|
</div>
|
|
16
17
|
</div>
|
|
17
18
|
</div>
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
|
|
34
35
|
<button type="button"
|
|
35
36
|
class="text-lightPrimary dark:text-darkPrimary text-base font-medium hover:underline p-0 inline-flex items-center mb-2"
|
|
36
|
-
@click="toggleTimeInputs">{{ showTimeInputs ? 'Hide time' : 'Show time' }}
|
|
37
|
+
@click="toggleTimeInputs">{{ showTimeInputs ? $t('Hide time') : $t('Show time') }}
|
|
37
38
|
<svg class="w-8 h-8 ms-0.5" :class="{'rotate-180': showTimeInputs}" aria-hidden="true"
|
|
38
39
|
xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
|
39
40
|
fill="none" viewBox="0 0 24 24">
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<input ref="datepickerStartEl" type="text"
|
|
10
10
|
class="bg-gray-50 border leading-none 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-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
11
|
-
placeholder="From">
|
|
11
|
+
:placeholder="$t('From')">
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
14
|
<div class="relative">
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<input ref="datepickerEndEl" type="text"
|
|
20
20
|
class="bg-gray-50 border leading-none 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-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
21
|
-
placeholder="To">
|
|
21
|
+
:placeholder="$t('To')">
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
24
24
|
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
<button type="button"
|
|
53
53
|
class="text-lightPrimary dark:text-darkPrimary text-base font-medium hover:underline p-0 inline-flex items-center mb-2"
|
|
54
|
-
@click="toggleTimeInputs">{{ showTimeInputs ? 'Hide time' : 'Show time' }}
|
|
54
|
+
@click="toggleTimeInputs">{{ showTimeInputs ? $t('Hide time') : $t('Show time') }}
|
|
55
55
|
<svg class="w-8 h-8 ms-0.5 relative top-px" :class="{'rotate-180': showTimeInputs}" aria-hidden="true"
|
|
56
56
|
xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
|
57
57
|
fill="none" viewBox="0 0 24 24">
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:max="maxFormatted"
|
|
6
6
|
type="number" aria-describedby="helper-text-explanation"
|
|
7
7
|
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-20 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
8
|
-
placeholder="From"
|
|
8
|
+
:placeholder="$t('From')"
|
|
9
9
|
v-model="start"
|
|
10
10
|
>
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
:max="maxFormatted"
|
|
15
15
|
type="number" aria-describedby="helper-text-explanation"
|
|
16
16
|
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-20 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
17
|
-
placeholder="To"
|
|
17
|
+
:placeholder="$t('To')"
|
|
18
18
|
v-model="end"
|
|
19
19
|
>
|
|
20
20
|
|
|
@@ -34,7 +34,12 @@
|
|
|
34
34
|
multiple
|
|
35
35
|
class="w-full"
|
|
36
36
|
v-else-if="c.type === 'boolean'"
|
|
37
|
-
:options="[
|
|
37
|
+
:options="[
|
|
38
|
+
{ label: $t('Yes'), value: true },
|
|
39
|
+
{ label: $t('No'), value: false },
|
|
40
|
+
// if field is not required, undefined might be there, and user might want to filter by it
|
|
41
|
+
...(c.required ? [] : [ { label: $t('Unset'), value: undefined } ])
|
|
42
|
+
]"
|
|
38
43
|
@update:modelValue="setFilterItem({ column: c, operator: 'in', value: $event || undefined })"
|
|
39
44
|
:modelValue="filtersStore.filters.find(f => f.field === c.name && f.operator === 'in')?.value || []"
|
|
40
45
|
/>
|
|
@@ -51,7 +56,7 @@
|
|
|
51
56
|
<input
|
|
52
57
|
v-else-if="[ 'string', 'text' ].includes(c.type)"
|
|
53
58
|
type="text" class="w-full py-1 px-2 border border-gray-300 rounded-md dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
54
|
-
placeholder="Search"
|
|
59
|
+
:placeholder="$t('Search')"
|
|
55
60
|
@input="setFilterItem({ column: c, operator: 'ilike', value: $event.target.value || undefined })"
|
|
56
61
|
:value="getFilterItem({ column: c, operator: 'ilike' })"
|
|
57
62
|
>
|
|
@@ -68,7 +73,7 @@
|
|
|
68
73
|
<input
|
|
69
74
|
v-else-if="[ 'date', 'time' ].includes(c.type)"
|
|
70
75
|
type="text" class="w-full py-1 px-2 border border-gray-300 rounded-md"
|
|
71
|
-
placeholder="Search datetime"
|
|
76
|
+
:placeholder="$t('Search datetime')"
|
|
72
77
|
@input="setFilterItem({ column: c, operator: 'ilike', value: $event.target.value || undefined })"
|
|
73
78
|
:value="getFilterItem({ column: c, operator: 'ilike' })"
|
|
74
79
|
>
|
|
@@ -87,14 +92,14 @@
|
|
|
87
92
|
<input
|
|
88
93
|
type="number" aria-describedby="helper-text-explanation"
|
|
89
94
|
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-20 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
90
|
-
placeholder="From"
|
|
95
|
+
:placeholder="$t('From')"
|
|
91
96
|
@input="setFilterItem({ column: c, operator: 'gte', value: $event.target.value || undefined })"
|
|
92
97
|
:value="getFilterItem({ column: c, operator: 'gte' })"
|
|
93
98
|
>
|
|
94
99
|
<input
|
|
95
100
|
type="number" aria-describedby="helper-text-explanation"
|
|
96
101
|
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-20 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
97
|
-
placeholder="To"
|
|
102
|
+
:placeholder="$t('To')"
|
|
98
103
|
@input="setFilterItem({ column: c, operator: 'lte', value: $event.target.value || undefined})"
|
|
99
104
|
:value="getFilterItem({ column: c, operator: 'lte' })"
|
|
100
105
|
>
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
class="w-full"
|
|
58
58
|
v-if="column.foreignResource"
|
|
59
59
|
:options="columnOptions[column.name] || []"
|
|
60
|
-
:placeholder = "columnOptions[column.name]?.length
|
|
60
|
+
:placeholder = "columnOptions[column.name]?.length ?$t('Select...'): $t('There are no options available')"
|
|
61
61
|
:modelValue="currentValues[column.name]"
|
|
62
62
|
@update:modelValue="setCurrentValue(column.name, $event)"
|
|
63
63
|
></Select>
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
<textarea
|
|
104
104
|
v-else-if="['text', 'richtext'].includes(column.type)"
|
|
105
105
|
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-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
106
|
-
placeholder="Text"
|
|
106
|
+
:placeholder="$t('Text')"
|
|
107
107
|
:value="currentValues[column.name]"
|
|
108
108
|
@input="setCurrentValue(column.name, $event.target.value)"
|
|
109
109
|
>
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
<textarea
|
|
112
112
|
v-else-if="['json'].includes(column.type)"
|
|
113
113
|
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-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
114
|
-
placeholder="Text"
|
|
114
|
+
:placeholder="$t('Text')"
|
|
115
115
|
:value="currentValues[column.name]"
|
|
116
116
|
@input="setCurrentValue(column.name, $event.target.value)"
|
|
117
117
|
>
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
v-else
|
|
121
121
|
:type="!column.masked || unmasked[column.name] ? 'text' : 'password'"
|
|
122
122
|
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-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
123
|
-
placeholder="Text"
|
|
123
|
+
:placeholder="$t('Text')"
|
|
124
124
|
:value="currentValues[column.name]"
|
|
125
125
|
@input="setCurrentValue(column.name, $event.target.value)"
|
|
126
126
|
autocomplete="false"
|
|
@@ -155,6 +155,9 @@
|
|
|
155
155
|
import { getCustomComponent } from '@/utils';
|
|
156
156
|
import { Tooltip } from '@/afcl';
|
|
157
157
|
import { ref, computed, watch, type Ref } from 'vue';
|
|
158
|
+
import { useI18n } from 'vue-i18n';
|
|
159
|
+
|
|
160
|
+
const { t } = useI18n();
|
|
158
161
|
|
|
159
162
|
const props = defineProps<{
|
|
160
163
|
source: 'create' | 'edit',
|
|
@@ -170,11 +173,11 @@
|
|
|
170
173
|
|
|
171
174
|
const getBooleanOptions = (column: any) => {
|
|
172
175
|
const options: Array<{ label: string; value: boolean | null }> = [
|
|
173
|
-
{ label: 'Yes', value: true },
|
|
174
|
-
{ label: 'No', value: false },
|
|
176
|
+
{ label: t('Yes'), value: true },
|
|
177
|
+
{ label: t('No'), value: false },
|
|
175
178
|
];
|
|
176
179
|
if (!column.required[props.mode]) {
|
|
177
|
-
options.push({ label: 'Unset', value: null });
|
|
180
|
+
options.push({ label: t('Unset'), value: null });
|
|
178
181
|
}
|
|
179
182
|
return options;
|
|
180
183
|
};
|
|
@@ -13,14 +13,28 @@
|
|
|
13
13
|
<component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-lightSidebarIcons dark:text-darkSidebarIcons transition duration-75 group-hover:text-lightSidebarIconsHover dark:group-hover:text-darkSidebarIconsHover" ></component>
|
|
14
14
|
<span class="ms-3">{{ item.label }}</span>
|
|
15
15
|
<span v-if="item.badge" class="inline-flex items-center justify-center w-3 h-3 p-3 ms-3 text-sm font-medium rounded-full bg-lightAnnouncementBG dark:bg-darkAnnouncementBG
|
|
16
|
-
fill-lightAnnouncementText dark:fill-darkAccent text-lightAnnouncementText dark:text-darkAccent"
|
|
16
|
+
fill-lightAnnouncementText dark:fill-darkAccent text-lightAnnouncementText dark:text-darkAccent"
|
|
17
|
+
>
|
|
18
|
+
|
|
19
|
+
<Tooltip v-if="item.badgeTooltip">
|
|
20
|
+
{{ item.badge }}
|
|
21
|
+
|
|
22
|
+
<template #tooltip>
|
|
23
|
+
{{ item.badgeTooltip }}
|
|
24
|
+
</template>
|
|
25
|
+
</Tooltip>
|
|
26
|
+
<template v-else>
|
|
27
|
+
{{ item.badge }}
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
</span>
|
|
17
31
|
|
|
18
32
|
</RouterLink>
|
|
19
33
|
</template>
|
|
20
34
|
|
|
21
35
|
<script setup lang="ts">
|
|
22
36
|
import { getIcon } from '@/utils';
|
|
23
|
-
|
|
37
|
+
import { Tooltip } from '@/afcl';
|
|
24
38
|
const props = defineProps(['item', 'isChild']);
|
|
25
39
|
|
|
26
40
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="rounded-default">
|
|
3
|
+
<pre>
|
|
4
|
+
</pre>
|
|
3
5
|
<form autocomplete="off" @submit.prevent>
|
|
4
6
|
<div v-if="!groups || groups.length === 0">
|
|
5
7
|
<GroupsTable
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
<div v-if="otherColumns.length > 0">
|
|
38
40
|
<GroupsTable
|
|
39
41
|
:source="source"
|
|
40
|
-
:group="{groupName: 'Other', columns: otherColumns}"
|
|
42
|
+
:group="{groupName: $t('Other'), columns: otherColumns}"
|
|
41
43
|
:currentValues="currentValues"
|
|
42
44
|
:editableColumns="editableColumns"
|
|
43
45
|
:mode="mode"
|
|
@@ -64,9 +66,11 @@ import { computed, onMounted, ref, watch } from 'vue';
|
|
|
64
66
|
import { useRouter, useRoute } from 'vue-router';
|
|
65
67
|
import { useCoreStore } from "@/stores/core";
|
|
66
68
|
import GroupsTable from '@/components/GroupsTable.vue';
|
|
69
|
+
import { useI18n } from 'vue-i18n';
|
|
67
70
|
|
|
68
|
-
const
|
|
71
|
+
const { t } = useI18n();
|
|
69
72
|
|
|
73
|
+
const coreStore = useCoreStore();
|
|
70
74
|
const router = useRouter();
|
|
71
75
|
const route = useRoute();
|
|
72
76
|
const props = defineProps({
|
|
@@ -103,18 +107,18 @@ const columnError = (column) => {
|
|
|
103
107
|
(customComponentsEmptiness.value[column.name] !== false)
|
|
104
108
|
|
|
105
109
|
) {
|
|
106
|
-
return 'This field is required';
|
|
110
|
+
return t('This field is required');
|
|
107
111
|
}
|
|
108
112
|
if (column.type === 'json' && currentValues.value[column.name]) {
|
|
109
113
|
try {
|
|
110
114
|
JSON.parse(currentValues.value[column.name]);
|
|
111
115
|
} catch (e) {
|
|
112
|
-
return 'Invalid JSON';
|
|
116
|
+
return t('Invalid JSON');
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
119
|
if ( column.type === 'string' || column.type === 'text' ) {
|
|
116
120
|
if ( column.maxLength && currentValues.value[column.name]?.length > column.maxLength ) {
|
|
117
|
-
return
|
|
121
|
+
return t('This field must be shorter than {maxLength} characters', { maxLength: column.maxLength });
|
|
118
122
|
}
|
|
119
123
|
|
|
120
124
|
if ( column.minLength && currentValues.value[column.name]?.length < column.minLength ) {
|
|
@@ -123,7 +127,7 @@ const columnError = (column) => {
|
|
|
123
127
|
if (!needToCheckEmpty) {
|
|
124
128
|
return null;
|
|
125
129
|
}
|
|
126
|
-
return
|
|
130
|
+
return t('This field must be longer than {minLength} characters', { minLength: column.minLength });
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
133
|
if ( ['integer', 'decimal', 'float'].includes(column.type) ) {
|
|
@@ -131,10 +135,10 @@ const columnError = (column) => {
|
|
|
131
135
|
&& currentValues.value[column.name] !== null
|
|
132
136
|
&& currentValues.value[column.name] < column.minValue
|
|
133
137
|
) {
|
|
134
|
-
return
|
|
138
|
+
return t('This field must be greater than {minValue}', { minValue: column.minValue });
|
|
135
139
|
}
|
|
136
140
|
if ( column.maxValue !== undefined && currentValues.value[column.name] > column.maxValue ) {
|
|
137
|
-
return
|
|
141
|
+
return t('This field must be less than {maxValue}', { maxValue: column.maxValue });
|
|
138
142
|
}
|
|
139
143
|
}
|
|
140
144
|
if (currentValues.value[column.name] && column.validation) {
|
|
@@ -233,13 +233,18 @@
|
|
|
233
233
|
<!-- Help text -->
|
|
234
234
|
<span class="text-sm text-gray-700 dark:text-gray-400">
|
|
235
235
|
<span v-if="((page || 1) - 1) * pageSize + 1 > totalRows">{{ $t('Wrong Page') }} </span>
|
|
236
|
-
<
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
236
|
+
<template v-else>
|
|
237
|
+
<span class="hidden sm:inline"
|
|
238
|
+
v-html="$t('Showing {from} to {to} of {total} Entries', {from: ((page || 1) - 1) * pageSize + 1, to: Math.min((page || 1) * pageSize, totalRows), total: totalRows})
|
|
239
|
+
.replace(/\d+/g, '<strong>$&</strong>')">
|
|
240
|
+
</span>
|
|
241
|
+
<span class="sm:hidden"
|
|
242
|
+
v-html="$t('{from} - {to} of {total}', {from: ((page || 1) - 1) * pageSize + 1, to: Math.min((page || 1) * pageSize, totalRows), total: totalRows})
|
|
243
|
+
.replace(/\d+/g, '<strong>$&</strong>')
|
|
244
|
+
">
|
|
245
|
+
</span>
|
|
246
|
+
|
|
247
|
+
</template>
|
|
243
248
|
</span>
|
|
244
249
|
</div>
|
|
245
250
|
</template>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createI18n } from 'vue-i18n';
|
|
2
|
+
import { createApp } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// taken from here https://vue-i18n.intlify.dev/guide/essentials/pluralization.html#custom-pluralization
|
|
6
|
+
function slavicPluralRule(choice, choicesLength, orgRule) {
|
|
7
|
+
if (choice === 0) {
|
|
8
|
+
return 0
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const teen = choice > 10 && choice < 20
|
|
12
|
+
const endsWithOne = choice % 10 === 1
|
|
13
|
+
|
|
14
|
+
if (!teen && endsWithOne) {
|
|
15
|
+
return 1
|
|
16
|
+
}
|
|
17
|
+
if (!teen && choice % 10 >= 2 && choice % 10 <= 4) {
|
|
18
|
+
return 2
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return choicesLength < 4 ? 2 : 3
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export function initI18n(app: ReturnType<typeof createApp>) {
|
|
26
|
+
const i18n = createI18n({
|
|
27
|
+
legacy: false,
|
|
28
|
+
|
|
29
|
+
missingWarn: false,
|
|
30
|
+
fallbackWarn: false,
|
|
31
|
+
|
|
32
|
+
pluralRules: {
|
|
33
|
+
'uk': slavicPluralRule,
|
|
34
|
+
'bg': slavicPluralRule,
|
|
35
|
+
'cs': slavicPluralRule,
|
|
36
|
+
'hr': slavicPluralRule,
|
|
37
|
+
'mk': slavicPluralRule,
|
|
38
|
+
'pl': slavicPluralRule,
|
|
39
|
+
'sk': slavicPluralRule,
|
|
40
|
+
'sl': slavicPluralRule,
|
|
41
|
+
'sr': slavicPluralRule,
|
|
42
|
+
'be': slavicPluralRule,
|
|
43
|
+
'ru': slavicPluralRule,
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
missing: (locale, key) => {
|
|
47
|
+
// very very dirty hack to make work $t("a {key} b", { key: "c" }) as "a c b" when translation is missing
|
|
48
|
+
// e.g. relevant for "Showing {from} to {to} of {total} entries" on list page
|
|
49
|
+
return key + ' ';
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
app.use(i18n);
|
|
54
|
+
|
|
55
|
+
}
|
package/dist/spa/src/main.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { createApp } from 'vue'
|
|
2
|
-
import { createI18n } from 'vue-i18n'
|
|
3
2
|
import { createPinia } from 'pinia'
|
|
4
3
|
/* IMPORTANT:ADMINFORTH IMPORTS */
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
import App from './App.vue'
|
|
8
7
|
import router from './router'
|
|
8
|
+
import { initI18n } from './i18n'
|
|
9
9
|
|
|
10
|
-
export const app = createApp(App)
|
|
10
|
+
export const app: ReturnType<typeof createApp> = createApp(App)
|
|
11
11
|
/* IMPORTANT:ADMINFORTH COMPONENT REGISTRATIONS */
|
|
12
12
|
|
|
13
|
-
const i18n = createI18n({
|
|
14
|
-
// something vue-i18n options here ...
|
|
15
|
-
})
|
|
16
13
|
app.use(createPinia())
|
|
17
14
|
app.use(router)
|
|
18
|
-
|
|
15
|
+
|
|
16
|
+
initI18n(app);
|
|
17
|
+
|
|
19
18
|
|
|
20
19
|
/* IMPORTANT:ADMINFORTH CUSTOM USES */
|
|
21
20
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ref, computed } from 'vue'
|
|
2
2
|
import { defineStore } from 'pinia'
|
|
3
3
|
import { callAdminForthApi } from '@/utils';
|
|
4
|
+
import websocket from '@/websocket';
|
|
5
|
+
|
|
4
6
|
import type { AdminForthResourceCommon, AdminForthResourceColumnCommon, GetBaseConfigResponse, ResourceVeryShort, AdminUser, UserData, AdminForthConfigMenuItem, AdminForthConfigForFrontend } from '@/types/Common';
|
|
5
7
|
import type { Ref } from 'vue'
|
|
6
8
|
|
|
@@ -64,19 +66,40 @@ export const useCoreStore = defineStore('core', () => {
|
|
|
64
66
|
console.log('๐ AdminForth v', resp.version);
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
function findItemWithId(items: AdminForthConfigMenuItem[],
|
|
69
|
+
function findItemWithId(items: AdminForthConfigMenuItem[], itemId: string): AdminForthConfigMenuItem | undefined {
|
|
68
70
|
for (const item of items) {
|
|
69
|
-
if (item.
|
|
71
|
+
if (item.itemId === itemId) {
|
|
70
72
|
return item;
|
|
71
73
|
}
|
|
72
74
|
if (item.children) {
|
|
73
|
-
const found = findItemWithId(item.children,
|
|
75
|
+
const found = findItemWithId(item.children, itemId);
|
|
74
76
|
if (found) {
|
|
75
77
|
return found;
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
}
|
|
82
|
+
async function subscribeToMenuBadges() {
|
|
83
|
+
const processItem = (mi: AdminForthConfigMenuItem) => {
|
|
84
|
+
if (mi.badge) {
|
|
85
|
+
console.log('mi ๐งช subsc', mi)
|
|
86
|
+
websocket.subscribe(`/opentopic/update-menu-badge/${mi.itemId}`, ({ badge }) => {
|
|
87
|
+
mi.badge = badge;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
menu.value.forEach((mi) => {
|
|
93
|
+
processItem(mi);
|
|
94
|
+
if (mi.children) {
|
|
95
|
+
mi.children.forEach((child) => {
|
|
96
|
+
console.log('mi ๐งช', JSON.stringify(child), mi.badge)
|
|
97
|
+
|
|
98
|
+
processItem(child);
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
}
|
|
80
103
|
async function fetchMenuBadges() {
|
|
81
104
|
const resp: Record<string, string> = await callAdminForthApi({
|
|
82
105
|
path: '/get_menu_badges',
|
|
@@ -85,12 +108,15 @@ export const useCoreStore = defineStore('core', () => {
|
|
|
85
108
|
if (!resp) {
|
|
86
109
|
return;
|
|
87
110
|
}
|
|
88
|
-
Object.entries(resp).forEach(([
|
|
89
|
-
const item: AdminForthConfigMenuItem | undefined = findItemWithId(menu.value,
|
|
111
|
+
Object.entries(resp).forEach(([itemId, badge]: [string, string]) => {
|
|
112
|
+
const item: AdminForthConfigMenuItem | undefined = findItemWithId(menu.value, itemId);
|
|
90
113
|
if (item) {
|
|
91
114
|
item.badge = badge;
|
|
92
115
|
}
|
|
93
116
|
});
|
|
117
|
+
|
|
118
|
+
subscribeToMenuBadges();
|
|
119
|
+
|
|
94
120
|
}
|
|
95
121
|
|
|
96
122
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export interface EmailAdapter {
|
|
2
|
+
validate()
|
|
3
|
+
|
|
2
4
|
sendEmail(
|
|
3
5
|
from: string,
|
|
4
6
|
to: string,
|
|
@@ -9,9 +11,16 @@ export interface EmailAdapter {
|
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export interface CompletionAdapter {
|
|
14
|
+
|
|
15
|
+
validate();
|
|
16
|
+
|
|
12
17
|
complete(
|
|
13
18
|
content: string,
|
|
14
19
|
stop: string[],
|
|
15
|
-
maxTokens: number
|
|
16
|
-
): Promise<{
|
|
20
|
+
maxTokens: number,
|
|
21
|
+
): Promise<{
|
|
22
|
+
content?: string;
|
|
23
|
+
finishReason?: string;
|
|
24
|
+
error?: string;
|
|
25
|
+
}>;
|
|
17
26
|
}
|