bfg-common 1.5.725 → 1.5.727
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/layout/theHeader/New.vue +301 -302
- package/components/common/layout/theHeader/Old.vue +252 -252
- package/components/common/layout/theHeader/TheHeader.vue +152 -154
- package/components/common/layout/theHeader/helpMenu/about/New.vue +97 -97
- package/components/common/layout/theHeader/userMenu/UserMenu.vue +104 -104
- package/package.json +1 -1
- package/composables/deepCopy.ts +0 -21
- package/composables/useUniqueId.ts +0 -5
|
@@ -1,154 +1,152 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="currentComponent"
|
|
4
|
-
v-model:security="security"
|
|
5
|
-
v-model:new-view-local="newViewLocal"
|
|
6
|
-
v-model:time-format="timeFormat"
|
|
7
|
-
v-model:console-value="consoleValue"
|
|
8
|
-
v-model:vm-in-hosts-clusters="vmInHostsClusters"
|
|
9
|
-
v-model:is-dark-theme="isDarkTheme"
|
|
10
|
-
:is-show-main-menu="props.isShowMainMenu"
|
|
11
|
-
:company-name="props.companyName"
|
|
12
|
-
:beta-text="props.betaText"
|
|
13
|
-
:global-refresh-loading="props.globalRefreshLoading"
|
|
14
|
-
:hostname="props.hostname"
|
|
15
|
-
:project-name="props.projectName"
|
|
16
|
-
:is-preference="props.isPreference"
|
|
17
|
-
:selected-language-type="props.selectedLanguageType"
|
|
18
|
-
:selected-lang="props.selectedLang"
|
|
19
|
-
:new-view="props.newView"
|
|
20
|
-
:project="props.project"
|
|
21
|
-
:security-loader="props.securityLoader"
|
|
22
|
-
:recovery="props.recovery"
|
|
23
|
-
@toggle-main-menu="emits('toggle-main-menu')"
|
|
24
|
-
@show-preference="emits('show-preference')"
|
|
25
|
-
@reset-preference="emits('reset-preference')"
|
|
26
|
-
@hide-preference="emits('hide-preference')"
|
|
27
|
-
@global-refresh="emits('global-refresh')"
|
|
28
|
-
@
|
|
29
|
-
@update-
|
|
30
|
-
@
|
|
31
|
-
@
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<common-layout-the-header-modals-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
import type {
|
|
41
|
-
import type {
|
|
42
|
-
import type {
|
|
43
|
-
import
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
(event: '
|
|
81
|
-
(event: '
|
|
82
|
-
(event: '
|
|
83
|
-
(event: '
|
|
84
|
-
(event: '
|
|
85
|
-
(event: '
|
|
86
|
-
(event: '
|
|
87
|
-
(event: '
|
|
88
|
-
(event: '
|
|
89
|
-
(event: '
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
v-model:security="security"
|
|
5
|
+
v-model:new-view-local="newViewLocal"
|
|
6
|
+
v-model:time-format="timeFormat"
|
|
7
|
+
v-model:console-value="consoleValue"
|
|
8
|
+
v-model:vm-in-hosts-clusters="vmInHostsClusters"
|
|
9
|
+
v-model:is-dark-theme="isDarkTheme"
|
|
10
|
+
:is-show-main-menu="props.isShowMainMenu"
|
|
11
|
+
:company-name="props.companyName"
|
|
12
|
+
:beta-text="props.betaText"
|
|
13
|
+
:global-refresh-loading="props.globalRefreshLoading"
|
|
14
|
+
:hostname="props.hostname"
|
|
15
|
+
:project-name="props.projectName"
|
|
16
|
+
:is-preference="props.isPreference"
|
|
17
|
+
:selected-language-type="props.selectedLanguageType"
|
|
18
|
+
:selected-lang="props.selectedLang"
|
|
19
|
+
:new-view="props.newView"
|
|
20
|
+
:project="props.project"
|
|
21
|
+
:security-loader="props.securityLoader"
|
|
22
|
+
:recovery="props.recovery"
|
|
23
|
+
@toggle-main-menu="emits('toggle-main-menu')"
|
|
24
|
+
@show-preference="emits('show-preference')"
|
|
25
|
+
@reset-preference="emits('reset-preference')"
|
|
26
|
+
@hide-preference="emits('hide-preference')"
|
|
27
|
+
@global-refresh="emits('global-refresh')"
|
|
28
|
+
@update-language="emits('update-language', $event)"
|
|
29
|
+
@update-is-browser="emits('update-is-browser', $event)"
|
|
30
|
+
@security-confirm="emits('security-confirm', $event)"
|
|
31
|
+
@submit-preferences="emits('submit-preferences')"
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<common-layout-the-header-modals-reconnect />
|
|
35
|
+
<common-layout-the-header-modals-redirect-login />
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
40
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
41
|
+
import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
|
|
42
|
+
import type { UI_I_Recovery } from '~/components/common/layout/theHeader/userMenu/modals/preferences/security/lib/models/interfaces'
|
|
43
|
+
import { checkIsTokenExpired } from '~/lib/utils/token'
|
|
44
|
+
|
|
45
|
+
const security = defineModel<boolean>('security')
|
|
46
|
+
const newViewLocal = defineModel<boolean>('newViewLocal')
|
|
47
|
+
const timeFormat = defineModel<UI_T_TimeValue>('timeFormat')
|
|
48
|
+
const consoleValue = defineModel<string>('consoleValue')
|
|
49
|
+
const vmInHostsClusters = defineModel<boolean>('vmInHostsClusters')
|
|
50
|
+
const isDarkTheme = defineModel<boolean>('isDarkTheme')
|
|
51
|
+
|
|
52
|
+
const props = withDefaults(
|
|
53
|
+
defineProps<{
|
|
54
|
+
isShowMainMenu: boolean
|
|
55
|
+
companyName: string
|
|
56
|
+
betaText: string
|
|
57
|
+
globalRefreshLoading: boolean
|
|
58
|
+
project: UI_T_Project
|
|
59
|
+
projectName: string
|
|
60
|
+
hostname: string
|
|
61
|
+
isPreference: boolean
|
|
62
|
+
selectedLanguageType: string
|
|
63
|
+
selectedLang: UI_I_Dropdown
|
|
64
|
+
newView: boolean
|
|
65
|
+
isPauseReconnect: boolean
|
|
66
|
+
expireTimeFromState: number
|
|
67
|
+
isShowReconnectModal: boolean
|
|
68
|
+
isShowRedirectLoginModal: boolean
|
|
69
|
+
securityLoader?: boolean // для Сферы
|
|
70
|
+
recovery?: UI_I_Recovery | null // для Сферы
|
|
71
|
+
}>(),
|
|
72
|
+
{
|
|
73
|
+
securityLoader: false,
|
|
74
|
+
recovery: null,
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
const emits = defineEmits<{
|
|
79
|
+
(event: 'toggle-main-menu'): void
|
|
80
|
+
(event: 'global-refresh'): void
|
|
81
|
+
(event: 'show-preference'): void
|
|
82
|
+
(event: 'reset-preference'): void
|
|
83
|
+
(event: 'hide-preference'): void
|
|
84
|
+
(event: 'update-language', value: UI_I_Dropdown): void
|
|
85
|
+
(event: 'update-is-browser', value: string): void
|
|
86
|
+
(event: 'security-confirm', value: boolean): void
|
|
87
|
+
(event: 'submit-preferences'): void
|
|
88
|
+
(event: 'show-redirect-login-modal', value: boolean): void
|
|
89
|
+
(event: 'show-reconnect-modal', value: boolean): void
|
|
90
|
+
}>()
|
|
91
|
+
|
|
92
|
+
const currentComponent = computed(() =>
|
|
93
|
+
props.newView
|
|
94
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
95
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
const inactivityTimer = ref<NodeJS.Timeout | undefined>(undefined)
|
|
99
|
+
const inactivityTimeout = ref<number>(10 * 60 * 1000)
|
|
100
|
+
|
|
101
|
+
const startInactivityTimer = (): void => {
|
|
102
|
+
inactivityTimer.value = setTimeout(() => {
|
|
103
|
+
// Проверяем если isPauseReconnect истина то не показываем модальное окно переподключения,
|
|
104
|
+
// к примеру если загружаем файл и он загружается дольше чем срабатывает таймаут
|
|
105
|
+
|
|
106
|
+
if (props.isPauseReconnect) {
|
|
107
|
+
startInactivityTimer()
|
|
108
|
+
return
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const expireTime =
|
|
112
|
+
props.expireTimeFromState || useCookie('token-expired-time').value
|
|
113
|
+
|
|
114
|
+
const isExpiredToken = checkIsTokenExpired(expireTime)
|
|
115
|
+
|
|
116
|
+
if (isExpiredToken) {
|
|
117
|
+
emits('show-redirect-login-modal', true)
|
|
118
|
+
|
|
119
|
+
if (props.isShowReconnectModal) {
|
|
120
|
+
emits('show-reconnect-modal', false)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (!isExpiredToken && !props.isShowRedirectLoginModal) {
|
|
125
|
+
emits('show-reconnect-modal', true)
|
|
126
|
+
startInactivityTimer()
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
console.log('Пользователь бездействует!')
|
|
130
|
+
}, inactivityTimeout.value)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const resetInactivityTimer = (): void => {
|
|
134
|
+
// Сброс таймера бездействия при каждом действии пользователя
|
|
135
|
+
inactivityTimer.value !== null && clearTimeout(inactivityTimer.value)
|
|
136
|
+
startInactivityTimer()
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
onMounted(() => {
|
|
140
|
+
document.addEventListener('mousemove', resetInactivityTimer)
|
|
141
|
+
|
|
142
|
+
startInactivityTimer()
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
onBeforeUnmount(() => {
|
|
146
|
+
document.removeEventListener('mousemove', resetInactivityTimer)
|
|
147
|
+
|
|
148
|
+
inactivityTimer.value !== null && clearTimeout(inactivityTimer.value)
|
|
149
|
+
})
|
|
150
|
+
</script>
|
|
151
|
+
|
|
152
|
+
<style scoped lang="scss"></style>
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ui-modal
|
|
3
|
-
:title="props.title"
|
|
4
|
-
:subtitle="props.subtitle"
|
|
5
|
-
:texts="{}"
|
|
6
|
-
test-id="about-modal"
|
|
7
|
-
width="720px"
|
|
8
|
-
show
|
|
9
|
-
@hide="onHideModal"
|
|
10
|
-
>
|
|
11
|
-
<template #content>
|
|
12
|
-
<ui-modal-block-standard>
|
|
13
|
-
<div class="about-modal__text">
|
|
14
|
-
<p>{{ aboutHeadingText }}</p>
|
|
15
|
-
|
|
16
|
-
<p>{{ localization.layout.aboutSubtitle }}</p>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<div class="about-modal__description">
|
|
20
|
-
{{ props.aboutDescOne
|
|
21
|
-
}}<a
|
|
22
|
-
id="about-description-link"
|
|
23
|
-
:href="url"
|
|
24
|
-
data-id="about-description-link"
|
|
25
|
-
target="_blank"
|
|
26
|
-
class="about-modal__description-link"
|
|
27
|
-
>
|
|
28
|
-
{{ props.url }} </a
|
|
29
|
-
>{{ props.aboutDescSecond }}
|
|
30
|
-
</div>
|
|
31
|
-
</ui-modal-block-standard>
|
|
32
|
-
</template>
|
|
33
|
-
<template #footer><div class="modal-footer-block"></div></template>
|
|
34
|
-
</ui-modal>
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<script lang="ts" setup>
|
|
38
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
39
|
-
|
|
40
|
-
const props = defineProps<{
|
|
41
|
-
title: string
|
|
42
|
-
subtitle: string
|
|
43
|
-
aboutHeadingText: string
|
|
44
|
-
aboutDescOne: string
|
|
45
|
-
aboutDescSecond: string
|
|
46
|
-
url: string
|
|
47
|
-
projectName: string // для warning console
|
|
48
|
-
}>()
|
|
49
|
-
const emits = defineEmits<{
|
|
50
|
-
(event: 'hide'): void
|
|
51
|
-
}>()
|
|
52
|
-
|
|
53
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
54
|
-
|
|
55
|
-
const onHideModal = (): void => {
|
|
56
|
-
emits('hide')
|
|
57
|
-
}
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<style lang="scss" scoped>
|
|
61
|
-
.modal-container-standard {
|
|
62
|
-
padding-top: 12px;
|
|
63
|
-
padding-bottom: 12px;
|
|
64
|
-
|
|
65
|
-
.about-modal {
|
|
66
|
-
&__text {
|
|
67
|
-
color: var(--about-text-color);
|
|
68
|
-
font-size: 13px;
|
|
69
|
-
font-weight: 400;
|
|
70
|
-
line-height: 15.73px;
|
|
71
|
-
|
|
72
|
-
p:last-child {
|
|
73
|
-
margin: 16px 0;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
&__description {
|
|
77
|
-
color: var(--about-text-color);
|
|
78
|
-
font-size: 13px;
|
|
79
|
-
font-weight: 400;
|
|
80
|
-
line-height: 15.73px;
|
|
81
|
-
|
|
82
|
-
&-link {
|
|
83
|
-
color: var(--about-text-link-color);
|
|
84
|
-
&:hover {
|
|
85
|
-
color: var(--about-text-link-hover-color);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
.modal-footer-block {
|
|
92
|
-
height: 32px;
|
|
93
|
-
}
|
|
94
|
-
:deep(.title-wrapper__subtitle) {
|
|
95
|
-
max-width: 400px;
|
|
96
|
-
}
|
|
97
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<ui-modal
|
|
3
|
+
:title="props.title"
|
|
4
|
+
:subtitle="props.subtitle"
|
|
5
|
+
:texts="{}"
|
|
6
|
+
test-id="about-modal"
|
|
7
|
+
width="720px"
|
|
8
|
+
show
|
|
9
|
+
@hide="onHideModal"
|
|
10
|
+
>
|
|
11
|
+
<template #content>
|
|
12
|
+
<ui-modal-block-standard>
|
|
13
|
+
<div class="about-modal__text">
|
|
14
|
+
<p>{{ aboutHeadingText }}</p>
|
|
15
|
+
|
|
16
|
+
<p>{{ localization.layout.aboutSubtitle }}</p>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="about-modal__description">
|
|
20
|
+
{{ props.aboutDescOne
|
|
21
|
+
}}<a
|
|
22
|
+
id="about-description-link"
|
|
23
|
+
:href="url"
|
|
24
|
+
data-id="about-description-link"
|
|
25
|
+
target="_blank"
|
|
26
|
+
class="about-modal__description-link"
|
|
27
|
+
>
|
|
28
|
+
{{ props.url }} </a
|
|
29
|
+
>{{ props.aboutDescSecond }}
|
|
30
|
+
</div>
|
|
31
|
+
</ui-modal-block-standard>
|
|
32
|
+
</template>
|
|
33
|
+
<template #footer><div class="modal-footer-block"></div></template>
|
|
34
|
+
</ui-modal>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script lang="ts" setup>
|
|
38
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
39
|
+
|
|
40
|
+
const props = defineProps<{
|
|
41
|
+
title: string
|
|
42
|
+
subtitle: string
|
|
43
|
+
aboutHeadingText: string
|
|
44
|
+
aboutDescOne: string
|
|
45
|
+
aboutDescSecond: string
|
|
46
|
+
url: string
|
|
47
|
+
projectName: string // для warning console
|
|
48
|
+
}>()
|
|
49
|
+
const emits = defineEmits<{
|
|
50
|
+
(event: 'hide'): void
|
|
51
|
+
}>()
|
|
52
|
+
|
|
53
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
54
|
+
|
|
55
|
+
const onHideModal = (): void => {
|
|
56
|
+
emits('hide')
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style lang="scss" scoped>
|
|
61
|
+
.modal-container-standard {
|
|
62
|
+
padding-top: 12px;
|
|
63
|
+
padding-bottom: 12px;
|
|
64
|
+
|
|
65
|
+
.about-modal {
|
|
66
|
+
&__text {
|
|
67
|
+
color: var(--about-text-color);
|
|
68
|
+
font-size: 13px;
|
|
69
|
+
font-weight: 400;
|
|
70
|
+
line-height: 15.73px;
|
|
71
|
+
|
|
72
|
+
p:last-child {
|
|
73
|
+
margin: 16px 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
&__description {
|
|
77
|
+
color: var(--about-text-color);
|
|
78
|
+
font-size: 13px;
|
|
79
|
+
font-weight: 400;
|
|
80
|
+
line-height: 15.73px;
|
|
81
|
+
|
|
82
|
+
&-link {
|
|
83
|
+
color: var(--about-text-link-color);
|
|
84
|
+
&:hover {
|
|
85
|
+
color: var(--about-text-link-hover-color);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
.modal-footer-block {
|
|
92
|
+
height: 32px;
|
|
93
|
+
}
|
|
94
|
+
:deep(.title-wrapper__subtitle) {
|
|
95
|
+
max-width: 400px;
|
|
96
|
+
}
|
|
97
|
+
</style>
|