@hostlink/nuxt-light 1.22.0 → 1.22.2
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-app-main.vue +3 -10
- package/dist/runtime/components/l-file-manager.vue +5 -1
- package/dist/runtime/components/l-login.vue +3 -3
- package/dist/runtime/light.d.ts +2 -0
- package/dist/runtime/light.js +5 -2
- package/dist/runtime/pages/System/index.vue +22 -1
- package/dist/runtime/pages/System/menu/index.vue +2 -4
- package/dist/runtime/plugin.js +3 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -61,6 +61,8 @@ let my = reactive(tt.my)
|
|
|
61
61
|
|
|
62
62
|
const light = useLight();
|
|
63
63
|
|
|
64
|
+
light.devMode = tt.system.devMode;
|
|
65
|
+
|
|
64
66
|
light.init(my.styles);
|
|
65
67
|
|
|
66
68
|
//set permission
|
|
@@ -281,15 +283,6 @@ const onLogout = async () => {
|
|
|
281
283
|
emits('logout');
|
|
282
284
|
}
|
|
283
285
|
|
|
284
|
-
watch(light.errors, (value) => {
|
|
285
|
-
if (value.length > 0) {
|
|
286
|
-
//if errors
|
|
287
|
-
for (let error of value) {
|
|
288
|
-
console.log(error.message);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
})
|
|
292
|
-
|
|
293
286
|
</script>
|
|
294
287
|
|
|
295
288
|
|
|
@@ -432,7 +425,7 @@ watch(light.errors, (value) => {
|
|
|
432
425
|
|
|
433
426
|
<q-page-container :class="containerClass" :style="containerStyle"> <!-- Error message -->
|
|
434
427
|
<slot name="header"></slot>
|
|
435
|
-
<div class="q-gutter-sm q-pa-sm" v-if="$light.errors.length > 0">
|
|
428
|
+
<div class="q-gutter-sm q-pa-sm" v-if="system.devMode && $light.errors.length > 0">
|
|
436
429
|
<q-banner dense inline-actions class="bg-grey-4" v-for=" error in $light.errors " rounded>
|
|
437
430
|
{{ error }}
|
|
438
431
|
<template v-slot:action>
|
|
@@ -145,6 +145,7 @@ function toggleLeftDrawer() {
|
|
|
145
145
|
leftDrawerOpen.value = !leftDrawerOpen.value;
|
|
146
146
|
}
|
|
147
147
|
const loadItems = async () => {
|
|
148
|
+
|
|
148
149
|
let path = selectedPath.value;
|
|
149
150
|
|
|
150
151
|
files.value = [];
|
|
@@ -201,13 +202,15 @@ const loadItems = async () => {
|
|
|
201
202
|
item.id = selectedDrive.value + "/" + item.path;
|
|
202
203
|
return item;
|
|
203
204
|
});
|
|
205
|
+
reloadTreeFolder(selectedNodePath.value, folders.value);
|
|
204
206
|
}
|
|
205
207
|
|
|
208
|
+
|
|
206
209
|
loading.value = false;
|
|
207
210
|
|
|
208
211
|
|
|
209
212
|
|
|
210
|
-
|
|
213
|
+
|
|
211
214
|
}
|
|
212
215
|
|
|
213
216
|
|
|
@@ -292,6 +295,7 @@ const findFolder = (path, folders) => {
|
|
|
292
295
|
|
|
293
296
|
const reloadTreeFolder = (path, newFolders) => {
|
|
294
297
|
let node = folderTree.value.getNodeByKey(path);
|
|
298
|
+
|
|
295
299
|
if (node) {
|
|
296
300
|
node.lazy = false;
|
|
297
301
|
node.children = newFolders;
|
|
@@ -293,20 +293,20 @@ const facebookLogin = (accessToken) => {
|
|
|
293
293
|
</div>
|
|
294
294
|
<q-form ref="form1" v-if="passwordBasedEnabled">
|
|
295
295
|
<div class="q-gutter-sm">
|
|
296
|
-
<l-input v-model.trim="data.username" label="Username" :rules="[v => !!v || $t('Username is required')]"
|
|
296
|
+
<l-input color="primary" v-model.trim="data.username" label="Username" :rules="[v => !!v || $t('Username is required')]"
|
|
297
297
|
clearable :outlined="false" stackLabel autocomplete="username">
|
|
298
298
|
<template v-slot:prepend>
|
|
299
299
|
<q-icon name="sym_o_person" />
|
|
300
300
|
</template>
|
|
301
301
|
</l-input>
|
|
302
|
-
<l-input v-model="data.password" label="Password" type="password" clearable show-password stackLabel
|
|
302
|
+
<l-input color="primary" v-model="data.password" label="Password" type="password" clearable show-password stackLabel
|
|
303
303
|
:rules="[v => !!v || $t('Password is required')]" @keydown.enter.prevent="submit" :outlined="false"
|
|
304
304
|
autocomplete="off">
|
|
305
305
|
<template v-slot:prepend>
|
|
306
306
|
<q-icon name="sym_o_lock" />
|
|
307
307
|
</template>
|
|
308
308
|
</l-input>
|
|
309
|
-
<l-input v-if="twoFactorAuthentication" v-model="data.code" label="2FA code"
|
|
309
|
+
<l-input color="primary" v-if="twoFactorAuthentication" v-model="data.code" label="2FA code"
|
|
310
310
|
:rules="[v => !!v || $t('2FA code is required')]" type="text" clearable stackLabel :outlined="false">
|
|
311
311
|
<template v-slot:prepend>
|
|
312
312
|
<q-icon name="sym_o_key" />
|
package/dist/runtime/light.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface User {
|
|
|
15
15
|
language?: string;
|
|
16
16
|
}
|
|
17
17
|
declare const light: {
|
|
18
|
+
devMode: boolean;
|
|
18
19
|
styles: any;
|
|
19
20
|
version: string;
|
|
20
21
|
errors: Array<Error>;
|
|
@@ -618,6 +619,7 @@ export declare const createLight: (opts: any) => {
|
|
|
618
619
|
install: (app: App) => void;
|
|
619
620
|
};
|
|
620
621
|
export declare const useLight: () => {
|
|
622
|
+
devMode: boolean;
|
|
621
623
|
styles: any;
|
|
622
624
|
version: string;
|
|
623
625
|
errors: Array<Error>;
|
package/dist/runtime/light.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuasar } from "quasar";
|
|
2
2
|
import packageJson from "../../package.json";
|
|
3
|
-
import { watch, reactive } from "vue";
|
|
3
|
+
import { watch, reactive, getCurrentInstance } from "vue";
|
|
4
4
|
import { m, q } from "./lib/index.js";
|
|
5
5
|
const COLOR_CODE = {
|
|
6
6
|
red: "#f44336",
|
|
@@ -32,6 +32,7 @@ const COLOR_CODE = {
|
|
|
32
32
|
dark: "#4b4b4b"
|
|
33
33
|
};
|
|
34
34
|
const light = reactive({
|
|
35
|
+
devMode: false,
|
|
35
36
|
styles: {
|
|
36
37
|
table: {
|
|
37
38
|
dense: true,
|
|
@@ -271,6 +272,8 @@ export const createLight = (opts) => {
|
|
|
271
272
|
};
|
|
272
273
|
let currentRoute = null;
|
|
273
274
|
export const useLight = () => {
|
|
274
|
-
|
|
275
|
+
if (getCurrentInstance()) {
|
|
276
|
+
light.$q = useQuasar();
|
|
277
|
+
}
|
|
275
278
|
return light;
|
|
276
279
|
};
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
import { q } from '#imports'
|
|
3
3
|
const { system } = await q({
|
|
4
4
|
system: {
|
|
5
|
-
server: true
|
|
5
|
+
server: true,
|
|
6
|
+
arch: true,
|
|
7
|
+
os: true,
|
|
8
|
+
CPUCores: true,
|
|
9
|
+
hostname: true,
|
|
10
|
+
memoryTotal: true,
|
|
11
|
+
memoryFree: true,
|
|
12
|
+
memoryAvailable: true,
|
|
6
13
|
}
|
|
7
14
|
})
|
|
8
15
|
|
|
@@ -22,6 +29,20 @@ const columns = [
|
|
|
22
29
|
</script>
|
|
23
30
|
<template>
|
|
24
31
|
<l-page>
|
|
32
|
+
<l-card>
|
|
33
|
+
<l-list>
|
|
34
|
+
<l-item label="Arch">{{ system.arch }}</l-item>
|
|
35
|
+
<l-item label="OS">{{ system.os }}</l-item>
|
|
36
|
+
<l-item label="CPUCores">{{ system.CPUCores }}</l-item>
|
|
37
|
+
<l-item label="Hostname">{{ system.hostname }}</l-item>
|
|
38
|
+
<l-item label="Memory Total">{{ system.memoryTotal }}</l-item>
|
|
39
|
+
<l-item label="Memory Free">{{ system.memoryFree }}</l-item>
|
|
40
|
+
<l-item label="Memory Available">{{ system.memoryAvailable }}</l-item>
|
|
41
|
+
</l-list>
|
|
42
|
+
</l-card>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
25
46
|
<l-table searchable :rows="system.server" :columns="columns" :rows-per-page-options="[0]"
|
|
26
47
|
hide-pagination></l-table>
|
|
27
48
|
</l-page>
|
|
@@ -237,7 +237,7 @@ const menusOnly = computed(() => {
|
|
|
237
237
|
</q-dialog>
|
|
238
238
|
|
|
239
239
|
<l-card>
|
|
240
|
-
<q-
|
|
240
|
+
<q-card-actions class="q-gutter-y-sm">
|
|
241
241
|
<l-btn @click="onSave" label="Save" icon="sym_o_save" />
|
|
242
242
|
<l-btn @click="onReload" label="Reload" icon="sym_o_refresh" />
|
|
243
243
|
|
|
@@ -298,7 +298,7 @@ const menusOnly = computed(() => {
|
|
|
298
298
|
</q-btn-dropdown>
|
|
299
299
|
</template>
|
|
300
300
|
</template>
|
|
301
|
-
</q-
|
|
301
|
+
</q-card-actions>
|
|
302
302
|
<q-splitter v-model="splitterModel" style="height:680px">
|
|
303
303
|
<template #before>
|
|
304
304
|
|
|
@@ -360,8 +360,6 @@ const menusOnly = computed(() => {
|
|
|
360
360
|
|
|
361
361
|
</q-splitter>
|
|
362
362
|
|
|
363
|
-
|
|
364
|
-
|
|
365
363
|
</l-card>
|
|
366
364
|
|
|
367
365
|
</l-page>
|
package/dist/runtime/plugin.js
CHANGED
|
@@ -32,8 +32,10 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
32
32
|
api.model("SystemValue").setDataPath("app.listSystemValue");
|
|
33
33
|
api.model("Permission").setDataPath("app.listPermission");
|
|
34
34
|
nuxtApp.vueApp.config.errorHandler = (err, instance, info) => {
|
|
35
|
-
console.log(err);
|
|
36
35
|
const light = useLight();
|
|
36
|
+
if (light.devMode) {
|
|
37
|
+
console.log(err);
|
|
38
|
+
}
|
|
37
39
|
if (err instanceof Error) {
|
|
38
40
|
light.addError(err);
|
|
39
41
|
} else {
|