@hostlink/nuxt-light 0.0.25 → 0.0.27

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": "0.0.25"
4
+ "version": "0.0.27"
5
5
  }
package/dist/module.mjs CHANGED
@@ -10,7 +10,6 @@ const module = defineNuxtModule({
10
10
  defaults: {},
11
11
  setup(options, nuxt) {
12
12
  const resolver = createResolver(import.meta.url);
13
- nuxt.options.modules.push("@nuxt/content");
14
13
  nuxt.options.css.push("element-plus/dist/index.css");
15
14
  nuxt.options.css.push("quasar/dist/quasar.prod.css");
16
15
  nuxt.options.css.push("@quasar/extras/material-icons/material-icons.css");
@@ -83,6 +83,7 @@ const languages = app.languages;
83
83
 
84
84
  const onChangeLocale = async (locale) => {
85
85
 
86
+ localStorage.setItem("locale", locale);
86
87
  await m("updateMyLanguage", { name: locale })
87
88
  window.location.reload();
88
89
  }
@@ -20,7 +20,7 @@ const submit = async () => {
20
20
 
21
21
  try {
22
22
  await login(data.username, data.password, data.code)
23
- window.self.location = "/";
23
+ window.self.location.reload();
24
24
  } catch (e) {
25
25
  notify(e.message, "negative");
26
26
 
@@ -105,17 +105,16 @@ const forgetPassword = async () => {
105
105
  </script>
106
106
 
107
107
  <template>
108
- <q-card bordered flat style="min-width:400px;max-width: 400px;" class="fixed-center">
108
+ <q-card bordered flat style="min-width:400px;max-width: 400px;" class="fixed-center ">
109
109
  <q-card-section>
110
110
  <q-img :src="companyLogo" class="full-width" />
111
111
  <div class="text-h6">
112
112
  {{ company }}
113
113
  </div>
114
114
  <q-form ref="form1">
115
- <q-input v-model="data.username" label="Username" required :rules="[v => !!v || 'Username is required']"
116
- clearable />
117
- <q-input v-model="data.password" label="Password" required type="password" clearable
118
- :rules="[v => !!v || 'Password is required']" />
115
+ <q-input v-model.trim="data.username" label="Username" :rules="[v => !!v || 'Username is required']" clearable />
116
+ <q-input v-model="data.password" label="Password" type="password" clearable
117
+ :rules="[v => !!v || 'Password is required']" @keydown.enter.prevent="submit" />
119
118
  <q-input v-if="twoFactorAuthentication" v-model="data.code" label="2FA code" required type="text" clearable>
120
119
  </q-input>
121
120
  </q-form>
@@ -17,7 +17,7 @@ const obj = reactive(app.config.reduce((acc, cur) => {
17
17
  }, {}));
18
18
 
19
19
  const fields = ["company", "company_logo", "password_upper_case", "password_lower_case", "password_number", "password_special_character",
20
- "file_manager_show", "two_factor_authentication"];
20
+ "file_manager", "two_factor_authentication"];
21
21
 
22
22
  //filter out fields that are not in the app.config table
23
23
  Object.keys(obj).forEach((key) => {
@@ -71,7 +71,7 @@ const onSave = async () => {
71
71
 
72
72
 
73
73
  <q-field label="File manager" stack-label>
74
- <q-checkbox label="Show" v-model="obj.file_manager_show" true-value="1" false-value="0"></q-checkbox>
74
+ <q-checkbox label="Show" v-model="obj.file_manager" true-value="1" false-value="0"></q-checkbox>
75
75
  </q-field>
76
76
 
77
77
  <q-field label="Two factor authentication" stack-label>
@@ -1,6 +1,8 @@
1
1
  <script setup>
2
2
  import { q } from '../'
3
3
  const my = await q("my", ["name", "first_name", "last_name", "email"]);
4
+ import { useI18n } from 'vue-i18n';
5
+ const i18n = useI18n();
4
6
  </script>
5
7
  <template>
6
8
  <q-page padding>
@@ -8,6 +10,7 @@ const my = await q("my", ["name", "first_name", "last_name", "email"]);
8
10
  <q-card-section>
9
11
  Hello
10
12
 
13
+ {{ i18n.locale }}
11
14
  {{ my }}
12
15
  </q-card-section>
13
16
  </l-card>
@@ -1,7 +1,16 @@
1
1
  <script setup>
2
2
  import { m } from '../'
3
3
  await m("logout");
4
- window.self.location = "/";
4
+
5
+ const href = window.self.location.href;
6
+
7
+ const url = new URL(href);
8
+ //move up one level
9
+ const newUrl = url.origin + url.pathname.substring(0, url.pathname.lastIndexOf("/"));
10
+ window.self.location = newUrl;
11
+
12
+
13
+
5
14
 
6
15
  </script>
7
16
  <template></template>
@@ -13,7 +13,6 @@ import routes from "./routes.mjs";
13
13
  localStorage.getItem("locale") || localStorage.setItem("locale", "en");
14
14
  import { useLight } from "./index.mjs";
15
15
  export default defineNuxtPlugin((nuxtApp) => {
16
- let locale = localStorage.getItem("locale") || "en";
17
16
  nuxtApp.vueApp.config.errorHandler = (error) => {
18
17
  console.log(error);
19
18
  const light = useLight();
@@ -21,7 +20,7 @@ export default defineNuxtPlugin((nuxtApp) => {
21
20
  };
22
21
  const i18n = createI18n({
23
22
  legacy: false,
24
- locale,
23
+ locale: localStorage.getItem("locale") || "en",
25
24
  messages: {
26
25
  en: Object.assign(en, message_en),
27
26
  "zh-hk": Object.assign(zhTW, message_zh),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",
@@ -39,7 +39,6 @@
39
39
  "json-to-graphql-query": "^2.2.5",
40
40
  "quasar": "^2.12.5",
41
41
  "unplugin-auto-import": "^0.16.6",
42
- "unplugin-vue-components": "^0.25.2",
43
42
  "vue-i18n": "^9.2.2"
44
43
  },
45
44
  "devDependencies": {