bfg-common 1.4.569 → 1.4.570
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-1.svg +407 -407
- package/assets/img/icons/icons-sprite-dark-2.svg +343 -343
- package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
- package/assets/img/icons/icons-sprite-dark-4.svg +255 -255
- package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
- package/assets/img/icons/icons-sprite-dark-6.svg +94 -94
- package/assets/img/icons/icons-sprite-light-1.svg +407 -407
- package/assets/img/icons/icons-sprite-light-2.svg +343 -343
- package/assets/img/icons/icons-sprite-light-3.svg +227 -227
- package/assets/img/icons/icons-sprite-light-4.svg +255 -255
- package/assets/img/icons/icons-sprite-light-5.svg +488 -488
- package/assets/img/icons/icons-sprite-light-6.svg +94 -94
- package/components/atoms/TheIcon3.vue +50 -50
- package/components/atoms/modal/bySteps/BySteps.vue +253 -253
- package/components/atoms/stack/StackBlock.vue +185 -185
- package/components/atoms/table/dataGrid/DataGrid.vue +1633 -1633
- package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +222 -222
- package/components/common/browse/BrowseNew.vue +237 -237
- package/components/common/browse/BrowseOld.vue +217 -217
- package/components/common/browse/blocks/contents/Files.vue +35 -35
- package/components/common/browse/blocks/contents/FilesOld.vue +70 -70
- package/components/common/browse/blocks/contents/filesNew/FilesNew.vue +92 -92
- package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
- package/components/common/browse/blocks/lib/models/types.ts +1 -1
- package/components/common/browse/lib/models/interfaces.ts +5 -5
- package/components/common/context/lib/models/interfaces.ts +30 -30
- package/components/common/context/recursion/Recursion.vue +86 -86
- package/components/common/context/recursion/RecursionNew.vue +199 -199
- package/components/common/context/recursion/RecursionOld.vue +213 -213
- package/components/common/diagramMain/Header.vue +211 -211
- package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
- package/components/common/diagramMain/lib/config/initial.ts +50 -50
- package/components/common/diagramMain/lib/models/enums.ts +44 -44
- package/components/common/diagramMain/lib/models/types.ts +21 -21
- package/components/common/diagramMain/lib/utils/utils.ts +331 -331
- package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +330 -330
- package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
- package/components/common/diagramMain/modals/editSettings/EditSettings.vue +497 -497
- package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +812 -812
- package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
- package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
- package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
- package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
- package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +398 -398
- package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
- package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
- package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +23 -23
- package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
- package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
- package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
- package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +537 -537
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
- package/components/common/diagramMain/port/Ports.vue +47 -47
- package/components/common/layout/theHeader/helpMenu/About.vue +85 -85
- package/components/common/layout/theHeader/helpMenu/aboutNew/AboutNew.vue +103 -103
- package/components/common/mainNavigationPanel/MainNavigationPanel.vue +152 -152
- package/components/common/portlets/customAttributes/Portlet.vue +655 -655
- package/components/common/portlets/tag/Portlet.vue +422 -422
- package/components/common/portlets/tag/TagAddNew.vue +624 -624
- package/components/common/spiceConsole/Drawer.vue +370 -370
- package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/add/Add.vue +617 -617
- package/components/common/vm/actions/clone/lib/config/steps.ts +129 -129
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +267 -267
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +264 -264
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +219 -219
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/BusNew.vue +118 -118
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveNew.vue +161 -161
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +165 -165
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +55 -55
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +147 -147
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/ModeOld.vue +55 -55
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/SharingNew.vue +44 -44
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetworkNew.vue +124 -124
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/LocationOld.vue +134 -134
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/New.vue +63 -63
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/Table.vue +74 -74
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +95 -95
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressNew.vue +69 -69
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressOld.vue +83 -83
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceNew.vue +85 -85
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceOld.vue +91 -91
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +35 -35
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoNew.vue +48 -48
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionNew.vue +46 -46
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +56 -56
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/OtherNew.vue +27 -27
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/TotalVideoMemoryNew.vue +54 -54
- package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +145 -145
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +102 -102
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +75 -75
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +26 -26
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +57 -57
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/FirmwareNew.vue +42 -42
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/MenuNew.vue +25 -25
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +171 -171
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +50 -50
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +141 -141
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +140 -140
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPasteNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransferNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/FolderSharingNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/KeymapNew.vue +39 -39
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordNew.vue +100 -100
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionNew.vue +38 -38
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
- package/components/common/vm/actions/common/select/storage/Storage.vue +130 -130
- package/components/common/vm/actions/common/select/storage/StorageOld.vue +129 -129
- package/components/common/vm/actions/common/select/storage/new/New.vue +159 -159
- package/components/common/vm/actions/editSettings/EditSettings.vue +214 -214
- package/components/common/vm/actions/editSettings/EditSettingsOld.vue +182 -182
- package/components/common/vm/actions/editSettings/new/New.vue +176 -176
- package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -87
- package/components/common/wizards/network/add/lib/config/steps.ts +464 -464
- package/composables/productNameLocal.ts +30 -30
- package/package.json +1 -1
- package/plugins/date.ts +233 -233
- package/plugins/recursion.ts +311 -311
- package/public/spice-console/lib/images/bitmap.js +203 -203
- package/public/spice-console/network/spicechannel.js +383 -383
- package/store/main/mutations.ts +7 -7
- package/store/main/state.ts +7 -7
|
@@ -1,624 +1,624 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="add-tag-modal-container">
|
|
3
|
-
<ui-modal
|
|
4
|
-
v-if="props.isShowModal"
|
|
5
|
-
:title="localization.common.assignTag"
|
|
6
|
-
:subtitle="props.selectedItemName"
|
|
7
|
-
:texts="assignTagTexts"
|
|
8
|
-
test-id="modal-assign-tag"
|
|
9
|
-
width="720px"
|
|
10
|
-
:is-disabled-accept="!selectedRowsCount"
|
|
11
|
-
@hide="emits('cancel')"
|
|
12
|
-
@submit="onAssign"
|
|
13
|
-
>
|
|
14
|
-
<template #header></template>
|
|
15
|
-
<template #content>
|
|
16
|
-
<div class="content-container">
|
|
17
|
-
<div v-if="isShowRequiredFieldsError" class="alert-container">
|
|
18
|
-
<ui-alert
|
|
19
|
-
:messages="[localization.common.pleaseFillAllRequiredFields]"
|
|
20
|
-
test-id="required-alert"
|
|
21
|
-
simple-error
|
|
22
|
-
hide-close-button
|
|
23
|
-
/>
|
|
24
|
-
</div>
|
|
25
|
-
<div
|
|
26
|
-
v-if="!isShowRequiredFieldsError && selectedRowsCount > 1"
|
|
27
|
-
class="alert-container"
|
|
28
|
-
>
|
|
29
|
-
<ui-alert
|
|
30
|
-
:messages="[localization.common.multipleTagsSelectedAlert]"
|
|
31
|
-
test-id="multiple-tags-alert"
|
|
32
|
-
type="info"
|
|
33
|
-
hide-close-button
|
|
34
|
-
/>
|
|
35
|
-
</div>
|
|
36
|
-
<div class="modal-top">
|
|
37
|
-
<span class="selected-text">
|
|
38
|
-
{{ selectedRowsCount }} {{ texts.selected }}
|
|
39
|
-
</span>
|
|
40
|
-
</div>
|
|
41
|
-
<ui-data-table
|
|
42
|
-
test-id="assign-tags-data-table"
|
|
43
|
-
:data="assignDataLocal"
|
|
44
|
-
:options="tagTableHeaderOptions"
|
|
45
|
-
server-off
|
|
46
|
-
:default-layout="false"
|
|
47
|
-
size="sm"
|
|
48
|
-
@select-row="onGetSelected"
|
|
49
|
-
>
|
|
50
|
-
<template #notFound>
|
|
51
|
-
<div v-if="!allRowsCount" class="new-tag-button-container">
|
|
52
|
-
<ui-button
|
|
53
|
-
variant="text"
|
|
54
|
-
test-id="create-new-tag"
|
|
55
|
-
is-without-height
|
|
56
|
-
is-without-sizes
|
|
57
|
-
:disabled="hasEditRow"
|
|
58
|
-
@click="onAddNewRow"
|
|
59
|
-
>
|
|
60
|
-
{{ localization.zabbix.addNew }}...
|
|
61
|
-
</ui-button>
|
|
62
|
-
</div>
|
|
63
|
-
</template>
|
|
64
|
-
<template #icon="{ item }">
|
|
65
|
-
<template v-if="item.data.type === 'tagName'">
|
|
66
|
-
<input
|
|
67
|
-
v-model="editData.tagName"
|
|
68
|
-
data-id="new-tag-name"
|
|
69
|
-
:class="[
|
|
70
|
-
'table-input',
|
|
71
|
-
{
|
|
72
|
-
'table-input-error':
|
|
73
|
-
validationData.tagName && isShowValidation,
|
|
74
|
-
},
|
|
75
|
-
]"
|
|
76
|
-
:placeholder="localization.common[item.data.type]"
|
|
77
|
-
type="text"
|
|
78
|
-
@click.prevent.stop
|
|
79
|
-
/>
|
|
80
|
-
</template>
|
|
81
|
-
|
|
82
|
-
<template v-else-if="item.data.type === 'category'">
|
|
83
|
-
<div class="category-select">
|
|
84
|
-
<ui-select
|
|
85
|
-
v-model="editData.category"
|
|
86
|
-
:items="selectItems"
|
|
87
|
-
:error="validationData.category && isShowValidation"
|
|
88
|
-
:placeholder="localization.common.chooseCategory"
|
|
89
|
-
width="165px"
|
|
90
|
-
select-width="100%"
|
|
91
|
-
:show-text="true"
|
|
92
|
-
size="sm"
|
|
93
|
-
test-id="new-tag-category"
|
|
94
|
-
>
|
|
95
|
-
<template #heading>
|
|
96
|
-
<div class="add-category-button">
|
|
97
|
-
<ui-button
|
|
98
|
-
variant="text"
|
|
99
|
-
is-without-height
|
|
100
|
-
is-without-sizes
|
|
101
|
-
test-id="create-new-tag-category"
|
|
102
|
-
@click="onShowCreateCategoryModal"
|
|
103
|
-
>
|
|
104
|
-
<div class="select-button-container">
|
|
105
|
-
<ui-icon name="plus" width="16" height="16" />
|
|
106
|
-
<span>{{ localization.common.createNew }}</span>
|
|
107
|
-
</div>
|
|
108
|
-
</ui-button>
|
|
109
|
-
</div>
|
|
110
|
-
<div class="separator-container"></div>
|
|
111
|
-
</template>
|
|
112
|
-
</ui-select>
|
|
113
|
-
</div>
|
|
114
|
-
</template>
|
|
115
|
-
<template v-else-if="item.data.type === 'description'">
|
|
116
|
-
<input
|
|
117
|
-
v-model="editData.description"
|
|
118
|
-
class="table-input"
|
|
119
|
-
:placeholder="localization.common[item.data.type]"
|
|
120
|
-
type="text"
|
|
121
|
-
data-id="new-tag-description"
|
|
122
|
-
@click.prevent.stop
|
|
123
|
-
/>
|
|
124
|
-
</template>
|
|
125
|
-
<template v-else-if="item.data.type === 'actions'">
|
|
126
|
-
<div class="actions-container">
|
|
127
|
-
<span
|
|
128
|
-
class="hide-row"
|
|
129
|
-
data-id="hide-create-new-tag-row"
|
|
130
|
-
@click.prevent.stop="onHideEditRow"
|
|
131
|
-
>
|
|
132
|
-
<ui-icon name="close" width="16" height="16" />
|
|
133
|
-
</span>
|
|
134
|
-
<span
|
|
135
|
-
class="create-row"
|
|
136
|
-
data-id="create-new-tag-accept"
|
|
137
|
-
@click.prevent.stop="onAddTag"
|
|
138
|
-
>
|
|
139
|
-
<ui-icon name="status-check" width="16" height="16" />
|
|
140
|
-
</span>
|
|
141
|
-
</div>
|
|
142
|
-
</template>
|
|
143
|
-
</template>
|
|
144
|
-
</ui-data-table>
|
|
145
|
-
|
|
146
|
-
<div v-if="allRowsCount" class="modal-bottom">
|
|
147
|
-
<span class="add-new-button">
|
|
148
|
-
<ui-button
|
|
149
|
-
variant="text"
|
|
150
|
-
is-without-height
|
|
151
|
-
is-without-sizes
|
|
152
|
-
:disabled="hasEditRow"
|
|
153
|
-
test-id="create-new-tag"
|
|
154
|
-
@click="onAddNewRow"
|
|
155
|
-
>
|
|
156
|
-
{{ localization.zabbix.addNew }}...
|
|
157
|
-
</ui-button>
|
|
158
|
-
</span>
|
|
159
|
-
<span class="selected-text">
|
|
160
|
-
{{ allRowsCount }} {{ texts.tags }}
|
|
161
|
-
</span>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
</template>
|
|
165
|
-
<template #footerLeftContent>
|
|
166
|
-
<div class="tags-link">
|
|
167
|
-
<ui-button
|
|
168
|
-
variant="text"
|
|
169
|
-
is-without-height
|
|
170
|
-
is-without-sizes
|
|
171
|
-
test-id="show-tags-custom-attributes"
|
|
172
|
-
@click="onShowDetails"
|
|
173
|
-
>
|
|
174
|
-
<div class="tags-link-container">
|
|
175
|
-
<span class="tags-link-icon">
|
|
176
|
-
<ui-icon
|
|
177
|
-
name="icon-tags-custom-attributes"
|
|
178
|
-
width="20"
|
|
179
|
-
height="20"
|
|
180
|
-
/>
|
|
181
|
-
</span>
|
|
182
|
-
<span class="tags-link-text">
|
|
183
|
-
{{ localization.mainNavigation.tagsCustomAttributes }}
|
|
184
|
-
</span>
|
|
185
|
-
</div>
|
|
186
|
-
</ui-button>
|
|
187
|
-
</div>
|
|
188
|
-
</template>
|
|
189
|
-
</ui-modal>
|
|
190
|
-
<common-portlets-tag-create-category
|
|
191
|
-
:is-show-modal="isShowCreateCategoryModal"
|
|
192
|
-
@cancel="onHideCreateCategoryModal"
|
|
193
|
-
@create="onCreateCategory"
|
|
194
|
-
/>
|
|
195
|
-
</div>
|
|
196
|
-
</template>
|
|
197
|
-
|
|
198
|
-
<script setup lang="ts">
|
|
199
|
-
import type {
|
|
200
|
-
UI_I_Localization,
|
|
201
|
-
UI_I_ArbitraryObject,
|
|
202
|
-
} from '~/lib/models/interfaces'
|
|
203
|
-
import type {
|
|
204
|
-
UI_I_DataTable,
|
|
205
|
-
UI_I_DataTableOptions,
|
|
206
|
-
UI_I_DataTableBody,
|
|
207
|
-
} from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
|
|
208
|
-
import type { UI_I_ModalTexts } from '~/node_modules/bfg-uikit/components/ui/modal/models/interfaces'
|
|
209
|
-
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
210
|
-
import type {
|
|
211
|
-
UI_I_NewTagData,
|
|
212
|
-
UI_I_CreateCategoryData,
|
|
213
|
-
} from '~/components/common/portlets/tag/lib/models/interfaces'
|
|
214
|
-
import {
|
|
215
|
-
tagTableHeaderOptions,
|
|
216
|
-
makeNewTagCreateActionRowFunc,
|
|
217
|
-
temporaryCategories,
|
|
218
|
-
} from '~/components/common/portlets/tag/lib/config/config'
|
|
219
|
-
|
|
220
|
-
const props = defineProps<{
|
|
221
|
-
isShowModal: boolean
|
|
222
|
-
assignData: UI_I_DataTable
|
|
223
|
-
selectedItemName: string
|
|
224
|
-
}>()
|
|
225
|
-
|
|
226
|
-
const onShowDetails = (_id: number): void => {
|
|
227
|
-
navigateTo('/tags-attributes/tags')
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const assignTagTexts = computed<UI_I_ModalTexts>(() => ({
|
|
231
|
-
button1: localization.value.common.cancel,
|
|
232
|
-
button2: localization.value.common.assign,
|
|
233
|
-
}))
|
|
234
|
-
|
|
235
|
-
const texts = computed<UI_I_ArbitraryObject<string>>(() => ({
|
|
236
|
-
selected: localization.value.common.selected.toLowerCase(),
|
|
237
|
-
tags: localization.value.common.tags.toLowerCase(),
|
|
238
|
-
}))
|
|
239
|
-
|
|
240
|
-
const selectItems = ref<UI_I_Dropdown[]>(useDeepCopy(temporaryCategories))
|
|
241
|
-
|
|
242
|
-
const assignDataLocal = ref<UI_I_DataTable>(useDeepCopy(props.assignData))
|
|
243
|
-
|
|
244
|
-
watch(
|
|
245
|
-
() => props.assignData,
|
|
246
|
-
(newValue: UI_I_DataTable) => {
|
|
247
|
-
const newDataBody = newValue.body.map((row) => ({
|
|
248
|
-
...row,
|
|
249
|
-
isSelected: assignDataLocal.value.body.find((r) => r.row === row.row)
|
|
250
|
-
?.isSelected,
|
|
251
|
-
}))
|
|
252
|
-
|
|
253
|
-
assignDataLocal.value = { ...newValue, body: newDataBody }
|
|
254
|
-
},
|
|
255
|
-
{ deep: true }
|
|
256
|
-
)
|
|
257
|
-
|
|
258
|
-
const selectedRowsCount = computed<number>(
|
|
259
|
-
() =>
|
|
260
|
-
assignDataLocal.value.body.filter(
|
|
261
|
-
(row: UI_I_DataTableBody) => row.isSelected
|
|
262
|
-
).length
|
|
263
|
-
)
|
|
264
|
-
|
|
265
|
-
const allRowsCount = computed<number>(
|
|
266
|
-
() =>
|
|
267
|
-
assignDataLocal.value.body.filter(
|
|
268
|
-
(row: UI_I_DataTableBody) => !row.actionRow
|
|
269
|
-
).length
|
|
270
|
-
)
|
|
271
|
-
|
|
272
|
-
const onAddNewRow = (): void => {
|
|
273
|
-
const rowsIds = assignDataLocal.value.body.map((row) => row.row).sort()
|
|
274
|
-
let lastId = rowsIds[rowsIds.length - 1]
|
|
275
|
-
lastId = lastId === undefined ? -1 : lastId
|
|
276
|
-
|
|
277
|
-
assignDataLocal.value.body.push(makeNewTagCreateActionRowFunc(lastId + 1))
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
const editData = ref<UI_I_NewTagData>({
|
|
281
|
-
tagName: '',
|
|
282
|
-
category: '',
|
|
283
|
-
description: '',
|
|
284
|
-
})
|
|
285
|
-
|
|
286
|
-
const isShowValidation = ref<boolean>(false)
|
|
287
|
-
const validationData = computed<{
|
|
288
|
-
tagName: boolean
|
|
289
|
-
category: boolean
|
|
290
|
-
}>(() => ({
|
|
291
|
-
tagName: !editData.value.tagName.trim(),
|
|
292
|
-
category: !editData.value.category.trim(),
|
|
293
|
-
}))
|
|
294
|
-
|
|
295
|
-
const isShowRequiredFieldsError = computed<boolean>(
|
|
296
|
-
() =>
|
|
297
|
-
(validationData.value.tagName || validationData.value.category) &&
|
|
298
|
-
isShowValidation.value
|
|
299
|
-
)
|
|
300
|
-
|
|
301
|
-
watch(
|
|
302
|
-
validationData,
|
|
303
|
-
(newValue: { tagName: boolean; category: boolean }) => {
|
|
304
|
-
!newValue.tagName && !newValue.category && (isShowValidation.value = false)
|
|
305
|
-
},
|
|
306
|
-
{ deep: true }
|
|
307
|
-
)
|
|
308
|
-
|
|
309
|
-
const resetFields = (): void => {
|
|
310
|
-
editData.value = {
|
|
311
|
-
tagName: '',
|
|
312
|
-
category: '',
|
|
313
|
-
description: '',
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
const onAddTag = (): void => {
|
|
318
|
-
if (validationData.value.tagName || validationData.value.category) {
|
|
319
|
-
isShowValidation.value = true
|
|
320
|
-
return
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
const withoutEditRowData = assignDataLocal.value.body.filter(
|
|
324
|
-
(row) => !row.actionRow
|
|
325
|
-
)
|
|
326
|
-
|
|
327
|
-
const rowsIds = withoutEditRowData.map((row) => row.row).sort()
|
|
328
|
-
let lastId = rowsIds[rowsIds.length - 1]
|
|
329
|
-
lastId = lastId === undefined ? -1 : lastId
|
|
330
|
-
|
|
331
|
-
emits('add-new-tag', {
|
|
332
|
-
row: lastId + 1,
|
|
333
|
-
isSelected: false,
|
|
334
|
-
data: [
|
|
335
|
-
{ col: 0, text: editData.value.tagName },
|
|
336
|
-
{ col: 1, text: editData.value.category },
|
|
337
|
-
{ col: 2, text: editData.value.description },
|
|
338
|
-
{ col: 3, text: '' },
|
|
339
|
-
],
|
|
340
|
-
})
|
|
341
|
-
|
|
342
|
-
resetFields()
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
const onHideEditRow = (): void => {
|
|
346
|
-
assignDataLocal.value.body = assignDataLocal.value.body.filter(
|
|
347
|
-
(row) => !row.actionRow
|
|
348
|
-
)
|
|
349
|
-
resetFields()
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
const hasEditRow = computed<boolean>(
|
|
353
|
-
() => !!assignDataLocal.value.body.find((row) => row.actionRow)
|
|
354
|
-
)
|
|
355
|
-
|
|
356
|
-
const onAssign = (): void => {
|
|
357
|
-
emits(
|
|
358
|
-
'assign',
|
|
359
|
-
assignDataLocal.value.body.filter((row) => row.isSelected)
|
|
360
|
-
)
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
const onGetSelected = (selectedRows: UI_I_DataTableBody[]): void => {
|
|
364
|
-
const selectedRowsId = selectedRows.map(
|
|
365
|
-
(selectedRow: UI_I_DataTableBody) => selectedRow.row
|
|
366
|
-
)
|
|
367
|
-
assignDataLocal.value.body = assignDataLocal.value.body.map((row) =>
|
|
368
|
-
selectedRowsId.includes(row.row)
|
|
369
|
-
? { ...row, isSelected: true }
|
|
370
|
-
: { ...row, isSelected: false }
|
|
371
|
-
)
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
const emits = defineEmits([
|
|
375
|
-
'add',
|
|
376
|
-
'cancel',
|
|
377
|
-
'assign',
|
|
378
|
-
'save',
|
|
379
|
-
'hide',
|
|
380
|
-
'add-new-tag',
|
|
381
|
-
'create-category',
|
|
382
|
-
])
|
|
383
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
384
|
-
|
|
385
|
-
const isShowCreateCategoryModal = ref<boolean>(false)
|
|
386
|
-
const onShowCreateCategoryModal = (): void => {
|
|
387
|
-
isShowCreateCategoryModal.value = true
|
|
388
|
-
}
|
|
389
|
-
const onHideCreateCategoryModal = (): void => {
|
|
390
|
-
isShowCreateCategoryModal.value = false
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
const onCreateCategory = (data: UI_I_CreateCategoryData): void => {
|
|
394
|
-
selectItems.value.push({
|
|
395
|
-
text: data.categoryName,
|
|
396
|
-
value: data.categoryName.replaceAll(' ', ''),
|
|
397
|
-
selected: false,
|
|
398
|
-
})
|
|
399
|
-
emits('create-category', data)
|
|
400
|
-
onHideCreateCategoryModal()
|
|
401
|
-
}
|
|
402
|
-
</script>
|
|
403
|
-
|
|
404
|
-
<style>
|
|
405
|
-
:root {
|
|
406
|
-
--separator-color: #e9ebed;
|
|
407
|
-
--input-border: #d3d6da;
|
|
408
|
-
--input-color: #4d5d69;
|
|
409
|
-
--input-caret-color: #000000;
|
|
410
|
-
--input-bg: #ffffff;
|
|
411
|
-
--hide-row-icon: #4d5d69;
|
|
412
|
-
--hide-row-icon-hover: #213444;
|
|
413
|
-
--create-row-icon: #008fd6;
|
|
414
|
-
--create-row-icon-hover: #0081c1;
|
|
415
|
-
}
|
|
416
|
-
:root.dark-theme {
|
|
417
|
-
--separator-color: #e9ebed1f;
|
|
418
|
-
--input-border: #e9ebed3d;
|
|
419
|
-
--input-color: #d3d6da;
|
|
420
|
-
--input-caret-color: #ffffff;
|
|
421
|
-
--input-bg: transparent;
|
|
422
|
-
--hide-row-icon: #e9eaec;
|
|
423
|
-
--hide-row-icon-hover: #ffffff;
|
|
424
|
-
--create-row-icon: #2ba2de;
|
|
425
|
-
--create-row-icon-hover: #008fd6;
|
|
426
|
-
}
|
|
427
|
-
</style>
|
|
428
|
-
|
|
429
|
-
<style scoped lang="scss">
|
|
430
|
-
.add-new-button {
|
|
431
|
-
:deep(button.ui-btn) {
|
|
432
|
-
line-height: 16px;
|
|
433
|
-
margin: 16px 0;
|
|
434
|
-
width: fit-content;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.add-tag-modal-container {
|
|
439
|
-
:deep(.modal-footer) {
|
|
440
|
-
padding: 0 !important;
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.selected-text {
|
|
445
|
-
font-size: 12px;
|
|
446
|
-
font-weight: 400;
|
|
447
|
-
line-height: 14.52px;
|
|
448
|
-
color: #9da6ad;
|
|
449
|
-
padding: 4px 0;
|
|
450
|
-
}
|
|
451
|
-
.modal-top {
|
|
452
|
-
display: flex;
|
|
453
|
-
justify-content: space-between;
|
|
454
|
-
align-items: center;
|
|
455
|
-
margin-bottom: 12px;
|
|
456
|
-
padding-top: 8px;
|
|
457
|
-
|
|
458
|
-
//&-manager-button {
|
|
459
|
-
// display: flex;
|
|
460
|
-
// align-items: center;
|
|
461
|
-
// column-gap: 0.5px;
|
|
462
|
-
// height: 28px;
|
|
463
|
-
// border: 1px solid #e9ebed;
|
|
464
|
-
// background-color: #ffffff;
|
|
465
|
-
// color: #4d5d69;
|
|
466
|
-
// font-size: 12px;
|
|
467
|
-
// font-weight: 500;
|
|
468
|
-
// line-height: 14.52px;
|
|
469
|
-
// padding: 6px 8px;
|
|
470
|
-
// border-radius: 6px;
|
|
471
|
-
// cursor: pointer;
|
|
472
|
-
//
|
|
473
|
-
// &:hover {
|
|
474
|
-
// background: #e9ebed66;
|
|
475
|
-
// }
|
|
476
|
-
//}
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.modal-bottom {
|
|
480
|
-
display: flex;
|
|
481
|
-
justify-content: space-between;
|
|
482
|
-
align-items: center;
|
|
483
|
-
|
|
484
|
-
.selected-text {
|
|
485
|
-
align-self: flex-start;
|
|
486
|
-
padding-top: 8px;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
.tags-link {
|
|
491
|
-
&-text {
|
|
492
|
-
font-size: 14px;
|
|
493
|
-
font-weight: 500;
|
|
494
|
-
line-height: 16.94px;
|
|
495
|
-
}
|
|
496
|
-
&-icon {
|
|
497
|
-
width: 20px;
|
|
498
|
-
height: 20px;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
&-container {
|
|
502
|
-
display: flex;
|
|
503
|
-
align-items: center;
|
|
504
|
-
column-gap: 8px;
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
.table-input {
|
|
509
|
-
height: 28px;
|
|
510
|
-
background-color: var(--input-bg);
|
|
511
|
-
border: 1px solid var(--input-border);
|
|
512
|
-
font-size: 12px;
|
|
513
|
-
font-weight: 500;
|
|
514
|
-
line-height: 14.52px;
|
|
515
|
-
border-radius: 6px;
|
|
516
|
-
width: 100%;
|
|
517
|
-
padding: 6px 8px;
|
|
518
|
-
caret-color: var(--input-caret-color);
|
|
519
|
-
color: var(--input-color);
|
|
520
|
-
|
|
521
|
-
&::placeholder {
|
|
522
|
-
color: #9da6ad;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
&:focus,
|
|
526
|
-
&:focus-visible {
|
|
527
|
-
border: 1px solid #008fd6;
|
|
528
|
-
outline: none;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
&.table-input-error {
|
|
532
|
-
border-color: #ea3223;
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
.category-select {
|
|
537
|
-
width: 100%;
|
|
538
|
-
|
|
539
|
-
:deep(.ui-select-toggle-button) {
|
|
540
|
-
height: 28px;
|
|
541
|
-
background-color: var(--input-bg);
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
:deep(.ui-placeholder) {
|
|
545
|
-
font-size: 12px;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
:deep(.ui-dropdown) {
|
|
549
|
-
max-height: 250px;
|
|
550
|
-
overflow-y: auto;
|
|
551
|
-
|
|
552
|
-
.ui-dropdown-menu-item {
|
|
553
|
-
height: 28px;
|
|
554
|
-
margin-bottom: 4px;
|
|
555
|
-
.ui-item-text {
|
|
556
|
-
font-size: 12px;
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
.add-category-button {
|
|
563
|
-
:deep(.ui-btn) {
|
|
564
|
-
height: 28px;
|
|
565
|
-
margin-top: 4px;
|
|
566
|
-
font-size: 12px;
|
|
567
|
-
justify-content: flex-start;
|
|
568
|
-
padding-left: 12px;
|
|
569
|
-
|
|
570
|
-
span {
|
|
571
|
-
font-size: 12px;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
.separator-container {
|
|
576
|
-
margin: 4px 12px 0;
|
|
577
|
-
border-bottom: 1px solid var(--separator-color);
|
|
578
|
-
height: 0;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
.hide-row {
|
|
582
|
-
cursor: pointer;
|
|
583
|
-
line-height: 16px;
|
|
584
|
-
color: var(--hide-row-icon);
|
|
585
|
-
|
|
586
|
-
&:hover {
|
|
587
|
-
color: var(--hide-row-icon-hover);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
.create-row {
|
|
592
|
-
cursor: pointer;
|
|
593
|
-
line-height: 16px;
|
|
594
|
-
color: var(--create-row-icon);
|
|
595
|
-
|
|
596
|
-
&:hover {
|
|
597
|
-
color: var(--create-row-icon-hover);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
.content-container {
|
|
602
|
-
padding: 8px 32px 0;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
.alert-container {
|
|
606
|
-
margin: 8px 0;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
.new-tag-button-container {
|
|
610
|
-
margin-top: 12px;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
.select-button-container {
|
|
614
|
-
display: flex;
|
|
615
|
-
align-items: center;
|
|
616
|
-
height: 28px;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
.actions-container {
|
|
620
|
-
display: flex;
|
|
621
|
-
align-items: center;
|
|
622
|
-
column-gap: 12px;
|
|
623
|
-
}
|
|
624
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="add-tag-modal-container">
|
|
3
|
+
<ui-modal
|
|
4
|
+
v-if="props.isShowModal"
|
|
5
|
+
:title="localization.common.assignTag"
|
|
6
|
+
:subtitle="props.selectedItemName"
|
|
7
|
+
:texts="assignTagTexts"
|
|
8
|
+
test-id="modal-assign-tag"
|
|
9
|
+
width="720px"
|
|
10
|
+
:is-disabled-accept="!selectedRowsCount"
|
|
11
|
+
@hide="emits('cancel')"
|
|
12
|
+
@submit="onAssign"
|
|
13
|
+
>
|
|
14
|
+
<template #header></template>
|
|
15
|
+
<template #content>
|
|
16
|
+
<div class="content-container">
|
|
17
|
+
<div v-if="isShowRequiredFieldsError" class="alert-container">
|
|
18
|
+
<ui-alert
|
|
19
|
+
:messages="[localization.common.pleaseFillAllRequiredFields]"
|
|
20
|
+
test-id="required-alert"
|
|
21
|
+
simple-error
|
|
22
|
+
hide-close-button
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
<div
|
|
26
|
+
v-if="!isShowRequiredFieldsError && selectedRowsCount > 1"
|
|
27
|
+
class="alert-container"
|
|
28
|
+
>
|
|
29
|
+
<ui-alert
|
|
30
|
+
:messages="[localization.common.multipleTagsSelectedAlert]"
|
|
31
|
+
test-id="multiple-tags-alert"
|
|
32
|
+
type="info"
|
|
33
|
+
hide-close-button
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="modal-top">
|
|
37
|
+
<span class="selected-text">
|
|
38
|
+
{{ selectedRowsCount }} {{ texts.selected }}
|
|
39
|
+
</span>
|
|
40
|
+
</div>
|
|
41
|
+
<ui-data-table
|
|
42
|
+
test-id="assign-tags-data-table"
|
|
43
|
+
:data="assignDataLocal"
|
|
44
|
+
:options="tagTableHeaderOptions"
|
|
45
|
+
server-off
|
|
46
|
+
:default-layout="false"
|
|
47
|
+
size="sm"
|
|
48
|
+
@select-row="onGetSelected"
|
|
49
|
+
>
|
|
50
|
+
<template #notFound>
|
|
51
|
+
<div v-if="!allRowsCount" class="new-tag-button-container">
|
|
52
|
+
<ui-button
|
|
53
|
+
variant="text"
|
|
54
|
+
test-id="create-new-tag"
|
|
55
|
+
is-without-height
|
|
56
|
+
is-without-sizes
|
|
57
|
+
:disabled="hasEditRow"
|
|
58
|
+
@click="onAddNewRow"
|
|
59
|
+
>
|
|
60
|
+
{{ localization.zabbix.addNew }}...
|
|
61
|
+
</ui-button>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
<template #icon="{ item }">
|
|
65
|
+
<template v-if="item.data.type === 'tagName'">
|
|
66
|
+
<input
|
|
67
|
+
v-model="editData.tagName"
|
|
68
|
+
data-id="new-tag-name"
|
|
69
|
+
:class="[
|
|
70
|
+
'table-input',
|
|
71
|
+
{
|
|
72
|
+
'table-input-error':
|
|
73
|
+
validationData.tagName && isShowValidation,
|
|
74
|
+
},
|
|
75
|
+
]"
|
|
76
|
+
:placeholder="localization.common[item.data.type]"
|
|
77
|
+
type="text"
|
|
78
|
+
@click.prevent.stop
|
|
79
|
+
/>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<template v-else-if="item.data.type === 'category'">
|
|
83
|
+
<div class="category-select">
|
|
84
|
+
<ui-select
|
|
85
|
+
v-model="editData.category"
|
|
86
|
+
:items="selectItems"
|
|
87
|
+
:error="validationData.category && isShowValidation"
|
|
88
|
+
:placeholder="localization.common.chooseCategory"
|
|
89
|
+
width="165px"
|
|
90
|
+
select-width="100%"
|
|
91
|
+
:show-text="true"
|
|
92
|
+
size="sm"
|
|
93
|
+
test-id="new-tag-category"
|
|
94
|
+
>
|
|
95
|
+
<template #heading>
|
|
96
|
+
<div class="add-category-button">
|
|
97
|
+
<ui-button
|
|
98
|
+
variant="text"
|
|
99
|
+
is-without-height
|
|
100
|
+
is-without-sizes
|
|
101
|
+
test-id="create-new-tag-category"
|
|
102
|
+
@click="onShowCreateCategoryModal"
|
|
103
|
+
>
|
|
104
|
+
<div class="select-button-container">
|
|
105
|
+
<ui-icon name="plus" width="16" height="16" />
|
|
106
|
+
<span>{{ localization.common.createNew }}</span>
|
|
107
|
+
</div>
|
|
108
|
+
</ui-button>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="separator-container"></div>
|
|
111
|
+
</template>
|
|
112
|
+
</ui-select>
|
|
113
|
+
</div>
|
|
114
|
+
</template>
|
|
115
|
+
<template v-else-if="item.data.type === 'description'">
|
|
116
|
+
<input
|
|
117
|
+
v-model="editData.description"
|
|
118
|
+
class="table-input"
|
|
119
|
+
:placeholder="localization.common[item.data.type]"
|
|
120
|
+
type="text"
|
|
121
|
+
data-id="new-tag-description"
|
|
122
|
+
@click.prevent.stop
|
|
123
|
+
/>
|
|
124
|
+
</template>
|
|
125
|
+
<template v-else-if="item.data.type === 'actions'">
|
|
126
|
+
<div class="actions-container">
|
|
127
|
+
<span
|
|
128
|
+
class="hide-row"
|
|
129
|
+
data-id="hide-create-new-tag-row"
|
|
130
|
+
@click.prevent.stop="onHideEditRow"
|
|
131
|
+
>
|
|
132
|
+
<ui-icon name="close" width="16" height="16" />
|
|
133
|
+
</span>
|
|
134
|
+
<span
|
|
135
|
+
class="create-row"
|
|
136
|
+
data-id="create-new-tag-accept"
|
|
137
|
+
@click.prevent.stop="onAddTag"
|
|
138
|
+
>
|
|
139
|
+
<ui-icon name="status-check" width="16" height="16" />
|
|
140
|
+
</span>
|
|
141
|
+
</div>
|
|
142
|
+
</template>
|
|
143
|
+
</template>
|
|
144
|
+
</ui-data-table>
|
|
145
|
+
|
|
146
|
+
<div v-if="allRowsCount" class="modal-bottom">
|
|
147
|
+
<span class="add-new-button">
|
|
148
|
+
<ui-button
|
|
149
|
+
variant="text"
|
|
150
|
+
is-without-height
|
|
151
|
+
is-without-sizes
|
|
152
|
+
:disabled="hasEditRow"
|
|
153
|
+
test-id="create-new-tag"
|
|
154
|
+
@click="onAddNewRow"
|
|
155
|
+
>
|
|
156
|
+
{{ localization.zabbix.addNew }}...
|
|
157
|
+
</ui-button>
|
|
158
|
+
</span>
|
|
159
|
+
<span class="selected-text">
|
|
160
|
+
{{ allRowsCount }} {{ texts.tags }}
|
|
161
|
+
</span>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</template>
|
|
165
|
+
<template #footerLeftContent>
|
|
166
|
+
<div class="tags-link">
|
|
167
|
+
<ui-button
|
|
168
|
+
variant="text"
|
|
169
|
+
is-without-height
|
|
170
|
+
is-without-sizes
|
|
171
|
+
test-id="show-tags-custom-attributes"
|
|
172
|
+
@click="onShowDetails"
|
|
173
|
+
>
|
|
174
|
+
<div class="tags-link-container">
|
|
175
|
+
<span class="tags-link-icon">
|
|
176
|
+
<ui-icon
|
|
177
|
+
name="icon-tags-custom-attributes"
|
|
178
|
+
width="20"
|
|
179
|
+
height="20"
|
|
180
|
+
/>
|
|
181
|
+
</span>
|
|
182
|
+
<span class="tags-link-text">
|
|
183
|
+
{{ localization.mainNavigation.tagsCustomAttributes }}
|
|
184
|
+
</span>
|
|
185
|
+
</div>
|
|
186
|
+
</ui-button>
|
|
187
|
+
</div>
|
|
188
|
+
</template>
|
|
189
|
+
</ui-modal>
|
|
190
|
+
<common-portlets-tag-create-category
|
|
191
|
+
:is-show-modal="isShowCreateCategoryModal"
|
|
192
|
+
@cancel="onHideCreateCategoryModal"
|
|
193
|
+
@create="onCreateCategory"
|
|
194
|
+
/>
|
|
195
|
+
</div>
|
|
196
|
+
</template>
|
|
197
|
+
|
|
198
|
+
<script setup lang="ts">
|
|
199
|
+
import type {
|
|
200
|
+
UI_I_Localization,
|
|
201
|
+
UI_I_ArbitraryObject,
|
|
202
|
+
} from '~/lib/models/interfaces'
|
|
203
|
+
import type {
|
|
204
|
+
UI_I_DataTable,
|
|
205
|
+
UI_I_DataTableOptions,
|
|
206
|
+
UI_I_DataTableBody,
|
|
207
|
+
} from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
|
|
208
|
+
import type { UI_I_ModalTexts } from '~/node_modules/bfg-uikit/components/ui/modal/models/interfaces'
|
|
209
|
+
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
210
|
+
import type {
|
|
211
|
+
UI_I_NewTagData,
|
|
212
|
+
UI_I_CreateCategoryData,
|
|
213
|
+
} from '~/components/common/portlets/tag/lib/models/interfaces'
|
|
214
|
+
import {
|
|
215
|
+
tagTableHeaderOptions,
|
|
216
|
+
makeNewTagCreateActionRowFunc,
|
|
217
|
+
temporaryCategories,
|
|
218
|
+
} from '~/components/common/portlets/tag/lib/config/config'
|
|
219
|
+
|
|
220
|
+
const props = defineProps<{
|
|
221
|
+
isShowModal: boolean
|
|
222
|
+
assignData: UI_I_DataTable
|
|
223
|
+
selectedItemName: string
|
|
224
|
+
}>()
|
|
225
|
+
|
|
226
|
+
const onShowDetails = (_id: number): void => {
|
|
227
|
+
navigateTo('/tags-attributes/tags')
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const assignTagTexts = computed<UI_I_ModalTexts>(() => ({
|
|
231
|
+
button1: localization.value.common.cancel,
|
|
232
|
+
button2: localization.value.common.assign,
|
|
233
|
+
}))
|
|
234
|
+
|
|
235
|
+
const texts = computed<UI_I_ArbitraryObject<string>>(() => ({
|
|
236
|
+
selected: localization.value.common.selected.toLowerCase(),
|
|
237
|
+
tags: localization.value.common.tags.toLowerCase(),
|
|
238
|
+
}))
|
|
239
|
+
|
|
240
|
+
const selectItems = ref<UI_I_Dropdown[]>(useDeepCopy(temporaryCategories))
|
|
241
|
+
|
|
242
|
+
const assignDataLocal = ref<UI_I_DataTable>(useDeepCopy(props.assignData))
|
|
243
|
+
|
|
244
|
+
watch(
|
|
245
|
+
() => props.assignData,
|
|
246
|
+
(newValue: UI_I_DataTable) => {
|
|
247
|
+
const newDataBody = newValue.body.map((row) => ({
|
|
248
|
+
...row,
|
|
249
|
+
isSelected: assignDataLocal.value.body.find((r) => r.row === row.row)
|
|
250
|
+
?.isSelected,
|
|
251
|
+
}))
|
|
252
|
+
|
|
253
|
+
assignDataLocal.value = { ...newValue, body: newDataBody }
|
|
254
|
+
},
|
|
255
|
+
{ deep: true }
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
const selectedRowsCount = computed<number>(
|
|
259
|
+
() =>
|
|
260
|
+
assignDataLocal.value.body.filter(
|
|
261
|
+
(row: UI_I_DataTableBody) => row.isSelected
|
|
262
|
+
).length
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
const allRowsCount = computed<number>(
|
|
266
|
+
() =>
|
|
267
|
+
assignDataLocal.value.body.filter(
|
|
268
|
+
(row: UI_I_DataTableBody) => !row.actionRow
|
|
269
|
+
).length
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
const onAddNewRow = (): void => {
|
|
273
|
+
const rowsIds = assignDataLocal.value.body.map((row) => row.row).sort()
|
|
274
|
+
let lastId = rowsIds[rowsIds.length - 1]
|
|
275
|
+
lastId = lastId === undefined ? -1 : lastId
|
|
276
|
+
|
|
277
|
+
assignDataLocal.value.body.push(makeNewTagCreateActionRowFunc(lastId + 1))
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const editData = ref<UI_I_NewTagData>({
|
|
281
|
+
tagName: '',
|
|
282
|
+
category: '',
|
|
283
|
+
description: '',
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
const isShowValidation = ref<boolean>(false)
|
|
287
|
+
const validationData = computed<{
|
|
288
|
+
tagName: boolean
|
|
289
|
+
category: boolean
|
|
290
|
+
}>(() => ({
|
|
291
|
+
tagName: !editData.value.tagName.trim(),
|
|
292
|
+
category: !editData.value.category.trim(),
|
|
293
|
+
}))
|
|
294
|
+
|
|
295
|
+
const isShowRequiredFieldsError = computed<boolean>(
|
|
296
|
+
() =>
|
|
297
|
+
(validationData.value.tagName || validationData.value.category) &&
|
|
298
|
+
isShowValidation.value
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
watch(
|
|
302
|
+
validationData,
|
|
303
|
+
(newValue: { tagName: boolean; category: boolean }) => {
|
|
304
|
+
!newValue.tagName && !newValue.category && (isShowValidation.value = false)
|
|
305
|
+
},
|
|
306
|
+
{ deep: true }
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
const resetFields = (): void => {
|
|
310
|
+
editData.value = {
|
|
311
|
+
tagName: '',
|
|
312
|
+
category: '',
|
|
313
|
+
description: '',
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const onAddTag = (): void => {
|
|
318
|
+
if (validationData.value.tagName || validationData.value.category) {
|
|
319
|
+
isShowValidation.value = true
|
|
320
|
+
return
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const withoutEditRowData = assignDataLocal.value.body.filter(
|
|
324
|
+
(row) => !row.actionRow
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
const rowsIds = withoutEditRowData.map((row) => row.row).sort()
|
|
328
|
+
let lastId = rowsIds[rowsIds.length - 1]
|
|
329
|
+
lastId = lastId === undefined ? -1 : lastId
|
|
330
|
+
|
|
331
|
+
emits('add-new-tag', {
|
|
332
|
+
row: lastId + 1,
|
|
333
|
+
isSelected: false,
|
|
334
|
+
data: [
|
|
335
|
+
{ col: 0, text: editData.value.tagName },
|
|
336
|
+
{ col: 1, text: editData.value.category },
|
|
337
|
+
{ col: 2, text: editData.value.description },
|
|
338
|
+
{ col: 3, text: '' },
|
|
339
|
+
],
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
resetFields()
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const onHideEditRow = (): void => {
|
|
346
|
+
assignDataLocal.value.body = assignDataLocal.value.body.filter(
|
|
347
|
+
(row) => !row.actionRow
|
|
348
|
+
)
|
|
349
|
+
resetFields()
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
const hasEditRow = computed<boolean>(
|
|
353
|
+
() => !!assignDataLocal.value.body.find((row) => row.actionRow)
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
const onAssign = (): void => {
|
|
357
|
+
emits(
|
|
358
|
+
'assign',
|
|
359
|
+
assignDataLocal.value.body.filter((row) => row.isSelected)
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const onGetSelected = (selectedRows: UI_I_DataTableBody[]): void => {
|
|
364
|
+
const selectedRowsId = selectedRows.map(
|
|
365
|
+
(selectedRow: UI_I_DataTableBody) => selectedRow.row
|
|
366
|
+
)
|
|
367
|
+
assignDataLocal.value.body = assignDataLocal.value.body.map((row) =>
|
|
368
|
+
selectedRowsId.includes(row.row)
|
|
369
|
+
? { ...row, isSelected: true }
|
|
370
|
+
: { ...row, isSelected: false }
|
|
371
|
+
)
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const emits = defineEmits([
|
|
375
|
+
'add',
|
|
376
|
+
'cancel',
|
|
377
|
+
'assign',
|
|
378
|
+
'save',
|
|
379
|
+
'hide',
|
|
380
|
+
'add-new-tag',
|
|
381
|
+
'create-category',
|
|
382
|
+
])
|
|
383
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
384
|
+
|
|
385
|
+
const isShowCreateCategoryModal = ref<boolean>(false)
|
|
386
|
+
const onShowCreateCategoryModal = (): void => {
|
|
387
|
+
isShowCreateCategoryModal.value = true
|
|
388
|
+
}
|
|
389
|
+
const onHideCreateCategoryModal = (): void => {
|
|
390
|
+
isShowCreateCategoryModal.value = false
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const onCreateCategory = (data: UI_I_CreateCategoryData): void => {
|
|
394
|
+
selectItems.value.push({
|
|
395
|
+
text: data.categoryName,
|
|
396
|
+
value: data.categoryName.replaceAll(' ', ''),
|
|
397
|
+
selected: false,
|
|
398
|
+
})
|
|
399
|
+
emits('create-category', data)
|
|
400
|
+
onHideCreateCategoryModal()
|
|
401
|
+
}
|
|
402
|
+
</script>
|
|
403
|
+
|
|
404
|
+
<style>
|
|
405
|
+
:root {
|
|
406
|
+
--separator-color: #e9ebed;
|
|
407
|
+
--input-border: #d3d6da;
|
|
408
|
+
--input-color: #4d5d69;
|
|
409
|
+
--input-caret-color: #000000;
|
|
410
|
+
--input-bg: #ffffff;
|
|
411
|
+
--hide-row-icon: #4d5d69;
|
|
412
|
+
--hide-row-icon-hover: #213444;
|
|
413
|
+
--create-row-icon: #008fd6;
|
|
414
|
+
--create-row-icon-hover: #0081c1;
|
|
415
|
+
}
|
|
416
|
+
:root.dark-theme {
|
|
417
|
+
--separator-color: #e9ebed1f;
|
|
418
|
+
--input-border: #e9ebed3d;
|
|
419
|
+
--input-color: #d3d6da;
|
|
420
|
+
--input-caret-color: #ffffff;
|
|
421
|
+
--input-bg: transparent;
|
|
422
|
+
--hide-row-icon: #e9eaec;
|
|
423
|
+
--hide-row-icon-hover: #ffffff;
|
|
424
|
+
--create-row-icon: #2ba2de;
|
|
425
|
+
--create-row-icon-hover: #008fd6;
|
|
426
|
+
}
|
|
427
|
+
</style>
|
|
428
|
+
|
|
429
|
+
<style scoped lang="scss">
|
|
430
|
+
.add-new-button {
|
|
431
|
+
:deep(button.ui-btn) {
|
|
432
|
+
line-height: 16px;
|
|
433
|
+
margin: 16px 0;
|
|
434
|
+
width: fit-content;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.add-tag-modal-container {
|
|
439
|
+
:deep(.modal-footer) {
|
|
440
|
+
padding: 0 !important;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.selected-text {
|
|
445
|
+
font-size: 12px;
|
|
446
|
+
font-weight: 400;
|
|
447
|
+
line-height: 14.52px;
|
|
448
|
+
color: #9da6ad;
|
|
449
|
+
padding: 4px 0;
|
|
450
|
+
}
|
|
451
|
+
.modal-top {
|
|
452
|
+
display: flex;
|
|
453
|
+
justify-content: space-between;
|
|
454
|
+
align-items: center;
|
|
455
|
+
margin-bottom: 12px;
|
|
456
|
+
padding-top: 8px;
|
|
457
|
+
|
|
458
|
+
//&-manager-button {
|
|
459
|
+
// display: flex;
|
|
460
|
+
// align-items: center;
|
|
461
|
+
// column-gap: 0.5px;
|
|
462
|
+
// height: 28px;
|
|
463
|
+
// border: 1px solid #e9ebed;
|
|
464
|
+
// background-color: #ffffff;
|
|
465
|
+
// color: #4d5d69;
|
|
466
|
+
// font-size: 12px;
|
|
467
|
+
// font-weight: 500;
|
|
468
|
+
// line-height: 14.52px;
|
|
469
|
+
// padding: 6px 8px;
|
|
470
|
+
// border-radius: 6px;
|
|
471
|
+
// cursor: pointer;
|
|
472
|
+
//
|
|
473
|
+
// &:hover {
|
|
474
|
+
// background: #e9ebed66;
|
|
475
|
+
// }
|
|
476
|
+
//}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.modal-bottom {
|
|
480
|
+
display: flex;
|
|
481
|
+
justify-content: space-between;
|
|
482
|
+
align-items: center;
|
|
483
|
+
|
|
484
|
+
.selected-text {
|
|
485
|
+
align-self: flex-start;
|
|
486
|
+
padding-top: 8px;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.tags-link {
|
|
491
|
+
&-text {
|
|
492
|
+
font-size: 14px;
|
|
493
|
+
font-weight: 500;
|
|
494
|
+
line-height: 16.94px;
|
|
495
|
+
}
|
|
496
|
+
&-icon {
|
|
497
|
+
width: 20px;
|
|
498
|
+
height: 20px;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
&-container {
|
|
502
|
+
display: flex;
|
|
503
|
+
align-items: center;
|
|
504
|
+
column-gap: 8px;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.table-input {
|
|
509
|
+
height: 28px;
|
|
510
|
+
background-color: var(--input-bg);
|
|
511
|
+
border: 1px solid var(--input-border);
|
|
512
|
+
font-size: 12px;
|
|
513
|
+
font-weight: 500;
|
|
514
|
+
line-height: 14.52px;
|
|
515
|
+
border-radius: 6px;
|
|
516
|
+
width: 100%;
|
|
517
|
+
padding: 6px 8px;
|
|
518
|
+
caret-color: var(--input-caret-color);
|
|
519
|
+
color: var(--input-color);
|
|
520
|
+
|
|
521
|
+
&::placeholder {
|
|
522
|
+
color: #9da6ad;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
&:focus,
|
|
526
|
+
&:focus-visible {
|
|
527
|
+
border: 1px solid #008fd6;
|
|
528
|
+
outline: none;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
&.table-input-error {
|
|
532
|
+
border-color: #ea3223;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.category-select {
|
|
537
|
+
width: 100%;
|
|
538
|
+
|
|
539
|
+
:deep(.ui-select-toggle-button) {
|
|
540
|
+
height: 28px;
|
|
541
|
+
background-color: var(--input-bg);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
:deep(.ui-placeholder) {
|
|
545
|
+
font-size: 12px;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
:deep(.ui-dropdown) {
|
|
549
|
+
max-height: 250px;
|
|
550
|
+
overflow-y: auto;
|
|
551
|
+
|
|
552
|
+
.ui-dropdown-menu-item {
|
|
553
|
+
height: 28px;
|
|
554
|
+
margin-bottom: 4px;
|
|
555
|
+
.ui-item-text {
|
|
556
|
+
font-size: 12px;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
.add-category-button {
|
|
563
|
+
:deep(.ui-btn) {
|
|
564
|
+
height: 28px;
|
|
565
|
+
margin-top: 4px;
|
|
566
|
+
font-size: 12px;
|
|
567
|
+
justify-content: flex-start;
|
|
568
|
+
padding-left: 12px;
|
|
569
|
+
|
|
570
|
+
span {
|
|
571
|
+
font-size: 12px;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
.separator-container {
|
|
576
|
+
margin: 4px 12px 0;
|
|
577
|
+
border-bottom: 1px solid var(--separator-color);
|
|
578
|
+
height: 0;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.hide-row {
|
|
582
|
+
cursor: pointer;
|
|
583
|
+
line-height: 16px;
|
|
584
|
+
color: var(--hide-row-icon);
|
|
585
|
+
|
|
586
|
+
&:hover {
|
|
587
|
+
color: var(--hide-row-icon-hover);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.create-row {
|
|
592
|
+
cursor: pointer;
|
|
593
|
+
line-height: 16px;
|
|
594
|
+
color: var(--create-row-icon);
|
|
595
|
+
|
|
596
|
+
&:hover {
|
|
597
|
+
color: var(--create-row-icon-hover);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.content-container {
|
|
602
|
+
padding: 8px 32px 0;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.alert-container {
|
|
606
|
+
margin: 8px 0;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.new-tag-button-container {
|
|
610
|
+
margin-top: 12px;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.select-button-container {
|
|
614
|
+
display: flex;
|
|
615
|
+
align-items: center;
|
|
616
|
+
height: 28px;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.actions-container {
|
|
620
|
+
display: flex;
|
|
621
|
+
align-items: center;
|
|
622
|
+
column-gap: 12px;
|
|
623
|
+
}
|
|
624
|
+
</style>
|