@hostlink/nuxt-light 1.60.0 → 1.60.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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.60.0",
4
+ "version": "1.60.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -315,7 +315,7 @@ const onLogout = async () => {
315
315
  <q-item-section avatar>
316
316
  <q-icon name="sym_o_settings_account_box" />
317
317
  </q-item-section>
318
- <q-item-section>{{ $t("Setting") }}</q-item-section>
318
+ <q-item-section>{{ $t("Settings") }}</q-item-section>
319
319
  </q-item>
320
320
 
321
321
  <q-item v-close-popup v-if="showViewAs" to="/System/view_as">
@@ -58,7 +58,7 @@ const hasChildLink = () => {
58
58
  <template v-if="menu.to && (menu.to.startsWith('http://') || menu.to.startsWith('https://'))">
59
59
  <q-item v-ripple :href="menu.to" v-if="!value.type" target="_blank">
60
60
  <q-item-section avatar>
61
- <q-icon :name="menu.icon" />
61
+ <q-icon :name="menu.icon" />
62
62
  </q-item-section>
63
63
  <q-item-section>{{ $t(menu.label) }}</q-item-section>
64
64
  </q-item>
@@ -67,7 +67,7 @@ const hasChildLink = () => {
67
67
  <template v-else>
68
68
  <q-item v-ripple :to="menu.to" v-if="!value.type">
69
69
  <q-item-section avatar>
70
- <q-icon :name="menu.icon" />
70
+ <q-icon :name="menu.icon" />
71
71
  </q-item-section>
72
72
  <q-item-section>{{ $t(menu.label) }}</q-item-section>
73
73
  </q-item>
@@ -1,9 +1,10 @@
1
1
  import type { QTabPanelProps, QTabProps } from 'quasar';
2
+ type __VLS_Props = QTabPanelProps & QTabProps;
2
3
  declare var __VLS_7: {};
3
4
  type __VLS_Slots = {} & {
4
5
  default?: (props: typeof __VLS_7) => any;
5
6
  };
6
- declare const __VLS_base: import("vue").DefineComponent<QTabPanelProps | QTabProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<QTabPanelProps | QTabProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
8
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
9
  declare const _default: typeof __VLS_export;
9
10
  export default _default;
@@ -1,9 +1,9 @@
1
1
  <script setup>
2
2
  import { getCurrentInstance } from "vue";
3
3
  const instance = getCurrentInstance();
4
- defineProps({
5
- name: { type: null, required: false },
6
- disable: { type: Boolean, required: false, skipCheck: true },
4
+ const props = defineProps({
5
+ name: { type: [Number, String], required: false },
6
+ disable: { type: Boolean, required: false },
7
7
  icon: { type: null, required: false },
8
8
  label: { type: null, required: false },
9
9
  alert: { type: [Boolean, String], required: false, skipCheck: true },
@@ -24,7 +24,7 @@ const parent_type = instance?.parent?.type.name;
24
24
  </template>
25
25
 
26
26
  <template v-if="parent_type == 'QTabs'">
27
- <q-tab v-bind="$props" :label="$t($props.label ?? '')">
27
+ <q-tab v-bind="$props" :label="$t(String($props.label))">
28
28
  </q-tab>
29
29
  </template>
30
30
  </template>
@@ -1,9 +1,10 @@
1
1
  import type { QTabPanelProps, QTabProps } from 'quasar';
2
+ type __VLS_Props = QTabPanelProps & QTabProps;
2
3
  declare var __VLS_7: {};
3
4
  type __VLS_Slots = {} & {
4
5
  default?: (props: typeof __VLS_7) => any;
5
6
  };
6
- declare const __VLS_base: import("vue").DefineComponent<QTabPanelProps | QTabProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<QTabPanelProps | QTabProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
8
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
9
  declare const _default: typeof __VLS_export;
9
10
  export default _default;
@@ -15,8 +15,7 @@ export type LTableColumn = QTableColumn & {
15
15
  * @deprecated use gql instead
16
16
  */
17
17
  gqlField?: string | Array<string> | Object;
18
- backgroundColor?: string | Function;
19
- searchMethod?: string;
18
+ searchMethod?: "equals" | "contains";
20
19
  autoWidth?: boolean;
21
20
  };
22
21
  export type LTableProps = QTableProps & {
@@ -429,17 +429,6 @@ const hasRowExpand = computed(() => {
429
429
  const hasActions = computed(() => {
430
430
  return props.actions.length > 0 || ss.indexOf("actions") >= 0;
431
431
  });
432
- const getCellStyle = (col, row) => {
433
- const style = col.cellStyle ?? {};
434
- if (col.backgroundColor) {
435
- if (typeof col.backgroundColor == "function") {
436
- style.backgroundColor = col.backgroundColor(row);
437
- } else {
438
- style.backgroundColor = col.backgroundColor;
439
- }
440
- }
441
- return style;
442
- };
443
432
  const localSelected = computed({
444
433
  get() {
445
434
  return props.selected;
@@ -578,8 +567,8 @@ const hasFilters = computed(() => {
578
567
  <slot :name="'body-cell-' + col.name" v-bind="props"></slot>
579
568
  </template>
580
569
  <template v-else>
581
- <q-td :key="col.name" :props="props" :auto-width="col.autoWidth ?? false"
582
- :style="getCellStyle(col, props.row)"><template v-if="col.to" class="bg-primary">
570
+ <q-td :key="col.name" :props="props" :auto-width="col.autoWidth ?? false"><template
571
+ v-if="col.to" class="bg-primary">
583
572
  <l-link :to="col.to(props.row)" v-if="col.to(props.row)">{{ col.value }}</l-link>
584
573
  </template>
585
574
  <template v-else-if="col.component">
@@ -655,7 +644,8 @@ const hasFilters = computed(() => {
655
644
  <q-td v-if="selection != 'none'" auto-width />
656
645
  <q-td v-if="hasRowExpand" auto-width />
657
646
  <q-td v-if="hasActions" auto-width />
658
- <q-td v-for="col in props.cols">
647
+ <q-td v-for="col in props.cols" :key="col.name" :style="col.style">
648
+
659
649
  <template v-if="col.searchable">
660
650
 
661
651
  <template v-if="col.searchType == 'number'">
@@ -15,8 +15,7 @@ export type LTableColumn = QTableColumn & {
15
15
  * @deprecated use gql instead
16
16
  */
17
17
  gqlField?: string | Array<string> | Object;
18
- backgroundColor?: string | Function;
19
- searchMethod?: string;
18
+ searchMethod?: "equals" | "contains";
20
19
  autoWidth?: boolean;
21
20
  };
22
21
  export type LTableProps = QTableProps & {
@@ -6,7 +6,8 @@ export default defineLightModel({
6
6
  label: "ID",
7
7
  sortable: true,
8
8
  searchable: true,
9
- autoWidth: true
9
+ autoWidth: true,
10
+ searchMethod: "equals"
10
11
  },
11
12
  username: {
12
13
  label: "User",
@@ -22,7 +23,8 @@ export default defineLightModel({
22
23
  logout_dt: {
23
24
  label: "Logout time",
24
25
  sortable: true,
25
- searchable: true
26
+ searchable: true,
27
+ searchType: "date"
26
28
  },
27
29
  result: {
28
30
  label: "Result",
@@ -38,8 +40,11 @@ export default defineLightModel({
38
40
  label: "FAIL",
39
41
  value: "FAIL"
40
42
  }
41
- ],
42
- autoWidth: true
43
+ ]
44
+ /* style(row) {
45
+ return row.result === "SUCCESS" ? "background-color: var(--q-positive);" : "background-color: var(--q-negative);";
46
+
47
+ } */
43
48
  },
44
49
  user_agent: {
45
50
  label: "User agent",
@@ -52,6 +57,11 @@ export default defineLightModel({
52
57
  sortable: true,
53
58
  searchable: true,
54
59
  searchType: "date"
60
+ },
61
+ ip: {
62
+ label: "IP Address",
63
+ sortable: true,
64
+ searchable: true
55
65
  }
56
66
  }
57
67
  });
@@ -3,7 +3,7 @@ import { q, m, useLight, useAsyncData } from "#imports";
3
3
  import { resolveComponent, ref, reactive, computed } from "vue";
4
4
  const light = useLight();
5
5
  const { data, refresh } = await useAsyncData("database", async () => {
6
- const { system } = await q({
6
+ return await q({
7
7
  system: {
8
8
  database: {
9
9
  table: true,
@@ -12,8 +12,7 @@ const { data, refresh } = await useAsyncData("database", async () => {
12
12
  tableStatus: true
13
13
  }
14
14
  }
15
- });
16
- return system.database;
15
+ }).then((res) => res.system.database);
17
16
  });
18
17
  const SYSTEM_TABLES = ["Config", "EventLog", "MailLog", "Permission", "Role", "SystemValue", "Translate", "User", "UserLog", "UserRole", "MyFavorite", "CustomField"];
19
18
  const custom_tables = computed(() => {
@@ -7,7 +7,8 @@ const columns = model("UserLog").columns({
7
7
  last_access_time: true,
8
8
  logout_dt: true,
9
9
  result: true,
10
- user_agent: true
10
+ user_agent: true,
11
+ ip: true
11
12
  });
12
13
  </script>
13
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.60.0",
3
+ "version": "1.60.1",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",