adminforth 2.4.0-next.131 → 2.4.0-next.133
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.
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
import SkeleteLoader from '@/components/SkeleteLoader.vue';
|
|
121
121
|
|
|
122
122
|
type Row = Record<string, unknown>
|
|
123
|
-
type LoadFn = (
|
|
123
|
+
type LoadFn = (params: { offset: number, limit: number }) => Promise<{ data: Row[]; total: number }>
|
|
124
124
|
|
|
125
125
|
const isFunc = (v: unknown): v is LoadFn => typeof v === 'function'
|
|
126
126
|
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
error.value = null
|
|
145
145
|
try {
|
|
146
146
|
if (isFunc(props.data)) {
|
|
147
|
-
const res = await props.data(page.value, pageSize.value)
|
|
147
|
+
const res = await props.data({offset: ((page.value - 1) * pageSize.value), limit: pageSize.value})
|
|
148
148
|
if (id !== requestId) return
|
|
149
149
|
result.value = res
|
|
150
150
|
} else {
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
}[],
|
|
175
175
|
data: {
|
|
176
176
|
[key: string]: any,
|
|
177
|
-
}[] | ((offset: number, limit: number) => Promise<{data: {[key: string]: any}[], total: number}>),
|
|
177
|
+
}[] | ((params: { offset: number, limit: number }) => Promise<{data: {[key: string]: any}[], total: number}>),
|
|
178
178
|
evenHighlights?: boolean,
|
|
179
179
|
pageSize?: number,
|
|
180
180
|
}>(), {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<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">
|
|
3
|
+
<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">
|
|
4
|
+
<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"/>
|
|
5
|
+
</svg>
|
|
6
|
+
<span class="sr-only">{{ $t('Info') }}</span>
|
|
7
|
+
<div>
|
|
8
|
+
{{ error }}
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
|
|
15
|
+
defineProps({
|
|
16
|
+
error: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: null
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
@@ -92,15 +92,7 @@
|
|
|
92
92
|
:meta="c.meta"
|
|
93
93
|
/>
|
|
94
94
|
|
|
95
|
-
<
|
|
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">
|
|
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"/>
|
|
98
|
-
</svg>
|
|
99
|
-
<span class="sr-only">{{ $t('Info') }}</span>
|
|
100
|
-
<div>
|
|
101
|
-
{{ error }}
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
95
|
+
<ErrorMessage :error="error" />
|
|
104
96
|
|
|
105
97
|
<div v-if="loginPromptHTML"
|
|
106
98
|
class="flex items-center p-4 mb-4 text-sm text-lightLoginViewPromptText rounded-lg bg-lightLoginViewPromptBackground dark:bg-darkLoginViewPromptBackground dark:text-darkLoginViewPromptText" role="alert"
|
|
@@ -136,6 +128,7 @@ import { callAdminForthApi, loadFile } from '@/utils';
|
|
|
136
128
|
import { useRoute, useRouter } from 'vue-router';
|
|
137
129
|
import { Button, Checkbox, Input } from '@/afcl';
|
|
138
130
|
import { useI18n } from 'vue-i18n';
|
|
131
|
+
import ErrorMessage from '@/components/ErrorMessage.vue';
|
|
139
132
|
|
|
140
133
|
const { t } = useI18n();
|
|
141
134
|
|