@hostlink/nuxt-light 1.8.3 → 1.8.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/runtime/components/l-card.vue +56 -28
- package/dist/runtime/components/l-tab.vue +5 -3
- package/dist/runtime/components/l-tabs.vue +14 -27
- package/dist/runtime/pages/EventLog/index.vue +1 -2
- package/dist/runtime/pages/User/index.vue +4 -3
- package/dist/runtime/pages/User/profile.vue +6 -4
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useLight, q, m } from '#imports'
|
|
3
|
-
import { ref, computed } from 'vue'
|
|
3
|
+
import { ref, computed, useSlots, onMounted } from 'vue'
|
|
4
4
|
import { type QCardProps } from 'quasar';
|
|
5
5
|
|
|
6
6
|
const minimized = defineModel<boolean>("minimized", { default: false })
|
|
@@ -16,7 +16,6 @@ export interface LCardProps extends QCardProps {
|
|
|
16
16
|
closeable?: boolean
|
|
17
17
|
minimizable?: boolean,
|
|
18
18
|
maximizable?: boolean
|
|
19
|
-
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
const light = useLight();
|
|
@@ -26,6 +25,8 @@ const props = withDefaults(defineProps<LCardProps>(), {
|
|
|
26
25
|
square: undefined,
|
|
27
26
|
});
|
|
28
27
|
|
|
28
|
+
|
|
29
|
+
|
|
29
30
|
const attrs = computed(() => {
|
|
30
31
|
const a = { ...props };
|
|
31
32
|
if (props.flat === undefined) a.flat = light.getStyle("cardFlat");
|
|
@@ -64,29 +65,29 @@ const roles = ref<{
|
|
|
64
65
|
}[]>([]);
|
|
65
66
|
|
|
66
67
|
if (props.permission && light.isAdmin) {
|
|
67
|
-
//get role
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
68
|
+
/* //get role
|
|
69
|
+
const data = await q({
|
|
70
|
+
listRole: {
|
|
71
|
+
name: true
|
|
72
|
+
},
|
|
73
|
+
listPermission: {
|
|
74
|
+
__args: {
|
|
75
|
+
filters: {
|
|
76
|
+
value: props.permission
|
|
77
|
+
}
|
|
78
|
+
}, data: {
|
|
79
|
+
role: true
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
roles.value = (data.listRole.map((r: any) => {
|
|
86
|
+
return {
|
|
87
|
+
name: r.name,
|
|
88
|
+
granted: data.listPermission.data.find((p: any) => p.role == r.name) != undefined
|
|
89
|
+
}
|
|
90
|
+
})); */
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
const onUpdatePermission = async (role: any) => {
|
|
@@ -104,6 +105,35 @@ const onUpdatePermission = async (role: any) => {
|
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
|
|
108
|
+
onMounted(async () => {
|
|
109
|
+
if (props.permission && light.isAdmin) {
|
|
110
|
+
//get role
|
|
111
|
+
const data = await q({
|
|
112
|
+
listRole: {
|
|
113
|
+
name: true
|
|
114
|
+
},
|
|
115
|
+
listPermission: {
|
|
116
|
+
__args: {
|
|
117
|
+
filters: {
|
|
118
|
+
value: props.permission
|
|
119
|
+
}
|
|
120
|
+
}, data: {
|
|
121
|
+
role: true
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
roles.value = (data.listRole.map((r: any) => {
|
|
128
|
+
return {
|
|
129
|
+
name: r.name,
|
|
130
|
+
granted: data.listPermission.data.find((p: any) => p.role == r.name) != undefined
|
|
131
|
+
}
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
|
|
107
137
|
|
|
108
138
|
|
|
109
139
|
</script>
|
|
@@ -133,9 +163,7 @@ const onUpdatePermission = async (role: any) => {
|
|
|
133
163
|
:icon="maximized ? 'sym_o_select_window_2' : 'sym_o_crop_square'" v-if="maximizable" />
|
|
134
164
|
<q-btn dense flat icon="sym_o_close" v-close-popup v-if="closeable" />
|
|
135
165
|
</q-bar>
|
|
136
|
-
<
|
|
137
|
-
<slot></slot>
|
|
138
|
-
</template>
|
|
166
|
+
<slot v-if="!minimized || maximized"></slot>
|
|
139
167
|
|
|
140
168
|
<q-inner-loading :showing="loading" label="Please wait..." label-class="text-primary" />
|
|
141
169
|
</q-card>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
defineProps<
|
|
2
|
+
import type { QTabPanelProps } from 'quasar';
|
|
3
|
+
defineProps<QTabPanelProps>()
|
|
4
4
|
</script>
|
|
5
5
|
<template>
|
|
6
|
-
<q-tab
|
|
6
|
+
<q-tab-panel :name="name">
|
|
7
|
+
<slot></slot>
|
|
8
|
+
</q-tab-panel>
|
|
7
9
|
</template>
|
|
@@ -1,57 +1,44 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { useSlots, computed, ref } from 'vue';
|
|
2
|
+
import { useSlots } from 'vue';
|
|
4
3
|
import type { QTabsProps } from 'quasar';
|
|
5
4
|
|
|
5
|
+
const model = defineModel<string | number | null | undefined>()
|
|
6
6
|
interface LTabsProps extends QTabsProps {
|
|
7
7
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const emit = defineEmits(["update:modelValue"])
|
|
10
|
+
defineProps<LTabsProps>()
|
|
11
|
+
|
|
13
12
|
const slots = useSlots();
|
|
14
|
-
const defaultSlots = slots.default()
|
|
13
|
+
const defaultSlots = slots.default ? slots.default() : []
|
|
15
14
|
|
|
16
15
|
//get the tabs from the default slot
|
|
17
16
|
let name = 0;
|
|
18
17
|
const tabContents = defaultSlots.map((slot) => {
|
|
19
|
-
const n = slot.props
|
|
18
|
+
const n = slot.props?.name || name++;
|
|
20
19
|
return {
|
|
21
|
-
label: slot.props
|
|
20
|
+
label: slot.props?.label,
|
|
22
21
|
content: slot.children,
|
|
23
22
|
name: n.toString()
|
|
24
23
|
}
|
|
25
24
|
})
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
v.value = tabContents[0].name
|
|
31
|
-
}
|
|
32
|
-
const localValue = computed({
|
|
33
|
-
get: () => props.modelValue || v.value,
|
|
34
|
-
set: (val) => {
|
|
35
|
-
v.value = val
|
|
36
|
-
emit("update:modelValue", val)
|
|
26
|
+
if (model.value === null || model.value === undefined) {
|
|
27
|
+
if (tabContents.length > 0) {
|
|
28
|
+
model.value = tabContents[0].name
|
|
37
29
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
}
|
|
41
31
|
|
|
42
32
|
</script>
|
|
43
33
|
|
|
44
34
|
<template>
|
|
45
35
|
<l-card>
|
|
46
|
-
|
|
47
36
|
<q-tabs class="text-grey" :active-color="$light.color" :indicator-color="$light.color" align="justify"
|
|
48
|
-
v-model="
|
|
37
|
+
v-model="model">
|
|
49
38
|
<q-tab v-for="tab in tabContents" :label="$t(tab.label)" :name="tab.name"></q-tab>
|
|
50
39
|
</q-tabs>
|
|
51
|
-
<q-tab-panels v-model="
|
|
52
|
-
<
|
|
53
|
-
<component :is="tab.content.default"></component>
|
|
54
|
-
</q-tab-panel>
|
|
40
|
+
<q-tab-panels v-model="model">
|
|
41
|
+
<component v-for="tab in tabContents" :key="tab.name" :is="tab.content?.default" :name="tab.name" />
|
|
55
42
|
</q-tab-panels>
|
|
56
43
|
</l-card>
|
|
57
44
|
</template>
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { model } from "#imports"
|
|
3
|
-
import { ref } from 'vue'
|
|
4
3
|
const columns = model('EventLog').columns(['eventlog_id', 'class', 'id', 'action', 'created_time', 'username'])
|
|
5
4
|
</script>
|
|
6
5
|
<template>
|
|
7
6
|
<l-page>
|
|
8
7
|
|
|
9
|
-
<l-table
|
|
8
|
+
<l-table @request="$event.loadObjects('EventLog')" :columns="columns"
|
|
10
9
|
sort-by="eventlog_id:desc" :actions="['view']">
|
|
11
10
|
|
|
12
11
|
</l-table>
|
|
@@ -2,22 +2,23 @@
|
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
import { model } from "#imports"
|
|
4
4
|
const onRequest = async (request) => {
|
|
5
|
+
|
|
5
6
|
request.loadObjects("User", { status: status.value });
|
|
6
7
|
};
|
|
7
|
-
const columns = model("User").columns(["username", "first_name", "label_name", "email", "phone", "join_date", "status","has2FA"]);
|
|
8
|
+
const columns = model("User").columns(["username", "first_name", "label_name", "email", "phone", "join_date", "status", "has2FA"]);
|
|
8
9
|
const status = ref("0");
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<template>
|
|
12
13
|
<l-page>
|
|
13
|
-
|
|
14
14
|
<l-tabs v-model="status">
|
|
15
15
|
<l-tab label="Active" name="0">
|
|
16
16
|
<l-table row-key="user_id" @request="onRequest" :columns="columns"
|
|
17
17
|
:actions="['view', 'edit', 'delete']"></l-table>
|
|
18
18
|
</l-tab>
|
|
19
19
|
<l-tab label="Inactive" name="1">
|
|
20
|
-
<l-table row-key="user_id" @request="onRequest" :columns="columns"
|
|
20
|
+
<l-table row-key="user_id" @request="onRequest" :columns="columns"
|
|
21
|
+
:actions="['view', 'edit', 'delete']">
|
|
21
22
|
</l-table>
|
|
22
23
|
</l-tab>
|
|
23
24
|
</l-tabs>
|
|
@@ -62,8 +62,8 @@ eventLogCols.forEach(col => {
|
|
|
62
62
|
</q-card-section>
|
|
63
63
|
|
|
64
64
|
<q-card-section class="text-center text-center q-pt-none">
|
|
65
|
-
<q-chip v-for="role in my.roles" :key="role" :label="role" :color="$light.color"
|
|
66
|
-
class="q-ma-xs" />
|
|
65
|
+
<q-chip v-for="role in my.roles" :key="role" :label="role" :color="$light.color"
|
|
66
|
+
text-color="white" class="q-ma-xs" />
|
|
67
67
|
</q-card-section>
|
|
68
68
|
|
|
69
69
|
|
|
@@ -85,11 +85,13 @@ eventLogCols.forEach(col => {
|
|
|
85
85
|
|
|
86
86
|
<l-tabs>
|
|
87
87
|
<l-tab label="User Log">
|
|
88
|
-
<l-table :rows="my.userLog.data" :columns="userlogColumns" searchable
|
|
88
|
+
<l-table :rows="my.userLog.data" :columns="userlogColumns" searchable
|
|
89
|
+
:rows-per-page-options="[0]">
|
|
89
90
|
</l-table>
|
|
90
91
|
</l-tab>
|
|
91
92
|
<l-tab label="Event Log">
|
|
92
|
-
<l-table :rows="my.eventLog.data" :columns="eventLogCols" searchable
|
|
93
|
+
<l-table :rows="my.eventLog.data" :columns="eventLogCols" searchable
|
|
94
|
+
:rows-per-page-options="[0]">
|
|
93
95
|
</l-table>
|
|
94
96
|
</l-tab>
|
|
95
97
|
|