bfg-common 1.2.50 → 1.2.52

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 (81) hide show
  1. package/components/atoms/alert/Notification.vue +167 -167
  2. package/components/atoms/autocomplete/Autocomplete.vue +236 -236
  3. package/components/atoms/datepicker/Datepicker.vue +612 -612
  4. package/components/atoms/list/SelectList.vue +62 -62
  5. package/components/atoms/nav/NavBar.vue +116 -116
  6. package/components/atoms/nav/VerticalNavBar.vue +89 -89
  7. package/components/atoms/notificationBar/NotificationBar.vue +175 -175
  8. package/components/atoms/perPage/PerPage.vue +52 -52
  9. package/components/atoms/popup/SimplePopup.vue +90 -90
  10. package/components/atoms/step/VerticalStep.vue +104 -104
  11. package/components/atoms/switch/Switch.vue +107 -107
  12. package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +206 -206
  13. package/components/atoms/table/dataGrid/DataGridPage.vue +189 -189
  14. package/components/atoms/tabs/Tabs.vue +189 -189
  15. package/components/atoms/tooltip/Signpost.vue +224 -224
  16. package/components/common/BadBrowser.vue +114 -114
  17. package/components/common/adapterManager/AddAdapterWarningModal.vue +82 -82
  18. package/components/common/adapterManager/NoActiveAdaptersModal.vue +62 -62
  19. package/components/common/adapterManager/NoConnectedActiveAdaptersModal.vue +62 -62
  20. package/components/common/browse/Browse.vue +182 -182
  21. package/components/common/browse/blocks/Title.vue +66 -66
  22. package/components/common/diagramMain/Diagram.vue +186 -186
  23. package/components/common/diagramMain/DiagramMain.vue +986 -986
  24. package/components/common/diagramMain/adapter/AdapterItem.vue +227 -227
  25. package/components/common/diagramMain/adapter/AdapterItems.vue +57 -57
  26. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +339 -339
  27. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +202 -202
  28. package/components/common/diagramMain/modals/remove/RemoveModal.vue +226 -226
  29. package/components/common/diagramMain/network/Contents.vue +238 -238
  30. package/components/common/feedback/Buttons.vue +232 -232
  31. package/components/common/feedback/Message.vue +468 -468
  32. package/components/common/feedback/VisitPortal.vue +54 -54
  33. package/components/common/help/navbar/left/Left.vue +159 -159
  34. package/components/common/help/navbar/left/utils/constructAccordion.ts +27 -27
  35. package/components/common/mainNavigationPanel/MainNavigationPanel.vue +359 -359
  36. package/components/common/modals/Rename.vue +165 -165
  37. package/components/common/monitor/config/getValidDateByOption.ts +0 -37
  38. package/components/common/monitor/overview/Overview.vue +470 -453
  39. package/components/common/monitor/overview/filters/Filters.vue +219 -216
  40. package/components/common/monitor/overview/filters/config/filterOptions.ts +80 -72
  41. package/components/common/perPage/PerPage.vue +51 -51
  42. package/components/common/recursionTree/RecursionTree.vue +201 -201
  43. package/components/common/vm/actions/clone/Clone.vue +545 -544
  44. package/components/common/vm/actions/clone/select/options/Options.vue +65 -65
  45. package/components/common/vm/actions/clone/utils.ts +43 -43
  46. package/components/common/vm/actions/common/config/capabilities.ts +338 -338
  47. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +678 -678
  48. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +109 -109
  49. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +383 -383
  50. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +234 -234
  51. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/config/options.ts +28 -28
  52. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +316 -316
  53. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/config/memoryOptions.ts +35 -35
  54. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +445 -446
  55. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +288 -288
  56. package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/Reservation.vue +235 -235
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +177 -177
  58. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +197 -197
  59. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +181 -181
  60. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +51 -51
  61. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +253 -253
  62. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +55 -55
  63. package/components/common/vm/actions/common/select/storage/Storage.vue +18 -1
  64. package/components/common/vm/actions/common/select/storage/config/config.ts +154 -154
  65. package/components/common/wizards/datastore/add/nfs/Nfs.vue +94 -94
  66. package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +377 -377
  67. package/components/common/wizards/datastore/add/nfs/configuration/serversList/ServersList.vue +123 -123
  68. package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +54 -54
  69. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/HostTable.vue +131 -131
  70. package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +230 -230
  71. package/composables/useLocal.ts +38 -38
  72. package/minify.js +146 -146
  73. package/models/store/interfaces.ts +37 -37
  74. package/models/store/storage/interfaces.ts +32 -32
  75. package/models/store/types.ts +32 -32
  76. package/modules/fixContentBuild/utils/methods.ts +114 -114
  77. package/package.json +2 -2
  78. package/public/spice-console/application/codec.js +257 -257
  79. package/public/spice-console/lib/rasterEngine.js +907 -907
  80. package/public/spice-console/network/spicechannel.js +369 -369
  81. package/utils/contentBuild.ts +34 -34
@@ -1,216 +1,219 @@
1
- <template>
2
- <div class="horizontal-flex-container overview-chart-title-bar">
3
- <div class="horizontal-flex-container">
4
- <label for="periodSelect" class="label-select"
5
- >{{ localization.period }}:</label
6
- >
7
- <div v-if="!disabledPeriodOptions" class="select">
8
- <select id="periodSelect" v-model="selectedPeriod">
9
- <option
10
- v-for="(item, index) in periodOptions"
11
- :key="index"
12
- :value="item.value"
13
- >
14
- {{ item.text }}
15
- </option>
16
- </select>
17
- </div>
18
- <span v-else class="single-option">{{ periodOptions[0].text }}</span>
19
- </div>
20
- <div v-show="isShowCustomIntervalButton">
21
- <a id="show-interval-modal-button" @click="onShowIntervalModal">{{
22
- localization.changeCustomInterval
23
- }}</a>
24
- </div>
25
- <div v-if="!disabledPeriodOptions" class="chart-title">
26
- {{ chartTitleDate }}
27
- </div>
28
- <div class="view-select-label horizontal-flex-container">
29
- <label for="viewSelect" class="label-select"
30
- >{{ localization.view }}:</label
31
- >
32
- <div class="select">
33
- <select id="viewSelect" v-model="selectedView">
34
- <option
35
- v-for="(item, index) in viewOptions"
36
- :key="index"
37
- :value="item.value"
38
- >
39
- {{ item.text }}
40
- </option>
41
- </select>
42
- </div>
43
- </div>
44
- </div>
45
-
46
- <common-monitor-overview-filters-custom-interval-modal
47
- v-if="isShowIntervalModal"
48
- :selected-periods="props.selectedPeriods"
49
- :format-date="props.formatDate"
50
- @hide="onHideIntervalModal"
51
- @submit="onSubmitIntervalModal"
52
- />
53
- </template>
54
-
55
- <script setup lang="ts">
56
- import { UI_I_Localization } from '~/models/interfaces'
57
- import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
58
- import {
59
- periodFunc,
60
- viewFunc,
61
- } from '~/components/common/monitor/overview/filters/config/filterOptions'
62
- import { UI_I_MonitorGraphPayload } from '~/components/common/monitor/models/interfaces'
63
- import { getValidDateByOptionFunc } from '~/components/common/monitor/config/getValidDateByOption'
64
- import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/models/types'
65
-
66
- const localization = computed<UI_I_Localization>(() => useLocal())
67
- const { $formattedDatetime } = useNuxtApp()
68
-
69
- const props = defineProps<{
70
- startDate: number
71
- endDate: number
72
- chartType: 'spline' | 'pie'
73
- view: UI_T_OverviewViewType
74
- selectedPeriods: number[]
75
- formatDate: string
76
- formatTime?: string
77
- }>()
78
-
79
- const emits = defineEmits<{
80
- (event: 'update-filters', value: UI_I_MonitorGraphPayload): void
81
- (event: 'update-custom-date', value: number[]): void
82
- }>()
83
-
84
- const selectedPeriod = ref<string>('')
85
- const periodOptions = computed<UI_I_OptionItem[]>(() =>
86
- periodFunc(localization.value)
87
- )
88
- watch(
89
- () => periodOptions.value,
90
- (newValue: UI_I_OptionItem[]) => {
91
- if (newValue) selectedPeriod.value = newValue[0].value
92
- },
93
- { immediate: true }
94
- )
95
-
96
- const isShowCustomIntervalButton = computed<boolean>(
97
- () => selectedPeriod.value === 'custom_interval'
98
- )
99
-
100
- const isShowIntervalModal = ref<boolean>(false)
101
- const onShowIntervalModal = (): void => {
102
- isShowIntervalModal.value = true
103
- }
104
- const onHideIntervalModal = (): void => {
105
- isShowIntervalModal.value = false
106
- }
107
- const onSubmitIntervalModal = (customDates: number[]): void => {
108
- customDatesData.value = customDates
109
- sendUpdatedFilters()
110
- onHideIntervalModal()
111
- emits('update-custom-date', customDates)
112
- }
113
-
114
- const chartTitleDate = computed<string>(() => {
115
- const startValue = props.startDate
116
- const endValue = props.endDate
117
- if (!startValue && !endValue) return ''
118
-
119
- const start = $formattedDatetime(
120
- startValue,
121
- props.formatDate,
122
- true,
123
- '',
124
- props.formatTime
125
- )
126
- const end = $formattedDatetime(
127
- endValue,
128
- props.formatDate,
129
- true,
130
- '',
131
- props.formatTime
132
- )
133
- return `${start} - ${end}`
134
- })
135
-
136
- const disabledPeriodOptions = computed<boolean>(
137
- () => props.chartType === 'pie' || !chartTitleDate.value
138
- )
139
-
140
- const selectedView = ref<string>('')
141
- const viewOptions = computed<UI_I_OptionItem[]>(() =>
142
- viewFunc(localization.value, props.view)
143
- )
144
- watch(
145
- () => viewOptions.value,
146
- (newValue: UI_I_OptionItem[]) => {
147
- if (newValue) selectedView.value = newValue[0].value
148
- },
149
- { immediate: true }
150
- )
151
-
152
- const customDatesData = ref<number[]>([])
153
- const sendUpdatedFilters = (): void => {
154
- const currentPeriod =
155
- selectedPeriod.value === 'custom_interval'
156
- ? customDatesData.value
157
- : getValidDateByOptionFunc(selectedPeriod.value)
158
- const filters: UI_I_MonitorGraphPayload = {
159
- period: currentPeriod,
160
- view: selectedView.value,
161
- }
162
-
163
- emits('update-filters', filters)
164
- }
165
- watch(
166
- () => [selectedPeriod.value, selectedView.value],
167
- (newValue: string[]) => {
168
- newValue[0] !== 'custom_interval' && sendUpdatedFilters()
169
- },
170
- { immediate: true }
171
- )
172
- </script>
173
-
174
- <style scoped lang="scss">
175
- .horizontal-flex-container {
176
- display: flex;
177
- flex-direction: row;
178
- align-items: center;
179
- line-height: 20px;
180
- flex-shrink: 0;
181
- padding-top: 5px;
182
-
183
- .select select {
184
- height: 20px;
185
- margin: 5px;
186
- color: var(--global-font-color);
187
- }
188
- .single-option {
189
- margin-left: 5px;
190
- }
191
-
192
- .chart-title {
193
- color: var(--global-font-color);
194
- text-overflow: ellipsis;
195
- white-space: nowrap;
196
- overflow: hidden;
197
- margin: 6px;
198
- font-weight: 700;
199
- text-transform: uppercase;
200
- }
201
-
202
- #show-interval-modal-button {
203
- cursor: pointer;
204
- color: var(--dropdown-item-color);
205
- }
206
-
207
- .view-select-label {
208
- margin-left: auto;
209
- padding-right: 7px;
210
- padding-left: 7px;
211
- text-overflow: ellipsis;
212
- white-space: nowrap;
213
- align-items: center;
214
- }
215
- }
216
- </style>
1
+ <template>
2
+ <div class="horizontal-flex-container overview-chart-title-bar">
3
+ <div class="horizontal-flex-container">
4
+ <label for="periodSelect" class="label-select"
5
+ >{{ localization.period }}:</label
6
+ >
7
+ <div v-if="!disabledPeriodOptions" class="select">
8
+ <select id="periodSelect" v-model="selectedPeriod">
9
+ <option
10
+ v-for="(item, index) in periodOptions"
11
+ :key="index"
12
+ :value="item.value"
13
+ >
14
+ {{ item.text }}
15
+ </option>
16
+ </select>
17
+ </div>
18
+ <span v-else class="single-option">{{ periodOptions[0].text }}</span>
19
+ </div>
20
+ <div v-show="isShowCustomIntervalButton">
21
+ <a id="show-interval-modal-button" @click="onShowIntervalModal">{{
22
+ localization.changeCustomInterval
23
+ }}</a>
24
+ </div>
25
+ <div v-if="!disabledPeriodOptions" class="chart-title">
26
+ {{ chartTitleDate }}
27
+ </div>
28
+ <div class="view-select-label horizontal-flex-container">
29
+ <label for="viewSelect" class="label-select"
30
+ >{{ localization.view }}:</label
31
+ >
32
+ <div class="select">
33
+ <select id="viewSelect" v-model="selectedView">
34
+ <option
35
+ v-for="(item, index) in viewOptions"
36
+ :key="index"
37
+ :value="item.value"
38
+ >
39
+ {{ item.text }}
40
+ </option>
41
+ </select>
42
+ </div>
43
+ </div>
44
+ </div>
45
+
46
+ <common-monitor-overview-filters-custom-interval-modal
47
+ v-if="isShowIntervalModal"
48
+ :selected-periods="props.selectedPeriods"
49
+ :format-date="props.formatDate"
50
+ @hide="onHideIntervalModal"
51
+ @submit="onSubmitIntervalModal"
52
+ />
53
+ </template>
54
+
55
+ <script setup lang="ts">
56
+ import { UI_I_Localization } from '~/models/interfaces'
57
+ import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
58
+ import {
59
+ periodFunc,
60
+ viewFunc,
61
+ } from '~/components/common/monitor/overview/filters/config/filterOptions'
62
+ import { UI_I_MonitorGraphPayload } from '~/components/common/monitor/models/interfaces'
63
+ import { getValidDateByOptionFunc } from '~/components/common/monitor/config/getValidDateByOption'
64
+ import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/models/types'
65
+
66
+ const localization = computed<UI_I_Localization>(() => useLocal())
67
+ const { $formattedDatetime } = useNuxtApp()
68
+
69
+ const props = defineProps<{
70
+ startDate: number
71
+ endDate: number
72
+ chartType: 'spline' | 'pie'
73
+ view: UI_T_OverviewViewType
74
+ selectedPeriods: number[]
75
+ formatDate: string
76
+ projectType?: number
77
+ formatTime?: string
78
+ }>()
79
+
80
+ const emits = defineEmits<{
81
+ (event: 'update-filters', value: UI_I_MonitorGraphPayload): void
82
+ (event: 'update-custom-date', value: number[]): void
83
+ }>()
84
+
85
+ const selectedPeriod = ref<string>('')
86
+ const periodOptions = computed<UI_I_OptionItem[]>(() =>
87
+ periodFunc(localization.value)
88
+ )
89
+ watch(
90
+ () => periodOptions.value,
91
+ (newValue: UI_I_OptionItem[]) => {
92
+ if (newValue) selectedPeriod.value = newValue[0].value
93
+ },
94
+ { immediate: true }
95
+ )
96
+
97
+ const isShowCustomIntervalButton = computed<boolean>(
98
+ () => selectedPeriod.value === 'custom_interval'
99
+ )
100
+
101
+ const isShowIntervalModal = ref<boolean>(false)
102
+ const onShowIntervalModal = (): void => {
103
+ isShowIntervalModal.value = true
104
+ }
105
+ const onHideIntervalModal = (): void => {
106
+ isShowIntervalModal.value = false
107
+ }
108
+ const onSubmitIntervalModal = (customDates: number[]): void => {
109
+ customDatesData.value = customDates
110
+ sendUpdatedFilters()
111
+ onHideIntervalModal()
112
+ emits('update-custom-date', customDates)
113
+ }
114
+
115
+ const chartTitleDate = computed<string>(() => {
116
+ const startValue = props.startDate
117
+ const endValue = props.endDate
118
+ if (!startValue && !endValue) return ''
119
+
120
+ const start = $formattedDatetime(
121
+ startValue,
122
+ props.formatDate,
123
+ true,
124
+ '',
125
+ props.formatTime
126
+ )
127
+ const end = $formattedDatetime(
128
+ endValue,
129
+ props.formatDate,
130
+ true,
131
+ '',
132
+ props.formatTime
133
+ )
134
+ return `${start} - ${end}`
135
+ })
136
+
137
+ // const disabledPeriodOptions = computed<boolean>(
138
+ // () => props.chartType === 'pie' || !chartTitleDate.value
139
+ // )
140
+
141
+ const disabledPeriodOptions = computed<boolean>(() => props.chartType === 'pie')
142
+
143
+ const selectedView = ref<string>('')
144
+ const viewOptions = computed<UI_I_OptionItem[]>(() =>
145
+ viewFunc(localization.value, props.view, props.projectType)
146
+ )
147
+ watch(
148
+ () => viewOptions.value,
149
+ (newValue: UI_I_OptionItem[]) => {
150
+ if (newValue) selectedView.value = newValue[0].value
151
+ },
152
+ { immediate: true }
153
+ )
154
+
155
+ const customDatesData = ref<number[]>([])
156
+ const sendUpdatedFilters = (): void => {
157
+ const currentPeriod =
158
+ selectedPeriod.value === 'custom_interval'
159
+ ? customDatesData.value
160
+ : getValidDateByOptionFunc(selectedPeriod.value)
161
+ const filters: UI_I_MonitorGraphPayload = {
162
+ period: currentPeriod,
163
+ view: selectedView.value,
164
+ }
165
+
166
+ emits('update-filters', filters)
167
+ }
168
+ watch(
169
+ () => [selectedPeriod.value, selectedView.value],
170
+ (newValue: string[]) => {
171
+ newValue[0] !== 'custom_interval' && sendUpdatedFilters()
172
+ },
173
+ { immediate: true }
174
+ )
175
+ </script>
176
+
177
+ <style scoped lang="scss">
178
+ .horizontal-flex-container {
179
+ display: flex;
180
+ flex-direction: row;
181
+ align-items: center;
182
+ line-height: 20px;
183
+ flex-shrink: 0;
184
+ padding-top: 5px;
185
+
186
+ .select select {
187
+ height: 20px;
188
+ margin: 5px;
189
+ color: var(--global-font-color);
190
+ }
191
+ .single-option {
192
+ margin-left: 5px;
193
+ }
194
+
195
+ .chart-title {
196
+ color: var(--global-font-color);
197
+ text-overflow: ellipsis;
198
+ white-space: nowrap;
199
+ overflow: hidden;
200
+ margin: 6px;
201
+ font-weight: 700;
202
+ text-transform: uppercase;
203
+ }
204
+
205
+ #show-interval-modal-button {
206
+ cursor: pointer;
207
+ color: var(--dropdown-item-color);
208
+ }
209
+
210
+ .view-select-label {
211
+ margin-left: auto;
212
+ padding-right: 7px;
213
+ padding-left: 7px;
214
+ text-overflow: ellipsis;
215
+ white-space: nowrap;
216
+ align-items: center;
217
+ }
218
+ }
219
+ </style>
@@ -1,72 +1,80 @@
1
- import { UI_I_Localization } from '~/models/interfaces'
2
- import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
3
- import { UI_I_OverviewViewOptionData } from '~/components/common/monitor/overview/filters/models/interfaces'
4
- import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/models/types'
5
-
6
- export const periodFunc = (
7
- localization: UI_I_Localization
8
- ): UI_I_OptionItem[] => [
9
- {
10
- text: localization.realTime,
11
- value: 'real_time',
12
- },
13
- {
14
- text: localization.lastDay,
15
- value: 'last_day',
16
- },
17
- {
18
- text: localization.lastWeek,
19
- value: 'last_week',
20
- },
21
- {
22
- text: localization.lastMonth,
23
- value: 'last_month',
24
- },
25
- // {
26
- // text: localization.lastYear,
27
- // value: 'last_year',
28
- // },
29
- {
30
- text: localization.customInterval,
31
- value: 'custom_interval',
32
- },
33
- ]
34
-
35
- export const viewFunc = (
36
- localization: UI_I_Localization,
37
- viewType: UI_T_OverviewViewType
38
- ): UI_I_OptionItem[] => {
39
- const viewData: UI_I_OverviewViewOptionData = {
40
- datacenter: [
41
- {
42
- text: localization.clusters,
43
- value: 'clusters',
44
- },
45
- {
46
- text: localization.spaceUtilization,
47
- value: 'spaceUtilization',
48
- },
49
- {
50
- text: localization.datastores,
51
- value: 'datastores',
52
- },
53
- ],
54
- host: [
55
- { text: localization.overview, value: 'overview' },
56
- { text: localization.memory, value: 'memory' },
57
- // { text: localization.overview, value: 'overview' },
58
- { text: localization.network, value: 'network' },
59
- { text: localization.disks, value: 'disks' },
60
- // { text: localization.virtual_machines, value: 'virtual_machines' },
61
- ],
62
- vm: [
63
- { text: localization.overview, value: 'overview' },
64
- // { text: localization.space, value: 'space' },
65
- // { text: localization.spaceUtilization, value: 'space_utilization' },
66
- { text: localization.network, value: 'network' },
67
- { text: localization.disks, value: 'disks' },
68
- ],
69
- }
70
-
71
- return viewData[viewType]
72
- }
1
+ import { UI_I_Localization } from '~/models/interfaces'
2
+ import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
3
+ import { UI_I_OverviewViewOptionData } from '~/components/common/monitor/overview/filters/models/interfaces'
4
+ import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/models/types'
5
+
6
+ export const periodFunc = (
7
+ localization: UI_I_Localization
8
+ ): UI_I_OptionItem[] => [
9
+ {
10
+ text: localization.realTime,
11
+ value: 'real_time',
12
+ },
13
+ {
14
+ text: localization.lastDay,
15
+ value: 'last_day',
16
+ },
17
+ {
18
+ text: localization.lastWeek,
19
+ value: 'last_week',
20
+ },
21
+ {
22
+ text: localization.lastMonth,
23
+ value: 'last_month',
24
+ },
25
+ // {
26
+ // text: localization.lastYear,
27
+ // value: 'last_year',
28
+ // },
29
+ {
30
+ text: localization.customInterval,
31
+ value: 'custom_interval',
32
+ },
33
+ ]
34
+
35
+ export const viewFunc = (
36
+ localization: UI_I_Localization,
37
+ viewType: UI_T_OverviewViewType,
38
+ projectType?: number
39
+ ): UI_I_OptionItem[] => {
40
+ const host = [
41
+ { text: localization.overview, value: 'overview' },
42
+ { text: localization.memory, value: 'memory' },
43
+ // { text: localization.overview, value: 'overview' },
44
+ { text: localization.network, value: 'network' },
45
+ { text: localization.disks, value: 'disks' },
46
+ // { text: localization.virtual_machines, value: 'virtual_machines' },
47
+ ]
48
+ if (projectType === 1)
49
+ host.push({
50
+ text: localization.spaceUtilization,
51
+ value: 'spaceUtilization',
52
+ })
53
+
54
+ const viewData: UI_I_OverviewViewOptionData = {
55
+ datacenter: [
56
+ {
57
+ text: localization.clusters,
58
+ value: 'clusters',
59
+ },
60
+ {
61
+ text: localization.spaceUtilization,
62
+ value: 'spaceUtilization',
63
+ },
64
+ {
65
+ text: localization.datastores,
66
+ value: 'datastores',
67
+ },
68
+ ],
69
+ host,
70
+ vm: [
71
+ { text: localization.overview, value: 'overview' },
72
+ // { text: localization.space, value: 'space' },
73
+ // { text: localization.spaceUtilization, value: 'space_utilization' },
74
+ { text: localization.network, value: 'network' },
75
+ { text: localization.disks, value: 'disks' },
76
+ ],
77
+ }
78
+
79
+ return viewData[viewType]
80
+ }