@hostlink/nuxt-light 1.18.1 → 1.18.3
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/dist/module.json +1 -1
- package/dist/module.mjs +0 -5
- package/dist/runtime/components/L/ForgetPasswordDialog.vue +11 -13
- package/dist/runtime/components/L/System/Setting/modules.vue +1 -1
- package/dist/runtime/components/l-app-main.vue +22 -17
- package/dist/runtime/components/l-app.vue +6 -13
- package/dist/runtime/components/l-edit-btn.vue +1 -1
- package/dist/runtime/components/l-form-dialog.vue +1 -2
- package/dist/runtime/components/l-input.vue +14 -9
- package/dist/runtime/components/l-login.vue +22 -17
- package/dist/runtime/components/l-page.vue +2 -1
- package/dist/runtime/components/l-tab.vue +4 -1
- package/dist/runtime/components/l-tabs.vue +2 -4
- package/dist/runtime/index.d.ts +1 -100
- package/dist/runtime/index.js +1 -209
- package/dist/runtime/lib/index.d.ts +1 -1
- package/dist/runtime/light.d.ts +1224 -0
- package/dist/runtime/light.js +242 -0
- package/dist/runtime/locales/zh-hk.json +29 -1
- package/dist/runtime/pages/System/database/table.vue +8 -10
- package/dist/runtime/pages/System/setting.vue +1 -1
- package/dist/runtime/pages/System/view_as.vue +3 -3
- package/dist/runtime/pages/User/_user_id/view.vue +6 -20
- package/dist/runtime/pages/User/setting/bio-auth.vue +34 -15
- package/dist/runtime/pages/User/setting/my_favorite.vue +2 -5
- package/dist/runtime/pages/User/setting/open_id.vue +35 -20
- package/dist/runtime/pages/User/setting/two-factor-auth.vue +2 -3
- package/dist/runtime/plugin.js +4 -1
- package/package.json +1 -1
- package/dist/runtime/components/L/ForgetPasswordResetDialog.vue +0 -34
- package/dist/runtime/pages/logout.vue +0 -17
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -5,11 +5,6 @@ import { quasar } from '@quasar/vite-plugin';
|
|
|
5
5
|
|
|
6
6
|
const resolver = createResolver(import.meta.url);
|
|
7
7
|
const routes = [
|
|
8
|
-
{
|
|
9
|
-
name: "logout",
|
|
10
|
-
path: "/logout",
|
|
11
|
-
file: resolver.resolve("./runtime/pages/logout.vue")
|
|
12
|
-
},
|
|
13
8
|
{
|
|
14
9
|
name: "EventLog",
|
|
15
10
|
path: "/EventLog",
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
import { useQuasar, useDialogPluginComponent } from 'quasar'
|
|
4
4
|
import { m, api } from '#imports';
|
|
5
|
+
import { useI18n } from 'vue-i18n';
|
|
6
|
+
const { t } = useI18n();
|
|
5
7
|
const $q = useQuasar()
|
|
6
8
|
|
|
7
|
-
|
|
8
9
|
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent()
|
|
9
10
|
|
|
10
11
|
const username = ref('')
|
|
@@ -13,7 +14,7 @@ const onOKClick = async () => {
|
|
|
13
14
|
if (username.value == '' || email.value == '') {
|
|
14
15
|
$q.notify({
|
|
15
16
|
type: 'negative',
|
|
16
|
-
message: 'Username and Email is required'
|
|
17
|
+
message: t('Username and Email is required')
|
|
17
18
|
})
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
@@ -34,34 +35,31 @@ const onOKClick = async () => {
|
|
|
34
35
|
} finally {
|
|
35
36
|
$q.loading.hide();
|
|
36
37
|
}
|
|
37
|
-
|
|
38
38
|
}
|
|
39
|
-
|
|
40
39
|
</script>
|
|
41
|
-
|
|
42
40
|
<template>
|
|
43
41
|
<q-dialog ref="dialogRef">
|
|
44
42
|
<q-card class="q-dialog-plugin">
|
|
45
43
|
|
|
46
44
|
<q-card-section class="q-dialog__title">
|
|
47
|
-
Forget
|
|
45
|
+
{{ t('Forget password') }}
|
|
48
46
|
</q-card-section>
|
|
49
47
|
|
|
50
48
|
<q-card-section class="q-dialog__message">
|
|
51
|
-
Please enter your username and email address, we will send you a code to reset your password
|
|
49
|
+
{{ t('Please enter your username and email address, we will send you a code to reset your password') }}
|
|
52
50
|
</q-card-section>
|
|
53
51
|
|
|
54
52
|
<q-card-section>
|
|
55
|
-
<q-input v-model="username" label="Username" stack-label
|
|
56
|
-
:rules="[val => !!val || 'Username is required']" hide-bottom-space />
|
|
57
|
-
<q-input v-model="email" label="Email" stack-label type="email" hide-bottom-space
|
|
58
|
-
:rules="[val => !!val || 'Email is required']" />
|
|
53
|
+
<q-input v-model="username" :label="$t('Username')" stack-label
|
|
54
|
+
:rules="[val => !!val || $t('Username is required')]" hide-bottom-space />
|
|
55
|
+
<q-input v-model="email" :label="$t('Email')" stack-label type="email" hide-bottom-space
|
|
56
|
+
:rules="[val => !!val || $t('Email is required')]" />
|
|
59
57
|
</q-card-section>
|
|
60
58
|
|
|
61
59
|
|
|
62
60
|
<q-card-actions align="right">
|
|
63
|
-
<q-btn label="Cancel" @click="onDialogCancel" flat color="primary" />
|
|
64
|
-
<q-btn label="OK" @click="onOKClick" flat color="primary" />
|
|
61
|
+
<q-btn :label="$t('Cancel')" @click="onDialogCancel" flat color="primary" />
|
|
62
|
+
<q-btn :label="$t('OK')" @click="onOKClick" flat color="primary" />
|
|
65
63
|
</q-card-actions>
|
|
66
64
|
</q-card>
|
|
67
65
|
</q-dialog>
|
|
@@ -39,7 +39,7 @@ const onSubmit = async (d, form) => {
|
|
|
39
39
|
file_manager: modelValue.file_manager,
|
|
40
40
|
revision: modelValue.revision
|
|
41
41
|
}" @submit="onSubmit">
|
|
42
|
-
<q-field label="File
|
|
42
|
+
<q-field :label="$t('File Manager')" stack-label>
|
|
43
43
|
<FormKit type="l-checkbox" label="Show" name="file_manager" true-value="1" false-value="0" />
|
|
44
44
|
</q-field>
|
|
45
45
|
|
|
@@ -5,12 +5,17 @@ import { useQuasar } from 'quasar';
|
|
|
5
5
|
import { useI18n } from 'vue-i18n';
|
|
6
6
|
import { ref, computed, reactive, provide, watch, toRaw } from 'vue';
|
|
7
7
|
import { useRuntimeConfig } from 'nuxt/app';
|
|
8
|
+
import { api } from '#imports';
|
|
8
9
|
|
|
10
|
+
const { t } = useI18n();
|
|
11
|
+
|
|
12
|
+
const emits = defineEmits(["logout"]);
|
|
9
13
|
const $q = useQuasar();
|
|
10
14
|
$q.loading.show()
|
|
11
15
|
|
|
12
16
|
const config = useRuntimeConfig();
|
|
13
17
|
|
|
18
|
+
|
|
14
19
|
const appVersion = config.public.appVersion ?? '0.0.1';
|
|
15
20
|
|
|
16
21
|
const tt = await q({
|
|
@@ -56,9 +61,8 @@ const tt = await q({
|
|
|
56
61
|
let app = tt.app
|
|
57
62
|
let my = reactive(tt.my)
|
|
58
63
|
|
|
59
|
-
const light = useLight(
|
|
60
|
-
|
|
61
|
-
});
|
|
64
|
+
const light = useLight();
|
|
65
|
+
|
|
62
66
|
light.init(my.styles);
|
|
63
67
|
|
|
64
68
|
//set permission
|
|
@@ -155,9 +159,6 @@ const onChangeLocale = async (locale) => {
|
|
|
155
159
|
window.location.reload();
|
|
156
160
|
}
|
|
157
161
|
|
|
158
|
-
const errors = computed(() => {
|
|
159
|
-
return light.getErrors();
|
|
160
|
-
})
|
|
161
162
|
|
|
162
163
|
const reloadMenu = async () => {
|
|
163
164
|
//menus.value = app.menus;
|
|
@@ -228,23 +229,22 @@ const onToggleFav = async () => {
|
|
|
228
229
|
return;
|
|
229
230
|
}
|
|
230
231
|
|
|
231
|
-
|
|
232
|
+
light.dialog({
|
|
232
233
|
title: 'Add to favorite',
|
|
233
234
|
message: 'Enter favorite label',
|
|
234
235
|
prompt: {
|
|
235
236
|
//get window title, remove - and replace with space
|
|
236
237
|
model: route.name.replace(/-/g, ' '),
|
|
238
|
+
isValid: (val) => val !== '',
|
|
237
239
|
},
|
|
238
240
|
cancel: true,
|
|
239
241
|
persistent: true,
|
|
240
242
|
}).onOk(async (data) => {
|
|
241
|
-
if (data === '') return;
|
|
242
243
|
if (await m("addMyFavorite", {
|
|
243
244
|
path: route.fullPath,
|
|
244
245
|
label: data,
|
|
245
246
|
})) {
|
|
246
247
|
light.reloadMyFavorites();
|
|
247
|
-
|
|
248
248
|
}
|
|
249
249
|
})
|
|
250
250
|
}
|
|
@@ -274,6 +274,11 @@ if (route.fullPath == "/" && my.default_page) {
|
|
|
274
274
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
+
const onLogout = async () => {
|
|
278
|
+
await api.auth.logout();
|
|
279
|
+
emits('logout');
|
|
280
|
+
}
|
|
281
|
+
|
|
277
282
|
</script>
|
|
278
283
|
|
|
279
284
|
<style scoped>
|
|
@@ -287,7 +292,7 @@ if (route.fullPath == "/" && my.default_page) {
|
|
|
287
292
|
<q-btn dense flat round icon="menu" class="q-mr-sm" @click="toggleLeftDrawer" />
|
|
288
293
|
|
|
289
294
|
<q-toolbar-title>
|
|
290
|
-
{{ light.
|
|
295
|
+
{{ light.company }}
|
|
291
296
|
<template v-if="tt.system.devMode">
|
|
292
297
|
- Development mode
|
|
293
298
|
</template>
|
|
@@ -344,7 +349,7 @@ if (route.fullPath == "/" && my.default_page) {
|
|
|
344
349
|
|
|
345
350
|
<q-btn flat round dense icon="sym_o_person" class="q-mr-sm">
|
|
346
351
|
<q-menu max-width="250px">
|
|
347
|
-
<q-list
|
|
352
|
+
<q-list>
|
|
348
353
|
<q-item v-close-popup to="/User/profile">
|
|
349
354
|
<q-item-section avatar>
|
|
350
355
|
<q-icon name="sym_o_person" />
|
|
@@ -375,7 +380,7 @@ if (route.fullPath == "/" && my.default_page) {
|
|
|
375
380
|
|
|
376
381
|
<q-separator />
|
|
377
382
|
|
|
378
|
-
<q-item
|
|
383
|
+
<q-item @click="onLogout" clickable>
|
|
379
384
|
<q-item-section avatar>
|
|
380
385
|
<q-icon name="logout" />
|
|
381
386
|
</q-item-section>
|
|
@@ -416,8 +421,8 @@ if (route.fullPath == "/" && my.default_page) {
|
|
|
416
421
|
|
|
417
422
|
<q-page-container :class="containerClass" :style="containerStyle"> <!-- Error message -->
|
|
418
423
|
<slot name="header"></slot>
|
|
419
|
-
<div class="q-gutter-sm q-pa-sm" v-if="errors.length > 0">
|
|
420
|
-
<q-banner dense inline-actions class="bg-grey-4" v-for=" error in errors " rounded>
|
|
424
|
+
<div class="q-gutter-sm q-pa-sm" v-if="$light.errors.length > 0">
|
|
425
|
+
<q-banner dense inline-actions class="bg-grey-4" v-for=" error in $light.errors " rounded>
|
|
421
426
|
{{ error }}
|
|
422
427
|
<template v-slot:action>
|
|
423
428
|
<q-btn flat label="Detail" @click="$q.dialog({
|
|
@@ -425,7 +430,7 @@ if (route.fullPath == "/" && my.default_page) {
|
|
|
425
430
|
message: error.stack,
|
|
426
431
|
fullWidth: true,
|
|
427
432
|
})"></q-btn>
|
|
428
|
-
<q-btn flat icon="sym_o_close" round dense @click="light.removeError(error)" />
|
|
433
|
+
<q-btn flat icon="sym_o_close" round dense @click="$light.removeError(error)" />
|
|
429
434
|
</template>
|
|
430
435
|
</q-banner>
|
|
431
436
|
|
|
@@ -451,9 +456,9 @@ if (route.fullPath == "/" && my.default_page) {
|
|
|
451
456
|
<q-footer bordered v-if="style.footer">
|
|
452
457
|
<q-item>
|
|
453
458
|
<q-item-section>
|
|
454
|
-
{{ light.
|
|
459
|
+
{{ light.company }} {{ appVersion }} - Copyright {{ app.copyrightYear }} {{ app.copyrightName
|
|
455
460
|
}}. Build
|
|
456
|
-
{{ light.
|
|
461
|
+
{{ light.version }}
|
|
457
462
|
</q-item-section>
|
|
458
463
|
</q-item>
|
|
459
464
|
</q-footer>
|
|
@@ -15,10 +15,10 @@ watch(route, (to, from) => {
|
|
|
15
15
|
light.setCurrentRoute(to);
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
+
const app = ref(null)
|
|
18
19
|
|
|
19
|
-
let app = null
|
|
20
20
|
try {
|
|
21
|
-
app = (await q({
|
|
21
|
+
app.value = (await q({
|
|
22
22
|
app: {
|
|
23
23
|
company: true,
|
|
24
24
|
companyLogo: true,
|
|
@@ -28,8 +28,8 @@ try {
|
|
|
28
28
|
forgetPasswordEnabled: true
|
|
29
29
|
}
|
|
30
30
|
})).app;
|
|
31
|
-
light.
|
|
32
|
-
light.
|
|
31
|
+
light.company = app.value.company;
|
|
32
|
+
light.companyLogo = app.value.companyLogo;
|
|
33
33
|
} catch (e) {
|
|
34
34
|
|
|
35
35
|
quasar.dialog({
|
|
@@ -42,28 +42,21 @@ try {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
const color = ref(light.color);
|
|
46
|
-
provide('color', color)
|
|
47
45
|
|
|
48
46
|
</script>
|
|
49
47
|
<template>
|
|
50
48
|
<q-layout v-if="!app.logged">
|
|
51
49
|
<q-page-container class="bg-grey-2" style="color:#1f1f1f">
|
|
52
50
|
<q-page padding>
|
|
53
|
-
<l-login v-bind="app"></l-login>
|
|
51
|
+
<l-login v-bind="app" @login="app.logged = true"></l-login>
|
|
54
52
|
</q-page>
|
|
55
53
|
</q-page-container>
|
|
56
54
|
</q-layout>
|
|
57
55
|
|
|
58
|
-
<l-app-main v-else>
|
|
59
|
-
|
|
56
|
+
<l-app-main v-else @logout="app.logged = false">
|
|
60
57
|
<template #header>
|
|
61
58
|
<slot name="header"></slot>
|
|
62
59
|
</template>
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
61
|
</l-app-main>
|
|
69
62
|
</template>
|
|
@@ -82,8 +82,7 @@ const onCancel = async () => {
|
|
|
82
82
|
<template>
|
|
83
83
|
<q-dialog ref="dialogRef">
|
|
84
84
|
|
|
85
|
-
<q-card :style="{ width }" :loading="loading">
|
|
86
|
-
|
|
85
|
+
<q-card :style="{ width }" :loading="loading" class="q-dialog-plugin">
|
|
87
86
|
<q-toolbar>
|
|
88
87
|
<q-toolbar-title v-if="title">
|
|
89
88
|
{{ title }}
|
|
@@ -11,7 +11,7 @@ export interface LInputProps extends QInputProps {
|
|
|
11
11
|
required?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const { t } = useI18n();
|
|
15
15
|
const light = useLight();
|
|
16
16
|
|
|
17
17
|
const props = withDefaults(defineProps<LInputProps>(), {
|
|
@@ -37,13 +37,13 @@ const new_rules = props.rules || [];
|
|
|
37
37
|
|
|
38
38
|
//has required prop (in properties)
|
|
39
39
|
if (props.required) {
|
|
40
|
-
new_rules.push(val => !!val ||
|
|
40
|
+
new_rules.push(val => !!val || t('input_required', [t(props.label ?? "")]));
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
if (props.type == "email") {
|
|
44
44
|
new_rules.push(val => {
|
|
45
45
|
if (val && !val.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
|
|
46
|
-
return
|
|
46
|
+
return t("Invalid email format");
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
}
|
|
@@ -51,7 +51,7 @@ if (props.type == "email") {
|
|
|
51
51
|
if (new_rules.indexOf("containUpper") >= 0) {
|
|
52
52
|
new_rules.push(val => {
|
|
53
53
|
if (val && !val.match(/[A-Z]/)) {
|
|
54
|
-
return
|
|
54
|
+
return t("Must contain at least one uppercase letter");
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
}
|
|
@@ -59,7 +59,7 @@ if (new_rules.indexOf("containUpper") >= 0) {
|
|
|
59
59
|
if (new_rules.indexOf("containLower") >= 0) {
|
|
60
60
|
new_rules.push(val => {
|
|
61
61
|
if (val && !val.match(/[a-z]/)) {
|
|
62
|
-
return
|
|
62
|
+
return t("Must contain at least one lowercase letter");
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -67,7 +67,7 @@ if (new_rules.indexOf("containLower") >= 0) {
|
|
|
67
67
|
if (new_rules.indexOf("containNumber") >= 0) {
|
|
68
68
|
new_rules.push(val => {
|
|
69
69
|
if (val && !val.match(/[0-9]/)) {
|
|
70
|
-
return
|
|
70
|
+
return t("Must contain at least one number");
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -75,7 +75,7 @@ if (new_rules.indexOf("containNumber") >= 0) {
|
|
|
75
75
|
if (new_rules.indexOf("containSpecial") >= 0) {
|
|
76
76
|
new_rules.push(val => {
|
|
77
77
|
if (val && !val.match(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/)) {
|
|
78
|
-
return
|
|
78
|
+
return t("Must contain at least one symbol");
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -90,7 +90,7 @@ if (minLength) {
|
|
|
90
90
|
const min = parseInt(minLength.replace("minLength:", ""));
|
|
91
91
|
new_rules.push(val => {
|
|
92
92
|
if (val && val.length < min) {
|
|
93
|
-
return
|
|
93
|
+
return t("input_min", [min]);
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
}
|
|
@@ -139,7 +139,7 @@ const attrs = computed(() => {
|
|
|
139
139
|
if (props.stackLabel === undefined) a.stackLabel = light.getStyle("inputStackLabel");
|
|
140
140
|
|
|
141
141
|
if (props.label) {
|
|
142
|
-
a.label =
|
|
142
|
+
a.label = t(props.label);
|
|
143
143
|
|
|
144
144
|
if (props.required) {
|
|
145
145
|
a.label = "* " + a.label;
|
|
@@ -147,6 +147,11 @@ const attrs = computed(() => {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
if (props.color === undefined) a.color = light.color
|
|
150
|
+
|
|
151
|
+
if (props.hint) {
|
|
152
|
+
a.hint = t(props.hint);
|
|
153
|
+
}
|
|
154
|
+
|
|
150
155
|
return a;
|
|
151
156
|
})
|
|
152
157
|
|
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { useLight } from "#imports";
|
|
3
2
|
import { ref, reactive, onMounted } from 'vue'
|
|
4
3
|
import { useQuasar } from 'quasar';
|
|
4
|
+
import { api, useHead } from '#imports';
|
|
5
5
|
import { useI18n } from 'vue-i18n';
|
|
6
|
-
import { m, api } from '#imports';
|
|
7
6
|
|
|
7
|
+
const { t } = useI18n();
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const emits = defineEmits(["login"]);
|
|
10
10
|
|
|
11
11
|
const props = defineProps({
|
|
12
12
|
twoFactorAuthentication: Boolean,
|
|
13
13
|
googleClientId: String,
|
|
14
|
-
forgetPasswordEnabled: Boolean
|
|
14
|
+
forgetPasswordEnabled: Boolean,
|
|
15
|
+
company: String,
|
|
16
|
+
companyLogo: String
|
|
15
17
|
})
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
useHead({
|
|
20
|
+
title: props.company
|
|
21
|
+
})
|
|
18
22
|
|
|
19
23
|
const form1 = ref(null);
|
|
20
24
|
const data = reactive({
|
|
21
25
|
username: "", password: "", code: ""
|
|
22
26
|
});
|
|
23
27
|
|
|
24
|
-
|
|
25
28
|
const $q = useQuasar()
|
|
26
29
|
|
|
27
30
|
const loginWithCode = (username, password) => {
|
|
28
31
|
$q.dialog({
|
|
29
|
-
title: "Enter your code",
|
|
30
|
-
message: "Please enter your two factor authentication code (If you lost your authenticator, please contact your administrator)",
|
|
32
|
+
title: t("Enter your code"),
|
|
33
|
+
message: t("Please enter your two factor authentication code (If you lost your authenticator, please contact your administrator)"),
|
|
31
34
|
prompt: {
|
|
32
35
|
type: "text",
|
|
33
36
|
required: true
|
|
@@ -48,7 +51,9 @@ const submit = async () => {
|
|
|
48
51
|
|
|
49
52
|
try {
|
|
50
53
|
await api.auth.login(data.username, data.password, data.code)
|
|
51
|
-
window.self.location.reload();
|
|
54
|
+
//window.self.location.reload();
|
|
55
|
+
//
|
|
56
|
+
emits("login");
|
|
52
57
|
} catch (e) {
|
|
53
58
|
data.code = "";
|
|
54
59
|
|
|
@@ -71,8 +76,8 @@ const submit = async () => {
|
|
|
71
76
|
|
|
72
77
|
const resetPassword = (username, code) => {
|
|
73
78
|
$q.dialog({
|
|
74
|
-
title: "Reset password",
|
|
75
|
-
message: "Please enter your new password",
|
|
79
|
+
title: t("Reset password"),
|
|
80
|
+
message: t("Please enter your new password"),
|
|
76
81
|
prompt: {
|
|
77
82
|
model: "",
|
|
78
83
|
type: "password",
|
|
@@ -86,7 +91,7 @@ const resetPassword = (username, code) => {
|
|
|
86
91
|
try {
|
|
87
92
|
await api.auth.resetPassword(username, password, code);
|
|
88
93
|
$q.notify({
|
|
89
|
-
message: "Your password has been reset successfully",
|
|
94
|
+
message: t("Your password has been reset successfully"),
|
|
90
95
|
color: "positive",
|
|
91
96
|
icon: "sym_o_check",
|
|
92
97
|
});
|
|
@@ -108,8 +113,8 @@ const forgetPassword = async () => {
|
|
|
108
113
|
component: resolveComponent("l-forget-password-dialog"),
|
|
109
114
|
}).onOk(async (data) => {
|
|
110
115
|
$q.dialog({
|
|
111
|
-
title: "Enter your code",
|
|
112
|
-
message: "Please enter the code sent to your email, your code will expire in 10 minutes",
|
|
116
|
+
title: t("Enter your code"),
|
|
117
|
+
message: t("Please enter the code sent to your email, your code will expire in 10 minutes"),
|
|
113
118
|
prompt: {
|
|
114
119
|
type: "text",
|
|
115
120
|
required: true
|
|
@@ -121,7 +126,7 @@ const forgetPassword = async () => {
|
|
|
121
126
|
resetPassword(data.username, code);
|
|
122
127
|
} else {
|
|
123
128
|
$q.notify({
|
|
124
|
-
message: "Your code is invalid",
|
|
129
|
+
message: t("Your code is invalid or expired"),
|
|
125
130
|
color: "negative",
|
|
126
131
|
icon: "sym_o_error",
|
|
127
132
|
});
|
|
@@ -191,13 +196,13 @@ onMounted(() => {
|
|
|
191
196
|
<template>
|
|
192
197
|
<q-card bordered flat style="min-width:360px" class="fixed-center">
|
|
193
198
|
<q-card-section>
|
|
194
|
-
<q-img :src="
|
|
199
|
+
<q-img :src="companyLogo" class="full-width">
|
|
195
200
|
<template v-slot:error>
|
|
196
201
|
<q-img src="https://raw.githubusercontent.com/HostLink/.github/master/profile/logo.webp" class="full-width" />
|
|
197
202
|
</template>
|
|
198
203
|
</q-img>
|
|
199
204
|
<div class="text-h6">
|
|
200
|
-
{{
|
|
205
|
+
{{ company }}
|
|
201
206
|
</div>
|
|
202
207
|
<q-form ref="form1">
|
|
203
208
|
<div class="q-gutter-sm">
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { QTabPanelProps, QTabProps } from 'quasar';
|
|
3
3
|
import { getCurrentInstance } from 'vue';
|
|
4
|
+
import { useI18n } from 'vue-i18n';
|
|
5
|
+
|
|
6
|
+
const { t } = useI18n();
|
|
4
7
|
|
|
5
8
|
const instance = getCurrentInstance();
|
|
6
9
|
defineProps<QTabPanelProps | QTabProps>()
|
|
@@ -17,7 +20,7 @@ const parent_type = instance?.parent?.type.name
|
|
|
17
20
|
</template>
|
|
18
21
|
|
|
19
22
|
<template v-if="parent_type == 'QTabs'">
|
|
20
|
-
<q-tab v-bind="$props">
|
|
23
|
+
<q-tab v-bind="$props" :label="$t($props.label ?? '')">
|
|
21
24
|
</q-tab>
|
|
22
25
|
</template>
|
|
23
26
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { QTabsProps } from 'quasar';
|
|
3
|
-
import {
|
|
3
|
+
import { useSlots } from '#imports';
|
|
4
4
|
const model = defineModel<string | number | null | undefined>()
|
|
5
|
-
export interface LTabsProps extends
|
|
5
|
+
export interface LTabsProps extends QTabsProps {
|
|
6
6
|
}
|
|
7
7
|
defineProps<LTabsProps>();
|
|
8
8
|
const slots = useSlots()
|
|
@@ -16,12 +16,10 @@ if (model.value === undefined) {
|
|
|
16
16
|
<l-card>
|
|
17
17
|
<q-tabs class="text-grey" :active-color="$light.color" :indicator-color="$light.color" align="justify"
|
|
18
18
|
v-model="model">
|
|
19
|
-
|
|
20
19
|
<slot></slot>
|
|
21
20
|
</q-tabs>
|
|
22
21
|
<q-tab-panels v-model="model">
|
|
23
22
|
<slot></slot>
|
|
24
|
-
<!-- component v-for="tab in tabContents" :key="tab.name" :is="tab.content?.default" :name="tab.name" /-->
|
|
25
23
|
</q-tab-panels>
|
|
26
24
|
</l-card>
|
|
27
25
|
</template>
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,60 +1,4 @@
|
|
|
1
1
|
import { type FormKitInputs } from '@formkit/inputs';
|
|
2
|
-
export interface User {
|
|
3
|
-
user_id?: number;
|
|
4
|
-
username: string;
|
|
5
|
-
password: string;
|
|
6
|
-
first_name: string;
|
|
7
|
-
last_name?: string;
|
|
8
|
-
email: string;
|
|
9
|
-
language?: string;
|
|
10
|
-
}
|
|
11
|
-
declare const app: {
|
|
12
|
-
company: string;
|
|
13
|
-
companyLogo: string;
|
|
14
|
-
color: string;
|
|
15
|
-
theme: string;
|
|
16
|
-
isAdmin: boolean;
|
|
17
|
-
permissions: string[];
|
|
18
|
-
myFavorites: any[];
|
|
19
|
-
users: {
|
|
20
|
-
create: (user: User) => Promise<User>;
|
|
21
|
-
del: (user_id: number) => Promise<any>;
|
|
22
|
-
update: (id: number, user: User) => Promise<any>;
|
|
23
|
-
list: (args: any) => Promise<any>;
|
|
24
|
-
};
|
|
25
|
-
roles: {
|
|
26
|
-
list: () => Promise<any>;
|
|
27
|
-
};
|
|
28
|
-
getColorValue: () => string;
|
|
29
|
-
setMyFavorites: (favorites: Array<any>) => void;
|
|
30
|
-
reloadMyFavorites: () => Promise<void>;
|
|
31
|
-
getMyFavorites: () => any[];
|
|
32
|
-
isDarkMode: () => boolean;
|
|
33
|
-
setCompany: (company: string) => void;
|
|
34
|
-
getCompany: () => string;
|
|
35
|
-
setCompanyLogo: (logo: string) => void;
|
|
36
|
-
getCompanyLogo: () => string;
|
|
37
|
-
getVersion: () => string;
|
|
38
|
-
addError: (err: Error) => void;
|
|
39
|
-
getErrors: () => Error[];
|
|
40
|
-
removeError: (error: Error) => void;
|
|
41
|
-
getStyle: (name: string) => any;
|
|
42
|
-
setStyles: (s: Object) => void;
|
|
43
|
-
getStyles: () => {
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
};
|
|
46
|
-
setStyle: (name: string, value: any) => Promise<void>;
|
|
47
|
-
setCurrentRoute: (to: any) => void;
|
|
48
|
-
getID: () => number | null;
|
|
49
|
-
init: (styles: any) => void;
|
|
50
|
-
isGranted: (right?: string) => boolean;
|
|
51
|
-
setPermissions: (permissions: Array<string>) => void;
|
|
52
|
-
};
|
|
53
|
-
declare module 'vue' {
|
|
54
|
-
interface ComponentCustomProperties {
|
|
55
|
-
$light: typeof app;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
2
|
declare module '@formkit/inputs' {
|
|
59
3
|
interface FormKitInputProps<Props extends FormKitInputs<Props>> {
|
|
60
4
|
lInput: {
|
|
@@ -90,48 +34,5 @@ declare module '@formkit/inputs' {
|
|
|
90
34
|
};
|
|
91
35
|
}
|
|
92
36
|
}
|
|
93
|
-
export
|
|
94
|
-
color?: string;
|
|
95
|
-
}) => {
|
|
96
|
-
company: string;
|
|
97
|
-
companyLogo: string;
|
|
98
|
-
color: string;
|
|
99
|
-
theme: string;
|
|
100
|
-
isAdmin: boolean;
|
|
101
|
-
permissions: string[];
|
|
102
|
-
myFavorites: any[];
|
|
103
|
-
users: {
|
|
104
|
-
create: (user: User) => Promise<User>;
|
|
105
|
-
del: (user_id: number) => Promise<any>;
|
|
106
|
-
update: (id: number, user: User) => Promise<any>;
|
|
107
|
-
list: (args: any) => Promise<any>;
|
|
108
|
-
};
|
|
109
|
-
roles: {
|
|
110
|
-
list: () => Promise<any>;
|
|
111
|
-
};
|
|
112
|
-
getColorValue: () => string;
|
|
113
|
-
setMyFavorites: (favorites: Array<any>) => void;
|
|
114
|
-
reloadMyFavorites: () => Promise<void>;
|
|
115
|
-
getMyFavorites: () => any[];
|
|
116
|
-
isDarkMode: () => boolean;
|
|
117
|
-
setCompany: (company: string) => void;
|
|
118
|
-
getCompany: () => string;
|
|
119
|
-
setCompanyLogo: (logo: string) => void;
|
|
120
|
-
getCompanyLogo: () => string;
|
|
121
|
-
getVersion: () => string;
|
|
122
|
-
addError: (err: Error) => void;
|
|
123
|
-
getErrors: () => Error[];
|
|
124
|
-
removeError: (error: Error) => void;
|
|
125
|
-
getStyle: (name: string) => any;
|
|
126
|
-
setStyles: (s: Object) => void;
|
|
127
|
-
getStyles: () => {
|
|
128
|
-
[key: string]: any;
|
|
129
|
-
};
|
|
130
|
-
setStyle: (name: string, value: any) => Promise<void>;
|
|
131
|
-
setCurrentRoute: (to: any) => void;
|
|
132
|
-
getID: () => number | null;
|
|
133
|
-
init: (styles: any) => void;
|
|
134
|
-
isGranted: (right?: string) => boolean;
|
|
135
|
-
setPermissions: (permissions: Array<string>) => void;
|
|
136
|
-
};
|
|
37
|
+
export { useLight } from "./light.js";
|
|
137
38
|
export * from "./lib/index.js";
|