bfg-common 1.3.76 → 1.3.78

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,66 +1,66 @@
1
- <template>
2
- <div class="title-block" :style="blockWidth">
3
- <div class="title-block__container" :style="blockWidth">
4
- <div class="title-block__title" :style="blockTitleWidth">
5
- <b>{{ props.title }}</b>
6
- </div>
7
- <div class="title-block__body">
8
- <slot name="content"></slot>
9
- </div>
10
- </div>
11
- </div>
12
- </template>
13
-
14
- <script setup lang="ts">
15
- const props = defineProps<{
16
- title: string
17
- width: number
18
- }>()
19
-
20
- const blockWidth = computed(() => ({ width: `${props.width}px` }))
21
- const blockTitleWidth = computed(() => ({ width: `${props.width - 2}px` }))
22
- </script>
23
-
24
- <style scoped lang="scss">
25
- .title-block {
26
- width: 100%;
27
- min-height: 400px;
28
- position: relative;
29
-
30
- &__container {
31
- position: absolute;
32
- top: 0;
33
- height: 400px;
34
- left: 0;
35
- display: flex;
36
- flex-direction: column;
37
- border-width: 1px;
38
- border-style: solid;
39
- border-color: rgb(204, 204, 204);
40
- border-image: initial;
41
- background: rgb(255, 255, 255);
42
- }
43
- &__title {
44
- background-color: rgb(231, 235, 239);
45
- flex: 0 0 auto;
46
- padding: 8px;
47
- border-bottom: 1px solid rgb(204, 204, 204);
48
- display: inline-block;
49
- white-space: nowrap;
50
- overflow: hidden !important;
51
- text-overflow: ellipsis;
52
-
53
- b {
54
- font-weight: bolder;
55
- font-size: 13px;
56
- letter-spacing: normal;
57
- font-family: Metropolis, Avenir Next, Helvetica Neue, Arial, sans-serif;
58
- color: #666;
59
- }
60
- }
61
- &__body {
62
- flex: 1 1 auto;
63
- overflow-y: auto;
64
- }
65
- }
66
- </style>
1
+ <template>
2
+ <div class="title-block" :style="blockWidth">
3
+ <div class="title-block__container" :style="blockWidth">
4
+ <div class="title-block__title" :style="blockTitleWidth">
5
+ <b>{{ props.title }}</b>
6
+ </div>
7
+ <div class="title-block__body">
8
+ <slot name="content"></slot>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ const props = defineProps<{
16
+ title: string
17
+ width: number
18
+ }>()
19
+
20
+ const blockWidth = computed(() => ({ width: `${props.width}px` }))
21
+ const blockTitleWidth = computed(() => ({ width: `${props.width - 2}px` }))
22
+ </script>
23
+
24
+ <style scoped lang="scss">
25
+ .title-block {
26
+ width: 100%;
27
+ min-height: 400px;
28
+ position: relative;
29
+
30
+ &__container {
31
+ position: absolute;
32
+ top: 0;
33
+ height: 400px;
34
+ left: 0;
35
+ display: flex;
36
+ flex-direction: column;
37
+ border-width: 1px;
38
+ border-style: solid;
39
+ border-color: rgb(204, 204, 204);
40
+ border-image: initial;
41
+ background: rgb(255, 255, 255);
42
+ }
43
+ &__title {
44
+ background-color: rgb(231, 235, 239);
45
+ flex: 0 0 auto;
46
+ padding: 8px;
47
+ border-bottom: 1px solid rgb(204, 204, 204);
48
+ display: inline-block;
49
+ white-space: nowrap;
50
+ overflow: hidden !important;
51
+ text-overflow: ellipsis;
52
+
53
+ b {
54
+ font-weight: bolder;
55
+ font-size: 13px;
56
+ letter-spacing: normal;
57
+ font-family: Metropolis, Avenir Next, Helvetica Neue, Arial, sans-serif;
58
+ color: #666;
59
+ }
60
+ }
61
+ &__body {
62
+ flex: 1 1 auto;
63
+ overflow-y: auto;
64
+ }
65
+ }
66
+ </style>
@@ -1,137 +1,137 @@
1
- <template>
2
- <div class="vertical-flex-container chart-option-counters-vertical-split">
3
- <span class="chart-options-grid-title">{{
4
- localization.selectCountersForThisChart
5
- }}</span>
6
-
7
- <atoms-table-data-grid
8
- v-model:selected-row="selectedCounters"
9
- v-model:column-keys="columnItems"
10
- v-model:page-size="pagination.pageSize"
11
- v-model:page="pagination.page"
12
- type="checkbox"
13
- class="data-table"
14
- :head-items="headItems"
15
- :body-items="bodyItems"
16
- :total-items="totalItems"
17
- :total-pages="totalPages"
18
- hide-footer
19
- server-off
20
- @change="onChangeRow"
21
- />
22
- </div>
23
- </template>
24
-
25
- <script setup lang="ts">
26
- import {
27
- UI_I_HeadItem,
28
- UI_I_BodyItem,
29
- UI_I_ColumnKey,
30
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
31
- import { UI_I_Localization } from '~/lib/models/interfaces'
32
- import { UI_I_Pagination } from '~/lib/models/table/interfaces'
33
- import * as table from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/tableConfig'
34
- import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
35
- import {
36
- UI_T_ChartHost,
37
- UI_T_ChartVm,
38
- } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
39
- import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
40
- import { countersItemsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/utils'
41
-
42
- const props = defineProps<{
43
- chart: UI_T_ChartHost | UI_T_ChartVm
44
- type: UI_T_AdvancedType
45
- selectedKeys: number[]
46
- }>()
47
-
48
- const emits = defineEmits<{
49
- (event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
50
- (event: 'total-items', value: number): void
51
- }>()
52
-
53
- const localization = computed<UI_I_Localization>(() => useLocal())
54
-
55
- const counters = computed<UI_I_AdvancedCounterItem[]>(() =>
56
- countersItemsFunc(props.type, props.chart, localization.value)
57
- )
58
-
59
- const totalItems = computed<number>(() => counters.value.length)
60
- const totalPages = computed<number>(() => 1)
61
-
62
- watch(
63
- totalItems,
64
- (newValue) => {
65
- emits('total-items', newValue)
66
- },
67
- { immediate: true }
68
- )
69
-
70
- const selectedCounters = ref<number[]>([])
71
- watch(
72
- () => props.selectedKeys,
73
- (newValue) => {
74
- selectedCounters.value = newValue
75
- },
76
- { immediate: true, deep: true }
77
- )
78
- watch(
79
- () => props.chart,
80
- () => {
81
- selectedCounters.value = []
82
- }
83
- )
84
- const pagination = ref<UI_I_Pagination>({
85
- page: 1,
86
- pageSize: 35,
87
- })
88
-
89
- const columnItems = computed<UI_I_ColumnKey[]>(() =>
90
- table.columnKeys(localization.value)
91
- )
92
- const headItems = computed<UI_I_HeadItem[]>(() =>
93
- table.headItems(localization.value)
94
- )
95
- const bodyItems = ref<UI_I_BodyItem[][]>([])
96
-
97
- watch(
98
- counters,
99
- (newValue) => {
100
- if (!newValue.length) return
101
-
102
- bodyItems.value = table.bodyItems(newValue)
103
- },
104
- { deep: true, immediate: true }
105
- )
106
-
107
- const onChangeRow = (val: number[]): void => {
108
- const result: UI_I_AdvancedCounterItem[] = []
109
-
110
- counters.value.forEach((item) => {
111
- if (val.includes(item.id)) result.push(item)
112
- })
113
-
114
- emits('select-row', result)
115
- }
116
-
117
- watch(
118
- selectedCounters,
119
- (newValue) => {
120
- onChangeRow(newValue)
121
- },
122
- { immediate: true }
123
- )
124
- </script>
125
-
126
- <style scoped lang="scss">
127
- .chart-option-counters-vertical-split {
128
- .chart-options-grid-title {
129
- display: block;
130
- margin-bottom: -20px;
131
- }
132
-
133
- :deep(.datagrid-table-wrapper) {
134
- max-height: 88px;
135
- }
136
- }
137
- </style>
1
+ <template>
2
+ <div class="vertical-flex-container chart-option-counters-vertical-split">
3
+ <span class="chart-options-grid-title">{{
4
+ localization.selectCountersForThisChart
5
+ }}</span>
6
+
7
+ <atoms-table-data-grid
8
+ v-model:selected-row="selectedCounters"
9
+ v-model:column-keys="columnItems"
10
+ v-model:page-size="pagination.pageSize"
11
+ v-model:page="pagination.page"
12
+ type="checkbox"
13
+ class="data-table"
14
+ :head-items="headItems"
15
+ :body-items="bodyItems"
16
+ :total-items="totalItems"
17
+ :total-pages="totalPages"
18
+ hide-footer
19
+ server-off
20
+ @change="onChangeRow"
21
+ />
22
+ </div>
23
+ </template>
24
+
25
+ <script setup lang="ts">
26
+ import {
27
+ UI_I_HeadItem,
28
+ UI_I_BodyItem,
29
+ UI_I_ColumnKey,
30
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
31
+ import { UI_I_Localization } from '~/lib/models/interfaces'
32
+ import { UI_I_Pagination } from '~/lib/models/table/interfaces'
33
+ import * as table from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/tableConfig'
34
+ import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
35
+ import {
36
+ UI_T_ChartHost,
37
+ UI_T_ChartVm,
38
+ } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
39
+ import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
40
+ import { countersItemsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/utils'
41
+
42
+ const props = defineProps<{
43
+ chart: UI_T_ChartHost | UI_T_ChartVm
44
+ type: UI_T_AdvancedType
45
+ selectedKeys: number[]
46
+ }>()
47
+
48
+ const emits = defineEmits<{
49
+ (event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
50
+ (event: 'total-items', value: number): void
51
+ }>()
52
+
53
+ const localization = computed<UI_I_Localization>(() => useLocal())
54
+
55
+ const counters = computed<UI_I_AdvancedCounterItem[]>(() =>
56
+ countersItemsFunc(props.type, props.chart, localization.value)
57
+ )
58
+
59
+ const totalItems = computed<number>(() => counters.value.length)
60
+ const totalPages = computed<number>(() => 1)
61
+
62
+ watch(
63
+ totalItems,
64
+ (newValue) => {
65
+ emits('total-items', newValue)
66
+ },
67
+ { immediate: true }
68
+ )
69
+
70
+ const selectedCounters = ref<number[]>([])
71
+ watch(
72
+ () => props.selectedKeys,
73
+ (newValue) => {
74
+ selectedCounters.value = newValue
75
+ },
76
+ { immediate: true, deep: true }
77
+ )
78
+ watch(
79
+ () => props.chart,
80
+ () => {
81
+ selectedCounters.value = []
82
+ }
83
+ )
84
+ const pagination = ref<UI_I_Pagination>({
85
+ page: 1,
86
+ pageSize: 35,
87
+ })
88
+
89
+ const columnItems = computed<UI_I_ColumnKey[]>(() =>
90
+ table.columnKeys(localization.value)
91
+ )
92
+ const headItems = computed<UI_I_HeadItem[]>(() =>
93
+ table.headItems(localization.value)
94
+ )
95
+ const bodyItems = ref<UI_I_BodyItem[][]>([])
96
+
97
+ watch(
98
+ counters,
99
+ (newValue) => {
100
+ if (!newValue.length) return
101
+
102
+ bodyItems.value = table.bodyItems(newValue)
103
+ },
104
+ { deep: true, immediate: true }
105
+ )
106
+
107
+ const onChangeRow = (val: number[]): void => {
108
+ const result: UI_I_AdvancedCounterItem[] = []
109
+
110
+ counters.value.forEach((item) => {
111
+ if (val.includes(item.id)) result.push(item)
112
+ })
113
+
114
+ emits('select-row', result)
115
+ }
116
+
117
+ watch(
118
+ selectedCounters,
119
+ (newValue) => {
120
+ onChangeRow(newValue)
121
+ },
122
+ { immediate: true }
123
+ )
124
+ </script>
125
+
126
+ <style scoped lang="scss">
127
+ .chart-option-counters-vertical-split {
128
+ .chart-options-grid-title {
129
+ display: block;
130
+ margin-bottom: -20px;
131
+ }
132
+
133
+ :deep(.datagrid-table-wrapper) {
134
+ max-height: 88px;
135
+ }
136
+ }
137
+ </style>
@@ -1,81 +1,82 @@
1
- import { UI_I_Localization } from '~/lib/models/interfaces'
2
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
- import { UI_I_OverviewViewOptionData } from '~/components/common/monitor/overview/filters/lib/models/interfaces'
4
- import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/lib/models/types'
5
- import { UI_T_Project } from '~/lib/models/types'
6
-
7
- export const periodFunc = (
8
- localization: UI_I_Localization
9
- ): UI_I_OptionItem[] => [
10
- {
11
- text: localization.realTime,
12
- value: 'real_time',
13
- },
14
- {
15
- text: localization.lastDay,
16
- value: 'last_day',
17
- },
18
- {
19
- text: localization.lastWeek,
20
- value: 'last_week',
21
- },
22
- {
23
- text: localization.lastMonth,
24
- value: 'last_month',
25
- },
26
- // {
27
- // text: localization.lastYear,
28
- // value: 'last_year',
29
- // },
30
- {
31
- text: localization.customInterval,
32
- value: 'custom_interval',
33
- },
34
- ]
35
-
36
- export const viewFunc = (
37
- localization: UI_I_Localization,
38
- viewType: UI_T_OverviewViewType,
39
- project: UI_T_Project
40
- ): UI_I_OptionItem[] => {
41
- const host = [
42
- { text: localization.overview, value: 'overview' },
43
- { text: localization.memory, value: 'memory' },
44
- // { text: localization.overview, value: 'overview' },
45
- { text: localization.network, value: 'network' },
46
- { text: localization.disks, value: 'disks' },
47
- // { text: localization.virtual_machines, value: 'virtual_machines' },
48
- ]
49
- if (project === 'procurator')
50
- host.push({
51
- text: localization.spaceUtilization,
52
- value: 'spaceUtilization',
53
- })
54
-
55
- const viewData: UI_I_OverviewViewOptionData = {
56
- datacenter: [
57
- {
58
- text: localization.clusters,
59
- value: 'clusters',
60
- },
61
- {
62
- text: localization.spaceUtilization,
63
- value: 'spaceUtilization',
64
- },
65
- {
66
- text: localization.datastores,
67
- value: 'datastores',
68
- },
69
- ],
70
- host,
71
- vm: [
72
- { text: localization.overview, value: 'overview' },
73
- // { text: localization.space, value: 'space' },
74
- // { text: localization.spaceUtilization, value: 'space_utilization' },
75
- { text: localization.network, value: 'network' },
76
- { text: localization.disks, value: 'disks' },
77
- ],
78
- }
79
-
80
- return viewData[viewType]
81
- }
1
+ import { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
+ import { UI_I_OverviewViewOptionData } from '~/components/common/monitor/overview/filters/lib/models/interfaces'
4
+ import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/lib/models/types'
5
+ import { UI_T_Project } from '~/lib/models/types'
6
+
7
+ export const periodFunc = (
8
+ localization: UI_I_Localization
9
+ ): UI_I_OptionItem[] => [
10
+ {
11
+ text: localization.realTime,
12
+ value: 'real_time',
13
+ },
14
+ {
15
+ text: localization.lastDay,
16
+ value: 'last_day',
17
+ },
18
+ {
19
+ text: localization.lastWeek,
20
+ value: 'last_week',
21
+ },
22
+ {
23
+ text: localization.lastMonth,
24
+ value: 'last_month',
25
+ },
26
+ // {
27
+ // text: localization.lastYear,
28
+ // value: 'last_year',
29
+ // },
30
+ {
31
+ text: localization.customInterval,
32
+ value: 'custom_interval',
33
+ },
34
+ ]
35
+
36
+ export const viewFunc = (
37
+ localization: UI_I_Localization,
38
+ viewType: UI_T_OverviewViewType,
39
+ project: UI_T_Project
40
+ ): UI_I_OptionItem[] => {
41
+ const host = [
42
+ { text: localization.overview, value: 'overview' },
43
+ { text: localization.memory, value: 'memory' },
44
+ // { text: localization.overview, value: 'overview' },
45
+ { text: localization.network, value: 'network' },
46
+ { text: localization.disks, value: 'disks' },
47
+ // { text: localization.virtual_machines, value: 'virtual_machines' },
48
+ ]
49
+ if (project === 'procurator')
50
+ host.push({
51
+ text: localization.spaceUtilization,
52
+ value: 'spaceUtilization',
53
+ })
54
+
55
+ const viewData: UI_I_OverviewViewOptionData = {
56
+ datacenter: [
57
+ {
58
+ text: localization.clusters,
59
+ value: 'clusters',
60
+ },
61
+ {
62
+ text: localization.spaceUtilization,
63
+ value: 'spaceUtilization',
64
+ },
65
+ {
66
+ text: localization.datastores,
67
+ value: 'datastores',
68
+ },
69
+ ],
70
+ host,
71
+ vm: [
72
+ { text: localization.overview, value: 'overview' },
73
+ // { text: localization.space, value: 'space' },
74
+ // { text: localization.spaceUtilization, value: 'space_utilization' },
75
+ { text: localization.network, value: 'network' },
76
+ { text: localization.disks, value: 'disks' },
77
+ ],
78
+ cluster: [{ text: localization.overview, value: 'overview' }],
79
+ }
80
+
81
+ return viewData[viewType]
82
+ }
@@ -1,7 +1,8 @@
1
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
2
-
3
- export interface UI_I_OverviewViewOptionData {
4
- datacenter: UI_I_OptionItem[]
5
- host: UI_I_OptionItem[]
6
- vm: UI_I_OptionItem[]
7
- }
1
+ import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
2
+
3
+ export interface UI_I_OverviewViewOptionData {
4
+ datacenter: UI_I_OptionItem[]
5
+ host: UI_I_OptionItem[]
6
+ vm: UI_I_OptionItem[]
7
+ cluster: UI_I_OptionItem[]
8
+ }
@@ -1,3 +1,3 @@
1
- export type UI_T_OverviewViewType = 'host' | 'vm' | 'datacenter'
2
-
3
- export type UI_T_OverviewRequestType = 'hosts' | 'vms' | 'datacenters'
1
+ export type UI_T_OverviewViewType = 'host' | 'vm' | 'datacenter' | 'cluster'
2
+
3
+ export type UI_T_OverviewRequestType = 'hosts' | 'vms' | 'datacenters'