@hostlink/nuxt-light 0.0.12 → 0.0.14
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-app.vue +1 -1
- package/dist/runtime/components/l-date-picker.vue +1 -0
- package/dist/runtime/components/l-form.vue +1 -1
- 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/System/database/table.vue +1 -1
- 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/package.json +1 -1
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,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref } from "vue";
|
|
3
3
|
import { useRouter, useRoute } from "vue-router";
|
|
4
|
+
import { useQuasar } from "quasar";
|
|
4
5
|
|
|
5
6
|
const route = useRoute();
|
|
6
7
|
const router = useRouter();
|
|
@@ -16,7 +17,6 @@ const props = defineProps({
|
|
|
16
17
|
const que = useQuasar();
|
|
17
18
|
const emit = defineEmits(["save"]);
|
|
18
19
|
const save = async () => {
|
|
19
|
-
console.log(form.value)
|
|
20
20
|
|
|
21
21
|
let valid = await form.value.validate();
|
|
22
22
|
if (!valid) return;
|
|
@@ -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,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>
|