adminforth 2.4.0-next.244 → 2.4.0-next.246

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.
@@ -198,6 +198,13 @@ export const useCoreStore = defineStore('core', () => {
198
198
  config.value = {...config.value, ...res};
199
199
  }
200
200
 
201
+ async function getLoginFormConfig() {
202
+ const res = await callAdminForthApi({
203
+ path: '/get_login_form_config',
204
+ method: 'GET',
205
+ });
206
+ config.value = {...config.value, ...res};
207
+ }
201
208
 
202
209
  const username = computed(() => {
203
210
  const usernameField = config.value?.usernameField;
@@ -218,6 +225,7 @@ export const useCoreStore = defineStore('core', () => {
218
225
  userFullname,
219
226
  getPublicConfig,
220
227
  fetchMenuAndResource,
228
+ getLoginFormConfig,
221
229
  fetchRecord,
222
230
  record,
223
231
  fetchResourceFull,
@@ -93,14 +93,14 @@
93
93
  @update:disableLoginButton="setDisableLoginButton($event)"
94
94
  />
95
95
 
96
- <div v-if="loginPromptHTML"
96
+ <div v-if="coreStore.config?.loginPromptHTML"
97
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"
98
98
  >
99
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">
100
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"/>
101
101
  </svg>
102
102
  <span class="sr-only">{{ $t('Info') }}</span>
103
- <div v-html="loginPromptHTML"></div>
103
+ <div v-html="coreStore.config?.loginPromptHTML"></div>
104
104
  </div>
105
105
  <Button @click="login" :loader="inProgress" :disabled="inProgress || disableLoginButton" class="w-full">
106
106
  {{ $t('Login to your account') }}
@@ -146,7 +146,6 @@ const password = ref('');
146
146
  const route = useRoute();
147
147
  const router = useRouter();
148
148
  const inProgress = ref(false);
149
- const loginPromptHTML = ref()
150
149
  const coreStore = useCoreStore();
151
150
  const user = useUserStore();
152
151
 
@@ -160,14 +159,6 @@ const backgroundPosition = computed(() => {
160
159
  });
161
160
 
162
161
 
163
- async function getLoginFormConfig() {
164
- const response = await callAdminForthApi({
165
- path: '/get_login_form_config',
166
- method: 'GET',
167
- });
168
- loginPromptHTML.value = response.loginPromptHTML;
169
- }
170
-
171
162
  onBeforeMount(() => {
172
163
  if (localStorage.getItem('isAuthorized') === 'true') {
173
164
  // if route has next param, redirect
@@ -181,7 +172,7 @@ onBeforeMount(() => {
181
172
  })
182
173
 
183
174
  onMounted(async () => {
184
- getLoginFormConfig();
175
+ coreStore.getLoginFormConfig();
185
176
  if (coreStore.config?.demoCredentials) {
186
177
  const [demoUsername, demoPassword] = coreStore.config.demoCredentials.split(':');
187
178
  username.value = demoUsername;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.4.0-next.244",
3
+ "version": "2.4.0-next.246",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",