@hostlink/nuxt-light 1.73.2 → 1.74.1

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.
Files changed (52) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/L/App.vue +0 -19
  3. package/dist/runtime/components/L/AppMain.d.vue.ts +3 -3
  4. package/dist/runtime/components/L/AppMain.vue +43 -10
  5. package/dist/runtime/components/L/AppMain.vue.d.ts +3 -3
  6. package/dist/runtime/components/L/Card.vue +3 -2
  7. package/dist/runtime/components/L/FacebookButton.d.vue.ts +19 -3
  8. package/dist/runtime/components/L/FacebookButton.vue +73 -12
  9. package/dist/runtime/components/L/FacebookButton.vue.d.ts +19 -3
  10. package/dist/runtime/components/L/FavMenu.d.vue.ts +2 -0
  11. package/dist/runtime/components/L/FavMenu.vue +10 -2
  12. package/dist/runtime/components/L/FavMenu.vue.d.ts +2 -0
  13. package/dist/runtime/components/L/Form.d.vue.ts +29 -56
  14. package/dist/runtime/components/L/Form.vue +70 -80
  15. package/dist/runtime/components/L/Form.vue.d.ts +29 -56
  16. package/dist/runtime/components/L/FormLayout.d.vue.ts +36 -0
  17. package/dist/runtime/components/L/FormLayout.vue +36 -0
  18. package/dist/runtime/components/L/FormLayout.vue.d.ts +36 -0
  19. package/dist/runtime/components/L/Login.vue +1 -1
  20. package/dist/runtime/components/L/Menu.d.vue.ts +2 -0
  21. package/dist/runtime/components/L/Menu.vue +4 -4
  22. package/dist/runtime/components/L/Menu.vue.d.ts +2 -0
  23. package/dist/runtime/composables/useLight.d.ts +0 -4
  24. package/dist/runtime/formkit/Form.d.vue.ts +2 -2
  25. package/dist/runtime/formkit/Form.vue +15 -18
  26. package/dist/runtime/formkit/Form.vue.d.ts +2 -2
  27. package/dist/runtime/formkit/index.js +2 -0
  28. package/dist/runtime/locales/en.json +8 -2
  29. package/dist/runtime/locales/zh-hk.json +8 -2
  30. package/dist/runtime/pages/Role/[name]/update-child.vue +4 -1
  31. package/dist/runtime/pages/System/database/table.vue +40 -2
  32. package/dist/runtime/pages/System/fs.vue +116 -15
  33. package/dist/runtime/pages/User/setting/index.vue +29 -12
  34. package/dist/runtime/pages/User/setting/information.vue +4 -28
  35. package/dist/runtime/pages/User/setting/open_id.vue +132 -91
  36. package/dist/runtime/pages/User/setting/two-factor-auth.vue +388 -143
  37. package/dist/runtime/pages/User/setting.vue +3 -4
  38. package/dist/runtime/types/form.d.ts +2 -0
  39. package/dist/runtime/types/form.js +0 -0
  40. package/dist/runtime/utils/filterMenuItems.d.ts +10 -0
  41. package/dist/runtime/utils/filterMenuItems.js +34 -0
  42. package/dist/runtime/utils/formLayout.d.ts +2 -0
  43. package/dist/runtime/utils/formLayout.js +7 -0
  44. package/dist/runtime/utils/socialSdk.d.ts +2 -0
  45. package/dist/runtime/utils/socialSdk.js +127 -0
  46. package/package.json +14 -14
  47. package/dist/runtime/pages/Role/add2.d.vue.ts +0 -3
  48. package/dist/runtime/pages/Role/add2.vue +0 -57
  49. package/dist/runtime/pages/Role/add2.vue.d.ts +0 -3
  50. package/dist/runtime/pages/System/test.d.vue.ts +0 -3
  51. package/dist/runtime/pages/System/test.vue +0 -13
  52. package/dist/runtime/pages/System/test.vue.d.ts +0 -3
@@ -1,48 +1,41 @@
1
1
  <script setup>
2
- import { computed, ref, useAttrs, getCurrentInstance } from "vue";
3
- import { useRouter, useRoute } from "vue-router";
4
- import { useQuasar, QForm } from "quasar";
2
+ import { computed, getCurrentInstance, ref, useAttrs, useSlots } from "vue";
3
+ import { useRoute, useRouter } from "vue-router";
4
+ import { useQuasar } from "quasar";
5
5
  import { model } from "#imports";
6
+ defineOptions({ inheritAttrs: false });
7
+ const props = defineProps({
8
+ actions: { type: Boolean, required: false, default: true },
9
+ bordered: { type: Boolean, required: false, default: true },
10
+ gutter: { type: String, required: false, default: "md" },
11
+ layout: { type: String, required: false, default: "grid" },
12
+ modelValue: { type: Object, required: false },
13
+ noRedirect: { type: Boolean, required: false, default: false },
14
+ submitIcon: { type: String, required: false, default: "sym_o_save" },
15
+ submitLabel: { type: String, required: false, default: "Save" }
16
+ });
17
+ const emit = defineEmits(["save", "submit", "submitted"]);
18
+ const attrs = useAttrs();
19
+ const slots = useSlots();
6
20
  const route = useRoute();
7
21
  const router = useRouter();
8
22
  const quasar = useQuasar();
9
23
  const form = ref(null);
10
- const props = defineProps({
11
- modelValue: {
12
- type: Object
13
- },
14
- bordered: {
15
- type: Boolean,
16
- default: true
17
- },
18
- gutter: {
19
- type: String,
20
- default: "md"
21
- },
22
- submitLabel: {
23
- type: String,
24
- default: "Save"
25
- },
26
- submitIcon: {
27
- type: String,
28
- default: "sym_o_save"
29
- },
30
- noRedirect: {
31
- type: Boolean,
32
- default: false
33
- }
34
- });
35
24
  const loading = ref(false);
36
- const attrs = useAttrs();
37
- const emit = defineEmits(["save", "submit", "submitted"]);
38
25
  const instance = getCurrentInstance();
39
- const hasSubmitListener = computed(() => {
40
- return !!instance?.vnode?.props?.onSubmit;
41
- });
26
+ const hasSubmitListener = computed(() => Boolean(instance?.vnode.props?.onSubmit));
27
+ const hasCustomActions = computed(() => Boolean(slots.actions || slots.buttons));
28
+ const contentClass = computed(() => attrs.class);
29
+ const formAttrs = computed(() => Object.fromEntries(
30
+ Object.entries(attrs).filter(([key]) => key !== "class")
31
+ ));
32
+ const routeParts = computed(() => typeof route.name === "string" ? route.name.split("-") : []);
33
+ const modelName = computed(() => routeParts.value[0]);
34
+ const idName = computed(() => routeParts.value[1]);
42
35
  const save = async () => {
43
- if (!form.value) return;
44
- let valid = await form.value.validate();
45
- if (!valid) return;
36
+ if (!form.value || !await form.value.validate()) {
37
+ return;
38
+ }
46
39
  emit("save");
47
40
  if (hasSubmitListener.value) {
48
41
  emit("submit", () => {
@@ -50,57 +43,54 @@ const save = async () => {
50
43
  });
51
44
  return;
52
45
  }
53
- if (props.modelValue && route.name) {
54
- try {
55
- if (route.params[id_name]) {
56
- if (await model(module).update(parseInt(route.params[id_name]), props.modelValue)) {
57
- if (!props.noRedirect) {
58
- router.push(`/${module}`);
59
- }
60
- emit("submitted");
61
- return;
62
- }
63
- } else {
64
- if (await model(module).add(props.modelValue)) {
65
- if (!props.noRedirect) {
66
- router.push(`/${module}`);
67
- }
68
- emit("submitted");
69
- return;
70
- }
71
- }
72
- } catch (e) {
73
- quasar.dialog({
74
- title: "Error",
75
- message: e.message,
76
- ok: "OK"
77
- });
46
+ if (!props.modelValue || !modelName.value) {
47
+ return;
48
+ }
49
+ loading.value = true;
50
+ try {
51
+ const routeId = idName.value ? route.params[idName.value] : void 0;
52
+ const saved = routeId ? await model(modelName.value).update(Number(routeId), props.modelValue) : await model(modelName.value).add(props.modelValue);
53
+ if (!saved) {
54
+ return;
78
55
  }
56
+ if (!props.noRedirect) {
57
+ await router.push(`/${modelName.value}`);
58
+ }
59
+ emit("submitted");
60
+ } catch (error) {
61
+ quasar.dialog({
62
+ title: "Error",
63
+ message: error instanceof Error ? error.message : String(error),
64
+ ok: "OK"
65
+ });
66
+ } finally {
67
+ loading.value = false;
79
68
  }
80
- loading.value = false;
81
69
  };
82
- const onSubmit = (e) => {
83
- e.preventDefault();
84
- save();
70
+ const onSubmit = async (event) => {
71
+ event.preventDefault();
72
+ await save();
85
73
  };
86
- const localClass = computed(() => {
87
- if (attrs.class) {
88
- return attrs.class;
89
- }
90
- return "row q-col-gutter-" + props.gutter;
91
- });
92
74
  </script>
93
75
 
94
76
  <template>
95
- <q-form ref="form" @submit="onSubmit">
96
- <l-card :bordered="bordered">
97
- <q-card-section :class="localClass">
98
- <slot></slot>
99
- </q-card-section>
77
+ <q-form ref="form" v-bind="formAttrs" @submit="onSubmit">
78
+ <l-form-layout
79
+ :actions="actions"
80
+ :bordered="bordered"
81
+ :content-class="contentClass"
82
+ :gutter="gutter"
83
+ :layout="layout"
84
+ :submit-icon="submitIcon"
85
+ :submit-label="submitLabel"
86
+ :submit-loading="loading"
87
+ >
88
+ <slot />
100
89
 
101
- <q-card-actions align="right">
102
- <l-btn :icon="submitIcon" :label="submitLabel" :loading="loading" type="submit" />
103
- </q-card-actions>
104
- </l-card>
90
+ <template v-if="hasCustomActions" #actions>
91
+ <slot v-if="$slots.actions" name="actions" :loading="loading" />
92
+ <slot v-else name="buttons" :loading="loading" />
93
+ </template>
94
+ </l-form-layout>
105
95
  </q-form>
106
96
  </template>
@@ -1,70 +1,43 @@
1
- declare var __VLS_23: {};
1
+ import type { LFormGutter, LFormLayout } from "../../types/form.js";
2
+ type __VLS_Props = {
3
+ actions?: boolean;
4
+ bordered?: boolean;
5
+ gutter?: LFormGutter;
6
+ layout?: LFormLayout;
7
+ modelValue?: Record<string, unknown>;
8
+ noRedirect?: boolean;
9
+ submitIcon?: string;
10
+ submitLabel?: string;
11
+ };
12
+ declare var __VLS_17: {}, __VLS_20: {
13
+ loading: boolean;
14
+ }, __VLS_22: {
15
+ loading: boolean;
16
+ };
2
17
  type __VLS_Slots = {} & {
3
- default?: (props: typeof __VLS_23) => any;
18
+ default?: (props: typeof __VLS_17) => any;
19
+ } & {
20
+ actions?: (props: typeof __VLS_20) => any;
21
+ } & {
22
+ buttons?: (props: typeof __VLS_22) => any;
4
23
  };
5
- declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
- modelValue: {
7
- type: ObjectConstructor;
8
- };
9
- bordered: {
10
- type: BooleanConstructor;
11
- default: boolean;
12
- };
13
- gutter: {
14
- type: StringConstructor;
15
- default: string;
16
- };
17
- submitLabel: {
18
- type: StringConstructor;
19
- default: string;
20
- };
21
- submitIcon: {
22
- type: StringConstructor;
23
- default: string;
24
- };
25
- noRedirect: {
26
- type: BooleanConstructor;
27
- default: boolean;
28
- };
29
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
25
  submit: (...args: any[]) => void;
31
26
  save: (...args: any[]) => void;
32
27
  submitted: (...args: any[]) => void;
33
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
34
- modelValue: {
35
- type: ObjectConstructor;
36
- };
37
- bordered: {
38
- type: BooleanConstructor;
39
- default: boolean;
40
- };
41
- gutter: {
42
- type: StringConstructor;
43
- default: string;
44
- };
45
- submitLabel: {
46
- type: StringConstructor;
47
- default: string;
48
- };
49
- submitIcon: {
50
- type: StringConstructor;
51
- default: string;
52
- };
53
- noRedirect: {
54
- type: BooleanConstructor;
55
- default: boolean;
56
- };
57
- }>> & Readonly<{
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
58
29
  onSubmit?: ((...args: any[]) => any) | undefined;
59
30
  onSave?: ((...args: any[]) => any) | undefined;
60
31
  onSubmitted?: ((...args: any[]) => any) | undefined;
61
32
  }>, {
33
+ actions: boolean;
62
34
  bordered: boolean;
63
- gutter: string;
64
- submitLabel: string;
65
- submitIcon: string;
35
+ gutter: LFormGutter;
36
+ layout: LFormLayout;
66
37
  noRedirect: boolean;
67
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
38
+ submitIcon: string;
39
+ submitLabel: string;
40
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
68
41
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
69
42
  declare const _default: typeof __VLS_export;
70
43
  export default _default;
@@ -0,0 +1,36 @@
1
+ import type { LFormGutter, LFormLayout } from "../../types/form.js";
2
+ type __VLS_Props = {
3
+ actions?: boolean;
4
+ bordered?: boolean;
5
+ contentClass?: string | string[] | Record<string, boolean>;
6
+ gutter?: LFormGutter;
7
+ layout?: LFormLayout;
8
+ submitDisable?: boolean;
9
+ submitIcon?: string;
10
+ submitLabel?: string;
11
+ submitLoading?: boolean;
12
+ };
13
+ declare var __VLS_14: {}, __VLS_22: {};
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_14) => any;
16
+ } & {
17
+ actions?: (props: typeof __VLS_22) => any;
18
+ };
19
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
20
+ actions: boolean;
21
+ bordered: boolean;
22
+ gutter: LFormGutter;
23
+ layout: LFormLayout;
24
+ submitIcon: string;
25
+ submitLabel: string;
26
+ submitDisable: boolean;
27
+ submitLoading: boolean;
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
30
+ declare const _default: typeof __VLS_export;
31
+ export default _default;
32
+ type __VLS_WithSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,36 @@
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import { getFormLayoutClasses } from "../../utils/formLayout";
4
+ const props = defineProps({
5
+ actions: { type: Boolean, required: false, default: true },
6
+ bordered: { type: Boolean, required: false, default: true },
7
+ contentClass: { type: [String, Array, Object], required: false },
8
+ gutter: { type: String, required: false, default: "md" },
9
+ layout: { type: String, required: false, default: "grid" },
10
+ submitDisable: { type: Boolean, required: false, default: false },
11
+ submitIcon: { type: String, required: false, default: "sym_o_save" },
12
+ submitLabel: { type: String, required: false, default: "Save" },
13
+ submitLoading: { type: Boolean, required: false, default: false }
14
+ });
15
+ const layoutClass = computed(() => getFormLayoutClasses(props.layout, props.gutter));
16
+ </script>
17
+
18
+ <template>
19
+ <l-card :bordered="bordered">
20
+ <q-card-section :class="[layoutClass, contentClass]">
21
+ <slot />
22
+ </q-card-section>
23
+
24
+ <q-card-actions v-if="actions" align="right">
25
+ <slot name="actions">
26
+ <l-btn
27
+ type="submit"
28
+ :icon="submitIcon"
29
+ :label="submitLabel"
30
+ :loading="submitLoading"
31
+ :disable="submitDisable"
32
+ />
33
+ </slot>
34
+ </q-card-actions>
35
+ </l-card>
36
+ </template>
@@ -0,0 +1,36 @@
1
+ import type { LFormGutter, LFormLayout } from "../../types/form.js";
2
+ type __VLS_Props = {
3
+ actions?: boolean;
4
+ bordered?: boolean;
5
+ contentClass?: string | string[] | Record<string, boolean>;
6
+ gutter?: LFormGutter;
7
+ layout?: LFormLayout;
8
+ submitDisable?: boolean;
9
+ submitIcon?: string;
10
+ submitLabel?: string;
11
+ submitLoading?: boolean;
12
+ };
13
+ declare var __VLS_14: {}, __VLS_22: {};
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_14) => any;
16
+ } & {
17
+ actions?: (props: typeof __VLS_22) => any;
18
+ };
19
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
20
+ actions: boolean;
21
+ bordered: boolean;
22
+ gutter: LFormGutter;
23
+ layout: LFormLayout;
24
+ submitIcon: string;
25
+ submitLabel: string;
26
+ submitDisable: boolean;
27
+ submitLoading: boolean;
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
30
+ declare const _default: typeof __VLS_export;
31
+ export default _default;
32
+ type __VLS_WithSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -305,7 +305,7 @@ const facebookLogin = (accessToken) => {
305
305
  </q-card-actions>
306
306
 
307
307
  <q-card-actions v-if="facebookAppId">
308
- <l-facebook-button @login="facebookLogin" />
308
+ <l-facebook-button :app-id="facebookAppId" @login="facebookLogin" />
309
309
  </q-card-actions>
310
310
  </q-card>
311
311
  </template>
@@ -3,7 +3,9 @@ export default _default;
3
3
  declare const __VLS_export: import("vue").DefineComponent<{
4
4
  value?: any;
5
5
  dense?: any;
6
+ expandAll?: any;
6
7
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
7
8
  value?: any;
8
9
  dense?: any;
10
+ expandAll?: any;
9
11
  }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -2,7 +2,7 @@
2
2
  import { useRoute } from "vue-router";
3
3
  import { ref, computed } from "vue";
4
4
  import { useLight } from "#imports";
5
- const props = defineProps(["value", "dense"]);
5
+ const props = defineProps(["value", "dense", "expandAll"]);
6
6
  const light = useLight();
7
7
  const isShowExpansionItem = (menu) => {
8
8
  if (menu.children && menu.children.length > 0) {
@@ -47,9 +47,9 @@ const hasChildLink = () => {
47
47
  <q-list class="menu-list" :dense="dense">
48
48
  <template v-for="menu in value">
49
49
 
50
- <q-expansion-item :default-opened="hasLink(menu)" :label="$t(menu.label)" :icon="menu.icon" :dense="dense"
51
- v-if="isShowExpansionItem(menu)" :group="group">
52
- <l-menu class="q-pl-md" :value="menu.children" :dense="dense"></l-menu>
50
+ <q-expansion-item :default-opened="expandAll || hasLink(menu)" :label="$t(menu.label)" :icon="menu.icon" :dense="dense"
51
+ v-if="isShowExpansionItem(menu)" :group="expandAll ? undefined : group">
52
+ <l-menu class="q-pl-md" :value="menu.children" :dense="dense" :expand-all="expandAll"></l-menu>
53
53
  </q-expansion-item>
54
54
 
55
55
  <template v-else>
@@ -3,7 +3,9 @@ export default _default;
3
3
  declare const __VLS_export: import("vue").DefineComponent<{
4
4
  value?: any;
5
5
  dense?: any;
6
+ expandAll?: any;
6
7
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
7
8
  value?: any;
8
9
  dense?: any;
10
+ expandAll?: any;
9
11
  }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -135,8 +135,6 @@ declare const light: {
135
135
  ipod: boolean;
136
136
  kindle: boolean;
137
137
  winphone: boolean;
138
- blackberry: boolean;
139
- playbook: boolean;
140
138
  silk: boolean;
141
139
  };
142
140
  has: {
@@ -732,8 +730,6 @@ declare const _default: () => {
732
730
  ipod: boolean;
733
731
  kindle: boolean;
734
732
  winphone: boolean;
735
- blackberry: boolean;
736
- playbook: boolean;
737
733
  silk: boolean;
738
734
  };
739
735
  has: {
@@ -1,8 +1,8 @@
1
- declare var __VLS_14: {
1
+ declare var __VLS_7: {
2
2
  [x: string]: any;
3
3
  };
4
4
  type __VLS_Slots = {} & {
5
- default?: (props: typeof __VLS_14) => any;
5
+ default?: (props: typeof __VLS_7) => any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
8
  context: {
@@ -14,7 +14,6 @@ let props = defineProps({
14
14
  let onSubmit = async () => {
15
15
  props.context?.handlers.submit(new Event("submit"));
16
16
  };
17
- const gutter = props.context?.gutter ?? "md";
18
17
  let bordered = true;
19
18
  if (props.context.bordered !== void 0) {
20
19
  bordered = props.context.bordered;
@@ -89,24 +88,22 @@ if (!props.context.onSubmit) {
89
88
  const isNoDirtyCheck = computed(() => {
90
89
  return props.context.attrs["no-dirty-check"] !== void 0;
91
90
  });
92
- const localClass = computed(() => {
93
- if (props.context.attrs.class) {
94
- return props.context.attrs.class;
95
- }
96
- return "row q-col-gutter-md";
97
- });
98
91
  </script>
99
92
 
100
93
  <template>
101
- <l-card :bordered="bordered">
102
- <form @submit.prevent="onSubmit">
103
- <q-card-section :class="localClass">
104
- <slot v-bind="context"></slot>
105
- </q-card-section>
106
- <q-card-actions align="right" v-if="context.actions">
107
- <l-btn type="submit" icon="sym_o_check" :label="context.submitLabel ?? 'Submit'"
108
- :disabled="!isNoDirtyCheck && !context.state.dirty" :loading="context.state.loading"></l-btn>
109
- </q-card-actions>
110
- </form>
111
- </l-card>
94
+ <form @submit.prevent="onSubmit">
95
+ <l-form-layout
96
+ :actions="context.actions"
97
+ :bordered="bordered"
98
+ :content-class="context.attrs.class"
99
+ :gutter="context.gutter ?? 'md'"
100
+ :layout="context.layout ?? 'grid'"
101
+ :submit-disable="!isNoDirtyCheck && !context.state.dirty"
102
+ :submit-icon="context.submitIcon ?? 'sym_o_check'"
103
+ :submit-label="context.submitLabel ?? 'Submit'"
104
+ :submit-loading="context.state.loading"
105
+ >
106
+ <slot v-bind="context" />
107
+ </l-form-layout>
108
+ </form>
112
109
  </template>
@@ -1,8 +1,8 @@
1
- declare var __VLS_14: {
1
+ declare var __VLS_7: {
2
2
  [x: string]: any;
3
3
  };
4
4
  type __VLS_Slots = {} & {
5
- default?: (props: typeof __VLS_14) => any;
5
+ default?: (props: typeof __VLS_7) => any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
8
  context: {
@@ -110,9 +110,11 @@ export const createLightPlugin = () => {
110
110
  props: [
111
111
  "actions",
112
112
  "submitLabel",
113
+ "submitIcon",
113
114
  "submit",
114
115
  "onSubmit",
115
116
  "gutter",
117
+ "layout",
116
118
  "bordered",
117
119
  "modelName",
118
120
  "modelId"
@@ -6,5 +6,11 @@
6
6
  "contains_symbol": "Must contain at least one special character",
7
7
  "storage_usage": "{0} free of {1}",
8
8
  "input_required": "Please input {0}",
9
- "input_min": "Please input at least {0} characters"
10
- }
9
+ "input_min": "Please input at least {0} characters",
10
+ "Filesystem decorators": "Filesystem decorators",
11
+ "Decorators are applied in order to every file operation.": "Decorators are applied in order to every file operation.",
12
+ "Add decorator": "Add decorator",
13
+ "Decorator": "Decorator",
14
+ "Search menu": "Search menu",
15
+ "No matching menu": "No matching menu"
16
+ }
@@ -126,6 +126,8 @@
126
126
  "File": "檔案",
127
127
  "Folder": "資料夾",
128
128
  "Search": "搜尋",
129
+ "Search menu": "搜尋選單",
130
+ "No matching menu": "找不到符合的選單",
129
131
  "Reset": "重設",
130
132
  "Reload": "重新載入",
131
133
  "Rename": "重新命名",
@@ -210,5 +212,9 @@
210
212
  "Are you sure you want to reset 2FA?" : "您確定要重置雙重認證嗎?",
211
213
  "Update role": "更新角色",
212
214
  "Overview": "概覽",
213
- "Click the button below to link your Google account.": "點擊下面的按鈕連接您的Google帳戶。"
214
- }
215
+ "Click the button below to link your Google account.": "點擊下面的按鈕連接您的Google帳戶。",
216
+ "Filesystem decorators": "檔案系統路徑處理器",
217
+ "Decorators are applied in order to every file operation.": "路徑處理器會按顯示次序套用到每個檔案操作。",
218
+ "Add decorator": "新增路徑處理器",
219
+ "Decorator": "路徑處理器"
220
+ }
@@ -1,6 +1,9 @@
1
1
  <script setup>
2
2
  import { useRoute } from "vue-router";
3
- import { q } from "#imports";
3
+ import { definePageMeta, q } from "#imports";
4
+ definePageMeta({
5
+ permission: "role.update-child"
6
+ });
4
7
  const route = useRoute();
5
8
  const name = route.params.name;
6
9
  const role = await q("getRole", {
@@ -24,6 +24,44 @@ const custom_tables = computed(() => {
24
24
  const systables = computed(() => {
25
25
  return (data.value?.tableStatus ?? []).filter((table) => SYSTEM_TABLES.includes(table.Name));
26
26
  });
27
+ const formatMb = (bytes) => `${(Number(bytes ?? 0) / 1024 / 1024).toFixed(2)} MB`;
28
+ const tableStatusColumns = [
29
+ { name: "Name", label: "Table", field: "Name", align: "left", sortable: true },
30
+ { name: "Engine", label: "Engine", field: "Engine", align: "left", sortable: true },
31
+ { name: "Rows", label: "Rows", field: "Rows", align: "right", sortable: true },
32
+ {
33
+ name: "Data_length",
34
+ label: "Data Length",
35
+ field: "Data_length",
36
+ format: formatMb,
37
+ align: "right",
38
+ sortable: true
39
+ },
40
+ {
41
+ name: "Index_length",
42
+ label: "Index Length",
43
+ field: "Index_length",
44
+ format: formatMb,
45
+ align: "right",
46
+ sortable: true
47
+ },
48
+ {
49
+ name: "Size",
50
+ label: "Size",
51
+ field: (row) => Number(row.Data_length ?? 0) + Number(row.Index_length ?? 0),
52
+ format: formatMb,
53
+ align: "right",
54
+ sortable: true
55
+ },
56
+ {
57
+ name: "Data_free",
58
+ label: "Data Free",
59
+ field: "Data_free",
60
+ format: formatMb,
61
+ align: "right",
62
+ sortable: true
63
+ }
64
+ ];
27
65
  const selected = reactive({});
28
66
  const add = async (table) => {
29
67
  $q.dialog({
@@ -202,7 +240,7 @@ const truncatTable = async () => {
202
240
 
203
241
  <l-card>
204
242
  <q-expansion-item label="Custom Tables" dense header-class="text-weight-medium">
205
- <q-table :rows="custom_tables" hide-pagination flat separator="cell" dense :rows-per-page-options="[0]"
243
+ <q-table :rows="custom_tables" :columns="tableStatusColumns" hide-pagination flat separator="cell" dense :rows-per-page-options="[0]"
206
244
  v-model:selected="selectedTable" selection="multiple" row-key="Name" class="q-ma-sm">
207
245
  <template #top>
208
246
  <div class="row items-center q-gutter-sm">
@@ -220,7 +258,7 @@ const truncatTable = async () => {
220
258
  <q-separator />
221
259
 
222
260
  <q-expansion-item label="System Tables" dense header-class="text-weight-medium">
223
- <q-table :rows="systables" hide-pagination flat separator="cell" dense :rows-per-page-options="[0]"
261
+ <q-table :rows="systables" :columns="tableStatusColumns" hide-pagination flat separator="cell" dense :rows-per-page-options="[0]"
224
262
  row-key="Name" class="q-ma-sm" />
225
263
  </q-expansion-item>
226
264
  </l-card>