@hostlink/nuxt-light 1.20.5 → 1.21.0
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 -3
- package/dist/runtime/components/l-app.vue +16 -0
- package/dist/runtime/components/l-file-manager copy.vue +750 -0
- package/dist/runtime/components/l-file-manager-move.vue +13 -8
- package/dist/runtime/components/l-file-manager-preview.vue +39 -46
- package/dist/runtime/components/l-file-manager.vue +275 -140
- package/dist/runtime/components/l-login.vue +4 -4
- package/dist/runtime/lib/getCurrentUser.d.ts +2 -1
- package/dist/runtime/lib/getCurrentUser.js +11 -4
- package/dist/runtime/lib/getObject.js +3 -4
- package/dist/runtime/lib/index.d.ts +0 -2
- package/dist/runtime/lib/index.js +0 -2
- package/dist/runtime/lib/isGranted.js +10 -1
- package/dist/runtime/pages/MailLog/index.vue +1 -10
- package/dist/runtime/pages/System/fs.vue +19 -7
- package/dist/runtime/pages/User/setting/bio-auth.vue +22 -19
- package/dist/runtime/pages/User/setting/open_id.vue +9 -11
- package/dist/runtime/plugin.js +5 -2
- package/package.json +2 -2
- package/dist/runtime/lib/listObject.d.ts +0 -2
- package/dist/runtime/lib/listObject.js +0 -10
- package/dist/runtime/lib/loadObject.d.ts +0 -1
- package/dist/runtime/lib/loadObject.js +0 -10
|
@@ -53,7 +53,7 @@ const passwordExpiredProcess = (username: string, password: string) => {
|
|
|
53
53
|
color: "positive",
|
|
54
54
|
icon: "sym_o_check",
|
|
55
55
|
});
|
|
56
|
-
} catch (e) {
|
|
56
|
+
} catch (e: any) {
|
|
57
57
|
$q.notify({
|
|
58
58
|
message: e.message,
|
|
59
59
|
color: "negative",
|
|
@@ -205,7 +205,7 @@ const bioLogin = async () => {
|
|
|
205
205
|
}
|
|
206
206
|
const handleGoogleCredentialResponse = async (response) => {
|
|
207
207
|
try {
|
|
208
|
-
await api.auth.
|
|
208
|
+
await api.auth.google.login(response.credential);
|
|
209
209
|
window.self.location.reload();
|
|
210
210
|
} catch (e: any) {
|
|
211
211
|
$q.notify({
|
|
@@ -255,7 +255,7 @@ onMounted(() => {
|
|
|
255
255
|
|
|
256
256
|
const microsoftLogin = async (resp) => {
|
|
257
257
|
try {
|
|
258
|
-
await api.auth.
|
|
258
|
+
await api.auth.microsoft.login(resp.accessToken);
|
|
259
259
|
emits("login");
|
|
260
260
|
} catch (e) {
|
|
261
261
|
$q.notify({
|
|
@@ -268,7 +268,7 @@ const microsoftLogin = async (resp) => {
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
const facebookLogin = (accessToken) => {
|
|
271
|
-
|
|
271
|
+
api.auth.facebook.login(accessToken).then(() => {
|
|
272
272
|
emits("login");
|
|
273
273
|
}).catch((e) => {
|
|
274
274
|
$q.notify({
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default async (
|
|
1
|
+
import { default as api } from "./api.js";
|
|
2
|
+
export default async (fields = {
|
|
3
|
+
username: true,
|
|
4
|
+
first_name: true,
|
|
5
|
+
last_name: true,
|
|
6
|
+
roles: true
|
|
7
|
+
}) => {
|
|
3
8
|
try {
|
|
4
|
-
|
|
9
|
+
const { my } = await api.query({
|
|
10
|
+
my: fields
|
|
11
|
+
});
|
|
12
|
+
return my;
|
|
5
13
|
} catch (e) {
|
|
6
14
|
return null;
|
|
7
15
|
}
|
|
8
|
-
return null;
|
|
9
16
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { toQuery } from "@hostlink/light";
|
|
1
2
|
import { useRoute } from "vue-router";
|
|
2
|
-
import loadObject from "./loadObject.js";
|
|
3
3
|
import { default as getModelField } from "./getModelField.js";
|
|
4
|
+
import { collect } from "#imports";
|
|
4
5
|
export default async function(fields = []) {
|
|
5
6
|
let route = useRoute();
|
|
6
7
|
if (!route.name) {
|
|
@@ -8,8 +9,6 @@ export default async function(fields = []) {
|
|
|
8
9
|
}
|
|
9
10
|
const [module, id_name] = route.name.split("-");
|
|
10
11
|
const id = parseInt(route.params[id_name]);
|
|
11
|
-
const filters = {};
|
|
12
|
-
filters[id_name] = id;
|
|
13
12
|
if (fields instanceof Object && !(fields instanceof Array)) {
|
|
14
13
|
fields = [fields];
|
|
15
14
|
}
|
|
@@ -25,5 +24,5 @@ export default async function(fields = []) {
|
|
|
25
24
|
}
|
|
26
25
|
return field;
|
|
27
26
|
});
|
|
28
|
-
return await
|
|
27
|
+
return await collect(module, toQuery(fs)).where(id_name, id).first();
|
|
29
28
|
}
|
|
@@ -7,8 +7,6 @@ export { default as list } from "./list.js";
|
|
|
7
7
|
export { default as m } from "./m.js";
|
|
8
8
|
export { default as q } from "./q.js";
|
|
9
9
|
export { default as t } from "./t.js";
|
|
10
|
-
export { default as listObject } from "./listObject.js";
|
|
11
|
-
export { default as loadObject } from "./loadObject.js";
|
|
12
10
|
export { default as isGranted } from "./isGranted.js";
|
|
13
11
|
export { default as GQLFieldBuilder } from "./GQLFieldBuilder.js";
|
|
14
12
|
export { default as getModelField } from "./getModelField.js";
|
|
@@ -9,8 +9,6 @@ export { default as list } from "./list.js";
|
|
|
9
9
|
export { default as m } from "./m.js";
|
|
10
10
|
export { default as q } from "./q.js";
|
|
11
11
|
export { default as t } from "./t.js";
|
|
12
|
-
export { default as listObject } from "./listObject.js";
|
|
13
|
-
export { default as loadObject } from "./loadObject.js";
|
|
14
12
|
export { default as isGranted } from "./isGranted.js";
|
|
15
13
|
export { default as GQLFieldBuilder } from "./GQLFieldBuilder.js";
|
|
16
14
|
export { default as getModelField } from "./getModelField.js";
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
import { default as api } from "./api.js";
|
|
1
2
|
export default async function isGranted(right) {
|
|
2
|
-
const my = await
|
|
3
|
+
const { my } = await api.query({
|
|
4
|
+
my: {
|
|
5
|
+
granted: {
|
|
6
|
+
__args: {
|
|
7
|
+
right
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
});
|
|
3
12
|
return my.granted;
|
|
4
13
|
}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { model
|
|
3
|
-
import { ref } from 'vue'
|
|
2
|
+
import { model } from "#imports"
|
|
4
3
|
const columns = model("MailLog").columns(["maillog_id", "from", "to", "subject", "created_time"])
|
|
5
4
|
</script>
|
|
6
|
-
|
|
7
5
|
<template>
|
|
8
6
|
<l-page>
|
|
9
|
-
<q-dialog v-model="show" full-width>
|
|
10
|
-
<l-card title="Mail content">
|
|
11
|
-
<q-card-section>
|
|
12
|
-
<iframe width="100%" height="500px" :srcdoc="content" frameborder="0"></iframe>
|
|
13
|
-
</q-card-section>
|
|
14
|
-
</l-card>
|
|
15
|
-
</q-dialog>
|
|
16
7
|
<l-table row-key="maillog_id" @request-data="$event.loadObjects('MailLog', {}, ['body'])" :columns="columns"
|
|
17
8
|
sort-by="maillog_id:desc">
|
|
18
9
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref } from 'vue';
|
|
3
3
|
import { m, q } from "#imports"
|
|
4
|
-
const { listFileSystem } = await q({
|
|
4
|
+
const { app, listFileSystem } = await q({
|
|
5
|
+
app: {
|
|
6
|
+
driveTypes: true
|
|
7
|
+
},
|
|
8
|
+
listFileSystem: true
|
|
9
|
+
});
|
|
10
|
+
|
|
5
11
|
const items = ref(listFileSystem)
|
|
6
12
|
const dialog = ref(false)
|
|
7
13
|
const value = ref({})
|
|
@@ -58,10 +64,12 @@ const columns = [
|
|
|
58
64
|
]
|
|
59
65
|
</script>
|
|
60
66
|
<template>
|
|
67
|
+
|
|
61
68
|
<l-page gutter="xs">
|
|
62
69
|
<template #header>
|
|
63
70
|
<l-btn label="Add" icon="sym_o_add" @click="dialog = true"></l-btn>
|
|
64
71
|
</template>
|
|
72
|
+
|
|
65
73
|
<q-dialog v-model="dialog" persistent>
|
|
66
74
|
<q-card style="width: 500px;">
|
|
67
75
|
|
|
@@ -74,18 +82,22 @@ const columns = [
|
|
|
74
82
|
<FormKit type="l-form" :value="value" @submit="onSubmit" #default="{ value }">
|
|
75
83
|
<FormKit type="l-input" label="Name" name="name" validation="required"></FormKit>
|
|
76
84
|
<FormKit type="l-select" label="Type" name="type" validation="required" :options="[
|
|
77
|
-
{ label: 'Local', value: 'local' },
|
|
78
|
-
{ label: 'S3', value: '
|
|
79
|
-
{ label: 'HostLink storage', value: 'hostlink' },
|
|
80
|
-
{ label: 'Aliyun OSS', value: 'aliyun-oss' }
|
|
85
|
+
{ label: 'Local', value: 'local', disable: !app.driveTypes.includes('local') },
|
|
86
|
+
{ label: 'S3', value: 's3', disable: !app.driveTypes.includes('s3') },
|
|
87
|
+
{ label: 'HostLink storage', value: 'hostlink', disable: !app.driveTypes.includes('hostlink') },
|
|
88
|
+
{ label: 'Aliyun OSS', value: 'aliyun-oss', disable: !app.driveTypes.includes('aliyun-oss') },
|
|
81
89
|
]"></FormKit>
|
|
82
90
|
|
|
83
91
|
<FormKit type="group" name="data">
|
|
84
92
|
<template v-if="value.type == 'local'">
|
|
85
|
-
<FormKit type="l-input" label="Location" name="location" validation="required"
|
|
93
|
+
<FormKit type="l-input" label="Location" name="location" validation="required"
|
|
94
|
+
hint="Location is the path to the directory where the files are stored."></FormKit>
|
|
95
|
+
<FormKit type="l-input" label="Base Url" name="base_url" validation="required"
|
|
96
|
+
hint="Base URL is used to generate the full URL of the file."></FormKit>
|
|
97
|
+
|
|
86
98
|
</template>
|
|
87
99
|
|
|
88
|
-
<template v-if="value.type == '
|
|
100
|
+
<template v-if="value.type == 's3'">
|
|
89
101
|
<FormKit type="l-input" label="Bucket" name="bucket" validation="required"></FormKit>
|
|
90
102
|
<FormKit type="l-input" label="Access Key" name="accessKey" validation="required"></FormKit>
|
|
91
103
|
<FormKit type="l-input" label="Secret Key" name="secretKey" validation="required"></FormKit>
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useQuasar } from "quasar";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { reactive } from "vue"
|
|
4
|
+
|
|
5
5
|
import { q, m, getCurrentUser, api } from '#imports'
|
|
6
|
-
const { app,
|
|
6
|
+
const { app, my: { webAuthn } } = reactive(await q({
|
|
7
7
|
app: {
|
|
8
8
|
hasBioAuth: true
|
|
9
9
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
my: {
|
|
11
|
+
webAuthn: {
|
|
12
|
+
uuid: true,
|
|
13
|
+
ip: true,
|
|
14
|
+
user_agent: true,
|
|
15
|
+
createdTime: true
|
|
16
|
+
}
|
|
15
17
|
}
|
|
16
18
|
}));
|
|
17
19
|
|
|
18
|
-
|
|
19
20
|
const quasar = useQuasar();
|
|
20
21
|
|
|
21
22
|
const register = async () => {
|
|
@@ -25,19 +26,21 @@ const register = async () => {
|
|
|
25
26
|
localStorage.setItem("username", user.username);
|
|
26
27
|
|
|
27
28
|
//refresh data
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const { my } = await q({
|
|
30
|
+
my: {
|
|
31
|
+
webAuthn: {
|
|
32
|
+
uuid: true,
|
|
33
|
+
ip: true,
|
|
34
|
+
user_agent: true,
|
|
35
|
+
createdTime: true
|
|
36
|
+
}
|
|
34
37
|
}
|
|
35
38
|
});
|
|
36
39
|
|
|
37
40
|
//clear data
|
|
38
|
-
|
|
41
|
+
webAuthn.splice(0, webAuthn.length);
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
webAuthn.push(...my.webAuthn);
|
|
41
44
|
|
|
42
45
|
} catch (e) {
|
|
43
46
|
quasar.dialog({
|
|
@@ -83,7 +86,7 @@ const deleteItem = async (uuid) => {
|
|
|
83
86
|
}).onOk(async () => {
|
|
84
87
|
await m("deleteWebAuthn", { uuid });
|
|
85
88
|
//remove from data
|
|
86
|
-
|
|
89
|
+
webAuthn.splice(webAuthn.findIndex(item => item.uuid === uuid), 1);
|
|
87
90
|
})
|
|
88
91
|
}
|
|
89
92
|
|
|
@@ -100,7 +103,7 @@ const deleteItem = async (uuid) => {
|
|
|
100
103
|
<l-btn label="Register" @click="register" icon="sym_o_add"></l-btn>
|
|
101
104
|
</q-toolbar>
|
|
102
105
|
|
|
103
|
-
<q-table :rows="
|
|
106
|
+
<q-table :rows="webAuthn" :columns="columns" dense :rows-per-page-options="[0]">
|
|
104
107
|
<template #body-cell-action="props">
|
|
105
108
|
<q-td :props="props" auto-width>
|
|
106
109
|
<q-btn @click="deleteItem(props.row.uuid)" icon="sym_o_delete" round flat dense></q-btn>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { reactive, onMounted, nextTick } from "vue"
|
|
3
3
|
import { useQuasar } from "quasar";
|
|
4
|
-
import { q, m, useLight } from '#imports'
|
|
4
|
+
import { q, m, useLight, api } from '#imports'
|
|
5
5
|
import { useI18n } from 'vue-i18n'
|
|
6
6
|
|
|
7
7
|
const light = useLight()
|
|
@@ -20,13 +20,13 @@ let { app, my } = await q({
|
|
|
20
20
|
}
|
|
21
21
|
})
|
|
22
22
|
|
|
23
|
+
|
|
23
24
|
const $q = useQuasar();
|
|
24
25
|
my = reactive(my);
|
|
25
26
|
|
|
26
27
|
const handleGoogleCredentialResponse = async (response) => {
|
|
27
28
|
try {
|
|
28
|
-
await
|
|
29
|
-
|
|
29
|
+
await api.auth.google.register(response.credential);
|
|
30
30
|
const resp = await q("my", ["gmail"]);
|
|
31
31
|
my.google = resp.google;
|
|
32
32
|
|
|
@@ -91,14 +91,12 @@ const onUnlink = async () => {
|
|
|
91
91
|
ok: "Yes",
|
|
92
92
|
cancel: "No",
|
|
93
93
|
}).onOk(async () => {
|
|
94
|
-
await
|
|
94
|
+
await api.auth.google.unlink();
|
|
95
95
|
my.gmail = null;
|
|
96
96
|
window.location.reload();
|
|
97
97
|
})
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
const ms = reactive({});
|
|
101
|
-
|
|
102
100
|
const onUnlinkMicrosoft = async () => {
|
|
103
101
|
//confirm
|
|
104
102
|
light.dialog({
|
|
@@ -108,7 +106,7 @@ const onUnlinkMicrosoft = async () => {
|
|
|
108
106
|
ok: "Yes",
|
|
109
107
|
cancel: "No",
|
|
110
108
|
}).onOk(async () => {
|
|
111
|
-
await
|
|
109
|
+
await api.auth.microsoft.unlink();
|
|
112
110
|
my.microsoft = null;
|
|
113
111
|
window.location.reload();
|
|
114
112
|
})
|
|
@@ -116,7 +114,7 @@ const onUnlinkMicrosoft = async () => {
|
|
|
116
114
|
|
|
117
115
|
const onLinkMicrosoft = async (resp) => {
|
|
118
116
|
try {
|
|
119
|
-
await
|
|
117
|
+
await api.auth.microsoft.register(resp.account.localAccountId);
|
|
120
118
|
light.notify({
|
|
121
119
|
message: "Microsoft account linked",
|
|
122
120
|
color: "positive",
|
|
@@ -131,9 +129,9 @@ const onLinkMicrosoft = async (resp) => {
|
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
131
|
|
|
134
|
-
const onLinkFacebook = (accessToken) => {
|
|
132
|
+
const onLinkFacebook = async (accessToken) => {
|
|
135
133
|
try {
|
|
136
|
-
|
|
134
|
+
await api.auth.facebook.register(accessToken);
|
|
137
135
|
light.notify({
|
|
138
136
|
message: "Facebook account linked",
|
|
139
137
|
color: "positive",
|
|
@@ -156,7 +154,7 @@ const onUnlinkFacebook = async () => {
|
|
|
156
154
|
ok: "Yes",
|
|
157
155
|
cancel: "No",
|
|
158
156
|
}).onOk(async () => {
|
|
159
|
-
await
|
|
157
|
+
await api.auth.facebook.unlink();
|
|
160
158
|
my.facebook = null;
|
|
161
159
|
window.location.reload();
|
|
162
160
|
})
|
package/dist/runtime/plugin.js
CHANGED
|
@@ -25,8 +25,11 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
25
25
|
api.models.create("SystemValue", TypeSystemValue);
|
|
26
26
|
api.models.create("MailLog", TypeMailLog);
|
|
27
27
|
api.models.create("EventLog", TypeEventLog);
|
|
28
|
-
api.model("MailLog").setDataPath("app.
|
|
29
|
-
api.model("EventLog").setDataPath("app.
|
|
28
|
+
api.model("MailLog").setDataPath("app.listMailLog");
|
|
29
|
+
api.model("EventLog").setDataPath("app.listEventLog");
|
|
30
|
+
api.model("User").setDataPath("app.listUser");
|
|
31
|
+
api.model("UserLog").setDataPath("app.listUserLog");
|
|
32
|
+
api.model("SystemValue").setDataPath("app.listSystemValue");
|
|
30
33
|
nuxtApp.vueApp.config.errorHandler = (err, instance, info) => {
|
|
31
34
|
console.log(err);
|
|
32
35
|
const light = useLight();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostlink/nuxt-light",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "HostLink Nuxt Light Framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@azure/msal-browser": "^3.26.1",
|
|
36
36
|
"@formkit/drag-and-drop": "^0.1.6",
|
|
37
|
-
"@hostlink/light": "^2.
|
|
37
|
+
"@hostlink/light": "^2.5.2",
|
|
38
38
|
"@nuxt/kit": "^3.7.4",
|
|
39
39
|
"@nuxt/module-builder": "^0.8.3",
|
|
40
40
|
"@quasar/extras": "^1.16.11",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (module: string, filters: Object, fields?: Array<string | Object>): Promise<any>;
|