@hostlink/nuxt-light 1.0.8 → 1.0.10

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.0.8"
4
+ "version": "1.0.10"
5
5
  }
@@ -1,13 +1,19 @@
1
1
  <script setup lang="ts">
2
2
  import { VariableType } from "json-to-graphql-query";
3
3
  import { ref, computed, useAttrs } from "vue";
4
- import { useLight, m } from '#imports';
4
+ import { useLight, m, q } from '#imports';
5
5
  import { Loading, Dialog } from "quasar";
6
6
  import { useI18n } from "vue-i18n";
7
7
 
8
8
  const light = useLight();
9
9
  const i18n = useI18n();
10
10
 
11
+ const { system } = await q({
12
+ system: {
13
+ maxUploadSize: true
14
+ }
15
+ })
16
+
11
17
  export interface LFileProps {
12
18
  modelValue?: string;
13
19
  label?: string;
@@ -58,7 +64,8 @@ const attrs = computed(() => {
58
64
  return a;
59
65
  });
60
66
 
61
- const uploadFile = ref(null);
67
+ const uploadFile = ref<File | null>(null);
68
+ const rename = ref(true);
62
69
 
63
70
  const onUploadFile = async () => {
64
71
 
@@ -71,6 +78,16 @@ const onUploadFile = async () => {
71
78
  return;
72
79
  }
73
80
 
81
+ //check file size
82
+ if (uploadFile.value.size > system.maxUploadSize) {
83
+ Dialog.create({
84
+ title: "Error",
85
+ message: "File size is too big. Max size is " + system.maxUploadSize + " bytes",
86
+ color: "negative"
87
+ });
88
+ return;
89
+ }
90
+
74
91
  Loading.show({
75
92
  message: i18n.t("Uploading file..."),
76
93
  });
@@ -79,7 +96,7 @@ const onUploadFile = async () => {
79
96
  let v = await m("fsUploadFile", {
80
97
  path: props.path,
81
98
  file: new VariableType("file"),
82
- rename: true
99
+ rename: rename.value
83
100
  }, [{
84
101
  __variables: {
85
102
  file: {
@@ -104,6 +121,7 @@ const onUploadFile = async () => {
104
121
  title: i18n.t("Error"),
105
122
  message: e.message,
106
123
  });
124
+ Loading.hide();
107
125
  }
108
126
 
109
127
 
@@ -116,7 +134,10 @@ const onUploadFile = async () => {
116
134
  <q-dialog v-model="show" persistent transition-show="scale" transition-hide="scale">
117
135
  <l-card style="width:300px">
118
136
  <q-card-section>
119
- <q-file ref="file" v-model="uploadFile" name="file" :label="$t('File')" :accept="accept"></q-file>
137
+ <q-file ref="file" v-model="uploadFile" name="file" :label="$t('File')" :accept="accept" :hint="`Max upload size: ${system.maxUploadSize} bytes`"></q-file>
138
+ <!-- q-checkbox v-model="rename" :label="$t('Rename file if exists')"></q-checkbox-->
139
+
140
+
120
141
  </q-card-section>
121
142
  <q-card-actions align="right">
122
143
  <q-btn flat :label="$t('Cancel')" color="primary" v-close-popup></q-btn>
@@ -1,14 +1,24 @@
1
1
  <script setup>
2
- import { q, m } from '../../../'
3
- import { useRouter } from "vue-router"
2
+ import { q, m } from '#imports'
3
+ import { useRouter, useRoute } from "vue-router"
4
+ import { Notify } from 'quasar';
5
+
4
6
  const system = await q("system", ["passwordPolicy"]);
5
7
  const router = useRouter();
8
+ const route = useRoute();
9
+ const id = route.params.user_id;
6
10
 
7
- const onSubmit = async (data, form) => {
11
+ const onSubmit = async (data) => {
8
12
  return await m("updateUserPassword", {
9
- id: route.params.user_id,
13
+ id: id,
10
14
  password: data.password
11
15
  }).then(() => {
16
+ Notify.create({
17
+ message: "Password changed successfully",
18
+ color: "positive",
19
+ icon: "check"
20
+ });
21
+
12
22
  router.push("/User");
13
23
  });
14
24
  }
@@ -17,7 +27,8 @@ const onSubmit = async (data, form) => {
17
27
  <template>
18
28
  <l-page>
19
29
  <FormKit type="l-form" @submit="onSubmit">
20
- <FormKit type="l-input" name="password" :validation="system.passwordPolicy" label="Password" input-type="password"></FormKit>
30
+ <FormKit type="l-input" name="password" :validation="system.passwordPolicy" label="Password"
31
+ input-type="password"></FormKit>
21
32
  </FormKit>
22
33
  </l-page>
23
34
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "@nuxt/module-builder": "^0.5.2",
40
40
  "@quasar/extras": "^1.16.6",
41
41
  "axios": "^1.5.0",
42
- "formkit-quasar": "^0.0.14",
42
+ "formkit-quasar": "^0.0.15",
43
43
  "json-to-graphql-query": "^2.2.5",
44
44
  "quasar": "^2.12.5",
45
45
  "vue-i18n": "^9.2.2",