@hostlink/nuxt-light 1.13.4 → 1.13.5
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 +1 -1
- package/dist/runtime/components/l-app.vue +3 -3
- package/dist/runtime/components/l-file-manager.vue +13 -18
- package/dist/runtime/components/l-form.vue +1 -1
- package/dist/runtime/components/l-login.vue +2 -3
- package/dist/runtime/formkit/Form.vue +1 -1
- package/dist/runtime/lib/defineLightModel.mjs +2 -2
- package/dist/runtime/lib/getGQLFields.mjs +2 -2
- package/dist/runtime/lib/getModelColumns.mjs +1 -1
- package/dist/runtime/lib/getModelField.d.ts +2 -2
- package/dist/runtime/lib/getModelField.mjs +4 -2
- package/dist/runtime/lib/getModelFields.mjs +1 -1
- package/dist/runtime/lib/getObject.mjs +1 -1
- package/dist/runtime/lib/index.d.ts +3 -1
- package/dist/runtime/lib/index.mjs +5 -1
- package/dist/runtime/lib/list.mjs +3 -2
- package/dist/runtime/lib/listObject.d.ts +1 -1
- package/dist/runtime/lib/m.mjs +2 -2
- package/dist/runtime/lib/model.d.ts +2 -2
- package/dist/runtime/lib/model.mjs +4 -4
- package/dist/runtime/lib/q.mjs +2 -6
- package/dist/runtime/lib/sv.mjs +2 -2
- package/dist/runtime/pages/Permission/all.vue +4 -4
- package/dist/runtime/pages/Permission/export.vue +2 -2
- package/dist/runtime/pages/System/database/table.vue +4 -4
- package/dist/runtime/pages/User/_user_id/view.vue +0 -6
- package/dist/runtime/pages/User/setting/bio-auth.vue +7 -6
- package/dist/runtime/pages/User/setting/password.vue +3 -4
- package/dist/runtime/pages/User/setting/two-factor-auth.vue +1 -1
- package/dist/runtime/pages/logout.vue +2 -2
- package/dist/runtime/plugin.mjs +8 -7
- package/package.json +3 -3
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -248,7 +248,6 @@ const module = defineNuxtModule({
|
|
|
248
248
|
async setup(options, nuxt) {
|
|
249
249
|
const resolver = createResolver(import.meta.url);
|
|
250
250
|
const { resolve: resolveQuasar } = createResolver(dirname(await resolvePath("quasar/package.json")));
|
|
251
|
-
JSON.parse(await readFile(resolveQuasar("package.json"), "utf-8"));
|
|
252
251
|
const importMap = JSON.parse(await await readFile(resolveQuasar("dist/transforms/import-map.json"), "utf-8"));
|
|
253
252
|
nuxt.options.css.push("quasar/dist/quasar.prod.css");
|
|
254
253
|
nuxt.options.css.push("@quasar/extras/material-icons/material-icons.css");
|
|
@@ -269,6 +268,7 @@ const module = defineNuxtModule({
|
|
|
269
268
|
const index = resolver.resolve("./runtime/index");
|
|
270
269
|
const SystemValue = resolver.resolve("./runtime/lib/SystemValue");
|
|
271
270
|
addImports([
|
|
271
|
+
{ name: "api", from },
|
|
272
272
|
{ name: "id", from },
|
|
273
273
|
{ name: "getID", from },
|
|
274
274
|
{ name: "addObject", from },
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { provide, ref } from 'vue'
|
|
3
3
|
import { useLight, watch } from "#imports";
|
|
4
4
|
import { useRuntimeConfig } from 'nuxt/app'
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
import { useQuasar } from 'quasar'
|
|
7
7
|
import { q } from '#imports'
|
|
8
8
|
import { useRoute } from "vue-router";
|
|
9
|
-
const config = useRuntimeConfig();
|
|
9
|
+
/* const config = useRuntimeConfig();
|
|
10
10
|
setApiUrl(config?.public?.apiBase ?? '/api/');
|
|
11
|
-
|
|
11
|
+
*/
|
|
12
12
|
const route = useRoute();
|
|
13
13
|
const light = useLight()
|
|
14
14
|
const quasar = useQuasar()
|
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
import { useI18n } from "vue-i18n";
|
|
3
3
|
import { ref, watch, computed } from 'vue';
|
|
4
4
|
import { useQuasar, format } from 'quasar';
|
|
5
|
-
import { q, m, useLight } from '#imports';
|
|
6
|
-
import {
|
|
7
|
-
fsListFolders, fsCreateFolder, fsDeleteFolder, fsDeleteFile, fsRenameFile, fsRenameFolder, fsReadFile,
|
|
8
|
-
granted
|
|
9
|
-
|
|
10
|
-
} from "@hostlink/light";
|
|
5
|
+
import { q, m, useLight, api } from '#imports';
|
|
11
6
|
const { humanStorageSize } = format
|
|
12
7
|
|
|
13
8
|
const light = useLight();
|
|
@@ -107,7 +102,7 @@ function toggleLeftDrawer() {
|
|
|
107
102
|
const path = ref(props.base);
|
|
108
103
|
|
|
109
104
|
const onLazyLoad = async ({ node, key, done, fail }) => {
|
|
110
|
-
const data = await
|
|
105
|
+
const data = await api.fs.folders.list(node.path);
|
|
111
106
|
data.map((item) => {
|
|
112
107
|
item.lazy = true;
|
|
113
108
|
return item;
|
|
@@ -139,7 +134,7 @@ const loadItems = async () => {
|
|
|
139
134
|
|
|
140
135
|
let folders = [];
|
|
141
136
|
if (!label.value && !localSearch.value) {
|
|
142
|
-
folders = await
|
|
137
|
+
folders = await api.fs.folders.list(path.value);
|
|
143
138
|
folders = folders.map((item) => {
|
|
144
139
|
item.type = "folder";
|
|
145
140
|
item.lazy = true;
|
|
@@ -259,9 +254,9 @@ const onDeleteSelected = () => {
|
|
|
259
254
|
}).onOk(async () => {
|
|
260
255
|
for (let row of selected.value) {
|
|
261
256
|
if (row.type == "folder") {
|
|
262
|
-
await
|
|
257
|
+
await api.fs.folders.delete(row.path)
|
|
263
258
|
} else {
|
|
264
|
-
await
|
|
259
|
+
await api.fs.files.delete(row.path)
|
|
265
260
|
}
|
|
266
261
|
}
|
|
267
262
|
selected.value = [];
|
|
@@ -279,7 +274,7 @@ const onNewFolder = () => {
|
|
|
279
274
|
},
|
|
280
275
|
cancel: true,
|
|
281
276
|
}).onOk(async (name) => {
|
|
282
|
-
await
|
|
277
|
+
await api.fs.folders.create(path.value + "/" + name);
|
|
283
278
|
const items = await loadItems();
|
|
284
279
|
reloadTreeFolder(path.value, items.folders);
|
|
285
280
|
});
|
|
@@ -292,7 +287,7 @@ const onDeleteRow = (row) => {
|
|
|
292
287
|
message: "Are you sure you want to delete this file?",
|
|
293
288
|
cancel: true,
|
|
294
289
|
}).onOk(async () => {
|
|
295
|
-
await
|
|
290
|
+
await api.fs.files.delete(row.path);
|
|
296
291
|
const items = await loadItems();
|
|
297
292
|
reloadTreeFolder(path.value, items.folders);
|
|
298
293
|
});
|
|
@@ -302,7 +297,7 @@ const onDeleteRow = (row) => {
|
|
|
302
297
|
message: "Are you sure you want to delete this folder?",
|
|
303
298
|
cancel: true,
|
|
304
299
|
}).onOk(async () => {
|
|
305
|
-
await
|
|
300
|
+
await api.fs.folders.delete(row.path);
|
|
306
301
|
const items = await loadItems();
|
|
307
302
|
reloadTreeFolder(path.value, items.folders);
|
|
308
303
|
});
|
|
@@ -320,9 +315,9 @@ const onRenameRow = (row) => {
|
|
|
320
315
|
}).onOk(async (name) => {
|
|
321
316
|
try {
|
|
322
317
|
if (row.type == "file") {
|
|
323
|
-
await
|
|
318
|
+
await api.fs.files.rename(row.path, name)
|
|
324
319
|
} else {
|
|
325
|
-
await
|
|
320
|
+
await api.fs.folders.rename(row.path, name)
|
|
326
321
|
}
|
|
327
322
|
} catch (e) {
|
|
328
323
|
quasar.dialog({
|
|
@@ -433,7 +428,7 @@ const reloadStorage = async () => {
|
|
|
433
428
|
reloadTreeFolder(path.value, items.folders);
|
|
434
429
|
}
|
|
435
430
|
|
|
436
|
-
const permission = await granted([
|
|
431
|
+
const permission = await api.auth.granted([
|
|
437
432
|
'fs.folder.create', 'fs.folder.delete', 'fs.folder.rename',
|
|
438
433
|
'fs.file.delete', 'fs.file.rename', 'fs.file.upload'
|
|
439
434
|
]);
|
|
@@ -489,8 +484,8 @@ const onPreviewPDF = async (row) => {
|
|
|
489
484
|
}
|
|
490
485
|
|
|
491
486
|
const onClickInfo = async (row) => {
|
|
492
|
-
|
|
493
|
-
|
|
487
|
+
rightDrawerOpen.value = true;
|
|
488
|
+
|
|
494
489
|
}
|
|
495
490
|
|
|
496
491
|
</script>
|
|
@@ -3,10 +3,9 @@ import { useLight } from "#imports";
|
|
|
3
3
|
import { ref, reactive, onMounted } from 'vue'
|
|
4
4
|
import { useQuasar, Dialog } from 'quasar';
|
|
5
5
|
import { useI18n } from 'vue-i18n';
|
|
6
|
-
import { m, notify } from '#imports';
|
|
6
|
+
import { m, notify, api } from '#imports';
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
import { login, webauthnLogin } from '@hostlink/light';
|
|
10
9
|
|
|
11
10
|
const light = useLight();
|
|
12
11
|
|
|
@@ -27,7 +26,7 @@ const submit = async () => {
|
|
|
27
26
|
if (await form1.value.validate()) {
|
|
28
27
|
|
|
29
28
|
try {
|
|
30
|
-
await login(data.username, data.password, data.code)
|
|
29
|
+
await api.auth.login(data.username, data.password, data.code)
|
|
31
30
|
window.self.location.reload();
|
|
32
31
|
} catch (e) {
|
|
33
32
|
notify(e.message, "negative");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineNuxtPlugin } from "#app";
|
|
2
|
-
import {
|
|
2
|
+
import { api } from "./index.mjs";
|
|
3
3
|
export default (model) => {
|
|
4
4
|
return defineNuxtPlugin(() => {
|
|
5
|
-
|
|
5
|
+
api.models.create(model.name, model.fields);
|
|
6
6
|
});
|
|
7
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import GQLFieldBuilder from "./GQLFieldBuilder.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { api } from "./index.mjs";
|
|
3
3
|
export default (name, fields) => {
|
|
4
4
|
const builder = GQLFieldBuilder();
|
|
5
5
|
fields.forEach((field) => {
|
|
6
|
-
const modelField =
|
|
6
|
+
const modelField = api.model(name).field(field);
|
|
7
7
|
if (modelField) {
|
|
8
8
|
builder.add(modelField.getGQLField());
|
|
9
9
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export default
|
|
1
|
+
declare const _default: (name: string, field: string) => import("@hostlink/light").ModelField | null;
|
|
2
|
+
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRoute } from "vue-router";
|
|
2
2
|
import loadObject from "./loadObject.mjs";
|
|
3
|
-
import { getModelField } from "
|
|
3
|
+
import { getModelField } from "./index.mjs";
|
|
4
4
|
export default async function(fields = []) {
|
|
5
5
|
let route = useRoute();
|
|
6
6
|
if (!route.name) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LightClient } from '@hostlink/light';
|
|
1
2
|
export { default as f } from "./f";
|
|
2
3
|
export { default as getApiUrl } from "./getApiUrl";
|
|
3
4
|
export { default as getCurrentUser } from "./getCurrentUser";
|
|
@@ -22,4 +23,5 @@ export declare const notify: (message: string, color?: string) => void;
|
|
|
22
23
|
export { default as getID } from "./getID";
|
|
23
24
|
export { default as id } from "./getID";
|
|
24
25
|
export declare const getApiBase: () => {};
|
|
25
|
-
export
|
|
26
|
+
export declare const api: LightClient;
|
|
27
|
+
export declare const getGQLFields: (name: string, fields: string[]) => any[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useRuntimeConfig } from "nuxt/app";
|
|
2
2
|
import { Notify } from "quasar";
|
|
3
|
+
import { createClient } from "@hostlink/light";
|
|
3
4
|
export { default as f } from "./f.mjs";
|
|
4
5
|
export { default as getApiUrl } from "./getApiUrl.mjs";
|
|
5
6
|
export { default as getCurrentUser } from "./getCurrentUser.mjs";
|
|
@@ -32,4 +33,7 @@ export const getApiBase = () => {
|
|
|
32
33
|
const config = useRuntimeConfig();
|
|
33
34
|
return config?.public?.apiBase ?? "/api/";
|
|
34
35
|
};
|
|
35
|
-
export
|
|
36
|
+
export const api = createClient("");
|
|
37
|
+
export const getGQLFields = (name, fields) => {
|
|
38
|
+
return api.model(name).gqlFields(fields);
|
|
39
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toQuery } from "@hostlink/light";
|
|
2
|
+
import { api } from "./index.mjs";
|
|
2
3
|
export default async function list(name, props = null, fields = []) {
|
|
3
4
|
let q = {};
|
|
4
5
|
if (props) {
|
|
@@ -31,7 +32,7 @@ export default async function list(name, props = null, fields = []) {
|
|
|
31
32
|
key: true,
|
|
32
33
|
name: true
|
|
33
34
|
};
|
|
34
|
-
const resp = await query({
|
|
35
|
+
const resp = await api.query({
|
|
35
36
|
[`list${name}`]: q
|
|
36
37
|
});
|
|
37
38
|
return resp[`list${name}`];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Fields } from "@hostlink/light";
|
|
1
|
+
import { type Fields } from "@hostlink/light";
|
|
2
2
|
export default function listObject(name: string, filters: {} | undefined, sort: string, offset: number, limit: number, fields?: Fields): Promise<any>;
|
package/dist/runtime/lib/m.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { api } from ".";
|
|
2
2
|
import type { LTableColumn } from "../components/l-table.vue";
|
|
3
|
-
interface LModel extends ReturnType<typeof model> {
|
|
3
|
+
interface LModel extends ReturnType<typeof api.model> {
|
|
4
4
|
columns(fields: string[]): Array<LTableColumn>;
|
|
5
5
|
}
|
|
6
6
|
declare const _default: (name: string) => LModel;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { api } from "./index.mjs";
|
|
2
2
|
export default (name) => {
|
|
3
|
-
const m = model(name);
|
|
3
|
+
const m = api.model(name);
|
|
4
4
|
return Object.assign(m, {
|
|
5
5
|
columns(fields) {
|
|
6
6
|
let columns = [];
|
|
7
7
|
if (Array.isArray(fields)) {
|
|
8
8
|
for (let f of fields) {
|
|
9
|
-
const field =
|
|
9
|
+
const field = m.field(f);
|
|
10
10
|
if (!field) continue;
|
|
11
11
|
const option = field.getRaw();
|
|
12
12
|
option.name = field.getName();
|
|
@@ -15,7 +15,7 @@ export default (name) => {
|
|
|
15
15
|
} else {
|
|
16
16
|
for (let f in fields) {
|
|
17
17
|
if (!fields[f]) continue;
|
|
18
|
-
const field =
|
|
18
|
+
const field = m.field(f);
|
|
19
19
|
if (!field) continue;
|
|
20
20
|
const option = field.getRaw();
|
|
21
21
|
option.name = field.getName();
|
package/dist/runtime/lib/q.mjs
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
1
|
import f from "./f.mjs";
|
|
3
2
|
import { jsonToGraphQLQuery } from "json-to-graphql-query";
|
|
4
|
-
import { getApiBase } from "./index.mjs";
|
|
5
3
|
import { toQuery } from "@hostlink/light";
|
|
4
|
+
import { api } from "./index.mjs";
|
|
6
5
|
export default async function(operation, args = null, fields = []) {
|
|
7
|
-
const service = axios.create({
|
|
8
|
-
withCredentials: true
|
|
9
|
-
});
|
|
10
6
|
let query;
|
|
11
7
|
if (operation instanceof Object) {
|
|
12
8
|
query = jsonToGraphQLQuery(toQuery(operation));
|
|
@@ -17,7 +13,7 @@ export default async function(operation, args = null, fields = []) {
|
|
|
17
13
|
}
|
|
18
14
|
query = f(operation, args, fields);
|
|
19
15
|
}
|
|
20
|
-
const resp = (await
|
|
16
|
+
const resp = (await api.axios.post("", {
|
|
21
17
|
query: `{ ${query} }`
|
|
22
18
|
})).data;
|
|
23
19
|
if (resp.errors) {
|
package/dist/runtime/lib/sv.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { api } from "./index.mjs";
|
|
2
2
|
export const cache = {};
|
|
3
3
|
export default (name) => {
|
|
4
4
|
if (cache[name]) {
|
|
5
5
|
return cache[name];
|
|
6
6
|
}
|
|
7
7
|
const p = new Promise(async (resolve, reject) => {
|
|
8
|
-
const resp = await query({
|
|
8
|
+
const resp = await api.query({
|
|
9
9
|
systemValue: {
|
|
10
10
|
__args: {
|
|
11
11
|
name
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { reactive } from 'vue'
|
|
3
|
-
import { m } from '#imports'
|
|
3
|
+
import { m, api } from '#imports'
|
|
4
4
|
import { useI18n } from 'vue-i18n';
|
|
5
|
-
import { query } from '@hostlink/light';
|
|
6
5
|
const { t } = useI18n();
|
|
7
6
|
|
|
8
|
-
const { app, listRole: roles } = await query({
|
|
7
|
+
const { app, listRole: roles } = await api.query({
|
|
9
8
|
app: {
|
|
10
9
|
permissions: true
|
|
11
10
|
},
|
|
@@ -78,7 +77,8 @@ const onUpdate = (value, role, permission) => {
|
|
|
78
77
|
</q-td>
|
|
79
78
|
<q-td v-for="role in roles">
|
|
80
79
|
<q-checkbox v-model="props.row[role.name]"
|
|
81
|
-
@update:model-value="onUpdate($event, role.name, props.row.permission)"
|
|
80
|
+
@update:model-value="onUpdate($event, role.name, props.row.permission)"
|
|
81
|
+
:color="$light.color" />
|
|
82
82
|
</q-td>
|
|
83
83
|
</q-tr>
|
|
84
84
|
</template>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { reactive } from 'vue'
|
|
3
3
|
import { utils, writeFileXLSX } from 'xlsx';
|
|
4
|
-
import {
|
|
4
|
+
import { api } from '#imports';
|
|
5
5
|
const obj = reactive({
|
|
6
6
|
roles: []
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
const { app, listRole } = await query({
|
|
9
|
+
const { app, listRole } = await api.query({
|
|
10
10
|
app: {
|
|
11
11
|
permissions: true
|
|
12
12
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { api } from '#imports';
|
|
3
3
|
|
|
4
|
-
const { system: { database } } = await query({
|
|
4
|
+
const { system: { database } } = await api.query({
|
|
5
5
|
system: {
|
|
6
6
|
database: {
|
|
7
7
|
table: true
|
|
@@ -17,8 +17,8 @@ const { system: { database } } = await query({
|
|
|
17
17
|
<q-list class="rounded-borders" separator bordered>
|
|
18
18
|
<q-expansion-item :label="table.name" v-for="table in database.table" dense>
|
|
19
19
|
<div class="q-ma-sm">
|
|
20
|
-
<q-table separator="cell" dense :rows="table.columns" :rows-per-page-options="[0]"
|
|
21
|
-
flat bordered></q-table>
|
|
20
|
+
<q-table separator="cell" dense :rows="table.columns" :rows-per-page-options="[0]"
|
|
21
|
+
hide-pagination flat bordered></q-table>
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
24
|
</q-expansion-item>
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useQuasar } from "quasar";
|
|
3
3
|
import { ref } from "vue"
|
|
4
|
-
import { q, m, getCurrentUser } from '#imports'
|
|
4
|
+
import { q, m, getCurrentUser, api } from '#imports'
|
|
5
5
|
const app = await q("app", ["hasBioAuth"]);
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
const quasar = useQuasar();
|
|
8
9
|
|
|
9
10
|
const data = ref(await q("listWebAuthn", ["uuid", "ip", "user_agent", "createdTime"]));
|
|
10
11
|
|
|
11
12
|
const register = async () => {
|
|
12
13
|
try {
|
|
13
|
-
await
|
|
14
|
+
await api.auth.WebAuthn.register();
|
|
14
15
|
data.value = await q("listWebAuthn", ["uuid", "ip", "user_agent", "createdTime"]);
|
|
15
16
|
const user = await getCurrentUser();
|
|
16
17
|
localStorage.setItem("username", user.username);
|
|
17
18
|
} catch (e) {
|
|
18
|
-
|
|
19
|
+
quasar.dialog({
|
|
19
20
|
title: "Error",
|
|
20
21
|
message: e.message,
|
|
21
22
|
ok: "OK"
|
|
@@ -49,7 +50,7 @@ const columns = [
|
|
|
49
50
|
|
|
50
51
|
const deleteItem = async (uuid) => {
|
|
51
52
|
//confirm
|
|
52
|
-
|
|
53
|
+
quasar.dialog({
|
|
53
54
|
title: "Delete",
|
|
54
55
|
color: "negative",
|
|
55
56
|
message: "Are you sure you want to delete this item?",
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
import { useI18n } from 'vue-i18n'
|
|
3
3
|
import { Dialog } from 'quasar'
|
|
4
4
|
import { reset } from "@formkit/core"
|
|
5
|
-
import { updatePassword } from "@hostlink/light"
|
|
6
5
|
import { computed } from 'vue'
|
|
7
|
-
import { q } from "#imports"
|
|
6
|
+
import { q, api } from "#imports"
|
|
8
7
|
|
|
9
8
|
const { t } = useI18n()
|
|
10
9
|
|
|
11
10
|
const onSubmit = async (data, form) => {
|
|
12
|
-
if (await updatePassword(data.old_password, data.new_password)) {
|
|
11
|
+
if (await api.auth.updatePassword(data.old_password, data.new_password)) {
|
|
13
12
|
reset(form);
|
|
14
13
|
await Dialog.create({
|
|
15
14
|
title: "Password updated",
|
|
@@ -35,7 +34,7 @@ const policies = computed(() => {
|
|
|
35
34
|
if (name == "length") {
|
|
36
35
|
return t('Must contain at least {0} characters', [policy.split(":")[1]]);
|
|
37
36
|
}
|
|
38
|
-
|
|
37
|
+
|
|
39
38
|
return t(name);
|
|
40
39
|
})
|
|
41
40
|
})
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -4,12 +4,12 @@ import { defineNuxtPlugin } from "#app";
|
|
|
4
4
|
import "./assets/main.css";
|
|
5
5
|
import message_en from "./locales/en.json";
|
|
6
6
|
import message_zh from "./locales/zh-hk.json";
|
|
7
|
-
import {
|
|
7
|
+
import { api } from "./lib/index.mjs";
|
|
8
8
|
localStorage.getItem("locale") || localStorage.setItem("locale", "en");
|
|
9
9
|
import { createQuasarPlugin } from "formkit-quasar";
|
|
10
10
|
import { createLightPlugin } from "./formkit/index.mjs";
|
|
11
11
|
import { plugin, defaultConfig } from "@formkit/vue";
|
|
12
|
-
import { useLight } from "./index.mjs";
|
|
12
|
+
import { getApiBase, useLight } from "./index.mjs";
|
|
13
13
|
import TypeUser from "./types/User.mjs";
|
|
14
14
|
import TypeUserLog from "./types/UserLog.mjs";
|
|
15
15
|
import TypeSystemValue from "./types/SystemValue.mjs";
|
|
@@ -17,11 +17,12 @@ import TypeMailLog from "./types/MailLog.mjs";
|
|
|
17
17
|
import TypeEventLog from "./types/EventLog.mjs";
|
|
18
18
|
import { zhTW } from "@formkit/i18n";
|
|
19
19
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
api.axios.defaults.baseURL = getApiBase();
|
|
21
|
+
api.models.create("User", TypeUser);
|
|
22
|
+
api.models.create("UserLog", TypeUserLog);
|
|
23
|
+
api.models.create("SystemValue", TypeSystemValue);
|
|
24
|
+
api.models.create("MailLog", TypeMailLog);
|
|
25
|
+
api.models.create("EventLog", TypeEventLog);
|
|
25
26
|
nuxtApp.vueApp.config.globalProperties.$light = useLight();
|
|
26
27
|
nuxtApp.vueApp.config.errorHandler = (error) => {
|
|
27
28
|
console.log(error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostlink/nuxt-light",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.5",
|
|
4
4
|
"description": "HostLink Nuxt Light Framework",
|
|
5
5
|
"repository": "@hostlink/nuxt-light",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@formkit/drag-and-drop": "^0.0.36",
|
|
37
|
-
"@hostlink/light": "^
|
|
37
|
+
"@hostlink/light": "^2.0.1",
|
|
38
38
|
"@nuxt/kit": "^3.7.4",
|
|
39
39
|
"@nuxt/module-builder": "^0.5.2",
|
|
40
40
|
"@quasar/extras": "^1.16.11",
|
|
@@ -57,4 +57,4 @@
|
|
|
57
57
|
"eslint": "^8.46.0",
|
|
58
58
|
"nuxt": "^3.7.0"
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|