bfg-common 1.6.113 → 1.6.114
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/assets/img/icons/icons-sprite-dark-4.svg +38 -17
- package/assets/img/icons/icons-sprite-light-4.svg +49 -17
- package/assets/localization/local_be.json +43 -4
- package/assets/localization/local_en.json +43 -4
- package/assets/localization/local_hy.json +43 -4
- package/assets/localization/local_kk.json +43 -4
- package/assets/localization/local_ru.json +43 -4
- package/assets/localization/local_zh.json +43 -4
- package/components/common/configure/advancedSystemSettings/AdvancedSystemSettings.vue +25 -17
- package/components/common/configure/advancedSystemSettings/New.vue +41 -0
- package/components/common/configure/advancedSystemSettings/Old.vue +36 -0
- package/components/common/configure/advancedSystemSettings/modals/edit/Edit.vue +4 -4
- package/components/common/configure/advancedSystemSettings/modals/edit/New.vue +42 -23
- package/components/common/configure/advancedSystemSettings/modals/edit/Old.vue +5 -3
- package/components/common/configure/advancedSystemSettings/tableView/TableView.vue +27 -2
- package/components/common/configure/advancedSystemSettings/tableView/{old/field → field}/Field.vue +20 -50
- package/components/common/configure/advancedSystemSettings/tableView/field/New.vue +88 -0
- package/components/common/configure/advancedSystemSettings/tableView/field/Old.vue +73 -0
- package/components/common/configure/advancedSystemSettings/tableView/field/lib/config/index.ts +10 -0
- package/components/common/configure/advancedSystemSettings/tableView/field/lib/models/enums.ts +14 -0
- package/components/common/configure/advancedSystemSettings/tableView/new/New.vue +60 -130
- package/components/common/configure/advancedSystemSettings/tableView/new/lib/config/index.ts +112 -0
- package/components/common/configure/advancedSystemSettings/tableView/old/Old.vue +14 -41
- package/components/common/configure/advancedSystemSettings/tools/New.vue +64 -3
- package/components/common/configure/advancedSystemSettings/tools/Old.vue +2 -2
- package/components/common/configure/advancedSystemSettings/tools/Tools.vue +2 -2
- package/components/common/configure/physicalAdapters/modals/edit/lib/config/config.ts +59 -59
- package/components/common/configure/physicalAdapters/tableView/TableViewNew.vue +353 -345
- package/components/common/diagramMain/modals/viewSettings/viewSettings/ViewSettingsNew.vue +327 -323
- package/components/common/graph/Graph.vue +19 -8
- package/components/common/graph/{graphNew/GraphNew.vue → new/New.vue} +3 -3
- package/components/common/modals/confirmation/Confirmation.vue +1 -0
- package/components/common/monitor/advanced/Advanced.vue +9 -49
- package/components/common/monitor/advanced/graphView/GraphView.vue +8 -12
- package/components/common/monitor/advanced/graphView/{GraphViewNew.vue → New.vue} +1 -1
- package/components/common/monitor/advanced/table/Table.vue +9 -8
- package/components/common/monitor/advanced/table/{tableNew/TableNew.vue → new/New.vue} +6 -5
- package/components/common/monitor/advanced/table/{tableNew → new}/lib/config/options.ts +1 -1
- package/components/common/monitor/advanced/table/{tableOld/TableOld.vue → old/Old.vue} +6 -3
- package/components/common/monitor/advanced/tools/{ToolsNew.vue → New.vue} +4 -0
- package/components/common/monitor/advanced/tools/{ToolsOld.vue → Old.vue} +2 -0
- package/components/common/monitor/advanced/tools/Tools.vue +11 -53
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +9 -13
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/{ActionsNew.vue → New.vue} +6 -3
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +12 -44
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/Table.vue +8 -7
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableNew/TableNew.vue → new/New.vue} +2 -2
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableNew → new}/config/tableData.ts +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableOld/TableOld.vue → old/Old.vue} +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableOld → old}/lib/config/tableConfig.ts +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +9 -36
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/Object.vue +8 -9
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{objectNew/ObjectNew.vue → new/New.vue} +2 -2
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{objectNew → new}/lib/config/tableData.ts +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{objectOld/ObjectOld.vue → old/Old.vue} +1 -2
- package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/Metrics.vue +8 -7
- package/components/common/monitor/advanced/tools/chartOptionsModal/{NotificationNew.vue → notification/New.vue} +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/{Notification.vue → notification/Notification.vue} +8 -6
- package/components/common/monitor/advanced/tools/chartOptionsModal/{NotificationOld.vue → notification/Old.vue} +1 -5
- package/components/common/monitor/overview/OverviewNew.vue +1 -1
- package/components/common/monitor/overview/OverviewOld.vue +1 -1
- package/components/common/monitor/overview/filters/FiltersNew.vue +1 -0
- package/components/common/monitor/overview/filters/FiltersOld.vue +1 -0
- package/components/common/pages/hardwareHealth/historyTestimony/GraphNew.vue +2 -2
- package/lib/models/interfaces.ts +1 -0
- package/package.json +1 -1
- package/components/common/configure/advancedSystemSettings/tableView/new/lib/config/hostTable.ts +0 -308
- package/components/common/configure/advancedSystemSettings/tableView/old/field/lib/models/enums.ts +0 -14
- package/components/common/graph/lib/utils/renderGraph.ts +0 -393
- /package/components/common/graph/{GraphOld.vue → Old.vue} +0 -0
- /package/components/common/graph/{graphNew → new}/EmptyBlock.vue +0 -0
- /package/components/common/graph/{graphNew → new}/lib/models/enums.ts +0 -0
- /package/components/common/monitor/advanced/{AdvancedNew.vue → New.vue} +0 -0
- /package/components/common/monitor/advanced/{AdvancedOld.vue → Old.vue} +0 -0
- /package/components/common/monitor/advanced/graphView/{GraphViewOld.vue → Old.vue} +0 -0
- /package/components/common/monitor/advanced/table/{tableNew → new}/lib/utils/constructBody.ts +0 -0
- /package/components/common/monitor/advanced/table/{tableOld → old}/lib/config/performanceDatatable.ts +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/{ChartOptionsModalNew.vue → New.vue} +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/{ChartOptionsModalOld.vue → Old.vue} +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/actions/{ActionsOld.vue → Old.vue} +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/{CountersNew.vue → New.vue} +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/{CountersOld.vue → Old.vue} +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableNew → new}/config/options.ts +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableNew → new}/utils/constructTable.ts +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableOld → old}/lib/models/types.ts +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/{TimespanNew.vue → New.vue} +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/{TimespanOld.vue → Old.vue} +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{objectNew → new}/lib/config/options.ts +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{objectNew → new}/lib/utils/constructTable.ts +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/{MetricsNew.vue → New.vue} +0 -0
- /package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/{MetricsOld.vue → Old.vue} +0 -0
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
3
|
:is="currentComponent"
|
|
4
|
-
v-model:settings="settings"
|
|
5
|
-
v-model:invalid-fields="invalidFields"
|
|
6
4
|
:data-table="props.data?.items || []"
|
|
7
5
|
:total-items="props.data?.total_items || 0"
|
|
8
6
|
:total-pages="props.data?.total_pages || 1"
|
|
9
7
|
:is-edit="props.isEdit"
|
|
8
|
+
:is-loading="props.isLoading"
|
|
9
|
+
@change-setting="onChangeSetting"
|
|
10
|
+
@update-invalid-fields="onUpdateInvalidFields"
|
|
10
11
|
/>
|
|
11
12
|
</template>
|
|
12
13
|
|
|
13
14
|
<script lang="ts" setup>
|
|
14
15
|
import type { API_UI_I_DataTable } from '~/lib/models/table/interfaces'
|
|
15
16
|
import type { UI_I_AdvancedSystemSetting } from '~/store/inventory/modules/configure/advancedSystemSettings/lib/models/interfaces'
|
|
17
|
+
import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
|
|
18
|
+
import type { UI_I_AdvancedSystemSettingsEditData } from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces'
|
|
16
19
|
|
|
17
20
|
const settings = defineModel<API_UI_I_DataTable<UI_I_AdvancedSystemSetting[]>>(
|
|
18
21
|
'settings',
|
|
@@ -24,6 +27,7 @@ const invalidFields = defineModel<string[]>('invalid-fields', {
|
|
|
24
27
|
const props = withDefaults(
|
|
25
28
|
defineProps<{
|
|
26
29
|
data: API_UI_I_DataTable<UI_I_AdvancedSystemSetting[]>
|
|
30
|
+
isLoading: boolean
|
|
27
31
|
isEdit?: boolean
|
|
28
32
|
}>(),
|
|
29
33
|
{ isEdit: false }
|
|
@@ -37,4 +41,25 @@ const currentComponent = computed(() =>
|
|
|
37
41
|
? defineAsyncComponent(() => import('./new/New.vue'))
|
|
38
42
|
: defineAsyncComponent(() => import('./old/Old.vue'))
|
|
39
43
|
)
|
|
44
|
+
|
|
45
|
+
const onChangeSetting = (
|
|
46
|
+
value: UI_I_AdvancedSystemSettingsEditData['value'],
|
|
47
|
+
key: string
|
|
48
|
+
): void => {
|
|
49
|
+
settings.value.items = settings.value.items.map((item) => {
|
|
50
|
+
if (item.key === key) {
|
|
51
|
+
item.value = value
|
|
52
|
+
}
|
|
53
|
+
return item
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const invalidFieldsLocal = ref<UI_I_ArbitraryObject<string>>({})
|
|
58
|
+
const onUpdateInvalidFields = (value: string, key: string): void => {
|
|
59
|
+
invalidFieldsLocal.value[key] = value
|
|
60
|
+
if (invalidFields.value)
|
|
61
|
+
invalidFields.value = Object.values(invalidFieldsLocal.value).filter(
|
|
62
|
+
(error) => error
|
|
63
|
+
)
|
|
64
|
+
}
|
|
40
65
|
</script>
|
package/components/common/configure/advancedSystemSettings/tableView/{old/field → field}/Field.vue
RENAMED
|
@@ -1,67 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/>
|
|
11
|
-
</div>
|
|
12
|
-
<div v-if="props.data.type === 'string'">
|
|
13
|
-
<input
|
|
14
|
-
v-model="valueLocal"
|
|
15
|
-
type="text"
|
|
16
|
-
:class="{ 'has-error': invalid }"
|
|
17
|
-
@input="onChangeSetting($event)"
|
|
18
|
-
/>
|
|
19
|
-
</div>
|
|
20
|
-
<div v-if="props.data.type === 'boolean'" class="select">
|
|
21
|
-
<select
|
|
22
|
-
v-model="valueLocal"
|
|
23
|
-
@change="onChangeSetting($event)"
|
|
24
|
-
:class="{ 'has-error': invalid }"
|
|
25
|
-
>
|
|
26
|
-
<option value="false">false</option>
|
|
27
|
-
<option value="true">true</option>
|
|
28
|
-
</select>
|
|
29
|
-
</div>
|
|
30
|
-
<!-- <div v-if="props.data.type === 'select'" class="select">-->
|
|
31
|
-
<!-- <select-->
|
|
32
|
-
<!-- v-model="valueLocal"-->
|
|
33
|
-
<!-- @change="onChangeSetting($event)"-->
|
|
34
|
-
<!-- :class="{ 'has-error': invalid }"-->
|
|
35
|
-
<!-- >-->
|
|
36
|
-
<!-- <option-->
|
|
37
|
-
<!-- v-for="item2 in props.data.options"-->
|
|
38
|
-
<!-- :key="item2.key"-->
|
|
39
|
-
<!-- :value="item2.key"-->
|
|
40
|
-
<!-- >-->
|
|
41
|
-
<!-- {{ item2.value }}-->
|
|
42
|
-
<!-- </option>-->
|
|
43
|
-
<!-- </select>-->
|
|
44
|
-
<!-- </div>-->
|
|
45
|
-
</template>
|
|
46
|
-
<template #content>
|
|
47
|
-
{{ errorMessage }}
|
|
48
|
-
</template>
|
|
49
|
-
</atoms-tooltip-error>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
v-model:value="valueLocal"
|
|
5
|
+
:data="props.data"
|
|
6
|
+
:invalid="invalid"
|
|
7
|
+
:error-message="errorMessage"
|
|
8
|
+
@change="onChangeSetting"
|
|
9
|
+
/>
|
|
50
10
|
</template>
|
|
51
11
|
|
|
52
12
|
<script setup lang="ts">
|
|
53
13
|
import type { UI_I_AdvancedSystemSettingsEditData } from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces'
|
|
54
|
-
import {
|
|
14
|
+
import { UI_E_Format } from '~/components/common/configure/advancedSystemSettings/tableView/field/lib/models/enums'
|
|
55
15
|
import { allRegExp } from '~/lib/config/regExp'
|
|
56
16
|
|
|
57
17
|
const props = defineProps<{
|
|
58
18
|
data: UI_I_AdvancedSystemSettingsEditData
|
|
59
19
|
}>()
|
|
20
|
+
|
|
60
21
|
const emits = defineEmits<{
|
|
61
22
|
(event: 'change', value: UI_I_AdvancedSystemSettingsEditData['value']): void
|
|
62
23
|
(event: 'error-message', value: string): void
|
|
63
24
|
}>()
|
|
64
25
|
|
|
26
|
+
const { $store }: any = useNuxtApp()
|
|
27
|
+
|
|
28
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
29
|
+
const currentComponent = computed(() =>
|
|
30
|
+
isNewView.value
|
|
31
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
32
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
33
|
+
)
|
|
34
|
+
|
|
65
35
|
const valueLocal = ref<UI_I_AdvancedSystemSettingsEditData['value']>(
|
|
66
36
|
props.data.value
|
|
67
37
|
)
|
|
@@ -118,7 +88,7 @@ const onChangeSetting = (event: Event): void => {
|
|
|
118
88
|
if (invalid.value) return
|
|
119
89
|
|
|
120
90
|
if (validation.Format) {
|
|
121
|
-
const format =
|
|
91
|
+
const format = UI_E_Format[validation.Format]
|
|
122
92
|
invalid.value = !allRegExp[format].test(value)
|
|
123
93
|
errorMessage.value = invalid.value ? `Value must be ${format}` : ''
|
|
124
94
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="w-full">
|
|
3
|
+
<ui-input
|
|
4
|
+
v-if="props.data.type === 'number'"
|
|
5
|
+
v-model="valueLocal"
|
|
6
|
+
:class="['w-full', { 'has-error': props.invalid }]"
|
|
7
|
+
:test-id="`advanced-system-settings-${props.data.key}`"
|
|
8
|
+
:error="props.errorMessage"
|
|
9
|
+
error-type="tooltip"
|
|
10
|
+
type="number"
|
|
11
|
+
size="sm"
|
|
12
|
+
@input="emits('change', $event)"
|
|
13
|
+
/>
|
|
14
|
+
<ui-input
|
|
15
|
+
v-if="props.data.type === 'string'"
|
|
16
|
+
v-model="valueLocal"
|
|
17
|
+
:class="['w-full', { 'has-error': props.invalid }]"
|
|
18
|
+
:test-id="`advanced-system-settings-${props.data.key}`"
|
|
19
|
+
type="text"
|
|
20
|
+
size="sm"
|
|
21
|
+
@input="emits('change', $event)"
|
|
22
|
+
/>
|
|
23
|
+
<ui-select
|
|
24
|
+
v-if="props.data.type === 'boolean'"
|
|
25
|
+
v-model="currentSelectValue"
|
|
26
|
+
:items="selectItems"
|
|
27
|
+
:test-id="`advanced-system-settings-${props.data.key}`"
|
|
28
|
+
select-width="100%"
|
|
29
|
+
size="sm"
|
|
30
|
+
@input="emits('change', $event)"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<!-- <div v-if="props.data.type === 'select'" class="select">-->
|
|
35
|
+
<!-- <select-->
|
|
36
|
+
<!-- v-model="valueLocal"-->
|
|
37
|
+
<!-- @change="onChangeSetting($event)"-->
|
|
38
|
+
<!-- :class="{ 'has-error': invalid }"-->
|
|
39
|
+
<!-- >-->
|
|
40
|
+
<!-- <option-->
|
|
41
|
+
<!-- v-for="item2 in props.data.options"-->
|
|
42
|
+
<!-- :key="item2.key"-->
|
|
43
|
+
<!-- :value="item2.key"-->
|
|
44
|
+
<!-- >-->
|
|
45
|
+
<!-- {{ item2.value }}-->
|
|
46
|
+
<!-- </option>-->
|
|
47
|
+
<!-- </select>-->
|
|
48
|
+
<!-- </div>-->
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup lang="ts">
|
|
52
|
+
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
53
|
+
import type { UI_I_AdvancedSystemSettingsEditData } from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces'
|
|
54
|
+
import { selectOptions } from '~/components/common/configure/advancedSystemSettings/tableView/field/lib/config'
|
|
55
|
+
|
|
56
|
+
const valueLocal = defineModel<any>('value', {
|
|
57
|
+
required: true,
|
|
58
|
+
})
|
|
59
|
+
const props = defineProps<{
|
|
60
|
+
data: UI_I_AdvancedSystemSettingsEditData
|
|
61
|
+
invalid: boolean
|
|
62
|
+
errorMessage: string
|
|
63
|
+
}>()
|
|
64
|
+
|
|
65
|
+
const emits = defineEmits<{
|
|
66
|
+
(event: 'change', value: UI_I_AdvancedSystemSettingsEditData['value']): void
|
|
67
|
+
}>()
|
|
68
|
+
|
|
69
|
+
const currentSelectValue = computed<number[] | null>({
|
|
70
|
+
get() {
|
|
71
|
+
return {
|
|
72
|
+
text: String(valueLocal.value),
|
|
73
|
+
value: String(valueLocal.value),
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
set(newValue: UI_I_Dropdown) {
|
|
77
|
+
valueLocal.value = newValue.value.toLowerCase() === 'true'
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const selectItems = ref<UI_I_Dropdown[]>(selectOptions)
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<style scoped lang="scss">
|
|
85
|
+
.has-error {
|
|
86
|
+
border: 1px solid #db2100;
|
|
87
|
+
}
|
|
88
|
+
</style>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<atoms-tooltip-error :has-error="props.invalid">
|
|
3
|
+
<template #elem>
|
|
4
|
+
<div v-if="props.data.type === 'number'">
|
|
5
|
+
<input
|
|
6
|
+
v-model="valueLocal"
|
|
7
|
+
type="number"
|
|
8
|
+
:class="{ 'has-error': props.invalid }"
|
|
9
|
+
@input="emits('change', $event)"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
<div v-if="props.data.type === 'string'">
|
|
13
|
+
<input
|
|
14
|
+
v-model="valueLocal"
|
|
15
|
+
type="text"
|
|
16
|
+
:class="{ 'has-error': props.invalid }"
|
|
17
|
+
@input="emits('change', $event)"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
<div v-if="props.data.type === 'boolean'" class="select">
|
|
21
|
+
<select
|
|
22
|
+
v-model="valueLocal"
|
|
23
|
+
:class="{ 'has-error': props.invalid }"
|
|
24
|
+
@input="emits('change', $event)"
|
|
25
|
+
>
|
|
26
|
+
<option value="false">false</option>
|
|
27
|
+
<option value="true">true</option>
|
|
28
|
+
</select>
|
|
29
|
+
</div>
|
|
30
|
+
<!-- <div v-if="props.data.type === 'select'" class="select">-->
|
|
31
|
+
<!-- <select-->
|
|
32
|
+
<!-- v-model="valueLocal"-->
|
|
33
|
+
<!-- @change="onChangeSetting($event)"-->
|
|
34
|
+
<!-- :class="{ 'has-error': invalid }"-->
|
|
35
|
+
<!-- >-->
|
|
36
|
+
<!-- <option-->
|
|
37
|
+
<!-- v-for="item2 in props.data.options"-->
|
|
38
|
+
<!-- :key="item2.key"-->
|
|
39
|
+
<!-- :value="item2.key"-->
|
|
40
|
+
<!-- >-->
|
|
41
|
+
<!-- {{ item2.value }}-->
|
|
42
|
+
<!-- </option>-->
|
|
43
|
+
<!-- </select>-->
|
|
44
|
+
<!-- </div>-->
|
|
45
|
+
</template>
|
|
46
|
+
<template #content>
|
|
47
|
+
{{ props.errorMessage }}
|
|
48
|
+
</template>
|
|
49
|
+
</atoms-tooltip-error>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script setup lang="ts">
|
|
53
|
+
import type { UI_I_AdvancedSystemSettingsEditData } from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces'
|
|
54
|
+
|
|
55
|
+
const valueLocal = defineModel<any>('value', {
|
|
56
|
+
required: true,
|
|
57
|
+
})
|
|
58
|
+
const props = defineProps<{
|
|
59
|
+
data: UI_I_AdvancedSystemSettingsEditData
|
|
60
|
+
invalid: boolean
|
|
61
|
+
errorMessage: string
|
|
62
|
+
}>()
|
|
63
|
+
|
|
64
|
+
const emits = defineEmits<{
|
|
65
|
+
(event: 'change', value: UI_I_AdvancedSystemSettingsEditData['value']): void
|
|
66
|
+
}>()
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style scoped lang="scss">
|
|
70
|
+
.has-error {
|
|
71
|
+
border: 1px solid #db2100;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
package/components/common/configure/advancedSystemSettings/tableView/field/lib/models/enums.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export enum UI_E_Format {
|
|
2
|
+
'unix path' = 'unixPath',
|
|
3
|
+
'win path' = 'winPath',
|
|
4
|
+
'mac' = 'mac',
|
|
5
|
+
'ip4' = 'ip4',
|
|
6
|
+
'ip6' = 'ip6',
|
|
7
|
+
'url' = 'url',
|
|
8
|
+
'uuid' = 'uuid',
|
|
9
|
+
'semver' = 'semver',
|
|
10
|
+
'domain' = 'domain',
|
|
11
|
+
'base64' = 'base64',
|
|
12
|
+
'regex' = 'regex',
|
|
13
|
+
'hex color' = 'hexColor',
|
|
14
|
+
}
|
|
@@ -1,72 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
v-if="item.data"
|
|
28
|
-
:style="`width: ${item.data}%`"
|
|
29
|
-
class="progress-line-fill"
|
|
30
|
-
></div>
|
|
31
|
-
</div>
|
|
32
|
-
<div
|
|
33
|
-
:class="[
|
|
34
|
-
'progress-text',
|
|
35
|
-
{
|
|
36
|
-
'progress-full': item.data === 100,
|
|
37
|
-
},
|
|
38
|
-
]"
|
|
39
|
-
>
|
|
40
|
-
{{ item.text }}
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<template #status="{ item }">
|
|
46
|
-
<ui-chip
|
|
47
|
-
:test-id="item.data.testId"
|
|
48
|
-
:color="item.data.chipColor"
|
|
49
|
-
size="sm"
|
|
50
|
-
rounded
|
|
51
|
-
>
|
|
52
|
-
<ui-icon
|
|
53
|
-
:name="item.data.icon"
|
|
54
|
-
width="14px"
|
|
55
|
-
height="14px"
|
|
56
|
-
class="chip-icon"
|
|
57
|
-
></ui-icon>
|
|
58
|
-
{{ item.text }}
|
|
59
|
-
</ui-chip>
|
|
60
|
-
</template>
|
|
61
|
-
|
|
62
|
-
<template #skeleton-header>
|
|
63
|
-
<div class="flex justify-between items-center">
|
|
64
|
-
<ui-skeleton-item width="80" height="20" />
|
|
65
|
-
<ui-skeleton-item width="88" height="28" border-radius="6" />
|
|
66
|
-
</div>
|
|
67
|
-
</template>
|
|
68
|
-
</ui-data-table>
|
|
69
|
-
</div>
|
|
2
|
+
<ui-data-table
|
|
3
|
+
:data="data"
|
|
4
|
+
:options="options"
|
|
5
|
+
:total-pages="props.totalPages"
|
|
6
|
+
:total-items="props.totalItems"
|
|
7
|
+
:texts="texts"
|
|
8
|
+
:skeleton="tableSkeleton"
|
|
9
|
+
:loading="props.isLoading"
|
|
10
|
+
:size="tableSize"
|
|
11
|
+
test-id="advanced-system-settings-table"
|
|
12
|
+
>
|
|
13
|
+
<template #value="{ item }">
|
|
14
|
+
<common-configure-advanced-system-settings-table-view-field
|
|
15
|
+
:data="item.data"
|
|
16
|
+
@change="emits('change-setting', $event, item.data.key)"
|
|
17
|
+
@error-message="emits('update-invalid-fields', $event, item.data.key)"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
20
|
+
<template v-if="props.isEdit" #footerActions>
|
|
21
|
+
<p class="table-items-count-text">
|
|
22
|
+
{{ tableBodyItems.length }}
|
|
23
|
+
{{ localization.advancedSystemSettings.keysCountText }}
|
|
24
|
+
</p>
|
|
25
|
+
</template>
|
|
26
|
+
</ui-data-table>
|
|
70
27
|
</template>
|
|
71
28
|
|
|
72
29
|
<script lang="ts" setup>
|
|
@@ -76,22 +33,34 @@ import type {
|
|
|
76
33
|
UI_I_DataTableHeader,
|
|
77
34
|
UI_I_DataTableBody,
|
|
78
35
|
UI_I_TableTexts,
|
|
36
|
+
UI_I_DataTableSkeleton,
|
|
37
|
+
UI_I_DataTableOptions,
|
|
79
38
|
} from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
|
|
80
|
-
import type {
|
|
39
|
+
import type { UI_I_AdvancedSystemSetting } from '~/store/inventory/modules/configure/advancedSystemSettings/lib/models/interfaces'
|
|
40
|
+
import type { UI_I_AdvancedSystemSettingsEditData } from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces'
|
|
81
41
|
import {
|
|
82
|
-
|
|
42
|
+
optionsFunc,
|
|
83
43
|
getHeaderDataFunc,
|
|
84
44
|
getBodyDataFunc,
|
|
85
|
-
} from '~/components/common/
|
|
45
|
+
} from '~/components/common/configure/advancedSystemSettings/tableView/new/lib/config'
|
|
86
46
|
|
|
87
|
-
const selectedDataLocal = defineModel<number | null>({ required: true })
|
|
88
47
|
const props = defineProps<{
|
|
89
|
-
dataTable:
|
|
48
|
+
dataTable: UI_I_AdvancedSystemSetting[]
|
|
90
49
|
totalItems: number
|
|
91
50
|
totalPages: number
|
|
51
|
+
isLoading: boolean
|
|
92
52
|
isEdit: boolean
|
|
93
53
|
}>()
|
|
94
54
|
|
|
55
|
+
const emits = defineEmits<{
|
|
56
|
+
(
|
|
57
|
+
event: 'change-setting',
|
|
58
|
+
value1: UI_I_AdvancedSystemSettingsEditData['value'],
|
|
59
|
+
value2: string
|
|
60
|
+
): void
|
|
61
|
+
(event: 'update-invalid-fields', value1: string, value2: string): void
|
|
62
|
+
}>()
|
|
63
|
+
|
|
95
64
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
96
65
|
|
|
97
66
|
const texts = computed<UI_I_TableTexts>(() => ({
|
|
@@ -110,84 +79,45 @@ const texts = computed<UI_I_TableTexts>(() => ({
|
|
|
110
79
|
}))
|
|
111
80
|
|
|
112
81
|
const tableSkeleton = ref<UI_I_DataTableSkeleton>({
|
|
113
|
-
columnsCount:
|
|
82
|
+
columnsCount: 3,
|
|
114
83
|
headColumns: [],
|
|
115
84
|
bodyColumns: [],
|
|
116
85
|
withoutPagination: true,
|
|
117
86
|
})
|
|
118
87
|
|
|
119
88
|
const data = computed<UI_I_DataTable>(() => ({
|
|
120
|
-
id: '
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
body: deviceBodyItems.value,
|
|
89
|
+
id: 'advanced-system-settings-table',
|
|
90
|
+
header: tableHeadItems.value,
|
|
91
|
+
body: tableBodyItems.value,
|
|
124
92
|
}))
|
|
125
93
|
|
|
126
|
-
const
|
|
127
|
-
|
|
94
|
+
const tableSize = computed<string>(() => (props.isEdit ? 'sm' : 'md'))
|
|
95
|
+
|
|
96
|
+
const options = computed<UI_I_DataTableOptions>(() => optionsFunc(props.isEdit))
|
|
97
|
+
|
|
98
|
+
const tableHeadItems = computed<UI_I_DataTableHeader[]>(() =>
|
|
99
|
+
getHeaderDataFunc(localization.value, props.isEdit)
|
|
128
100
|
)
|
|
129
101
|
|
|
130
|
-
const
|
|
102
|
+
const tableBodyItems = ref<UI_I_DataTableBody[]>([])
|
|
131
103
|
watch(
|
|
132
104
|
() => props.dataTable,
|
|
133
|
-
(newValue:
|
|
105
|
+
(newValue: UI_I_AdvancedSystemSetting[]) => {
|
|
134
106
|
if (!newValue?.length) {
|
|
135
|
-
|
|
107
|
+
tableBodyItems.value = []
|
|
136
108
|
return
|
|
137
109
|
}
|
|
138
110
|
|
|
139
|
-
|
|
111
|
+
tableBodyItems.value = getBodyDataFunc(newValue, props.isEdit)
|
|
140
112
|
},
|
|
141
113
|
{ deep: true, immediate: true }
|
|
142
114
|
)
|
|
143
|
-
|
|
144
|
-
const onSelectRow = (value: UI_I_DataTableBody[]): void => {
|
|
145
|
-
selectedDataLocal.value = value?.[0].row
|
|
146
|
-
}
|
|
147
115
|
</script>
|
|
148
116
|
|
|
149
117
|
<style lang="scss" scoped>
|
|
150
|
-
.
|
|
151
|
-
margin:
|
|
152
|
-
:
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
:deep(.table-title .title-container h6) {
|
|
156
|
-
font-size: 12px;
|
|
157
|
-
}
|
|
158
|
-
.device-table {
|
|
159
|
-
&__icon {
|
|
160
|
-
margin-right: 4px;
|
|
161
|
-
}
|
|
162
|
-
&__text {
|
|
163
|
-
font-size: 12px;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
.progress {
|
|
167
|
-
&-line {
|
|
168
|
-
height: 12px;
|
|
169
|
-
width: 100%;
|
|
170
|
-
background: #e9ebed8f;
|
|
171
|
-
border-radius: 6px;
|
|
172
|
-
|
|
173
|
-
&-fill {
|
|
174
|
-
height: 12px;
|
|
175
|
-
min-width: 12px;
|
|
176
|
-
background: #008fd6;
|
|
177
|
-
border-radius: 6px;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
&-text {
|
|
182
|
-
width: 53px;
|
|
183
|
-
min-width: 53px;
|
|
184
|
-
margin-left: 8px;
|
|
185
|
-
text-align: right;
|
|
186
|
-
|
|
187
|
-
&.progress-full {
|
|
188
|
-
color: #ea3223;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
118
|
+
.table-items-count-text {
|
|
119
|
+
margin-left: auto;
|
|
120
|
+
font-size: 12px;
|
|
121
|
+
color: #9da6ad;
|
|
192
122
|
}
|
|
193
123
|
</style>
|