bfg-common 1.5.709 → 1.5.710
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CODE_STYLE.md +109 -109
- package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
- package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
- package/assets/img/icons/icons-sprite-light-3.svg +227 -227
- package/assets/img/icons/icons-sprite-light-5.svg +488 -488
- package/assets/localization/local_be.json +2 -1
- package/assets/localization/local_en.json +2 -1
- package/assets/localization/local_hy.json +2 -1
- package/assets/localization/local_kk.json +2 -1
- package/assets/localization/local_ru.json +2 -1
- package/assets/localization/local_zh.json +2 -1
- package/components/atoms/TheIcon3.vue +50 -50
- package/components/atoms/collapse/CollapseNav.vue +170 -170
- package/components/atoms/perPage/PerPage.vue +58 -58
- package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
- package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
- package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
- package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
- package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
- package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
- package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
- package/components/common/diagramMain/port/Port.vue +580 -580
- package/components/common/layout/theHeader/TheHeader.vue +191 -186
- package/components/common/layout/theHeader/TheHeaderNew.vue +7 -3
- package/components/common/layout/theHeader/TheHeaderOld.vue +7 -3
- package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
- package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
- package/components/common/layout/theHeader/userMenu/UserMenu.vue +113 -109
- package/components/common/layout/theHeader/userMenu/modals/preferences/Preferences.vue +86 -81
- package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesNew.vue +115 -113
- package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesOld.vue +4 -2
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +108 -114
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/New.vue +88 -65
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/Old.vue +89 -66
- package/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types.ts +7 -7
- package/components/common/layout/theHeader/userMenu/modals/preferences/view/View.vue +46 -33
- package/components/common/pages/backups/DetailView.vue +52 -52
- package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
- package/components/common/pages/backups/modals/Modals.vue +243 -243
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
- package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
- package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
- package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
- package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
- package/components/common/pages/home/lib/models/interfaces.ts +48 -48
- package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
- package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
- package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
- package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
- package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
- package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
- package/components/common/select/radio/RadioGroup.vue +137 -137
- package/components/common/selectLanguage/SelectLanguage.vue +200 -200
- package/components/common/spiceConsole/Drawer.vue +420 -420
- package/components/common/spiceConsole/SpiceConsole.vue +184 -184
- package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
- package/components/common/tools/Actions.vue +207 -207
- package/components/common/treeView/TreeView.vue +52 -52
- package/components/common/vm/actions/clone/lib/config/steps.ts +295 -295
- package/components/common/vm/actions/clone/new/New.vue +438 -438
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +283 -283
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +156 -156
- package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
- package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/options/New.vue +264 -264
- package/components/common/vm/actions/common/select/options/Options.vue +58 -58
- package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
- package/components/common/vm/actions/common/select/storage/new/New.vue +311 -311
- package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
- package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
- package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
- package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
- package/components/common/wizards/common/steps/computeResource/New.vue +93 -93
- package/components/common/wizards/common/steps/name/Name.vue +178 -178
- package/components/common/wizards/common/steps/name/New.vue +221 -221
- package/components/common/wizards/common/steps/name/Old.vue +121 -121
- package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
- package/components/common/wizards/common/steps/name/location/New.vue +40 -40
- package/components/common/wizards/datastore/add/Add.vue +228 -228
- package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
- package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
- package/composables/useAppVersion.ts +21 -21
- package/composables/useLocal.ts +6 -6
- package/composables/useLocalCommon.ts +39 -39
- package/package.json +1 -1
- package/plugins/console.ts +21 -21
- package/plugins/mouse.ts +21 -21
- package/plugins/panelStates.ts +70 -70
- package/plugins/text.ts +59 -59
- package/public/spice-console/application/clientgui.js +854 -854
- package/public/spice-console/application/packetfactory.js +211 -211
- package/public/spice-console/application/virtualmouse.js +147 -147
- package/public/spice-console/lib/images/bitmap.js +203 -203
- package/public/spice-console/network/spicechannel.js +440 -440
- package/public/spice-console/process/cursorprocess.js +128 -128
- package/public/spice-console/process/inputprocess.js +227 -227
- package/public/spice-console/process/mainprocess.js +212 -212
- package/public/spice-console/run.js +210 -210
- package/store/main/mutations.ts +7 -7
- package/store/main/state.ts +7 -7
- package/store/tasks/mappers/recentTasks.ts +123 -123
- package/store/tasks/mutations.ts +82 -82
|
@@ -1,113 +1,115 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ui-modal
|
|
3
|
-
:title="localization.common.preferences"
|
|
4
|
-
:texts="modalTexts"
|
|
5
|
-
test-id="user-preferences-modal"
|
|
6
|
-
width="580px"
|
|
7
|
-
show
|
|
8
|
-
@reset="emits('reset')"
|
|
9
|
-
@submit="emits('submit')"
|
|
10
|
-
@hide="onHide"
|
|
11
|
-
>
|
|
12
|
-
<template #content>
|
|
13
|
-
<ui-modal-block-standard>
|
|
14
|
-
<ui-modal-block-form-standard>
|
|
15
|
-
<common-layout-the-header-user-menu-modals-preferences-time-format
|
|
16
|
-
:new-view="props.newView"
|
|
17
|
-
:time-format="props.timeFormat"
|
|
18
|
-
@update-time-format="emits('update-time-format', $event)"
|
|
19
|
-
/>
|
|
20
|
-
</ui-modal-block-form-standard>
|
|
21
|
-
|
|
22
|
-
<ui-modal-block-form-standard>
|
|
23
|
-
<common-layout-the-header-user-menu-modals-preferences-change-language
|
|
24
|
-
:new-view="props.newView"
|
|
25
|
-
:selected-type="props.selectedLanguageType"
|
|
26
|
-
:selected-language="props.selectedLanguage"
|
|
27
|
-
@update-language="emits('update-language', $event)"
|
|
28
|
-
@update-is-browser="emits('update-is-browser', $event)"
|
|
29
|
-
/>
|
|
30
|
-
</ui-modal-block-form-standard>
|
|
31
|
-
|
|
32
|
-
<ui-modal-block-form-standard v-if="isSphere">
|
|
33
|
-
<common-layout-the-header-user-menu-modals-preferences-default-console
|
|
34
|
-
:new-view="props.newView"
|
|
35
|
-
:remote-console="props.remoteConsole"
|
|
36
|
-
@update-remote-console="emits('update-remote-console', $event)"
|
|
37
|
-
/>
|
|
38
|
-
</ui-modal-block-form-standard>
|
|
39
|
-
|
|
40
|
-
<ui-modal-block-form-standard v-if="isSphere">
|
|
41
|
-
<common-layout-the-header-user-menu-modals-preferences-inventory
|
|
42
|
-
:new-view="props.newView"
|
|
43
|
-
:vm-cluster="props.vmCluster"
|
|
44
|
-
@update-vm-clusters="emits('update-vm-clusters', $event)"
|
|
45
|
-
/>
|
|
46
|
-
</ui-modal-block-form-standard>
|
|
47
|
-
|
|
48
|
-
<ui-modal-block-form-standard v-if="isSphere">
|
|
49
|
-
<common-layout-the-header-user-menu-modals-preferences-security
|
|
50
|
-
v-model:security="security"
|
|
51
|
-
:recovery="props.recovery"
|
|
52
|
-
@confirm="emits('security-confirm', $event)"
|
|
53
|
-
/>
|
|
54
|
-
</ui-modal-block-form-standard>
|
|
55
|
-
|
|
56
|
-
<ui-modal-block-form-standard without-border-bottom>
|
|
57
|
-
<common-layout-the-header-user-menu-modals-preferences-view
|
|
58
|
-
|
|
59
|
-
:new-view="props.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
import type {
|
|
70
|
-
import type {
|
|
71
|
-
import type {
|
|
72
|
-
import type {
|
|
73
|
-
import type {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const props = defineProps<{
|
|
79
|
-
project: UI_T_Project
|
|
80
|
-
timeFormat: UI_T_TimeValue
|
|
81
|
-
selectedLanguage: UI_I_Dropdown
|
|
82
|
-
selectedLanguageType: UI_T_LangValue
|
|
83
|
-
newView: boolean
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
(event: '
|
|
91
|
-
(event: 'update-
|
|
92
|
-
(event: 'update-
|
|
93
|
-
(event: 'update-
|
|
94
|
-
(event: 'update-
|
|
95
|
-
(event: '
|
|
96
|
-
(event: '
|
|
97
|
-
(event: '
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<ui-modal
|
|
3
|
+
:title="localization.common.preferences"
|
|
4
|
+
:texts="modalTexts"
|
|
5
|
+
test-id="user-preferences-modal"
|
|
6
|
+
width="580px"
|
|
7
|
+
show
|
|
8
|
+
@reset="emits('reset')"
|
|
9
|
+
@submit="emits('submit')"
|
|
10
|
+
@hide="onHide"
|
|
11
|
+
>
|
|
12
|
+
<template #content>
|
|
13
|
+
<ui-modal-block-standard>
|
|
14
|
+
<ui-modal-block-form-standard>
|
|
15
|
+
<common-layout-the-header-user-menu-modals-preferences-time-format
|
|
16
|
+
:new-view="props.newView"
|
|
17
|
+
:time-format="props.timeFormat"
|
|
18
|
+
@update-time-format="emits('update-time-format', $event)"
|
|
19
|
+
/>
|
|
20
|
+
</ui-modal-block-form-standard>
|
|
21
|
+
|
|
22
|
+
<ui-modal-block-form-standard>
|
|
23
|
+
<common-layout-the-header-user-menu-modals-preferences-change-language
|
|
24
|
+
:new-view="props.newView"
|
|
25
|
+
:selected-type="props.selectedLanguageType"
|
|
26
|
+
:selected-language="props.selectedLanguage"
|
|
27
|
+
@update-language="emits('update-language', $event)"
|
|
28
|
+
@update-is-browser="emits('update-is-browser', $event)"
|
|
29
|
+
/>
|
|
30
|
+
</ui-modal-block-form-standard>
|
|
31
|
+
|
|
32
|
+
<ui-modal-block-form-standard v-if="isSphere">
|
|
33
|
+
<common-layout-the-header-user-menu-modals-preferences-default-console
|
|
34
|
+
:new-view="props.newView"
|
|
35
|
+
:remote-console="props.remoteConsole"
|
|
36
|
+
@update-remote-console="emits('update-remote-console', $event)"
|
|
37
|
+
/>
|
|
38
|
+
</ui-modal-block-form-standard>
|
|
39
|
+
|
|
40
|
+
<ui-modal-block-form-standard v-if="isSphere">
|
|
41
|
+
<common-layout-the-header-user-menu-modals-preferences-inventory
|
|
42
|
+
:new-view="props.newView"
|
|
43
|
+
:vm-cluster="props.vmCluster"
|
|
44
|
+
@update-vm-clusters="emits('update-vm-clusters', $event)"
|
|
45
|
+
/>
|
|
46
|
+
</ui-modal-block-form-standard>
|
|
47
|
+
|
|
48
|
+
<ui-modal-block-form-standard v-if="isSphere">
|
|
49
|
+
<common-layout-the-header-user-menu-modals-preferences-security
|
|
50
|
+
v-model:security="security"
|
|
51
|
+
:recovery="props.recovery"
|
|
52
|
+
@confirm="emits('security-confirm', $event)"
|
|
53
|
+
/>
|
|
54
|
+
</ui-modal-block-form-standard>
|
|
55
|
+
|
|
56
|
+
<ui-modal-block-form-standard without-border-bottom>
|
|
57
|
+
<common-layout-the-header-user-menu-modals-preferences-view
|
|
58
|
+
:new-view="props.newView"
|
|
59
|
+
:new-view-local="props.newViewLocal"
|
|
60
|
+
@update-is-new-view="emits('update-is-new-view', $event)"
|
|
61
|
+
/>
|
|
62
|
+
</ui-modal-block-form-standard>
|
|
63
|
+
</ui-modal-block-standard>
|
|
64
|
+
</template>
|
|
65
|
+
</ui-modal>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup lang="ts">
|
|
69
|
+
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
70
|
+
import type { UI_I_ModalTexts } from '~/node_modules/bfg-uikit/components/ui/modal/models/interfaces'
|
|
71
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
72
|
+
import type { UI_T_LangValue, UI_T_Project } from '~/lib/models/types'
|
|
73
|
+
import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
|
|
74
|
+
import type { UI_I_Recovery } from '~/components/common/layout/theHeader/userMenu/modals/preferences/security/lib/models/interfaces'
|
|
75
|
+
|
|
76
|
+
const security = defineModel<boolean>('security')
|
|
77
|
+
|
|
78
|
+
const props = defineProps<{
|
|
79
|
+
project: UI_T_Project
|
|
80
|
+
timeFormat: UI_T_TimeValue
|
|
81
|
+
selectedLanguage: UI_I_Dropdown
|
|
82
|
+
selectedLanguageType: UI_T_LangValue
|
|
83
|
+
newView: boolean
|
|
84
|
+
newViewLocal: boolean
|
|
85
|
+
remoteConsole: string
|
|
86
|
+
vmCluster: boolean
|
|
87
|
+
recovery: UI_I_Recovery | null // для Сферы
|
|
88
|
+
}>()
|
|
89
|
+
const emits = defineEmits<{
|
|
90
|
+
(event: 'hide'): void
|
|
91
|
+
(event: 'update-time-format', value: UI_T_TimeValue): void
|
|
92
|
+
(event: 'update-language', value: UI_I_Dropdown): void
|
|
93
|
+
(event: 'update-is-browser', value: string): void
|
|
94
|
+
(event: 'update-is-new-view', value: boolean): void
|
|
95
|
+
(event: 'update-remote-console', value: string): void
|
|
96
|
+
(event: 'update-vm-clusters', value: boolean): void
|
|
97
|
+
(event: 'security-confirm', value: boolean): void
|
|
98
|
+
(event: 'submit'): void
|
|
99
|
+
(event: 'reset'): void
|
|
100
|
+
}>()
|
|
101
|
+
|
|
102
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
103
|
+
|
|
104
|
+
const modalTexts = ref<UI_I_ModalTexts>({
|
|
105
|
+
resetToDefault: localization.value.common.resetToDefault,
|
|
106
|
+
button1: localization.value.common.cancel,
|
|
107
|
+
button2: localization.value.common.save,
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const isSphere = ref<boolean>(props.project === 'sphere')
|
|
111
|
+
|
|
112
|
+
const onHide = (): void => {
|
|
113
|
+
emits('hide')
|
|
114
|
+
}
|
|
115
|
+
</script>
|
|
@@ -54,8 +54,9 @@
|
|
|
54
54
|
|
|
55
55
|
<common-layout-the-header-user-menu-modals-preferences-view
|
|
56
56
|
v-if="selectedTab === 'view-tab'"
|
|
57
|
-
v-model:new-view-local="newViewLocal"
|
|
58
57
|
:new-view="props.newView"
|
|
58
|
+
:new-view-local="props.newViewLocal"
|
|
59
|
+
@update-is-new-view="emits('update-is-new-view', $event)"
|
|
59
60
|
/>
|
|
60
61
|
</template>
|
|
61
62
|
|
|
@@ -90,7 +91,6 @@ import type { UI_I_Recovery } from '~/components/common/layout/theHeader/userMen
|
|
|
90
91
|
import { preferencesTabs } from '~/components/common/layout/theHeader/userMenu/modals/preferences/lib/config/preferencesTabs'
|
|
91
92
|
|
|
92
93
|
const security = defineModel<boolean>('security')
|
|
93
|
-
const newViewLocal = defineModel<boolean>('newViewLocal')
|
|
94
94
|
|
|
95
95
|
const props = defineProps<{
|
|
96
96
|
project: UI_T_Project
|
|
@@ -98,6 +98,7 @@ const props = defineProps<{
|
|
|
98
98
|
selectedLanguage: UI_T_LangValue
|
|
99
99
|
selectedLanguageType: UI_T_LangValue
|
|
100
100
|
newView: boolean
|
|
101
|
+
newViewLocal: boolean
|
|
101
102
|
remoteConsole: string
|
|
102
103
|
vmCluster: boolean
|
|
103
104
|
securityLoader: boolean // для Сферы
|
|
@@ -108,6 +109,7 @@ const emits = defineEmits<{
|
|
|
108
109
|
(event: 'update-time-format', value: UI_T_TimeValue): void
|
|
109
110
|
(event: 'update-language', value: string): void
|
|
110
111
|
(event: 'update-is-browser', value: string): void
|
|
112
|
+
(event: 'update-is-new-view', value: boolean): void
|
|
111
113
|
(event: 'update-remote-console', value: string): void
|
|
112
114
|
(event: 'update-vm-clusters', value: boolean): void
|
|
113
115
|
(event: 'security-confirm', value: boolean): void
|
|
@@ -1,114 +1,108 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="currentComponent"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
:
|
|
7
|
-
:
|
|
8
|
-
:locales="locales"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import type {
|
|
16
|
-
import type {
|
|
17
|
-
import type {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
50
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
watch(selectedLanguageLocal, (newValue) => {
|
|
112
|
-
onSelectLang(newValue)
|
|
113
|
-
})
|
|
114
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
:selected-language="selectedLanguageLocal"
|
|
5
|
+
:description="description"
|
|
6
|
+
:radio-options="radioOptions"
|
|
7
|
+
:language-mode="languageMode"
|
|
8
|
+
:locales="locales"
|
|
9
|
+
@update-language="onSelectLang"
|
|
10
|
+
@update-is-browser="onUpdateIsBrowser"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
16
|
+
import type { UI_T_LangValue } from '~/lib/models/types'
|
|
17
|
+
import type { UI_T_SelectedRadio } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/types'
|
|
18
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
19
|
+
import type { UI_I_RadioItemLang } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/interfaces'
|
|
20
|
+
import { UI_E_DetectSelectedRadio } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/enums'
|
|
21
|
+
import { locales } from '~/components/common/selectLanguage/lib/config/config'
|
|
22
|
+
import { findInLocals } from '~/components/common/selectLanguage/lib/utils/utils'
|
|
23
|
+
import { radioOptionsFunc } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/config/radioOptions'
|
|
24
|
+
import { defineBrowserLangFunc } from '~/components/common/layout/theHeader/lib/utils/localization'
|
|
25
|
+
|
|
26
|
+
const props = defineProps<{
|
|
27
|
+
newView: boolean
|
|
28
|
+
selectedType: UI_T_LangValue
|
|
29
|
+
selectedLanguage: UI_I_Dropdown | UI_T_LangValue
|
|
30
|
+
}>()
|
|
31
|
+
|
|
32
|
+
const emits = defineEmits<{
|
|
33
|
+
(event: 'update-language', value: UI_I_Dropdown): void
|
|
34
|
+
(event: 'update-is-browser', value: string): void
|
|
35
|
+
}>()
|
|
36
|
+
|
|
37
|
+
const config = useRuntimeConfig()
|
|
38
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
39
|
+
|
|
40
|
+
const currentComponent = computed(() =>
|
|
41
|
+
props.newView
|
|
42
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
43
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
const description = computed<string>(() => {
|
|
47
|
+
return localization.value.common.languageDesc.replaceAll(
|
|
48
|
+
'{trademark}',
|
|
49
|
+
String(config.public[`TRADEMARK_${useEnvLanguage()}`])
|
|
50
|
+
)
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const radioOptions = readonly<UI_I_RadioItemLang[]>(
|
|
54
|
+
radioOptionsFunc(localization.value)
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
const languageMode = ref<UI_T_SelectedRadio>(
|
|
58
|
+
UI_E_DetectSelectedRadio[props.selectedType]
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
const selectedLanguageLocal = ref<UI_I_Dropdown | UI_T_LangValue>(
|
|
62
|
+
props.selectedLanguage
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
const setPreferenceLang = (language: string): void => {
|
|
66
|
+
let currentLang = language
|
|
67
|
+
|
|
68
|
+
language === 'BROWSER' &&
|
|
69
|
+
(currentLang = findInLocals(defineBrowserLangFunc()))
|
|
70
|
+
|
|
71
|
+
emits('update-language', currentLang)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const onSelectLang = (newValue: string): void => {
|
|
75
|
+
selectedLanguageLocal.value && setPreferenceLang(newValue)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const onChange = (): void => {
|
|
79
|
+
const lang =
|
|
80
|
+
languageMode.value === 'LANG'
|
|
81
|
+
? selectedLanguageLocal.value
|
|
82
|
+
: languageMode.value // 'BROWSER'
|
|
83
|
+
|
|
84
|
+
lang && setPreferenceLang(lang)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const onUpdateIsBrowser = (value: string): void => {
|
|
88
|
+
emits('update-is-browser', value)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
watch(
|
|
92
|
+
() => props.selectedLanguage,
|
|
93
|
+
(newValue: UI_I_Dropdown) => {
|
|
94
|
+
selectedLanguageLocal.value = newValue
|
|
95
|
+
},
|
|
96
|
+
{ immediate: true }
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
watch(
|
|
100
|
+
() => props.selectedType,
|
|
101
|
+
(newValue: UI_T_LangValue) => {
|
|
102
|
+
languageMode.value = UI_E_DetectSelectedRadio[newValue]
|
|
103
|
+
onChange()
|
|
104
|
+
newValue && onUpdateIsBrowser(newValue)
|
|
105
|
+
},
|
|
106
|
+
{ immediate: true }
|
|
107
|
+
)
|
|
108
|
+
</script>
|
package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/New.vue
CHANGED
|
@@ -1,65 +1,88 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<form id="change-language-form" @submit.prevent>
|
|
3
|
-
<div class="flex">
|
|
4
|
-
<ui-modal-icon>
|
|
5
|
-
<ui-icon-icon3 name="language-new" width="20" height="20" />
|
|
6
|
-
</ui-modal-icon>
|
|
7
|
-
|
|
8
|
-
<div>
|
|
9
|
-
<div class="form-first-title">
|
|
10
|
-
{{ localization.common.language }}
|
|
11
|
-
</div>
|
|
12
|
-
<div class="form-second-title">
|
|
13
|
-
{{ props.description }}
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<div v-for="(item, key) in radioOptions" :key="key" class="radio flex">
|
|
17
|
-
<ui-radio
|
|
18
|
-
v-model="
|
|
19
|
-
:test-id="item.testId"
|
|
20
|
-
:label="item.label"
|
|
21
|
-
:value="item.value"
|
|
22
|
-
size="md"
|
|
23
|
-
/>
|
|
24
|
-
|
|
25
|
-
<span v-if="item.selectLang" class="select-language">
|
|
26
|
-
<common-select-language
|
|
27
|
-
v-model="
|
|
28
|
-
:normalize-lang="props.locales"
|
|
29
|
-
:disabled="
|
|
30
|
-
width="max-content"
|
|
31
|
-
size="xs"
|
|
32
|
-
/>
|
|
33
|
-
</span>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</form>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script setup lang="ts">
|
|
41
|
-
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
42
|
-
import type { UI_T_SelectedRadio } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/types'
|
|
43
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
44
|
-
import type { UI_I_RadioItemLang } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/interfaces'
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
locales: UI_I_Dropdown[]
|
|
52
|
-
}>()
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<form id="change-language-form" @submit.prevent>
|
|
3
|
+
<div class="flex">
|
|
4
|
+
<ui-modal-icon>
|
|
5
|
+
<ui-icon-icon3 name="language-new" width="20" height="20" />
|
|
6
|
+
</ui-modal-icon>
|
|
7
|
+
|
|
8
|
+
<div>
|
|
9
|
+
<div class="form-first-title">
|
|
10
|
+
{{ localization.common.language }}
|
|
11
|
+
</div>
|
|
12
|
+
<div class="form-second-title">
|
|
13
|
+
{{ props.description }}
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div v-for="(item, key) in radioOptions" :key="key" class="radio flex">
|
|
17
|
+
<ui-radio
|
|
18
|
+
v-model="languageModeLocal"
|
|
19
|
+
:test-id="item.testId"
|
|
20
|
+
:label="item.label"
|
|
21
|
+
:value="item.value"
|
|
22
|
+
size="md"
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<span v-if="item.selectLang" class="select-language">
|
|
26
|
+
<common-select-language
|
|
27
|
+
v-model="selectedLanguageLocal"
|
|
28
|
+
:normalize-lang="props.locales"
|
|
29
|
+
:disabled="languageModeLocal === 'BROWSER'"
|
|
30
|
+
width="max-content"
|
|
31
|
+
size="xs"
|
|
32
|
+
/>
|
|
33
|
+
</span>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</form>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
42
|
+
import type { UI_T_SelectedRadio } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/types'
|
|
43
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
44
|
+
import type { UI_I_RadioItemLang } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/interfaces'
|
|
45
|
+
|
|
46
|
+
const props = defineProps<{
|
|
47
|
+
selectedLanguage: UI_I_Dropdown
|
|
48
|
+
description: string
|
|
49
|
+
radioOptions: UI_I_RadioItemLang[]
|
|
50
|
+
languageMode: UI_T_SelectedRadio
|
|
51
|
+
locales: UI_I_Dropdown[]
|
|
52
|
+
}>()
|
|
53
|
+
|
|
54
|
+
const emits = defineEmits<{
|
|
55
|
+
(event: 'update-language', value: UI_I_Dropdown): void
|
|
56
|
+
(event: 'update-is-browser', value: string): void
|
|
57
|
+
}>()
|
|
58
|
+
|
|
59
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
60
|
+
|
|
61
|
+
const selectedLanguageLocal = computed<UI_I_Dropdown>({
|
|
62
|
+
get() {
|
|
63
|
+
return props.selectedLanguage
|
|
64
|
+
},
|
|
65
|
+
set(newValue: UI_I_Dropdown) {
|
|
66
|
+
emits('update-language', newValue)
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const languageModeLocal = computed<UI_T_SelectedRadio>({
|
|
71
|
+
get() {
|
|
72
|
+
return props.languageMode
|
|
73
|
+
},
|
|
74
|
+
set(newValue: UI_T_SelectedRadio) {
|
|
75
|
+
emits('update-is-browser', newValue)
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<style lang="scss" scoped>
|
|
81
|
+
.radio:not(:last-child) {
|
|
82
|
+
margin-bottom: 8px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.select-language {
|
|
86
|
+
margin-left: 8px;
|
|
87
|
+
}
|
|
88
|
+
</style>
|