bfg-common 1.4.52 → 1.4.53

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.
@@ -1,8 +1 @@
1
- export type UI_T_HostTableItemsKey =
2
- | 'name'
3
- | 'identifier'
4
- | 'lun'
5
- | 'capacity_mb'
6
- | 'hardware_acceleration'
7
- | 'drive_type'
8
- | 'sector_format'
1
+ export type T_DatastoreTableItemsTuple = ['name', 'type_ds', 'description']
@@ -31,16 +31,15 @@
31
31
 
32
32
  <script lang="ts" setup>
33
33
  import { useDebounceFn } from '@vueuse/core'
34
- import {
34
+ import type {
35
35
  UI_I_HeadItem,
36
36
  UI_I_ColumnKey,
37
37
  UI_I_BodyItem,
38
38
  } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
39
39
  import { UI_I_Localization } from '~/lib/models/interfaces'
40
40
  import { UI_I_Pagination } from '~/lib/models/table/interfaces'
41
- // import { optionsDefault as itemsPerPage } from '~/node_modules/nuxt-3-uikit/components/atoms/table/dataGrid/config'
42
41
  import { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces'
43
- import * as lunDiskTable from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/hostsTable'
42
+ import * as lunDiskTable from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/lunDiskTable'
44
43
 
45
44
  const props = defineProps<{
46
45
  dataTable: UI_I_CreateStorageLunDiskItem[]
@@ -108,11 +107,11 @@ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
108
107
  return result
109
108
  })
110
109
 
111
- const selectedLunDiskLocal = ref<number[]>()
110
+ const selectedLunDiskLocal = ref<number[]>([])
112
111
  watch(
113
112
  selectedLunDiskLocal,
114
113
  (newValue: number[]) => {
115
- modelLunDisk.value = props.dataTable.filter((_: any, key: number) =>
114
+ modelLunDisk.value = props.dataTable.filter((_: never, key: number) =>
116
115
  newValue.includes(key)
117
116
  )
118
117
  },
@@ -0,0 +1,84 @@
1
+ import type {
2
+ UI_I_HeadItem,
3
+ UI_I_ColumnKey,
4
+ UI_I_BodyItem,
5
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
6
+ import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
7
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
8
+ import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
9
+ import { lunDiskTableItemsKeys } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/tableKeys'
10
+
11
+ const getItems = (
12
+ localization: UI_I_Localization
13
+ ): [string, boolean, string, string][] => {
14
+ return [
15
+ [localization.common.name, true, '180px', lunDiskTableItemsKeys[0]],
16
+ [localization.common.identifier, false, '96px', lunDiskTableItemsKeys[1]],
17
+ [localization.common.lun, true, '96px', lunDiskTableItemsKeys[2]],
18
+ [localization.common.capacity, true, '96px', lunDiskTableItemsKeys[3]],
19
+ [
20
+ localization.common.hardwareAcceleration,
21
+ true,
22
+ '96px',
23
+ lunDiskTableItemsKeys[4],
24
+ ],
25
+ [localization.common.driveType, true, '96px', lunDiskTableItemsKeys[5]],
26
+ [localization.common.sectorFormat, true, '96px', lunDiskTableItemsKeys[6]],
27
+ ]
28
+ }
29
+
30
+ export const columnKeys = (
31
+ localization: UI_I_Localization
32
+ ): UI_I_ColumnKey[] => {
33
+ return defaultSettings.defaultColumnKeys(getItems(localization))
34
+ }
35
+ export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
36
+ return defaultSettings.defaultHeadItems(getItems(localization))
37
+ }
38
+
39
+ export const bodyItems = (
40
+ data: UI_I_CreateStorageLunDiskItem[]
41
+ ): UI_I_BodyItem[][] => {
42
+ const bodyItems: UI_I_BodyItem[][] = []
43
+ const { $binary } = useNuxtApp() as any
44
+ data.forEach((lanDisk: UI_I_CreateStorageLunDiskItem, key) => {
45
+ bodyItems.push([
46
+ {
47
+ key: 'col0',
48
+ text: lanDisk[lunDiskTableItemsKeys[0]],
49
+ id: key,
50
+ },
51
+ {
52
+ key: 'col1',
53
+ text: lanDisk[lunDiskTableItemsKeys[1]],
54
+ id: key,
55
+ },
56
+ {
57
+ key: 'col2',
58
+ text: lanDisk[lunDiskTableItemsKeys[2]],
59
+ id: key,
60
+ },
61
+ {
62
+ key: 'col3',
63
+ text: $binary.round(lanDisk[lunDiskTableItemsKeys[3]]),
64
+ id: key,
65
+ },
66
+ {
67
+ key: 'col4',
68
+ text: lanDisk[lunDiskTableItemsKeys[4]],
69
+ id: key,
70
+ },
71
+ {
72
+ key: 'col5',
73
+ text: lanDisk[lunDiskTableItemsKeys[5]],
74
+ id: key,
75
+ },
76
+ {
77
+ key: 'col6',
78
+ text: lanDisk[lunDiskTableItemsKeys[6]],
79
+ id: key,
80
+ },
81
+ ])
82
+ })
83
+ return bodyItems
84
+ }
@@ -1,6 +1,6 @@
1
- import { UI_T_HostTableItemsKey } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/types'
1
+ import type { UI_T_LunDiskTableItemTuple } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/models/types'
2
2
 
3
- export const hostTableItemsKeys: UI_T_HostTableItemsKey[] = [
3
+ export const lunDiskTableItemsKeys: UI_T_LunDiskTableItemTuple = [
4
4
  'name',
5
5
  'identifier',
6
6
  'lun',
@@ -0,0 +1,9 @@
1
+ export type UI_T_LunDiskTableItemTuple = [
2
+ 'name',
3
+ 'identifier',
4
+ 'lun',
5
+ 'capacity_mb',
6
+ 'hardware_acceleration',
7
+ 'drive_type',
8
+ 'sector_format'
9
+ ]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.52",
4
+ "version": "1.4.53",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,87 +0,0 @@
1
- import {
2
- UI_I_HeadItem,
3
- UI_I_ColumnKey,
4
- UI_I_BodyItem,
5
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
6
- import { UI_I_Localization } from '~/lib/models/interfaces'
7
- import {
8
- constructHeadItem,
9
- constructColumnKey,
10
- } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
11
- import { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
12
- import { hostTableItemsKeys } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/lib/config/tableKeys'
13
-
14
- const getItems = (
15
- localization: UI_I_Localization
16
- ): [string, boolean, string, string][] => {
17
- return [
18
- [localization.common.name, true, '180px', hostTableItemsKeys[0]],
19
- [localization.common.identifier, false, '96px', hostTableItemsKeys[1]],
20
- [localization.common.lun, true, '96px', hostTableItemsKeys[2]],
21
- [localization.common.capacity, true, '96px', hostTableItemsKeys[3]],
22
- [localization.common.hardwareAcceleration, true, '96px', hostTableItemsKeys[4]],
23
- [localization.common.driveType, true, '96px', hostTableItemsKeys[5]],
24
- [localization.common.sectorFormat, true, '96px', hostTableItemsKeys[6]],
25
- ]
26
- }
27
- export const columnKeys = (localization: UI_I_Localization): UI_I_ColumnKey[] => {
28
- const result: UI_I_ColumnKey[] = []
29
- getItems(localization).forEach((item, i) => {
30
- const col = `col${i}`
31
- result.push(constructColumnKey(col, item[0], item[1]))
32
- })
33
- return result
34
- }
35
- export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
36
- const result: UI_I_HeadItem[] = []
37
- getItems(localization).forEach((item, i) => {
38
- const col = `col${i}`
39
- result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
40
- })
41
- return result
42
- }
43
-
44
- export const bodyItems = (data: UI_I_CreateStorageLunDiskItem[]): UI_I_BodyItem[][] => {
45
- const bodyItems: UI_I_BodyItem[][] = []
46
- const { $binary } = useNuxtApp() as any
47
- data.forEach((host: UI_I_CreateStorageLunDiskItem, key) => {
48
- bodyItems.push([
49
- {
50
- key: 'col0',
51
- text: host[hostTableItemsKeys[0]],
52
- id: key,
53
- },
54
- {
55
- key: 'col1',
56
- text: host[hostTableItemsKeys[1]],
57
- id: key,
58
- },
59
- {
60
- key: 'col2',
61
- text: host[hostTableItemsKeys[2]],
62
- id: key,
63
- },
64
- {
65
- key: 'col3',
66
- text: $binary.round(host[hostTableItemsKeys[3]]),
67
- id: key,
68
- },
69
- {
70
- key: 'col4',
71
- text: host[hostTableItemsKeys[4]],
72
- id: key,
73
- },
74
- {
75
- key: 'col5',
76
- text: host[hostTableItemsKeys[5]],
77
- id: key,
78
- },
79
- {
80
- key: 'col6',
81
- text: host[hostTableItemsKeys[6]],
82
- id: key,
83
- },
84
- ])
85
- })
86
- return bodyItems
87
- }