bfg-common 1.5.812 → 1.5.813
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/CODE_STYLE.md +109 -109
- package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
- package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
- package/assets/img/icons/icons-sprite-light-3.svg +227 -227
- package/assets/img/icons/icons-sprite-light-5.svg +488 -488
- package/components/atoms/TheIcon3.vue +50 -50
- package/components/atoms/collapse/CollapseNav.vue +170 -170
- package/components/atoms/perPage/PerPage.vue +58 -58
- package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
- package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
- package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
- package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
- package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
- package/components/common/configure/advancedSystemSettings/AdvancedSystemSettings.vue +47 -47
- package/components/common/configure/advancedSystemSettings/modals/edit/Edit.vue +78 -78
- package/components/common/configure/advancedSystemSettings/modals/edit/New.vue +56 -56
- package/components/common/configure/advancedSystemSettings/modals/edit/Old.vue +66 -66
- package/components/common/configure/advancedSystemSettings/tableView/TableView.vue +40 -40
- package/components/common/configure/advancedSystemSettings/tableView/old/Old.vue +122 -122
- package/components/common/configure/advancedSystemSettings/tableView/old/field/Field.vue +139 -139
- package/components/common/configure/advancedSystemSettings/tableView/old/field/lib/models/enums.ts +13 -13
- package/components/common/configure/advancedSystemSettings/tableView/old/lib/config/table.ts +131 -131
- package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
- package/components/common/diagramMain/port/Port.vue +580 -580
- package/components/common/layout/theHeader/userMenu/UserMenu.vue +116 -116
- package/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types.ts +7 -7
- package/components/common/layout/topNotification/TopNotification.vue +37 -37
- package/components/common/layout/topNotification/lib/models/enums.ts +3 -3
- package/components/common/pages/backups/DetailView.vue +52 -52
- package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
- package/components/common/pages/backups/modals/Modals.vue +243 -243
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
- package/components/common/pages/backups/modals/restore/disks/tableView/old/Table.vue +117 -117
- package/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions.ts +96 -96
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +134 -134
- package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
- package/components/common/pages/home/lib/models/interfaces.ts +48 -48
- package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
- package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
- package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
- package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
- package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
- package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
- package/components/common/select/radio/RadioGroup.vue +137 -137
- package/components/common/spiceConsole/Drawer.vue +420 -420
- package/components/common/spiceConsole/SpiceConsole.vue +184 -184
- package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
- package/components/common/tools/Actions.vue +207 -207
- package/components/common/treeView/TreeView.vue +52 -52
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +283 -283
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/New.vue +340 -340
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +511 -502
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/Old.vue +279 -279
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/vmStoragePolicy/New.vue +53 -53
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/vmStoragePolicy/Old.vue +45 -45
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/vmStoragePolicy/VmStoragePolicy.vue +31 -31
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/vmStoragePolicy/lib/config/options.ts +12 -12
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +156 -156
- package/components/common/vm/actions/common/lib/models/interfaces.ts +192 -192
- package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
- package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/options/Options.vue +58 -58
- package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
- package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
- package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
- package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
- package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
- package/components/common/wizards/common/steps/name/Old.vue +121 -121
- package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
- package/components/common/wizards/common/steps/name/location/New.vue +40 -40
- package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
- package/components/common/wizards/network/add/steps/portProperties/PortProperties.vue +192 -192
- package/composables/useAppVersion.ts +21 -21
- package/composables/useLocal.ts +6 -6
- package/composables/useLocalCommon.ts +39 -39
- package/lib/config/regExp.ts +53 -53
- package/package.json +1 -1
- package/plugins/console.ts +21 -21
- package/plugins/helpers.ts +34 -34
- package/plugins/mouse.ts +21 -21
- package/plugins/panelStates.ts +70 -70
- package/plugins/text.ts +59 -59
- package/public/spice-console/application/clientgui.js +854 -854
- package/public/spice-console/application/packetfactory.js +211 -211
- package/public/spice-console/application/virtualmouse.js +147 -147
- package/public/spice-console/lib/images/bitmap.js +203 -203
- package/public/spice-console/network/spicechannel.js +440 -440
- package/public/spice-console/process/cursorprocess.js +128 -128
- package/public/spice-console/process/inputprocess.js +227 -227
- package/public/spice-console/process/mainprocess.js +212 -212
- package/public/spice-console/run.js +210 -210
- package/store/inventory/modules/configure/advancedSystemSettings/actions.ts +92 -92
- package/store/inventory/modules/configure/advancedSystemSettings/getters.ts +17 -17
- package/store/inventory/modules/configure/advancedSystemSettings/lib/models/interfaces.ts +45 -45
- package/store/inventory/modules/configure/advancedSystemSettings/lib/models/types.ts +30 -30
- package/store/inventory/modules/configure/advancedSystemSettings/mappers/mapSettings.ts +50 -50
- package/store/main/actions.ts +28 -28
- package/store/main/getters.ts +14 -14
- package/store/main/lib/interfaces.ts +18 -18
- package/store/main/mutations.ts +28 -28
- package/store/main/state.ts +9 -9
- package/store/tasks/mappers/recentTasks.ts +123 -123
- package/store/tasks/mutations.ts +82 -82
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="data-table-view">
|
|
3
|
-
<atoms-table-data-grid
|
|
4
|
-
v-model:column-keys="columnKeys"
|
|
5
|
-
v-model:page-size="paginationLocal.pageSize"
|
|
6
|
-
v-model:page="paginationLocal.page"
|
|
7
|
-
:head-items="headItems"
|
|
8
|
-
:body-items="bodyItems"
|
|
9
|
-
:total-items="props.totalItems"
|
|
10
|
-
:total-pages="props.totalPages"
|
|
11
|
-
class="data-table"
|
|
12
|
-
test-id="any-table"
|
|
13
|
-
server-off
|
|
14
|
-
>
|
|
15
|
-
<template #value="{ item }">
|
|
16
|
-
<common-configure-advanced-system-settings-table-view-old-field
|
|
17
|
-
:data="item.data"
|
|
18
|
-
@change="onChangeSetting($event, item.data.key)"
|
|
19
|
-
@error-message="onUpdateInvalidFields($event, item.data.key)"
|
|
20
|
-
/>
|
|
21
|
-
</template>
|
|
22
|
-
</atoms-table-data-grid>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script lang="ts" setup>
|
|
27
|
-
import type {
|
|
28
|
-
UI_I_ColumnKey,
|
|
29
|
-
UI_I_HeadItem,
|
|
30
|
-
UI_I_BodyItem,
|
|
31
|
-
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
32
|
-
import type {
|
|
33
|
-
UI_I_ArbitraryObject,
|
|
34
|
-
UI_I_Localization,
|
|
35
|
-
} from '~/lib/models/interfaces'
|
|
36
|
-
import type {
|
|
37
|
-
API_UI_I_DataTable,
|
|
38
|
-
UI_I_Pagination,
|
|
39
|
-
} from '~/lib/models/table/interfaces'
|
|
40
|
-
import type { UI_I_AdvancedSystemSetting } from '~/store/inventory/modules/configure/advancedSystemSettings/lib/models/interfaces'
|
|
41
|
-
import type { UI_I_AdvancedSystemSettingsEditData } from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces'
|
|
42
|
-
import * as table from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/config/table'
|
|
43
|
-
|
|
44
|
-
const settings = defineModel<API_UI_I_DataTable<UI_I_AdvancedSystemSetting[]>>(
|
|
45
|
-
'settings',
|
|
46
|
-
{ required: true }
|
|
47
|
-
)
|
|
48
|
-
const invalidFields = defineModel<string[]>('invalid-fields', {
|
|
49
|
-
required: false,
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
const props = defineProps<{
|
|
53
|
-
dataTable: UI_I_AdvancedSystemSetting[]
|
|
54
|
-
totalItems: number
|
|
55
|
-
totalPages: number
|
|
56
|
-
isEdit: boolean
|
|
57
|
-
}>()
|
|
58
|
-
|
|
59
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
60
|
-
|
|
61
|
-
const onChangeSetting = (
|
|
62
|
-
value: UI_I_AdvancedSystemSettingsEditData['value'],
|
|
63
|
-
key: string
|
|
64
|
-
): void => {
|
|
65
|
-
settings.value.items = settings.value.items.map((item) => {
|
|
66
|
-
if (item.key === key) {
|
|
67
|
-
item.value = value
|
|
68
|
-
}
|
|
69
|
-
return item
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const invalidFieldsLocal = ref<UI_I_ArbitraryObject<string>>({})
|
|
74
|
-
const onUpdateInvalidFields = (value: string, key: string): void => {
|
|
75
|
-
invalidFieldsLocal.value[key] = value
|
|
76
|
-
if (invalidFields.value)
|
|
77
|
-
invalidFields.value = Object.values(invalidFieldsLocal.value).filter(
|
|
78
|
-
(error) => error
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const paginationLocal = ref<UI_I_Pagination>({
|
|
83
|
-
page: 1,
|
|
84
|
-
pageSize: 100,
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
88
|
-
table.headItems(localization.value, props.isEdit)
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
const columnKeys = computed<UI_I_ColumnKey[]>(() =>
|
|
92
|
-
table.columnKeys(localization.value, props.isEdit)
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
const bodyItems = ref<UI_I_BodyItem[][]>([])
|
|
96
|
-
watch(
|
|
97
|
-
() => props.dataTable,
|
|
98
|
-
(newValue) => {
|
|
99
|
-
bodyItems.value = table.bodyItems(newValue, props.isEdit)
|
|
100
|
-
},
|
|
101
|
-
{ deep: true, immediate: true }
|
|
102
|
-
)
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<style lang="scss" scoped>
|
|
106
|
-
@import 'assets/scss/common/mixins.scss';
|
|
107
|
-
.data-table-view {
|
|
108
|
-
@include flex($dir: column);
|
|
109
|
-
overflow: hidden;
|
|
110
|
-
height: inherit;
|
|
111
|
-
max-height: 250px;
|
|
112
|
-
.data-table {
|
|
113
|
-
@include flex($dir: column);
|
|
114
|
-
flex-direction: column;
|
|
115
|
-
overflow: hidden;
|
|
116
|
-
height: inherit;
|
|
117
|
-
:deep(.datagrid-outer-wrapper) {
|
|
118
|
-
height: inherit;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="data-table-view">
|
|
3
|
+
<atoms-table-data-grid
|
|
4
|
+
v-model:column-keys="columnKeys"
|
|
5
|
+
v-model:page-size="paginationLocal.pageSize"
|
|
6
|
+
v-model:page="paginationLocal.page"
|
|
7
|
+
:head-items="headItems"
|
|
8
|
+
:body-items="bodyItems"
|
|
9
|
+
:total-items="props.totalItems"
|
|
10
|
+
:total-pages="props.totalPages"
|
|
11
|
+
class="data-table"
|
|
12
|
+
test-id="any-table"
|
|
13
|
+
server-off
|
|
14
|
+
>
|
|
15
|
+
<template #value="{ item }">
|
|
16
|
+
<common-configure-advanced-system-settings-table-view-old-field
|
|
17
|
+
:data="item.data"
|
|
18
|
+
@change="onChangeSetting($event, item.data.key)"
|
|
19
|
+
@error-message="onUpdateInvalidFields($event, item.data.key)"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
</atoms-table-data-grid>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script lang="ts" setup>
|
|
27
|
+
import type {
|
|
28
|
+
UI_I_ColumnKey,
|
|
29
|
+
UI_I_HeadItem,
|
|
30
|
+
UI_I_BodyItem,
|
|
31
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
32
|
+
import type {
|
|
33
|
+
UI_I_ArbitraryObject,
|
|
34
|
+
UI_I_Localization,
|
|
35
|
+
} from '~/lib/models/interfaces'
|
|
36
|
+
import type {
|
|
37
|
+
API_UI_I_DataTable,
|
|
38
|
+
UI_I_Pagination,
|
|
39
|
+
} from '~/lib/models/table/interfaces'
|
|
40
|
+
import type { UI_I_AdvancedSystemSetting } from '~/store/inventory/modules/configure/advancedSystemSettings/lib/models/interfaces'
|
|
41
|
+
import type { UI_I_AdvancedSystemSettingsEditData } from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces'
|
|
42
|
+
import * as table from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/config/table'
|
|
43
|
+
|
|
44
|
+
const settings = defineModel<API_UI_I_DataTable<UI_I_AdvancedSystemSetting[]>>(
|
|
45
|
+
'settings',
|
|
46
|
+
{ required: true }
|
|
47
|
+
)
|
|
48
|
+
const invalidFields = defineModel<string[]>('invalid-fields', {
|
|
49
|
+
required: false,
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
const props = defineProps<{
|
|
53
|
+
dataTable: UI_I_AdvancedSystemSetting[]
|
|
54
|
+
totalItems: number
|
|
55
|
+
totalPages: number
|
|
56
|
+
isEdit: boolean
|
|
57
|
+
}>()
|
|
58
|
+
|
|
59
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
60
|
+
|
|
61
|
+
const onChangeSetting = (
|
|
62
|
+
value: UI_I_AdvancedSystemSettingsEditData['value'],
|
|
63
|
+
key: string
|
|
64
|
+
): void => {
|
|
65
|
+
settings.value.items = settings.value.items.map((item) => {
|
|
66
|
+
if (item.key === key) {
|
|
67
|
+
item.value = value
|
|
68
|
+
}
|
|
69
|
+
return item
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const invalidFieldsLocal = ref<UI_I_ArbitraryObject<string>>({})
|
|
74
|
+
const onUpdateInvalidFields = (value: string, key: string): void => {
|
|
75
|
+
invalidFieldsLocal.value[key] = value
|
|
76
|
+
if (invalidFields.value)
|
|
77
|
+
invalidFields.value = Object.values(invalidFieldsLocal.value).filter(
|
|
78
|
+
(error) => error
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const paginationLocal = ref<UI_I_Pagination>({
|
|
83
|
+
page: 1,
|
|
84
|
+
pageSize: 100,
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
88
|
+
table.headItems(localization.value, props.isEdit)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
const columnKeys = computed<UI_I_ColumnKey[]>(() =>
|
|
92
|
+
table.columnKeys(localization.value, props.isEdit)
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
const bodyItems = ref<UI_I_BodyItem[][]>([])
|
|
96
|
+
watch(
|
|
97
|
+
() => props.dataTable,
|
|
98
|
+
(newValue) => {
|
|
99
|
+
bodyItems.value = table.bodyItems(newValue, props.isEdit)
|
|
100
|
+
},
|
|
101
|
+
{ deep: true, immediate: true }
|
|
102
|
+
)
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style lang="scss" scoped>
|
|
106
|
+
@import 'assets/scss/common/mixins.scss';
|
|
107
|
+
.data-table-view {
|
|
108
|
+
@include flex($dir: column);
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
height: inherit;
|
|
111
|
+
max-height: 250px;
|
|
112
|
+
.data-table {
|
|
113
|
+
@include flex($dir: column);
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
height: inherit;
|
|
117
|
+
:deep(.datagrid-outer-wrapper) {
|
|
118
|
+
height: inherit;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
</style>
|
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<atoms-tooltip-error :has-error="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': invalid }"
|
|
9
|
-
@input="onChangeSetting($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': 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>
|
|
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
|
-
import { E_Format } from '~/components/common/configure/advancedSystemSettings/tableView/old/field/lib/models/enums'
|
|
55
|
-
import { allRegExp } from '~/lib/config/regExp'
|
|
56
|
-
|
|
57
|
-
const props = defineProps<{
|
|
58
|
-
data: UI_I_AdvancedSystemSettingsEditData
|
|
59
|
-
}>()
|
|
60
|
-
const emits = defineEmits<{
|
|
61
|
-
(event: 'change', value: UI_I_AdvancedSystemSettingsEditData['value']): void
|
|
62
|
-
(event: 'error-message', value: string): void
|
|
63
|
-
}>()
|
|
64
|
-
|
|
65
|
-
const valueLocal = ref<UI_I_AdvancedSystemSettingsEditData['value']>(
|
|
66
|
-
props.data.value
|
|
67
|
-
)
|
|
68
|
-
watch(valueLocal, (newValue, oldValue) => {
|
|
69
|
-
// Обработка для firefox
|
|
70
|
-
if (props.data.type === 'number' && typeof newValue === 'string') {
|
|
71
|
-
valueLocal.value = oldValue
|
|
72
|
-
}
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
const invalid = ref<boolean>(false)
|
|
76
|
-
const errorMessage = ref<string>('')
|
|
77
|
-
|
|
78
|
-
const onChangeSetting = (event: Event): void => {
|
|
79
|
-
invalid.value = false
|
|
80
|
-
errorMessage.value = ''
|
|
81
|
-
|
|
82
|
-
const target = event.target as HTMLInputElement
|
|
83
|
-
let value: UI_I_AdvancedSystemSettingsEditData['value'] = target.value
|
|
84
|
-
if (props.data.type === 'boolean') value = value === 'true'
|
|
85
|
-
if (props.data.type === 'number') value = +value
|
|
86
|
-
|
|
87
|
-
const { validation } = props.data
|
|
88
|
-
if (Object.hasOwn(validation, 'equal')) {
|
|
89
|
-
invalid.value = !validation.equal.includes(value)
|
|
90
|
-
errorMessage.value = invalid.value
|
|
91
|
-
? `Value must be equal ${validation.equal.join(', ')}`
|
|
92
|
-
: ''
|
|
93
|
-
}
|
|
94
|
-
if (invalid.value) return
|
|
95
|
-
|
|
96
|
-
if (Object.hasOwn(validation, 'notEqual')) {
|
|
97
|
-
invalid.value = validation.notEqual.includes(value)
|
|
98
|
-
errorMessage.value = invalid.value
|
|
99
|
-
? `Value must not be equal ${validation.notEqual.join(', ')}`
|
|
100
|
-
: ''
|
|
101
|
-
}
|
|
102
|
-
if (invalid.value) return
|
|
103
|
-
|
|
104
|
-
if (Object.hasOwn(validation, 'min')) {
|
|
105
|
-
invalid.value = value < validation.min
|
|
106
|
-
errorMessage.value = invalid.value
|
|
107
|
-
? `Value must be more then ${validation.min}`
|
|
108
|
-
: ''
|
|
109
|
-
}
|
|
110
|
-
if (invalid.value) return
|
|
111
|
-
|
|
112
|
-
if (Object.hasOwn(validation, 'max')) {
|
|
113
|
-
invalid.value = value > validation.max
|
|
114
|
-
errorMessage.value = invalid.value
|
|
115
|
-
? `Value must be less then ${validation.max}`
|
|
116
|
-
: ''
|
|
117
|
-
}
|
|
118
|
-
if (invalid.value) return
|
|
119
|
-
|
|
120
|
-
if (validation.Format) {
|
|
121
|
-
const format = E_Format[validation.Format]
|
|
122
|
-
invalid.value = !allRegExp[format].test(value)
|
|
123
|
-
errorMessage.value = invalid.value ? `Value must be ${format}` : ''
|
|
124
|
-
}
|
|
125
|
-
if (invalid.value) return
|
|
126
|
-
|
|
127
|
-
emits('change', value)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
watch(errorMessage, (newValue) => {
|
|
131
|
-
emits('error-message', newValue)
|
|
132
|
-
})
|
|
133
|
-
</script>
|
|
134
|
-
|
|
135
|
-
<style scoped lang="scss">
|
|
136
|
-
.has-error {
|
|
137
|
-
border: 1px solid #db2100;
|
|
138
|
-
}
|
|
139
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<atoms-tooltip-error :has-error="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': invalid }"
|
|
9
|
+
@input="onChangeSetting($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': 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>
|
|
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
|
+
import { E_Format } from '~/components/common/configure/advancedSystemSettings/tableView/old/field/lib/models/enums'
|
|
55
|
+
import { allRegExp } from '~/lib/config/regExp'
|
|
56
|
+
|
|
57
|
+
const props = defineProps<{
|
|
58
|
+
data: UI_I_AdvancedSystemSettingsEditData
|
|
59
|
+
}>()
|
|
60
|
+
const emits = defineEmits<{
|
|
61
|
+
(event: 'change', value: UI_I_AdvancedSystemSettingsEditData['value']): void
|
|
62
|
+
(event: 'error-message', value: string): void
|
|
63
|
+
}>()
|
|
64
|
+
|
|
65
|
+
const valueLocal = ref<UI_I_AdvancedSystemSettingsEditData['value']>(
|
|
66
|
+
props.data.value
|
|
67
|
+
)
|
|
68
|
+
watch(valueLocal, (newValue, oldValue) => {
|
|
69
|
+
// Обработка для firefox
|
|
70
|
+
if (props.data.type === 'number' && typeof newValue === 'string') {
|
|
71
|
+
valueLocal.value = oldValue
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const invalid = ref<boolean>(false)
|
|
76
|
+
const errorMessage = ref<string>('')
|
|
77
|
+
|
|
78
|
+
const onChangeSetting = (event: Event): void => {
|
|
79
|
+
invalid.value = false
|
|
80
|
+
errorMessage.value = ''
|
|
81
|
+
|
|
82
|
+
const target = event.target as HTMLInputElement
|
|
83
|
+
let value: UI_I_AdvancedSystemSettingsEditData['value'] = target.value
|
|
84
|
+
if (props.data.type === 'boolean') value = value === 'true'
|
|
85
|
+
if (props.data.type === 'number') value = +value
|
|
86
|
+
|
|
87
|
+
const { validation } = props.data
|
|
88
|
+
if (Object.hasOwn(validation, 'equal')) {
|
|
89
|
+
invalid.value = !validation.equal.includes(value)
|
|
90
|
+
errorMessage.value = invalid.value
|
|
91
|
+
? `Value must be equal ${validation.equal.join(', ')}`
|
|
92
|
+
: ''
|
|
93
|
+
}
|
|
94
|
+
if (invalid.value) return
|
|
95
|
+
|
|
96
|
+
if (Object.hasOwn(validation, 'notEqual')) {
|
|
97
|
+
invalid.value = validation.notEqual.includes(value)
|
|
98
|
+
errorMessage.value = invalid.value
|
|
99
|
+
? `Value must not be equal ${validation.notEqual.join(', ')}`
|
|
100
|
+
: ''
|
|
101
|
+
}
|
|
102
|
+
if (invalid.value) return
|
|
103
|
+
|
|
104
|
+
if (Object.hasOwn(validation, 'min')) {
|
|
105
|
+
invalid.value = value < validation.min
|
|
106
|
+
errorMessage.value = invalid.value
|
|
107
|
+
? `Value must be more then ${validation.min}`
|
|
108
|
+
: ''
|
|
109
|
+
}
|
|
110
|
+
if (invalid.value) return
|
|
111
|
+
|
|
112
|
+
if (Object.hasOwn(validation, 'max')) {
|
|
113
|
+
invalid.value = value > validation.max
|
|
114
|
+
errorMessage.value = invalid.value
|
|
115
|
+
? `Value must be less then ${validation.max}`
|
|
116
|
+
: ''
|
|
117
|
+
}
|
|
118
|
+
if (invalid.value) return
|
|
119
|
+
|
|
120
|
+
if (validation.Format) {
|
|
121
|
+
const format = E_Format[validation.Format]
|
|
122
|
+
invalid.value = !allRegExp[format].test(value)
|
|
123
|
+
errorMessage.value = invalid.value ? `Value must be ${format}` : ''
|
|
124
|
+
}
|
|
125
|
+
if (invalid.value) return
|
|
126
|
+
|
|
127
|
+
emits('change', value)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
watch(errorMessage, (newValue) => {
|
|
131
|
+
emits('error-message', newValue)
|
|
132
|
+
})
|
|
133
|
+
</script>
|
|
134
|
+
|
|
135
|
+
<style scoped lang="scss">
|
|
136
|
+
.has-error {
|
|
137
|
+
border: 1px solid #db2100;
|
|
138
|
+
}
|
|
139
|
+
</style>
|
package/components/common/configure/advancedSystemSettings/tableView/old/field/lib/models/enums.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export enum 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',
|
|
1
|
+
export enum 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
14
|
}
|