bfg-common 1.6.29 → 1.6.30

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.
Files changed (101) hide show
  1. package/assets/localization/local_be.json +5 -66
  2. package/assets/localization/local_en.json +12 -73
  3. package/assets/localization/local_hy.json +6 -67
  4. package/assets/localization/local_kk.json +5 -66
  5. package/assets/localization/local_ru.json +11 -72
  6. package/assets/localization/local_zh.json +5 -66
  7. package/assets/scss/common/theme.scss +2 -2
  8. package/components/atoms/stack/StackBlock.vue +1 -1
  9. package/components/common/adapterManager/addAdapterModal/AddAdapterModalNew.vue +1 -1
  10. package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModalNew.vue +1 -0
  11. package/components/common/adapterManager/ui/table/adapters/AdaptersNew.vue +0 -1
  12. package/components/common/configure/physicalAdapters/PhysicalAdapters.vue +0 -6
  13. package/components/common/configure/physicalAdapters/PhysicalAdaptersNew.vue +192 -219
  14. package/components/common/configure/physicalAdapters/PhysicalAdaptersOld.vue +4 -6
  15. package/components/common/configure/physicalAdapters/buttons/Buttons.vue +0 -1
  16. package/components/common/configure/physicalAdapters/modals/edit/Edit.vue +1 -26
  17. package/components/common/configure/physicalAdapters/modals/edit/EditNew.vue +1 -30
  18. package/components/common/configure/physicalAdapters/modals/edit/lib/models/interfaces.ts +0 -5
  19. package/components/common/configure/physicalAdapters/tableView/TableViewNew.vue +1 -12
  20. package/components/common/configure/physicalAdapters/tableView/lib/config/physicalAdaptersTableConfigNew.ts +21 -21
  21. package/components/common/configure/physicalAdapters/tableView/lib/config/settings.ts +5 -12
  22. package/components/common/configure/physicalAdapters/tableView/lib/models/interfaces.ts +1 -4
  23. package/components/common/diagramMain/DiagramMain.vue +0 -6
  24. package/components/common/diagramMain/modals/Modals.vue +0 -4
  25. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +2 -2
  26. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +1 -1
  27. package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +2 -2
  28. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +1 -1
  29. package/components/common/layout/theHeader/ThemeSwitch.vue +1 -1
  30. package/components/common/layout/theHeader/userMenu/modals/changePassword/New.vue +9 -8
  31. package/components/common/layout/theHeader/userMenu/modals/preferences/New.vue +0 -4
  32. package/components/common/layout/theHeader/userMenu/modals/preferences/Old.vue +2 -9
  33. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +7 -11
  34. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsole.vue +1 -7
  35. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/config/consoleOptions.ts +5 -8
  36. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormat.vue +5 -9
  37. package/components/common/layout/theHeader/userMenu/modals/preferences/view/Old.vue +9 -5
  38. package/components/common/layout/theHeader/userMenu/modals/preferences/view/View.vue +6 -9
  39. package/components/common/mainNavigationPanel/MainNavigationPanelNew.vue +1 -3
  40. package/components/common/monitor/advanced/table/lib/models/interfaces.ts +13 -12
  41. package/components/common/monitor/advanced/table/lib/models/types.ts +7 -10
  42. package/components/common/monitor/advanced/table/tableNew/TableNew.vue +93 -92
  43. package/components/common/monitor/advanced/table/tableNew/lib/config/options.ts +109 -139
  44. package/components/common/monitor/advanced/table/tableNew/lib/utils/constructBody.ts +25 -27
  45. package/components/common/monitor/advanced/table/tableOld/TableOld.vue +93 -93
  46. package/components/common/monitor/advanced/table/tableOld/lib/config/performanceDatatable.ts +125 -149
  47. package/components/common/monitor/lib/utils/local_be.json +702 -698
  48. package/components/common/monitor/lib/utils/local_en.json +702 -698
  49. package/components/common/monitor/lib/utils/local_hy.json +702 -698
  50. package/components/common/monitor/lib/utils/local_kk.json +702 -698
  51. package/components/common/monitor/lib/utils/local_ru.json +702 -698
  52. package/components/common/monitor/lib/utils/local_zh.json +702 -698
  53. package/components/common/monitor/utilization/lib/utils/index.ts +33 -31
  54. package/components/common/noDataProvided/NoDataProvidedNew.vue +1 -1
  55. package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/config/table.ts +4 -4
  56. package/components/common/pages/backups/modals/createBackup/datastores/tableView/old/lib/config/table.ts +4 -4
  57. package/components/common/pages/hardwareHealth/HardwareHealthNew.vue +1 -1
  58. package/components/common/pages/hardwareHealth/historyTestimony/GraphNew.vue +1 -1
  59. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/actions/ActionsNew.vue +1 -1
  60. package/components/common/pages/scheduledTasks/table/lib/models/enums.ts +0 -9
  61. package/components/common/pages/scheduledTasks/table/new/New.vue +10 -12
  62. package/components/common/pages/tasks/Tasks.vue +1 -4
  63. package/components/common/pages/tasks/table/Table.vue +22 -24
  64. package/components/common/split/vertical/New.vue +8 -42
  65. package/components/common/split/vertical/Old.vue +2 -31
  66. package/components/common/split/vertical/Vertical.vue +0 -4
  67. package/components/common/vm/actions/add/New.vue +6 -21
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/New.vue +0 -1
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/New.vue +0 -2
  70. package/components/common/vm/actions/common/select/options/New.vue +1 -1
  71. package/components/common/vm/actions/common/select/storage/new/lib/config/table.ts +15 -13
  72. package/components/common/vm/actions/confirm/Confirm.vue +0 -3
  73. package/components/common/vm/actions/rename/New.vue +7 -7
  74. package/components/common/vm/snapshots/DetailView.vue +6 -6
  75. package/components/common/wizards/common/steps/name/New.vue +6 -4
  76. package/components/common/wizards/datastore/add/New.vue +0 -6
  77. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceNew.vue +1 -1
  78. package/components/common/wizards/datastore/add/steps/nameAndDevice/advancedOptions/New.vue +1 -1
  79. package/components/common/wizards/network/add/Add.vue +2 -13
  80. package/components/common/wizards/network/add/AddNew.vue +26 -22
  81. package/components/common/wizards/network/add/lib/config/initialData.ts +4 -4
  82. package/components/common/wizards/network/add/lib/utils/utils.ts +1 -1
  83. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettingsNew.vue +8 -2
  84. package/components/common/wizards/network/add/steps/portProperties/PortPropertiesNew.vue +8 -2
  85. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue +3 -10
  86. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectNetwork.vue +1 -5
  87. package/components/common/wizards/network/add/validations/common.ts +1 -1
  88. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/New.vue +13 -31
  89. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/hostTable.ts +1 -3
  90. package/components/common/wizards/vm/migrate/steps/selectStorage/New.vue +4 -5
  91. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/New.vue +0 -4
  92. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/table/new/New.vue +1 -3
  93. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/new/lib/config/diskTable.ts +3 -8
  94. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/old/lib/config/diskTable.ts +1 -7
  95. package/lib/models/store/tasks/enums.ts +0 -3
  96. package/lib/models/store/tasks/types.ts +6 -7
  97. package/package.json +2 -2
  98. package/store/tasks/actions.ts +8 -26
  99. package/store/tasks/mappers/recentTasks.ts +0 -1
  100. package/components/common/configure/physicalAdapters/modals/edit/lib/validations/validations.ts +0 -19
  101. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/clusterTable.ts +0 -340
@@ -12,13 +12,12 @@ import type { UI_I_Localization } from '~/lib/models/interfaces'
12
12
  import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
13
13
  import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
14
14
  import { formatOptionsFunc } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions'
15
- import type { UI_T_Project } from '~/lib/models/types'
16
15
 
17
16
  const timeFormat = defineModel<UI_T_TimeValue>('timeFormat')
18
17
  const props = defineProps<{
19
- project: UI_T_Project
20
18
  newView: boolean
21
19
  }>()
20
+
22
21
  const currentComponent = computed(() =>
23
22
  props.newView
24
23
  ? defineAsyncComponent(() => import('./New.vue'))
@@ -29,14 +28,11 @@ const localization = computed<UI_I_Localization>(() => useLocal())
29
28
 
30
29
  const config = useRuntimeConfig()
31
30
 
32
- /* TODO SC-2104 */
33
31
  const description = computed<string>(() =>
34
- props.project === 'sphere'
35
- ? localization.value.common.timeFormatDesc1
36
- : localization.value.common.timeFormatDesc.replaceAll(
37
- '{trademark}',
38
- String(config.public[`TRADEMARK_${useEnvLanguage()}`])
39
- )
32
+ localization.value.common.timeFormatDesc.replaceAll(
33
+ '{trademark}',
34
+ String(config.public[`TRADEMARK_${useEnvLanguage()}`])
35
+ )
40
36
  )
41
37
 
42
38
  const formatOptions = readonly<UI_I_RadioItem[]>(
@@ -15,9 +15,13 @@
15
15
  />
16
16
  </div>
17
17
 
18
- <div class="flex-align-center second-description">
18
+ <div class="description second-description">
19
+ {{ localization.myPreferences.showNotificationDescription }}
20
+ </div>
21
+
22
+ <div class="flex-align-center">
19
23
  <label for="show-notification">{{
20
- localization.myPreferences.showNotificationDescription
24
+ localization.myPreferences.showNotification
21
25
  }}</label>
22
26
  <input
23
27
  id="show-notification"
@@ -59,10 +63,10 @@ window.tools = new Proxy(
59
63
  <style lang="scss" scoped>
60
64
  .description {
61
65
  margin-bottom: 10px;
62
- }
63
66
 
64
- .second-description {
65
- margin-top: 20px;
67
+ &.second-description {
68
+ margin-top: 20px;
69
+ }
66
70
  }
67
71
 
68
72
  label {
@@ -30,13 +30,10 @@ const currentComponent = computed(() =>
30
30
 
31
31
  const localization = computed<UI_I_Localization>(() => useLocal())
32
32
 
33
- /* TODO SC-2104 */
34
- const description = computed<string>(() =>
35
- props.project === 'sphere'
36
- ? localization.value.common.viewDesc1
37
- : localization.value.common.viewDesc.replaceAll(
38
- '{trademark}',
39
- String(config.public[`TRADEMARK_${useEnvLanguage()}`])
40
- )
41
- )
33
+ const description = computed<string>(() => {
34
+ return localization.value.common.viewDesc.replaceAll(
35
+ '{trademark}',
36
+ String(config.public[`TRADEMARK_${useEnvLanguage()}`])
37
+ )
38
+ })
42
39
  </script>
@@ -143,7 +143,7 @@ const localization = computed<UI_I_Localization>(() => useLocal())
143
143
  &.pinned {
144
144
  .nav-context {
145
145
  position: relative;
146
- z-index: calc(var(--z-fixed) + 2);
146
+ z-index: calc(var(--z-default) + 1);
147
147
  }
148
148
  }
149
149
  &:not(.pinned) {
@@ -177,8 +177,6 @@ const localization = computed<UI_I_Localization>(() => useLocal())
177
177
  }
178
178
  }
179
179
  &:not(.collapsed) {
180
- min-width: 240px;
181
-
182
180
  :deep(.tooltip-container-hover) {
183
181
  display: none;
184
182
  }
@@ -1,12 +1,13 @@
1
- export interface UI_I_PerformanceItem {
2
- id: number
3
- key: string
4
- measurement: string
5
- units: string
6
- latest: number
7
- maximum: number
8
- minimum: number
9
- average: number
10
- relatedDeviceName: string
11
- rollupType: string
12
- }
1
+ export interface UI_I_PerformanceItem {
2
+ id: number
3
+ key: string
4
+ measurement: string
5
+ units: string
6
+ latest: number
7
+ maximum: number
8
+ minimum: number
9
+ average: number
10
+ relatedDeviceName: string
11
+ rollupType: string
12
+ description: string
13
+ }
@@ -1,10 +1,7 @@
1
- export type UI_T_PerformanceColumnKey =
2
- | 'key'
3
- | 'relatedDeviceName'
4
- | 'measurement'
5
- | 'rollupType'
6
- | 'units'
7
- | 'latest'
8
- | 'maximum'
9
- | 'minimum'
10
- | 'average'
1
+ export type UI_T_PerformanceColumnKey =
2
+ | 'key'
3
+ | 'relatedDeviceName'
4
+ | 'description'
5
+ | 'units'
6
+ | 'maximum'
7
+ | 'minimum'
@@ -1,92 +1,93 @@
1
- <template>
2
- <div class="advanced-main-table">
3
- <ui-data-table
4
- :data="data"
5
- :options="options"
6
- :loading="props.loading"
7
- :texts="tableTexts"
8
- test-id="advanced-table"
9
- @select-row="onSelectRow"
10
- >
11
- <template #icon="{ item }">
12
- <div
13
- :style="{ backgroundColor: item.data.color }"
14
- class="color-circle"
15
- ></div>
16
- </template>
17
- <template #zone="{ item }">
18
- <span class="zone-item-block">
19
- <span class="icon vsphere-icon-vcenter"></span>
20
- <span>{{ item.text }}</span>
21
- </span>
22
- </template>
23
- </ui-data-table>
24
- </div>
25
- </template>
26
-
27
- <script setup lang="ts">
28
- import type {
29
- UI_I_DataTable,
30
- UI_I_DataTableOptions,
31
- UI_I_DataTableBody,
32
- UI_I_TableTexts,
33
- } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
34
- import type { UI_I_Localization } from '~/lib/models/interfaces'
35
- import type { UI_I_PerformanceItem } from '~/components/common/monitor/advanced/table/lib/models/interfaces'
36
- import {
37
- bodyOptions,
38
- headOptions,
39
- } from '~/components/common/monitor/advanced/table/tableNew/lib/config/options'
40
- import { tableTextsFunc } from '~/lib/config/uiTable'
41
-
42
- const localization = computed<UI_I_Localization>(() => useLocal())
43
-
44
- const props = defineProps<{
45
- loading: boolean
46
- items: UI_I_PerformanceItem[]
47
- }>()
48
- const emits = defineEmits<{
49
- (event: 'select', value: number[]): void
50
- }>()
51
-
52
- const data = computed<UI_I_DataTable>(() =>
53
- bodyOptions(localization.value, props.items)
54
- )
55
-
56
- const options = computed<UI_I_DataTableOptions>(() => headOptions())
57
-
58
- const onSelectRow = (data: UI_I_DataTableBody[]): void => {
59
- emits(
60
- 'select',
61
- data.map((item) => item.row)
62
- )
63
- }
64
-
65
- const tableTexts = computed<UI_I_TableTexts>(() =>
66
- tableTextsFunc(localization.value)
67
- )
68
- </script>
69
-
70
- <style scoped lang="scss">
71
- .advanced-main-table {
72
- margin: 12px 6px 16px 6px;
73
-
74
- :deep(.title-container) {
75
- height: 20px;
76
-
77
- h5 {
78
- margin-bottom: 0;
79
- }
80
- }
81
- .color-circle {
82
- width: 18px;
83
- height: 18px;
84
- border-radius: 32px;
85
- }
86
- .zone-item-block {
87
- display: flex;
88
- align-items: center;
89
- column-gap: 4px;
90
- }
91
- }
92
- </style>
1
+ <template>
2
+ <div class="advanced-main-table">
3
+ <ui-data-table
4
+ :data="data"
5
+ :options="options"
6
+ :loading="props.loading"
7
+ :texts="tableTexts"
8
+ test-id="advanced-table"
9
+ @select-row="onSelectRow"
10
+ >
11
+ <template #icon="{ item }">
12
+ <div
13
+ :style="{ backgroundColor: item.data.color }"
14
+ class="color-circle"
15
+ ></div>
16
+ </template>
17
+ <template #zone="{ item }">
18
+ <span class="zone-item-block">
19
+ <span class="icon vsphere-icon-vcenter"></span>
20
+ <span>{{ item.text }}</span>
21
+ </span>
22
+ </template>
23
+ <template #default-actions></template>
24
+ </ui-data-table>
25
+ </div>
26
+ </template>
27
+
28
+ <script setup lang="ts">
29
+ import type {
30
+ UI_I_DataTable,
31
+ UI_I_DataTableOptions,
32
+ UI_I_DataTableBody,
33
+ UI_I_TableTexts,
34
+ } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
35
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
36
+ import type { UI_I_PerformanceItem } from '~/components/common/monitor/advanced/table/lib/models/interfaces'
37
+ import {
38
+ bodyOptions,
39
+ headOptions,
40
+ } from '~/components/common/monitor/advanced/table/tableNew/lib/config/options'
41
+ import { tableTextsFunc } from '~/lib/config/uiTable'
42
+
43
+ const localization = computed<UI_I_Localization>(() => useLocal())
44
+
45
+ const props = defineProps<{
46
+ loading: boolean
47
+ items: UI_I_PerformanceItem[]
48
+ }>()
49
+ const emits = defineEmits<{
50
+ (event: 'select', value: number[]): void
51
+ }>()
52
+
53
+ const data = computed<UI_I_DataTable>(() =>
54
+ bodyOptions(localization.value, props.items)
55
+ )
56
+
57
+ const options = computed<UI_I_DataTableOptions>(() => headOptions())
58
+
59
+ const onSelectRow = (data: UI_I_DataTableBody[]): void => {
60
+ emits(
61
+ 'select',
62
+ data.map((item) => item.row)
63
+ )
64
+ }
65
+
66
+ const tableTexts = computed<UI_I_TableTexts>(() =>
67
+ tableTextsFunc(localization.value)
68
+ )
69
+ </script>
70
+
71
+ <style scoped lang="scss">
72
+ .advanced-main-table {
73
+ margin: 12px 6px 16px 6px;
74
+
75
+ :deep(.title-container) {
76
+ height: 20px;
77
+
78
+ h5 {
79
+ margin-bottom: 0;
80
+ }
81
+ }
82
+ .color-circle {
83
+ width: 18px;
84
+ height: 18px;
85
+ border-radius: 32px;
86
+ }
87
+ .zone-item-block {
88
+ display: flex;
89
+ align-items: center;
90
+ column-gap: 4px;
91
+ }
92
+ }
93
+ </style>
@@ -1,139 +1,109 @@
1
- import type { UI_I_DataTable } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
2
- import type { UI_I_DataTableOptions } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
3
- import type { UI_I_Localization } from '~/lib/models/interfaces'
4
- import type { UI_I_PerformanceItem } from '~/components/common/monitor/advanced/table/lib/models/interfaces'
5
- import { constructUsersAndGroupsTableItems } from '~/components/common/monitor/advanced/table/tableNew/lib/utils/constructBody'
6
-
7
- export const bodyOptions = (
8
- localization: UI_I_Localization,
9
- items: UI_I_PerformanceItem[]
10
- ): UI_I_DataTable => {
11
- const currentBody = constructUsersAndGroupsTableItems(items)
12
-
13
- return {
14
- id: 'find-user-or-group-modal-table-config',
15
- title: `${localization.inventoryMonitor.performanceChartLegend} (${items.length})`,
16
- selectedRows: [],
17
- isAllSelected: false,
18
- header: [
19
- {
20
- col: 'col0',
21
- colName: 'key',
22
- text: localization.inventoryMonitor.chartColor,
23
- width: '96px',
24
- isSortable: false,
25
- sort: 'asc',
26
- show: true,
27
- filter: false,
28
- },
29
- {
30
- col: 'col1',
31
- colName: 'object',
32
- text: localization.inventoryMonitor.metricName,
33
- width: '150px',
34
- isSortable: true,
35
- sort: 'asc',
36
- show: true,
37
- filter: true,
38
- },
39
- {
40
- col: 'col2',
41
- colName: 'measurement',
42
- text: localization.inventoryMonitor.metricDescription,
43
- width: '192px',
44
- isSortable: true,
45
- sort: 'asc',
46
- show: true,
47
- filter: true,
48
- },
49
- // {
50
- // col: 'col3',
51
- // colName: 'rollup',
52
- // text: localization.common.rollup,
53
- // width: '150px',
54
- // isSortable: true,
55
- // sort: 'asc',
56
- // show: true,
57
- // filter: true,
58
- // },
59
- {
60
- col: 'col4',
61
- colName: 'units',
62
- text: localization.inventoryMonitor.unitOfMeasurement,
63
- width: '150px',
64
- isSortable: true,
65
- sort: 'asc',
66
- show: true,
67
- filter: true,
68
- },
69
- {
70
- col: 'col5',
71
- colName: 'latest',
72
- text: localization.common.latest,
73
- width: '150px',
74
- isSortable: true,
75
- sort: 'asc',
76
- show: true,
77
- filter: true,
78
- },
79
- {
80
- col: 'col6',
81
- colName: 'maximum',
82
- text: localization.common.maximum,
83
- width: '150px',
84
- isSortable: true,
85
- sort: 'asc',
86
- show: true,
87
- filter: true,
88
- },
89
- {
90
- col: 'col7',
91
- colName: 'minimum',
92
- text: localization.common.minimum,
93
- width: '150px',
94
- isSortable: true,
95
- sort: 'asc',
96
- show: true,
97
- filter: true,
98
- },
99
- // {
100
- // col: 'col8',
101
- // colName: 'average',
102
- // text: localization.common.average,
103
- // width: '150px',
104
- // isSortable: true,
105
- // sort: 'asc',
106
- // show: true,
107
- // filter: true,
108
- // },
109
- {
110
- col: 'col9',
111
- colName: 'default-actions',
112
- text: '',
113
- show: true,
114
- },
115
- ],
116
-
117
- body: currentBody,
118
- }
119
- }
120
-
121
- export const headOptions = (): UI_I_DataTableOptions => {
122
- return {
123
- selectType: 'checkbox',
124
- perPageOptions: [
125
- { text: '20', value: 20, default: true },
126
- { text: '50', value: 50 },
127
- { text: '100', value: 100 },
128
- ],
129
- inBlock: true,
130
- isSelectable: true,
131
- showPagination: false,
132
- showPageInfo: false,
133
- isSortable: true,
134
- server: false,
135
- isResizable: true,
136
- showSearch: false,
137
- showColumnManager: true,
138
- }
139
- }
1
+ import type { UI_I_DataTable } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
2
+ import type { UI_I_DataTableOptions } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
3
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
4
+ import type { UI_I_PerformanceItem } from '~/components/common/monitor/advanced/table/lib/models/interfaces'
5
+ import { constructUsersAndGroupsTableItems } from '~/components/common/monitor/advanced/table/tableNew/lib/utils/constructBody'
6
+
7
+ export const bodyOptions = (
8
+ localization: UI_I_Localization,
9
+ items: UI_I_PerformanceItem[]
10
+ ): UI_I_DataTable => {
11
+ const currentBody = constructUsersAndGroupsTableItems(items)
12
+
13
+ return {
14
+ id: 'advanced-main-table-config',
15
+ title: `${localization.inventoryMonitor.performanceChartLegend} (${items.length})`,
16
+ selectedRows: [],
17
+ isAllSelected: false,
18
+ header: [
19
+ {
20
+ col: 'col0',
21
+ colName: 'key',
22
+ text: localization.inventoryMonitor.chartColor,
23
+ width: '96px',
24
+ isSortable: false,
25
+ sort: 'asc',
26
+ show: true,
27
+ filter: false,
28
+ },
29
+ {
30
+ col: 'col1',
31
+ colName: 'object',
32
+ text: localization.inventoryMonitor.metricName,
33
+ width: '150px',
34
+ isSortable: true,
35
+ sort: 'asc',
36
+ show: true,
37
+ filter: true,
38
+ },
39
+ {
40
+ col: 'col2',
41
+ colName: 'measurement',
42
+ text: localization.inventoryMonitor.metricDescription,
43
+ width: '192px',
44
+ isSortable: true,
45
+ sort: 'asc',
46
+ show: true,
47
+ filter: true,
48
+ },
49
+ {
50
+ col: 'col3',
51
+ colName: 'units',
52
+ text: localization.inventoryMonitor.unitOfMeasurement,
53
+ width: '150px',
54
+ isSortable: true,
55
+ sort: 'asc',
56
+ show: true,
57
+ filter: true,
58
+ },
59
+ {
60
+ col: 'col4',
61
+ colName: 'maximum',
62
+ text: localization.common.maximum,
63
+ width: '150px',
64
+ isSortable: true,
65
+ sort: 'asc',
66
+ show: true,
67
+ filter: true,
68
+ },
69
+ {
70
+ col: 'col5',
71
+ colName: 'minimum',
72
+ text: localization.common.minimum,
73
+ width: '150px',
74
+ isSortable: true,
75
+ sort: 'asc',
76
+ show: true,
77
+ filter: true,
78
+ },
79
+ {
80
+ col: 'default-actions',
81
+ colName: 'default-actions',
82
+ text: '',
83
+ show: true,
84
+ },
85
+ ],
86
+
87
+ body: currentBody,
88
+ }
89
+ }
90
+
91
+ export const headOptions = (): UI_I_DataTableOptions => {
92
+ return {
93
+ selectType: 'checkbox',
94
+ perPageOptions: [
95
+ { text: '20', value: 20, default: true },
96
+ { text: '50', value: 50 },
97
+ { text: '100', value: 100 },
98
+ ],
99
+ inBlock: true,
100
+ isSelectable: true,
101
+ showPagination: false,
102
+ showPageInfo: false,
103
+ isSortable: true,
104
+ server: false,
105
+ isResizable: true,
106
+ showSearch: false,
107
+ showColumnManager: true,
108
+ }
109
+ }
@@ -1,27 +1,25 @@
1
- import type { UI_I_DataTableBody } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
2
- import type { UI_I_PerformanceItem } from '~/components/common/monitor/advanced/table/lib/models/interfaces'
3
-
4
- export const constructUsersAndGroupsTableItems = (
5
- items: UI_I_PerformanceItem[]
6
- ): UI_I_DataTableBody[] => {
7
- const result: UI_I_DataTableBody[] = []
8
-
9
- items.forEach((item: UI_I_PerformanceItem, key: number) => {
10
- result.push({
11
- row: key,
12
- data: [
13
- { col: 'col0', key: 'icon', text: '', data: { color: item.key } },
14
- { col: 'col1', key: 'zone', text: item.relatedDeviceName },
15
- { col: 'col2', text: item.measurement },
16
- { col: 'col3', text: item.rollupType },
17
- { col: 'col4', text: item.units },
18
- { col: 'col5', text: String(item.latest) },
19
- { col: 'col6', text: String(item.maximum) },
20
- { col: 'col7', text: String(item.minimum) },
21
- { col: 'col8', text: String(item.average) },
22
- ],
23
- })
24
- })
25
-
26
- return result
27
- }
1
+ import type { UI_I_DataTableBody } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
2
+ import type { UI_I_PerformanceItem } from '~/components/common/monitor/advanced/table/lib/models/interfaces'
3
+
4
+ export const constructUsersAndGroupsTableItems = (
5
+ items: UI_I_PerformanceItem[]
6
+ ): UI_I_DataTableBody[] => {
7
+ const result: UI_I_DataTableBody[] = []
8
+
9
+ items.forEach((item: UI_I_PerformanceItem, key: number) => {
10
+ result.push({
11
+ row: key,
12
+ data: [
13
+ { col: 'col0', key: 'icon', text: '', data: { color: item.key } },
14
+ { col: 'col1', key: 'zone', text: item.relatedDeviceName },
15
+ { col: 'col2', text: item.description },
16
+ { col: 'col3', text: item.units },
17
+ { col: 'col4', text: String(item.maximum) },
18
+ { col: 'col5', text: String(item.minimum) },
19
+ { col: 'default-actions', key: 'default-actions', text: '', data: {} },
20
+ ],
21
+ })
22
+ })
23
+
24
+ return result
25
+ }