bfg-common 1.5.762 → 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/browse/blocks/lib/models/types.ts +1 -1
- package/components/common/browse/lib/models/interfaces.ts +5 -5
- 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/modals/lib/config/vCenterModal.ts +48 -48
- package/components/common/diagramMain/network/Contents.vue +497 -497
- package/components/common/diagramMain/port/Port.vue +580 -580
- package/package.json +1 -1
- package/plugins/time.ts +58 -58
- package/store/inventory/modules/configure/securityProfile/lib/models/interfaces.ts +12 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export type UI_T_BlocksWidth = [number, number, number]
|
|
1
|
+
export type UI_T_BlocksWidth = [number, number, number]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export interface UI_I_FileInfo {
|
|
2
|
-
type: string
|
|
3
|
-
title: string
|
|
4
|
-
value: string | number
|
|
5
|
-
}
|
|
1
|
+
export interface UI_I_FileInfo {
|
|
2
|
+
type: string
|
|
3
|
+
title: string
|
|
4
|
+
value: string | number
|
|
5
|
+
}
|
|
@@ -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>
|