@hostlink/nuxt-light 0.0.11 → 0.0.13
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-add-btn.vue +1 -1
- package/dist/runtime/components/l-date-picker.vue +1 -0
- package/dist/runtime/components/l-file-manager.vue +2 -1
- package/dist/runtime/components/l-input.vue +1 -0
- package/dist/runtime/components/l-select.vue +3 -2
- package/dist/runtime/lib/list.d.ts +1 -1
- package/dist/runtime/lib/list.mjs +6 -6
- package/dist/runtime/lib/q.d.ts +1 -1
- package/dist/runtime/lib/q.mjs +29 -6
- package/dist/runtime/pages/EventLog/_eventlog_id/view.vue +1 -2
- package/dist/runtime/pages/EventLog/index.vue +3 -1
- package/dist/runtime/pages/MailLog/index.vue +1 -0
- package/dist/runtime/pages/Permission/add.vue +3 -0
- package/dist/runtime/pages/Permission/all.vue +2 -0
- package/dist/runtime/pages/Permission/index.vue +1 -0
- package/dist/runtime/pages/Role/add.vue +2 -0
- package/dist/runtime/pages/Role/index.vue +3 -0
- package/dist/runtime/pages/System/database/table.vue +4 -3
- package/dist/runtime/pages/System/index.vue +1 -0
- package/dist/runtime/pages/System/mailtest.vue +2 -0
- package/dist/runtime/pages/System/package.vue +2 -1
- package/dist/runtime/pages/System/phpinfo.vue +3 -2
- package/dist/runtime/pages/System/setting.vue +8 -2
- package/dist/runtime/pages/System/view_as.vue +6 -1
- package/dist/runtime/pages/User/_user_id/change-password.vue +3 -0
- package/dist/runtime/pages/User/_user_id/edit.vue +1 -0
- package/dist/runtime/pages/User/_user_id/view.vue +2 -1
- package/dist/runtime/pages/User/add.vue +2 -0
- package/dist/runtime/pages/User/profile.vue +1 -0
- package/dist/runtime/pages/User/update-password.vue +3 -0
- package/dist/runtime/pages/UserLog/index.vue +1 -0
- package/dist/runtime/pages/logout.vue +2 -5
- package/package.json +2 -2
package/dist/module.json
CHANGED
|
@@ -16,7 +16,7 @@ const to = props.to ?? relativePath + "/add";
|
|
|
16
16
|
|
|
17
17
|
</script>
|
|
18
18
|
<template>
|
|
19
|
-
<q-btn rounded outline color="primary" icon="sym_o_add" :to="to"
|
|
19
|
+
<q-btn rounded outline color="primary" icon="sym_o_add" :to="to" :label="label">
|
|
20
20
|
<q-tooltip>
|
|
21
21
|
{{ label }}
|
|
22
22
|
</q-tooltip>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { VariableType } from "json-to-graphql-query";
|
|
3
3
|
import { useI18n } from "vue-i18n";
|
|
4
|
-
import { ref } from 'vue';
|
|
4
|
+
import { ref, watch, computed } from 'vue';
|
|
5
5
|
import { useQuasar } from 'quasar';
|
|
6
|
+
import { q } from "../light";
|
|
6
7
|
|
|
7
8
|
const quasar = useQuasar();
|
|
8
9
|
const emit = defineEmits(["input", "close"]);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, ref } from "vue";
|
|
3
|
+
import { t } from "../light"
|
|
3
4
|
const props = defineProps({
|
|
4
5
|
|
|
5
6
|
rules: {
|
|
@@ -28,10 +29,10 @@ const props = defineProps({
|
|
|
28
29
|
|
|
29
30
|
if (props.required) {
|
|
30
31
|
props.rules.push((val) => {
|
|
31
|
-
if(isNumber(val)){
|
|
32
|
+
if (isNumber(val)) {
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
+
|
|
35
36
|
return !!val || 'Required.'
|
|
36
37
|
});
|
|
37
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function
|
|
1
|
+
export default function list(name: string, props?: any, fields?: Array<string>): Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import q from "./q.mjs";
|
|
2
2
|
import f from "./f.mjs";
|
|
3
|
-
export default async function
|
|
3
|
+
export default async function list(name, props = {}, fields = []) {
|
|
4
4
|
let v = {};
|
|
5
5
|
if (props.sort) {
|
|
6
6
|
v.sort = props.sort;
|
|
@@ -25,11 +25,11 @@ export default async function listData(name, props = {}, fields = []) {
|
|
|
25
25
|
let data = await q(`list${name}`, v, [f("data", offset_limit, fs), f("meta", ["total", "key", "name"])]);
|
|
26
26
|
if (props.done) {
|
|
27
27
|
props.done({
|
|
28
|
-
rows: data
|
|
29
|
-
total: data
|
|
30
|
-
key: data
|
|
31
|
-
name: data
|
|
28
|
+
rows: data.data,
|
|
29
|
+
total: data.meta.total,
|
|
30
|
+
key: data.meta.key,
|
|
31
|
+
name: data.meta.name
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
return data
|
|
34
|
+
return data.data;
|
|
35
35
|
}
|
package/dist/runtime/lib/q.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function (operation: string, args: any, fields?: Array<any>): Promise<any>;
|
|
1
|
+
export default function (operation: string | object, args: any, fields?: Array<any>): Promise<any>;
|
package/dist/runtime/lib/q.mjs
CHANGED
|
@@ -1,19 +1,42 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import f from "./f.mjs";
|
|
3
|
+
import { jsonToGraphQLQuery } from "json-to-graphql-query";
|
|
4
|
+
const mapping = function(obj) {
|
|
5
|
+
let q = {};
|
|
6
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
7
|
+
if (value instanceof Array) {
|
|
8
|
+
q[key] = {};
|
|
9
|
+
value.forEach((subField) => {
|
|
10
|
+
q[key][subField] = true;
|
|
11
|
+
});
|
|
12
|
+
} else {
|
|
13
|
+
q[key] = mapping(value);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return q;
|
|
17
|
+
};
|
|
3
18
|
export default async function(operation, args, fields = []) {
|
|
4
|
-
|
|
5
|
-
fields = args;
|
|
6
|
-
args = {};
|
|
7
|
-
}
|
|
8
|
-
let service = axios.create({
|
|
19
|
+
const service = axios.create({
|
|
9
20
|
withCredentials: true
|
|
10
21
|
});
|
|
11
|
-
|
|
22
|
+
let query;
|
|
23
|
+
if (operation instanceof Object) {
|
|
24
|
+
query = jsonToGraphQLQuery(mapping(operation));
|
|
25
|
+
} else {
|
|
26
|
+
if (arguments.length === 2) {
|
|
27
|
+
fields = args;
|
|
28
|
+
args = {};
|
|
29
|
+
}
|
|
30
|
+
query = f(operation, args, fields);
|
|
31
|
+
}
|
|
12
32
|
const resp = (await service.post("/api/", {
|
|
13
33
|
query: `{ ${query} }`
|
|
14
34
|
})).data;
|
|
15
35
|
if (resp.errors) {
|
|
16
36
|
throw resp.errors[0].message;
|
|
17
37
|
}
|
|
38
|
+
if (operation instanceof Object) {
|
|
39
|
+
return resp.data;
|
|
40
|
+
}
|
|
18
41
|
return resp.data[operation];
|
|
19
42
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { listData } from "../../light"
|
|
3
|
+
|
|
2
4
|
const onRequest = async (params) => {
|
|
3
5
|
listData("EventLog", params, ["canRead"]);
|
|
4
6
|
};
|
|
@@ -50,7 +52,7 @@ const columns = [
|
|
|
50
52
|
<template>
|
|
51
53
|
<l-page>
|
|
52
54
|
<l-table @request="onRequest" :columns="columns" sort-by="eventlog_id:desc" :show-actions="['view']">
|
|
53
|
-
|
|
55
|
+
|
|
54
56
|
</l-table>
|
|
55
57
|
</l-page>
|
|
56
58
|
</template>
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
2
|
+
import { q } from "../../../light"
|
|
3
|
+
const { system: { database } } = await q({ system: { database: ["table"] } })
|
|
3
4
|
</script>
|
|
4
5
|
<template>
|
|
5
6
|
<l-page>
|
|
6
7
|
<q-card flat bordered>
|
|
7
|
-
<q-list bordered class="rounded-borders"
|
|
8
|
+
<q-list bordered class="rounded-borders" separator>
|
|
8
9
|
<q-expansion-item :label="table.name" v-for="table in database.table" expand-separator>
|
|
9
10
|
<div class=" q-ma-sm">
|
|
10
11
|
<q-table :rows="table.columns" :rows-per-page-options="[0]" hide-pagination flat bordered></q-table>
|
|
11
12
|
</div>
|
|
12
|
-
|
|
13
|
+
|
|
13
14
|
</q-expansion-item>
|
|
14
15
|
</q-list>
|
|
15
16
|
</q-card>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
2
|
+
import { q } from "../../light"
|
|
3
|
+
const { system } = await q({ system: ["phpInfo"] })
|
|
3
4
|
</script>
|
|
4
5
|
<template>
|
|
5
6
|
<l-page>
|
|
6
|
-
<iframe :srcdoc="
|
|
7
|
+
<iframe :srcdoc="system.phpInfo" style="height: 700px;" class="full-width no-border"></iframe>
|
|
7
8
|
</l-page>
|
|
8
9
|
</template>
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useQuasar } from 'quasar'
|
|
3
|
+
import { useRouter } from 'vue-router'
|
|
4
|
+
import { reactive } from "vue"
|
|
5
|
+
import { q, m } from "../../light"
|
|
6
|
+
|
|
2
7
|
const router = useRouter()
|
|
3
8
|
const que = useQuasar()
|
|
4
9
|
|
|
5
|
-
const app = await q(
|
|
10
|
+
const { app } = await q({ app: { config: ["name", "value"] } })
|
|
6
11
|
|
|
7
12
|
//const system = await q("system", ["passwordPolicy"])
|
|
8
13
|
|
|
@@ -49,6 +54,7 @@ const onSave = async () => {
|
|
|
49
54
|
<template>
|
|
50
55
|
<l-page>
|
|
51
56
|
|
|
57
|
+
{{ test }}
|
|
52
58
|
<l-form @save="onSave">
|
|
53
59
|
<l-input label="Company" v-model="obj.company"></l-input>
|
|
54
60
|
<l-input label="Company logo" v-model="obj.company_logo"></l-input>
|
|
@@ -63,6 +69,6 @@ const onSave = async () => {
|
|
|
63
69
|
false-value="0"></q-checkbox>
|
|
64
70
|
</q-field>
|
|
65
71
|
|
|
66
|
-
|
|
72
|
+
</l-form>
|
|
67
73
|
</l-page>
|
|
68
74
|
</template>
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { list } from "../../light"
|
|
3
|
+
import { useRouter } from "vue-router"
|
|
4
|
+
|
|
2
5
|
let users = await list("User", {
|
|
3
6
|
fields: [
|
|
4
7
|
"user_id", "username", "name", "roles"
|
|
@@ -41,10 +44,12 @@ const onCickView = async (id) => {
|
|
|
41
44
|
</script>
|
|
42
45
|
<template>
|
|
43
46
|
<l-page>
|
|
47
|
+
|
|
44
48
|
<q-table flat :columns="columns" :rows="users">
|
|
45
49
|
<template #body-cell-view="props">
|
|
46
50
|
<q-td :props="props">
|
|
47
|
-
<q-btn rounded outline color="primary" @click="onCickView(props.row.user_id)"
|
|
51
|
+
<q-btn rounded outline color="primary" @click="onCickView(props.row.user_id)" label="view"
|
|
52
|
+
icon="sym_o_search"></q-btn>
|
|
48
53
|
</q-td>
|
|
49
54
|
|
|
50
55
|
</template>
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { q } from "../../../light"
|
|
3
|
+
import { useRouter, useRoute } from "vue-router"
|
|
4
|
+
import { reactive } from "vue"
|
|
2
5
|
const system = await q("system", ["passwordPolicy"]);
|
|
3
6
|
const rules = system.passwordPolicy.map((rule) => {
|
|
4
7
|
let s = rule.split(":");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { getObject } from "../../../light";
|
|
2
3
|
const obj = await getObject(["username", "first_name", "last_name", "email", "phone"]);
|
|
3
4
|
|
|
4
5
|
</script>
|
|
@@ -6,7 +7,7 @@ const obj = await getObject(["username", "first_name", "last_name", "email", "ph
|
|
|
6
7
|
<template>
|
|
7
8
|
<l-page>
|
|
8
9
|
<template #header>
|
|
9
|
-
<l-btn to="change-password" icon="sym_o_key" permission="user.changePassword"
|
|
10
|
+
<l-btn to="change-password" icon="sym_o_key" permission="user.changePassword" label="Change password"></l-btn>
|
|
10
11
|
</template>
|
|
11
12
|
<l-card>
|
|
12
13
|
<l-list>
|
package/package.json
CHANGED