bfg-common 1.5.761 → 1.5.763
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/components/common/configure/securityProfile/SecurityProfile.vue +13 -0
- package/components/common/configure/securityProfile/lockdownMode/LockdownMode.vue +94 -0
- package/components/common/configure/securityProfile/lockdownMode/lib/utils/constructData.ts +27 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/LockdownModeEdit.vue +60 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/New.vue +5 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/Old.vue +150 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/ExceptionUsers.vue +28 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/New.vue +5 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/Old.vue +137 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/config/table.ts +43 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/config/tableKeys.ts +6 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/models/types.ts +1 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/lib/config/tabs.ts +19 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/lockdownMode/LockdownMode.vue +22 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/lockdownMode/New.vue +5 -0
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/lockdownMode/Old.vue +76 -0
- package/components/common/configure/securityProfile/lockdownMode/tools/New.vue +5 -0
- package/components/common/configure/securityProfile/lockdownMode/tools/Old.vue +30 -0
- package/components/common/configure/securityProfile/lockdownMode/tools/Tools.vue +24 -0
- package/components/common/diagramMain/lib/models/interfaces.ts +1 -1
- package/components/common/diagramMain/modals/lib/mappers/mappers.ts +1 -0
- package/components/common/wizards/network/add/steps/portProperties/PortProperties.vue +22 -38
- package/components/common/wizards/network/add/steps/portProperties/PortPropertiesOld.vue +1 -1
- package/package.json +1 -1
- package/store/inventory/modules/configure/securityProfile/lib/models/interfaces.ts +12 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<common-configure-security-profile-lockdown-mode
|
|
3
|
+
:active-node-name="props.activeNodeName"
|
|
4
|
+
/>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
activeNodeName: string
|
|
10
|
+
}>()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="lockdown-mode">
|
|
3
|
+
<common-configure-security-profile-lockdown-mode-tools />
|
|
4
|
+
|
|
5
|
+
<div class="stack-view">
|
|
6
|
+
<atoms-stack-block
|
|
7
|
+
:has-children="false"
|
|
8
|
+
test-id="certificate-subject-stack-block"
|
|
9
|
+
>
|
|
10
|
+
<template #stackBlockKey>
|
|
11
|
+
<div class="flex-align-center">
|
|
12
|
+
<span data-id="certificate-subject">
|
|
13
|
+
{{ localization.common.lockdownMode }}
|
|
14
|
+
</span>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<template #stackBlockContent>
|
|
18
|
+
<span data-id="certificate-subject-value">
|
|
19
|
+
{{ securityProfileData.lockdownMode.lockdownMode }}
|
|
20
|
+
</span>
|
|
21
|
+
</template>
|
|
22
|
+
</atoms-stack-block>
|
|
23
|
+
<atoms-stack-block
|
|
24
|
+
:has-children="false"
|
|
25
|
+
test-id="certificate-subject-stack-block"
|
|
26
|
+
>
|
|
27
|
+
<template #stackBlockKey>
|
|
28
|
+
<div class="flex-align-center">
|
|
29
|
+
<span data-id="certificate-subject">
|
|
30
|
+
{{ localization.configureSecurityProfile.exceptionUsers }}
|
|
31
|
+
</span>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
<template #stackBlockContent>
|
|
35
|
+
<span data-id="certificate-subject-value">
|
|
36
|
+
{{ lockdownModeExceptionUsers }}
|
|
37
|
+
</span>
|
|
38
|
+
</template>
|
|
39
|
+
</atoms-stack-block>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<common-configure-security-profile-lockdown-mode-modals-lockdown-mode-edit
|
|
44
|
+
v-if="isShowEdit"
|
|
45
|
+
:active-node-name="props.activeNodeName"
|
|
46
|
+
:edit-data="securityProfileData.lockdownMode"
|
|
47
|
+
@hide="isShowEdit = false"
|
|
48
|
+
@submit="isShowEdit = false"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script setup lang="ts">
|
|
53
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
54
|
+
import type { UI_I_SecurityProfileData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
55
|
+
import { constructData } from '~/components/common/configure/securityProfile/lockdownMode/lib/utils/constructData'
|
|
56
|
+
|
|
57
|
+
const props = defineProps<{
|
|
58
|
+
activeNodeName: string
|
|
59
|
+
}>()
|
|
60
|
+
|
|
61
|
+
const { $store }: any = useNuxtApp()
|
|
62
|
+
|
|
63
|
+
const nodeId = useRoute().params.id
|
|
64
|
+
|
|
65
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
66
|
+
|
|
67
|
+
const securityProfileData = computed<UI_I_SecurityProfileData>(() =>
|
|
68
|
+
constructData($store.getters['securityProfile/getSystemSecurityProfile'])
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
const lockdownModeExceptionUsers = computed<string>(() =>
|
|
72
|
+
securityProfileData.value.lockdownMode.exceptionUsers.join(', ')
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
const getData = (): void => {
|
|
76
|
+
$store.dispatch('securityProfile/A_GET_SECURITY_PROFILE', nodeId)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const isShowEdit = ref<boolean>(false)
|
|
80
|
+
|
|
81
|
+
onMounted(() => {
|
|
82
|
+
getData()
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
onUnmounted(() => {
|
|
86
|
+
$store.dispatch('main/A_PAUSE_GLOBAL_REFRESH', 'hostSystemSecurityProfile')
|
|
87
|
+
})
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style scoped lang="scss">
|
|
91
|
+
.stack-view {
|
|
92
|
+
margin-top: 10px;
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { UI_I_SecurityProfileData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
2
|
+
|
|
3
|
+
const getLockdownModeCurrentText = (data: string): string => {
|
|
4
|
+
switch (data) {
|
|
5
|
+
case 'disabled':
|
|
6
|
+
return 'disabled'
|
|
7
|
+
default:
|
|
8
|
+
return ''
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const constructData = (
|
|
13
|
+
data: UI_I_SecurityProfileData | null
|
|
14
|
+
): UI_I_SecurityProfileData => {
|
|
15
|
+
let result: UI_I_SecurityProfileData | null = null
|
|
16
|
+
|
|
17
|
+
result = {
|
|
18
|
+
lockdownMode: {
|
|
19
|
+
lockdownMode: getLockdownModeCurrentText(
|
|
20
|
+
data?.lockdownMode.lockdownMode || ''
|
|
21
|
+
),
|
|
22
|
+
exceptionUsers: data?.lockdownMode.exceptionUsers || [],
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return result
|
|
27
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
:title="title"
|
|
5
|
+
:selected-tab="selectedTab"
|
|
6
|
+
:tab-items="tabItems"
|
|
7
|
+
@add-new-user="onAddNewUser"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
13
|
+
import type { UI_I_VerticalTabs } from '~/components/atoms/tabs/lib/models/interfaces'
|
|
14
|
+
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
15
|
+
import { navigateTabsFunc } from '~/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/lib/config/tabs'
|
|
16
|
+
|
|
17
|
+
const props = defineProps<{
|
|
18
|
+
activeNodeName: string
|
|
19
|
+
editData: UI_I_LockdownModeData
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
const { $store }: any = useNuxtApp()
|
|
23
|
+
|
|
24
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
25
|
+
|
|
26
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
27
|
+
const currentComponent = computed(() =>
|
|
28
|
+
isNewView.value
|
|
29
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
30
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
const title = computed<string>(
|
|
34
|
+
() => props.activeNodeName + ' - ' + localization.value.common.lockdownMode
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
const selectedTab = ref<number>(1)
|
|
38
|
+
const tabItems = computed<UI_I_VerticalTabs[]>(() =>
|
|
39
|
+
navigateTabsFunc(localization.value)
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
const localEditData = ref<UI_I_LockdownModeData>({
|
|
43
|
+
lockdownMode: '',
|
|
44
|
+
exceptionUsers: [],
|
|
45
|
+
})
|
|
46
|
+
watch(
|
|
47
|
+
() => props.editData,
|
|
48
|
+
(newValue) => {
|
|
49
|
+
localEditData.value.lockdownMode = newValue.lockdownMode
|
|
50
|
+
localEditData.value.exceptionUsers = newValue.exceptionUsers
|
|
51
|
+
},
|
|
52
|
+
{ immediate: true, deep: true }
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
const onAddNewUser = (value: string): void => {
|
|
56
|
+
localEditData.value.exceptionUsers.push(value)
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style scoped lang="scss"></style>
|
package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/Old.vue
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<atoms-modal
|
|
3
|
+
:title="props.title"
|
|
4
|
+
width="862px"
|
|
5
|
+
class="lockdown-mode-edit"
|
|
6
|
+
test-id="lockdown-mode-edit"
|
|
7
|
+
show
|
|
8
|
+
@hide="emits('hide')"
|
|
9
|
+
@submit="emits('submit')"
|
|
10
|
+
>
|
|
11
|
+
<template #modalBody>
|
|
12
|
+
<div class="flex column-gap-6 lockdown-mode-edit__content">
|
|
13
|
+
<atoms-tabs-vertical-tabs
|
|
14
|
+
v-model="selectedTab"
|
|
15
|
+
:items="props.tabItems"
|
|
16
|
+
test-id="lockdown-mode-edit-tabs"
|
|
17
|
+
class="lockdown-mode-edit__tabs"
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<common-configure-security-profile-lockdown-mode-modals-lockdown-mode-edit-lockdown-mode
|
|
21
|
+
v-if="selectedTab === 1"
|
|
22
|
+
v-model:form="localEditData"
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<common-configure-security-profile-lockdown-mode-modals-lockdown-mode-edit-exception-users
|
|
26
|
+
v-if="selectedTab === 2"
|
|
27
|
+
v-model:form="localEditData"
|
|
28
|
+
@add="emits('add-new-user', $event)"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
</atoms-modal>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script lang="ts" setup>
|
|
36
|
+
import type { UI_I_VerticalTabs } from '~/components/atoms/tabs/lib/models/interfaces'
|
|
37
|
+
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
38
|
+
|
|
39
|
+
const selectedTab = defineModel<number>('selectedTab', { required: true })
|
|
40
|
+
const localEditData = defineModel<UI_I_LockdownModeData>('localEditData', {
|
|
41
|
+
required: true,
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const props = defineProps<{
|
|
45
|
+
title: string
|
|
46
|
+
tabItems: UI_I_VerticalTabs[]
|
|
47
|
+
}>()
|
|
48
|
+
|
|
49
|
+
const emits = defineEmits<{
|
|
50
|
+
(event: 'add-new-user', value: string): void
|
|
51
|
+
(event: 'hide'): void
|
|
52
|
+
(event: 'submit'): void
|
|
53
|
+
}>()
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped>
|
|
57
|
+
.lockdown-mode-edit {
|
|
58
|
+
&__content {
|
|
59
|
+
height: inherit;
|
|
60
|
+
}
|
|
61
|
+
&__tabs {
|
|
62
|
+
&.vertical-groups-sidenav {
|
|
63
|
+
background: initial;
|
|
64
|
+
&.sidenav {
|
|
65
|
+
border-right: 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
&__alert {
|
|
70
|
+
margin-bottom: 10px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:deep(.modal-body) {
|
|
74
|
+
height: inherit;
|
|
75
|
+
|
|
76
|
+
.custom-radio-label {
|
|
77
|
+
padding-left: 23px;
|
|
78
|
+
}
|
|
79
|
+
.add-new-name-input {
|
|
80
|
+
width: 170px;
|
|
81
|
+
}
|
|
82
|
+
.sub-text-input {
|
|
83
|
+
position: absolute;
|
|
84
|
+
left: 0;
|
|
85
|
+
top: 22px;
|
|
86
|
+
font-size: 11px;
|
|
87
|
+
}
|
|
88
|
+
.add-user-btn {
|
|
89
|
+
margin-left: 20px;
|
|
90
|
+
text-transform: uppercase;
|
|
91
|
+
color: #0079ad;
|
|
92
|
+
font-size: 11px;
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
|
|
96
|
+
&:hover {
|
|
97
|
+
color: #00608a;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.ellipsis-vertical-btn {
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
|
|
103
|
+
svg {
|
|
104
|
+
width: 15px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
.action-container {
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: -33px;
|
|
112
|
+
left: 5px;
|
|
113
|
+
background: var(--block-view-bg-color2);
|
|
114
|
+
border: 1px solid var(--block-border-color);
|
|
115
|
+
padding: 5px 6px;
|
|
116
|
+
border-radius: 3px;
|
|
117
|
+
|
|
118
|
+
.action-wrap {
|
|
119
|
+
&::after {
|
|
120
|
+
content: '';
|
|
121
|
+
display: block;
|
|
122
|
+
position: absolute;
|
|
123
|
+
width: 8px;
|
|
124
|
+
height: 8px;
|
|
125
|
+
background: var(--block-view-bg-color2);
|
|
126
|
+
transform: rotate(45deg);
|
|
127
|
+
left: -11px;
|
|
128
|
+
bottom: calc(50% - 4px);
|
|
129
|
+
border-left: 0.5px solid var(--block-border-color);
|
|
130
|
+
border-bottom: 0.5px solid var(--block-border-color);
|
|
131
|
+
z-index: var(--z-dropdown);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
.action {
|
|
135
|
+
border: none;
|
|
136
|
+
padding: 1px 20px;
|
|
137
|
+
width: 100%;
|
|
138
|
+
text-align: left;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
background: var(--block-view-bg-color2);
|
|
141
|
+
color: var(--global-font-color3);
|
|
142
|
+
white-space: nowrap;
|
|
143
|
+
text-transform: capitalize;
|
|
144
|
+
|
|
145
|
+
&:hover {
|
|
146
|
+
background: var(--vertical-nav-hover-bg-color);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
v-model:local-edit-data="localEditData"
|
|
5
|
+
@add="emits('add', $event)"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
11
|
+
|
|
12
|
+
const localEditData = defineModel<UI_I_LockdownModeData>('localEditData')
|
|
13
|
+
|
|
14
|
+
const emits = defineEmits<{
|
|
15
|
+
(event: 'add', value: string): void
|
|
16
|
+
}>()
|
|
17
|
+
|
|
18
|
+
const { $store }: any = useNuxtApp()
|
|
19
|
+
|
|
20
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
21
|
+
const currentComponent = computed(() =>
|
|
22
|
+
isNewView.value
|
|
23
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
24
|
+
: defineAsyncComponent(() => import('./old/Old.vue'))
|
|
25
|
+
)
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="exception-users">
|
|
3
|
+
<h5 class="font-bold">
|
|
4
|
+
{{ localization.configureSecurityProfile.exceptionUsers }}
|
|
5
|
+
</h5>
|
|
6
|
+
<label>
|
|
7
|
+
{{ localization.configureSecurityProfile.exceptionUsersDesc }}
|
|
8
|
+
<span class="relative">
|
|
9
|
+
<input v-model="newUserName" type="text" class="add-new-name-input" />
|
|
10
|
+
<span class="sub-text-input">
|
|
11
|
+
{{ localization.configureSecurityProfile.separateUsersWithCommas }}
|
|
12
|
+
</span>
|
|
13
|
+
</span>
|
|
14
|
+
<span class="add-user-btn" @click="emits('add', newUserName)">
|
|
15
|
+
{{ localization.common.addUser }}
|
|
16
|
+
</span>
|
|
17
|
+
</label>
|
|
18
|
+
|
|
19
|
+
<div class="mt-3">
|
|
20
|
+
<atoms-table-data-grid
|
|
21
|
+
:column-keys="columnKeys"
|
|
22
|
+
:head-items="headItems"
|
|
23
|
+
:body-items="bodyItems"
|
|
24
|
+
:total-items="bodyItems.length"
|
|
25
|
+
:page-size="100"
|
|
26
|
+
:page="1"
|
|
27
|
+
:total-pages="1"
|
|
28
|
+
test-id="exception-users-table"
|
|
29
|
+
hide-pagination
|
|
30
|
+
hide-page-size
|
|
31
|
+
off-select-by-row
|
|
32
|
+
server-off
|
|
33
|
+
>
|
|
34
|
+
<template #col1="{ item }">
|
|
35
|
+
<div class="data-table__action-icon">
|
|
36
|
+
<atoms-popover
|
|
37
|
+
:test-id="`${item.data.id}-popover`"
|
|
38
|
+
@click="onShowTooltip(item.data.id)"
|
|
39
|
+
>
|
|
40
|
+
<template #elem>
|
|
41
|
+
<span class="ellipsis-vertical-btn">
|
|
42
|
+
<atoms-the-icon name="ellipsis-vertical" />
|
|
43
|
+
</span>
|
|
44
|
+
</template>
|
|
45
|
+
<template #content>
|
|
46
|
+
<div v-if="showTooltip && item.data.id === selectedUserId">
|
|
47
|
+
<div class="action-container">
|
|
48
|
+
<div class="action-wrap relative">
|
|
49
|
+
<button
|
|
50
|
+
:data-id="`${item.data.id}-remove-button`"
|
|
51
|
+
class="action"
|
|
52
|
+
@click="onRemoveUser(item.data.name)"
|
|
53
|
+
>
|
|
54
|
+
{{ localization.common.removeUser }}
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
</atoms-popover>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</atoms-table-data-grid>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup lang="ts">
|
|
69
|
+
import type {
|
|
70
|
+
UI_I_HeadItem,
|
|
71
|
+
UI_I_BodyItem,
|
|
72
|
+
} from '~/components/atoms/table/compact/lib/models/interfaces'
|
|
73
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
74
|
+
import type { UI_I_ColumnKey } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
75
|
+
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
76
|
+
import * as exceptionUsersTable from '~/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/config/table'
|
|
77
|
+
|
|
78
|
+
const localEditData = defineModel<UI_I_LockdownModeData>('localEditData', {
|
|
79
|
+
required: true,
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const emits = defineEmits<{
|
|
83
|
+
(event: 'add', value: string): void
|
|
84
|
+
}>()
|
|
85
|
+
|
|
86
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
87
|
+
|
|
88
|
+
const newUserName = ref<string>('')
|
|
89
|
+
|
|
90
|
+
const columnKeys = ref<UI_I_ColumnKey[]>(
|
|
91
|
+
exceptionUsersTable.columnKeys(localization.value)
|
|
92
|
+
)
|
|
93
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
94
|
+
exceptionUsersTable.headItems(localization.value)
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
const bodyItems = ref<UI_I_BodyItem[][]>([])
|
|
98
|
+
watch(
|
|
99
|
+
localEditData,
|
|
100
|
+
(newValue) => {
|
|
101
|
+
if (!newValue.exceptionUsers?.length) {
|
|
102
|
+
bodyItems.value = []
|
|
103
|
+
return
|
|
104
|
+
}
|
|
105
|
+
bodyItems.value = exceptionUsersTable.bodyItems(newValue.exceptionUsers)
|
|
106
|
+
},
|
|
107
|
+
{ immediate: true, deep: true }
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
const selectedUserId = ref<number | null>(null)
|
|
111
|
+
const showTooltip = ref<boolean>(false)
|
|
112
|
+
const onShowTooltip = (id: number): void => {
|
|
113
|
+
selectedUserId.value = id
|
|
114
|
+
showTooltip.value = true
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const onRemoveUser = (value: string): void => {
|
|
118
|
+
localEditData.value.exceptionUsers =
|
|
119
|
+
localEditData.value.exceptionUsers.filter((item) => item !== value)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const hideActionsPopover = (): void => {
|
|
123
|
+
showTooltip.value = false
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// TODO удалить потом это
|
|
127
|
+
onMounted(() => {
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
window.addEventListener('click', hideActionsPopover)
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
onUnmounted(() => {
|
|
133
|
+
window.removeEventListener('click', hideActionsPopover)
|
|
134
|
+
})
|
|
135
|
+
</script>
|
|
136
|
+
|
|
137
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type {
|
|
3
|
+
UI_I_ColumnKey,
|
|
4
|
+
UI_I_HeadItem,
|
|
5
|
+
UI_I_BodyItem,
|
|
6
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
7
|
+
import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
|
|
8
|
+
import { exceptionUsersTableKeys } from '~/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/config/tableKeys'
|
|
9
|
+
|
|
10
|
+
const getItems = (
|
|
11
|
+
localization: UI_I_Localization
|
|
12
|
+
): [string, boolean, string, string][] => {
|
|
13
|
+
return [
|
|
14
|
+
['', true, '10%', exceptionUsersTableKeys[0]],
|
|
15
|
+
[localization.common.user, true, '90%', exceptionUsersTableKeys[1]],
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const columnKeys = (localization: UI_I_Localization): UI_I_ColumnKey[] =>
|
|
20
|
+
defaultSettings.defaultColumnKeys(getItems(localization))
|
|
21
|
+
|
|
22
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] =>
|
|
23
|
+
defaultSettings.defaultHeadItems(getItems(localization))
|
|
24
|
+
|
|
25
|
+
export const bodyItems = (data: string[]): UI_I_BodyItem[][] => {
|
|
26
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
27
|
+
data.forEach((item: string, key) => {
|
|
28
|
+
bodyItems.push([
|
|
29
|
+
{
|
|
30
|
+
key: 'col1',
|
|
31
|
+
text: '',
|
|
32
|
+
id: key,
|
|
33
|
+
data: { id: key, name: item },
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: 'col2',
|
|
37
|
+
text: item,
|
|
38
|
+
id: key,
|
|
39
|
+
},
|
|
40
|
+
])
|
|
41
|
+
})
|
|
42
|
+
return bodyItems
|
|
43
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { UI_T_ExceptionUsersTableKeys } from '~/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/models/types'
|
|
2
|
+
|
|
3
|
+
export const exceptionUsersTableKeys: UI_T_ExceptionUsersTableKeys[] = [
|
|
4
|
+
'action',
|
|
5
|
+
'user',
|
|
6
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UI_T_ExceptionUsersTableKeys = 'action' | 'user'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_VerticalTabs } from '~/components/atoms/tabs/lib/models/interfaces'
|
|
3
|
+
|
|
4
|
+
export const navigateTabsFunc = (
|
|
5
|
+
localization: UI_I_Localization
|
|
6
|
+
): UI_I_VerticalTabs[] => {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
value: 1,
|
|
10
|
+
text: localization.common.lockdownMode,
|
|
11
|
+
testId: 'lockdown-mode-tab',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: 2,
|
|
15
|
+
text: localization.configureSecurityProfile.exceptionUsers,
|
|
16
|
+
testId: 'exception-users-tab',
|
|
17
|
+
},
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="currentComponent" v-model:form="form" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
7
|
+
|
|
8
|
+
const form = defineModel<UI_I_LockdownModeData>('form', {
|
|
9
|
+
required: true,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const { $store }: any = useNuxtApp()
|
|
13
|
+
|
|
14
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
15
|
+
const currentComponent = computed(() =>
|
|
16
|
+
isNewView.value
|
|
17
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
18
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
19
|
+
)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="lockdown-mode">
|
|
3
|
+
<h5 class="font-bold">{{ localization.common.lockdownMode }}</h5>
|
|
4
|
+
<p>{{ localization.configureSecurityProfile.lockdownModeDesc }}</p>
|
|
5
|
+
|
|
6
|
+
<div class="clr-form-control">
|
|
7
|
+
<label class="clr-col-12 clr-col-md-12 clr-control-label">
|
|
8
|
+
{{ localization.configureSecurityProfile.specifyHostLockdownMode }}
|
|
9
|
+
</label>
|
|
10
|
+
<div class="radio-content">
|
|
11
|
+
<div class="label-content">
|
|
12
|
+
<div class="flex-align-center">
|
|
13
|
+
<input
|
|
14
|
+
id="disabledValue"
|
|
15
|
+
v-model="form.lockdownMode"
|
|
16
|
+
type="radio"
|
|
17
|
+
class="custom-radio-button absolute"
|
|
18
|
+
value="disabled"
|
|
19
|
+
name="lockdownMode"
|
|
20
|
+
/>
|
|
21
|
+
<label for="disabledValue" class="custom-radio-label">
|
|
22
|
+
{{ localization.common.disabled }}
|
|
23
|
+
</label>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="radio-content">
|
|
28
|
+
<div class="label-content">
|
|
29
|
+
<div class="flex-align-center">
|
|
30
|
+
<input
|
|
31
|
+
id="normalValue"
|
|
32
|
+
v-model="form.lockdownMode"
|
|
33
|
+
type="radio"
|
|
34
|
+
class="custom-radio-button absolute"
|
|
35
|
+
value="normal"
|
|
36
|
+
name="lockdownMode"
|
|
37
|
+
/>
|
|
38
|
+
<label for="normalValue" class="custom-radio-label">
|
|
39
|
+
{{ localization.common.normal }}
|
|
40
|
+
</label>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="radio-content">
|
|
45
|
+
<div class="label-content">
|
|
46
|
+
<div class="flex-align-center">
|
|
47
|
+
<input
|
|
48
|
+
id="strictValue"
|
|
49
|
+
v-model="form.lockdownMode"
|
|
50
|
+
type="radio"
|
|
51
|
+
class="custom-radio-button absolute"
|
|
52
|
+
value="strict"
|
|
53
|
+
name="lockdownMode"
|
|
54
|
+
/>
|
|
55
|
+
<label for="strictValue" class="custom-radio-label">
|
|
56
|
+
{{ localization.common.strict }}
|
|
57
|
+
</label>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script setup lang="ts">
|
|
66
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
67
|
+
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
68
|
+
|
|
69
|
+
const form = defineModel<UI_I_LockdownModeData>('form', {
|
|
70
|
+
required: true,
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<common-headline :headline="props.title" class="items-center">
|
|
3
|
+
<template #action>
|
|
4
|
+
<button
|
|
5
|
+
class="btn btn-sm btn-secondary ng-star-inserted"
|
|
6
|
+
@click="emits('show-edit')"
|
|
7
|
+
>
|
|
8
|
+
{{ localization.common.edit }}...
|
|
9
|
+
</button>
|
|
10
|
+
</template>
|
|
11
|
+
</common-headline>
|
|
12
|
+
<p>{{ props.description }}</p>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
17
|
+
|
|
18
|
+
const props = defineProps<{
|
|
19
|
+
title: string
|
|
20
|
+
description: string
|
|
21
|
+
}>()
|
|
22
|
+
|
|
23
|
+
const emits = defineEmits<{
|
|
24
|
+
(event: 'show-edit'): void
|
|
25
|
+
}>()
|
|
26
|
+
|
|
27
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
:title="localization.common.lockdownMode"
|
|
5
|
+
:description="localization.configureSecurityProfile.lockdownModeDesc"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
11
|
+
|
|
12
|
+
const { $store }: any = useNuxtApp()
|
|
13
|
+
|
|
14
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
15
|
+
|
|
16
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
17
|
+
const currentComponent = computed(() =>
|
|
18
|
+
isNewView.value
|
|
19
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
20
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
21
|
+
)
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped lang="scss"></style>
|
|
@@ -21,6 +21,7 @@ export const portEditDataFunc = (
|
|
|
21
21
|
mtu: properties?.mtu,
|
|
22
22
|
services: {
|
|
23
23
|
Management: !!properties?.services.management,
|
|
24
|
+
VMotion: !!properties?.services.vMotion,
|
|
24
25
|
Provisioning: !!properties?.services.provisioning,
|
|
25
26
|
VSAN: !!properties?.services.vSAN,
|
|
26
27
|
},
|
|
@@ -86,45 +86,30 @@ const fields = ref<UI_I_PortProperties>({
|
|
|
86
86
|
},
|
|
87
87
|
})
|
|
88
88
|
|
|
89
|
-
const
|
|
90
|
-
tcp: UI_T_TCP,
|
|
91
|
-
currentFields: UI_I_PortProperties
|
|
92
|
-
): void => {
|
|
93
|
-
tcp === 'default' &&
|
|
94
|
-
(fields.value = {
|
|
95
|
-
...currentFields,
|
|
96
|
-
services: servicesInitial,
|
|
97
|
-
})
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const setEnabledServiceProvisioning = (
|
|
89
|
+
const setEnabledService = (
|
|
101
90
|
tcp: UI_T_TCP,
|
|
102
91
|
currentFields: UI_I_PortProperties,
|
|
103
92
|
newFields?: UI_I_PortProperties
|
|
104
93
|
): void => {
|
|
105
|
-
tcp === '
|
|
106
|
-
|
|
94
|
+
if (tcp === 'default') {
|
|
95
|
+
fields.value = {
|
|
96
|
+
...currentFields,
|
|
97
|
+
services: useDeepCopy(servicesInitial),
|
|
98
|
+
}
|
|
99
|
+
} else if (servicesInitial.hasOwnProperty(tcp)) {
|
|
100
|
+
fields.value = {
|
|
107
101
|
...(newFields || currentFields),
|
|
108
102
|
services: {
|
|
109
|
-
...servicesInitial,
|
|
110
|
-
|
|
103
|
+
...useDeepCopy(servicesInitial),
|
|
104
|
+
[tcp]: true,
|
|
111
105
|
},
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const setEnabledServiceVMotion = (
|
|
116
|
-
tcp: UI_T_TCP,
|
|
117
|
-
currentFields: UI_I_PortProperties,
|
|
118
|
-
newFields?: UI_I_PortProperties
|
|
119
|
-
): void => {
|
|
120
|
-
tcp === '' &&
|
|
121
|
-
(fields.value = {
|
|
106
|
+
}
|
|
107
|
+
} else {
|
|
108
|
+
fields.value = {
|
|
122
109
|
...(newFields || currentFields),
|
|
123
|
-
services:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
})
|
|
110
|
+
services: useDeepCopy(servicesInitial),
|
|
111
|
+
}
|
|
112
|
+
}
|
|
128
113
|
}
|
|
129
114
|
|
|
130
115
|
let oldFields = useDeepCopy(fields.value)
|
|
@@ -134,9 +119,7 @@ watch(
|
|
|
134
119
|
(newFields: UI_I_PortProperties) => {
|
|
135
120
|
if (newFields.tcp && newFields.tcp !== oldFields.tcp) {
|
|
136
121
|
emits('change-gateway-flag', false)
|
|
137
|
-
|
|
138
|
-
setEnabledServiceProvisioning(newFields.tcp, fields.value, newFields)
|
|
139
|
-
setEnabledServiceVMotion(newFields.tcp, fields.value, newFields)
|
|
122
|
+
setEnabledService(newFields.tcp, fields.value, newFields)
|
|
140
123
|
}
|
|
141
124
|
|
|
142
125
|
oldFields.networkLabel !== newFields.networkLabel &&
|
|
@@ -184,9 +167,7 @@ watch(
|
|
|
184
167
|
() => fields.value.tcp,
|
|
185
168
|
(newTcp: UI_T_TCP, oldTcp: UI_T_TCP) => {
|
|
186
169
|
if (newTcp !== oldTcp) {
|
|
187
|
-
|
|
188
|
-
setEnabledServiceProvisioning(newTcp, fields.value)
|
|
189
|
-
setEnabledServiceVMotion(newTcp, fields.value)
|
|
170
|
+
setEnabledService(newTcp, fields.value)
|
|
190
171
|
}
|
|
191
172
|
emits('change-port-properties', fields.value)
|
|
192
173
|
}
|
|
@@ -196,7 +177,10 @@ watch(
|
|
|
196
177
|
() => props.tcpStacks,
|
|
197
178
|
(newValue: UI_I_TCPStack[]) => {
|
|
198
179
|
if (fields.value.tcp === '') {
|
|
199
|
-
fields.value.tcp =
|
|
180
|
+
fields.value.tcp =
|
|
181
|
+
newValue?.find?.((item) => item.id === 'default')?.id ||
|
|
182
|
+
newValue?.[0]?.id ||
|
|
183
|
+
''
|
|
200
184
|
}
|
|
201
185
|
},
|
|
202
186
|
{ deep: true, immediate: true }
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<select id="tsp" v-model="fields.tcp" data-id="tsp-select">
|
|
147
147
|
<template v-for="tcp in props.tcpStacks" :key="tcp.id">
|
|
148
148
|
<option :value="tcp.id">
|
|
149
|
-
{{ localization.common[tcp.id] }}
|
|
149
|
+
{{ localization.common[tcp.id] || tcp.id }}
|
|
150
150
|
</option>
|
|
151
151
|
</template>
|
|
152
152
|
<!-- <option value="1">{{ localization.common.provisioning }}</option>-->
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface UI_API_I_LockdownModeData {
|
|
2
|
+
lockdownMode: string
|
|
3
|
+
exceptionUsers: string[]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface API_I_SecurityProfileData {
|
|
7
|
+
lockdownMode: UI_API_I_LockdownModeData
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface UI_I_LockdownModeData extends UI_API_I_LockdownModeData {}
|
|
11
|
+
|
|
12
|
+
export interface UI_I_SecurityProfileData extends API_I_SecurityProfileData {}
|