@hostlink/nuxt-light 1.74.0 → 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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.74.0",
4
+ "version": "1.74.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { useLight, q, m } from "#imports";
3
- import { ref, computed, onMounted, useAttrs } from "vue";
3
+ import { ref, computed, onMounted, useAttrs, useSlots } from "vue";
4
4
  import { useStorage } from "@vueuse/core";
5
5
  import { useLightCardDefaults } from "../../composables/useLightProps";
6
6
  defineOptions({ inheritAttrs: false });
@@ -23,6 +23,7 @@ const props = defineProps({
23
23
  tag: { type: null, required: false }
24
24
  });
25
25
  const vAttrs = useAttrs();
26
+ const slots = useSlots();
26
27
  const L_KEYS = ["loading", "title", "permission", "closeable", "minimizable", "maximizable", "name", "minimized", "maximized", "onUpdate:minimized", "onUpdate:maximized"];
27
28
  const storedMinimized = props.name ? useStorage(`l-card-minimized-${props.name}`, false) : ref(false);
28
29
  if (props.name && storedMinimized.value) {
@@ -41,7 +42,7 @@ const showBar = computed(() => {
41
42
  if (props.minimizable) return true;
42
43
  if (props.title !== void 0) return true;
43
44
  if (showSecurity.value) return true;
44
- if (vAttrs.actions) return true;
45
+ if (slots.actions) return true;
45
46
  return false;
46
47
  });
47
48
  const showSecurity = computed(() => {
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.74.0",
3
+ "version": "1.74.1",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",