@hostlink/nuxt-light 1.21.0 → 1.21.2
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 +24 -25
- package/dist/runtime/components/l-user-overview.vue +34 -65
- package/dist/runtime/index.d.ts +0 -2
- package/dist/runtime/index.js +0 -4
- package/dist/runtime/lib/collect.d.ts +3 -0
- package/dist/runtime/lib/collect.js +4 -0
- package/dist/runtime/lib/getObject.js +1 -1
- package/dist/runtime/lib/index.d.ts +1 -0
- package/dist/runtime/lib/index.js +1 -0
- package/dist/runtime/pages/Permission/all.vue +8 -6
- package/dist/runtime/pages/Permission/export.vue +8 -9
- package/dist/runtime/pages/Permission/index.vue +1 -0
- package/dist/runtime/pages/System/fs.vue +4 -3
- package/dist/runtime/plugin.js +1 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -267,37 +267,36 @@ const module = defineNuxtModule({
|
|
|
267
267
|
await addComponentsDir({
|
|
268
268
|
path: resolver.resolve("./runtime/components")
|
|
269
269
|
});
|
|
270
|
-
const from = resolver.resolve("./runtime/lib");
|
|
271
270
|
const index = resolver.resolve("./runtime/index");
|
|
272
271
|
const SystemValue = resolver.resolve("./runtime/lib/SystemValue");
|
|
273
272
|
addImports([
|
|
274
|
-
{ name: "api", from },
|
|
275
|
-
{ name: "id", from },
|
|
276
|
-
{ name: "getID", from },
|
|
277
|
-
{ name: "addObject", from },
|
|
278
|
-
{ name: "f", from },
|
|
279
|
-
{ name: "getApiUrl", from },
|
|
280
|
-
{ name: "getCurrentUser", from },
|
|
281
|
-
{ name: "getObject", from },
|
|
282
|
-
{ name: "list", from },
|
|
283
|
-
{ name: "m", from },
|
|
284
|
-
{ name: "q", from },
|
|
285
|
-
{ name: "removeObject", from },
|
|
286
|
-
{ name: "t", from },
|
|
273
|
+
{ name: "api", from: index },
|
|
274
|
+
{ name: "id", from: index },
|
|
275
|
+
{ name: "getID", from: index },
|
|
276
|
+
{ name: "addObject", from: index },
|
|
277
|
+
{ name: "f", from: index },
|
|
278
|
+
{ name: "getApiUrl", from: index },
|
|
279
|
+
{ name: "getCurrentUser", from: index },
|
|
280
|
+
{ name: "getObject", from: index },
|
|
281
|
+
{ name: "list", from: index },
|
|
282
|
+
{ name: "m", from: index },
|
|
283
|
+
{ name: "q", from: index },
|
|
284
|
+
{ name: "removeObject", from: index },
|
|
285
|
+
{ name: "t", from: index },
|
|
287
286
|
{ name: "useLight", from: index },
|
|
288
|
-
{ name: "isGranted", from },
|
|
289
|
-
{ name: "sv", from },
|
|
287
|
+
{ name: "isGranted", from: index },
|
|
288
|
+
{ name: "sv", from: index },
|
|
290
289
|
{ name: "loadSV", from: SystemValue },
|
|
291
290
|
{ name: "getSV", from: SystemValue },
|
|
292
|
-
{ name: "getModelColumns", from },
|
|
293
|
-
{ name: "getModelFields", from },
|
|
294
|
-
{ name: "getModelField", from },
|
|
295
|
-
{ name: "getGQLFields", from },
|
|
296
|
-
{ name: "model", from },
|
|
297
|
-
{ name: "notify", from },
|
|
298
|
-
{ name: "defineLightModel", from },
|
|
299
|
-
{ name: "LightModelField", from, type: true },
|
|
300
|
-
{ name: "LightModel", from, type: true },
|
|
291
|
+
{ name: "getModelColumns", from: index },
|
|
292
|
+
{ name: "getModelFields", from: index },
|
|
293
|
+
{ name: "getModelField", from: index },
|
|
294
|
+
{ name: "getGQLFields", from: index },
|
|
295
|
+
{ name: "model", from: index },
|
|
296
|
+
{ name: "notify", from: index },
|
|
297
|
+
{ name: "defineLightModel", from: index },
|
|
298
|
+
{ name: "LightModelField", from: index, type: true },
|
|
299
|
+
{ name: "LightModel", from: index, type: true },
|
|
301
300
|
{ name: "collect", from: index }
|
|
302
301
|
]);
|
|
303
302
|
const files = await resolveFiles(process.cwd() + "/models", ["*"]);
|
|
@@ -1,79 +1,48 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
|
|
3
|
-
import { model } from "#imports";
|
|
4
|
-
const props = defineProps(
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { collect, model } from "#imports";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
id: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const obj = await collect("User", {
|
|
12
|
+
user_id: true,
|
|
13
|
+
username: true,
|
|
14
|
+
first_name: true,
|
|
15
|
+
last_name: true,
|
|
16
|
+
email: true,
|
|
17
|
+
phone: true,
|
|
18
|
+
roles: true,
|
|
19
|
+
status: true,
|
|
20
|
+
join_date: true
|
|
21
|
+
}).where("user_id", props.id).first()
|
|
7
22
|
|
|
8
23
|
</script>
|
|
9
24
|
<template>
|
|
10
|
-
<l-card
|
|
25
|
+
<l-card>
|
|
11
26
|
<q-card-section>
|
|
12
27
|
<l-row>
|
|
13
|
-
<l-col md="
|
|
28
|
+
<l-col md="6">
|
|
14
29
|
<q-list dense separator>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</
|
|
25
|
-
|
|
26
|
-
</
|
|
27
|
-
<
|
|
28
|
-
<q-item-section>
|
|
29
|
-
<q-item-label>{{ $t('Last name') }}</q-item-label>
|
|
30
|
-
</q-item-section>
|
|
31
|
-
<q-item-section>{{ obj.last_name }}</q-item-section>
|
|
32
|
-
</q-item>
|
|
33
|
-
<q-item>
|
|
34
|
-
<q-item-section>
|
|
35
|
-
<q-item-label>{{ $t('Email') }}</q-item-label>
|
|
36
|
-
</q-item-section>
|
|
37
|
-
<q-item-section>{{ obj.email }}</q-item-section>
|
|
38
|
-
</q-item>
|
|
39
|
-
<q-item>
|
|
40
|
-
<q-item-section>
|
|
41
|
-
<q-item-label>{{ $t('Phone') }}</q-item-label>
|
|
42
|
-
</q-item-section>
|
|
43
|
-
<q-item-section>{{ obj.phone }}</q-item-section>
|
|
44
|
-
</q-item>
|
|
45
|
-
|
|
46
|
-
<q-item>
|
|
47
|
-
<q-item-section>
|
|
48
|
-
<q-item-label>{{ $t('Roles') }}</q-item-label>
|
|
49
|
-
</q-item-section>
|
|
50
|
-
<q-item-section>
|
|
51
|
-
<div class="q-gutter-xs float-left">
|
|
52
|
-
<q-badge v-for="role in obj.roles" :key="role" :color="$light.color">{{ role }}</q-badge>
|
|
53
|
-
</div>
|
|
54
|
-
</q-item-section>
|
|
55
|
-
</q-item>
|
|
56
|
-
|
|
57
|
-
<q-item>
|
|
58
|
-
<q-item-section>
|
|
59
|
-
<q-item-label>{{ $t('Status') }}</q-item-label>
|
|
60
|
-
</q-item-section>
|
|
61
|
-
<q-item-section>{{ model('User').columns(["status"])[0].format(obj.status) }}</q-item-section>
|
|
62
|
-
</q-item>
|
|
63
|
-
|
|
64
|
-
<q-item>
|
|
65
|
-
<q-item-section>
|
|
66
|
-
<q-item-label>{{ $t('Join date') }}</q-item-label>
|
|
67
|
-
</q-item-section>
|
|
68
|
-
<q-item-section>{{ obj.join_date }}</q-item-section>
|
|
69
|
-
</q-item>
|
|
30
|
+
<l-item label="Username">{{ obj.username }}</l-item>
|
|
31
|
+
<l-item label="First name">{{ obj.first_name }}</l-item>
|
|
32
|
+
<l-item label="Last name">{{ obj.last_name }}</l-item>
|
|
33
|
+
<l-item label="Email">{{ obj.email }}</l-item>
|
|
34
|
+
<l-item label="Phone">{{ obj.phone }}</l-item>
|
|
35
|
+
<l-item label="Roles">
|
|
36
|
+
<div class="q-gutter-xs float-left">
|
|
37
|
+
<q-badge v-for="role in obj.roles" :key="role" :color="$light.color">{{ role
|
|
38
|
+
}}</q-badge>
|
|
39
|
+
</div>
|
|
40
|
+
</l-item>
|
|
41
|
+
<l-item label="Status">{{ model('User').columns(["status"])[0].format(obj.status) }}</l-item>
|
|
42
|
+
<l-item label="Join date">{{ obj.join_date }}</l-item>
|
|
70
43
|
</q-list>
|
|
71
|
-
|
|
72
|
-
|
|
73
44
|
</l-col>
|
|
74
45
|
</l-row>
|
|
75
|
-
|
|
76
46
|
</q-card-section>
|
|
77
|
-
|
|
78
47
|
</l-card>
|
|
79
48
|
</template>
|
package/dist/runtime/index.d.ts
CHANGED
package/dist/runtime/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toQuery } from "@hostlink/light";
|
|
2
2
|
import { useRoute } from "vue-router";
|
|
3
3
|
import { default as getModelField } from "./getModelField.js";
|
|
4
|
-
import { collect } from "
|
|
4
|
+
import { default as collect } from "./collect.js";
|
|
5
5
|
export default async function(fields = []) {
|
|
6
6
|
let route = useRoute();
|
|
7
7
|
if (!route.name) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useRuntimeConfig } from "nuxt/app";
|
|
2
2
|
import { Notify } from "quasar";
|
|
3
3
|
export { default as api } from "./api.js";
|
|
4
|
+
export { default as collect } from "./collect.js";
|
|
4
5
|
export { default as f } from "./f.js";
|
|
5
6
|
export { default as getApiUrl } from "./getApiUrl.js";
|
|
6
7
|
export { default as getCurrentUser } from "./getCurrentUser.js";
|
|
@@ -4,16 +4,18 @@ import { m, api } from '#imports'
|
|
|
4
4
|
import { useI18n } from 'vue-i18n';
|
|
5
5
|
const { t } = useI18n();
|
|
6
6
|
|
|
7
|
-
const { app
|
|
7
|
+
const { app } = await api.query({
|
|
8
8
|
app: {
|
|
9
|
-
permissions: true
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
permissions: true,
|
|
10
|
+
roles: {
|
|
11
|
+
name: true,
|
|
12
|
+
permissions: true
|
|
13
|
+
}
|
|
14
14
|
}
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
+
const roles = app.roles;
|
|
18
|
+
|
|
17
19
|
const columns = [{
|
|
18
20
|
label: t("Permission"),
|
|
19
21
|
field: "permission",
|
|
@@ -6,18 +6,17 @@ const obj = reactive({
|
|
|
6
6
|
roles: []
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
const { app
|
|
9
|
+
const { app } = await api.query({
|
|
10
10
|
app: {
|
|
11
|
-
permissions: true
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
permissions: true,
|
|
12
|
+
roles: {
|
|
13
|
+
name: true,
|
|
14
|
+
permissions: true
|
|
15
|
+
}
|
|
16
16
|
}
|
|
17
|
-
|
|
18
17
|
})
|
|
19
18
|
|
|
20
|
-
let roles =
|
|
19
|
+
let roles = app.roles.map((role) => {
|
|
21
20
|
return {
|
|
22
21
|
label: role.name,
|
|
23
22
|
value: role.name,
|
|
@@ -27,7 +26,7 @@ let roles = listRole.map((role) => {
|
|
|
27
26
|
const submit = () => {
|
|
28
27
|
|
|
29
28
|
//filter roles
|
|
30
|
-
let e =
|
|
29
|
+
let e = app.roles.filter((role) => {
|
|
31
30
|
return obj.roles.indexOf(role.name) != -1;
|
|
32
31
|
});
|
|
33
32
|
|
|
@@ -89,12 +89,13 @@ const columns = [
|
|
|
89
89
|
]"></FormKit>
|
|
90
90
|
|
|
91
91
|
<FormKit type="group" name="data">
|
|
92
|
+
<FormKit type="l-input" label="Url" name="url"
|
|
93
|
+
hint="URL is used to generate the full URL of the file.">
|
|
94
|
+
</FormKit>
|
|
95
|
+
|
|
92
96
|
<template v-if="value.type == 'local'">
|
|
93
97
|
<FormKit type="l-input" label="Location" name="location" validation="required"
|
|
94
98
|
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
|
-
|
|
98
99
|
</template>
|
|
99
100
|
|
|
100
101
|
<template v-if="value.type == 's3'">
|
package/dist/runtime/plugin.js
CHANGED
|
@@ -30,6 +30,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
30
30
|
api.model("User").setDataPath("app.listUser");
|
|
31
31
|
api.model("UserLog").setDataPath("app.listUserLog");
|
|
32
32
|
api.model("SystemValue").setDataPath("app.listSystemValue");
|
|
33
|
+
api.model("Permission").setDataPath("app.listPermission");
|
|
33
34
|
nuxtApp.vueApp.config.errorHandler = (err, instance, info) => {
|
|
34
35
|
console.log(err);
|
|
35
36
|
const light = useLight();
|