bfg-common 1.3.467 → 1.3.468

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.
Files changed (109) hide show
  1. package/assets/scss/common/normalize.scss +340 -340
  2. package/components/atoms/TheIcon2.vue +1353 -1353
  3. package/components/atoms/loader/Loader.vue +30 -30
  4. package/components/atoms/loader/PreLoader.vue +38 -38
  5. package/components/atoms/switch/Switch.vue +111 -111
  6. package/components/atoms/table/compact/Compact.vue +526 -526
  7. package/components/common/adapterManager/ui/table/Header.vue +93 -93
  8. package/components/common/adapterManager/ui/table/Table.vue +162 -162
  9. package/components/common/context/Context.vue +99 -99
  10. package/components/common/layout/theHeader/LanguageSwitch.vue +102 -0
  11. package/components/common/layout/theHeader/TheHeader.vue +91 -0
  12. package/components/common/layout/theHeader/TheHeaderNew.vue +229 -0
  13. package/components/common/layout/theHeader/TheHeaderOld.vue +241 -0
  14. package/components/common/layout/theHeader/feedback/Feedback.vue +104 -0
  15. package/components/common/layout/theHeader/feedback/FeedbackNew.vue +63 -0
  16. package/components/common/layout/theHeader/feedback/FeedbackOld.vue +73 -0
  17. package/components/common/layout/theHeader/helpMenu/About.vue +110 -0
  18. package/components/common/layout/theHeader/helpMenu/HelpMenu.vue +45 -0
  19. package/components/common/layout/theHeader/helpMenu/helpMenuNew/HelpMenuNew.vue +112 -0
  20. package/components/common/layout/theHeader/helpMenu/helpMenuNew/lib/config/dropMenu.ts +25 -0
  21. package/components/common/layout/theHeader/helpMenu/helpMenuOld/HelpMenuOld.vue +69 -0
  22. package/components/common/layout/theHeader/helpMenu/helpMenuOld/lib/config/dropMenu.ts +22 -0
  23. package/components/common/layout/theHeader/helpMenu/helpMenuOld/lib/models/types.ts +1 -0
  24. package/components/common/layout/theHeader/lib/models/types.ts +5 -0
  25. package/components/common/layout/theHeader/modals/Reconnect.vue +98 -0
  26. package/components/common/layout/theHeader/modals/RedirectLogin.vue +60 -0
  27. package/components/common/layout/theHeader/userMenu/UserMenu.vue +95 -0
  28. package/components/common/layout/theHeader/userMenu/lib/models/interfaces.ts +32 -0
  29. package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePassword.vue +210 -0
  30. package/components/common/layout/theHeader/userMenu/modals/changePassword/lib/config/form.ts +31 -0
  31. package/components/common/layout/theHeader/userMenu/modals/changePassword/lib/models/interfaces.ts +12 -0
  32. package/components/common/layout/theHeader/userMenu/modals/preferences/Inventory.vue +43 -0
  33. package/components/common/layout/theHeader/userMenu/modals/preferences/Preferences.vue +119 -0
  34. package/components/common/layout/theHeader/userMenu/modals/preferences/View.vue +113 -0
  35. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +148 -0
  36. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/config/lang.ts +10 -0
  37. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/config/radioOptions.ts +22 -0
  38. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/enums.ts +9 -0
  39. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/interfaces.ts +11 -0
  40. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/types.ts +1 -0
  41. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsole.vue +66 -0
  42. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/config/consoleOptions.ts +30 -0
  43. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/models/interfaces.ts +5 -0
  44. package/components/common/layout/theHeader/userMenu/modals/preferences/lib/config/preferencesTabs.ts +68 -0
  45. package/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types.ts +1 -0
  46. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormat.vue +67 -0
  47. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions.ts +27 -0
  48. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types.ts +1 -0
  49. package/components/common/layout/theHeader/userMenu/userMenuNew/UserMenuNew.vue +114 -0
  50. package/components/common/layout/theHeader/userMenu/userMenuNew/lib/config/dropMenu.ts +28 -0
  51. package/components/common/layout/theHeader/userMenu/userMenuOld/UserMenuOld.vue +36 -0
  52. package/components/common/layout/theHeader/userMenu/userMenuOld/lib/config/dropMenu.ts +36 -0
  53. package/components/common/layout/theHeader/userMenu/userMenuOld/lib/models/types.ts +5 -0
  54. package/components/common/lib/config/states.ts +160 -160
  55. package/components/common/mainNavigationPanel/MainNavigationPanel.vue +142 -142
  56. package/components/common/mainNavigationPanel/MainNavigationPanelNew.vue +248 -248
  57. package/components/common/mainNavigationPanel/MainNavigationPanelOld.vue +288 -288
  58. package/components/common/readyToComplete/ReadyToComplete.vue +15 -15
  59. package/components/common/resource/progressBlock/ProgressBlock.vue +142 -142
  60. package/components/common/split/horizontal/Horizontal.vue +70 -70
  61. package/components/common/vm/actions/clone/Clone.vue +511 -511
  62. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +273 -273
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +697 -697
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +400 -400
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +329 -329
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +305 -305
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +168 -168
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +82 -82
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +32 -32
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +182 -182
  71. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +114 -114
  72. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +192 -192
  73. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +72 -72
  74. package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +164 -164
  75. package/components/common/vm/actions/common/select/name/Name.vue +235 -235
  76. package/components/common/vm/actions/common/select/storage/Storage.vue +198 -198
  77. package/components/common/vm/actions/editSettings/EditSettings.vue +316 -316
  78. package/components/common/weekSelect/lib/config/options.ts +10 -10
  79. package/components/common/wizards/datastore/add/Add.vue +436 -436
  80. package/components/common/wizards/datastore/add/lib/config/stepItems.ts +191 -191
  81. package/components/common/wizards/datastore/add/lib/models/interfaces.ts +38 -38
  82. package/components/common/wizards/datastore/add/lib/utils.ts +70 -70
  83. package/components/common/wizards/datastore/add/local/createName/CreateName.vue +160 -160
  84. package/components/common/wizards/datastore/add/nfs/Nfs.vue +112 -112
  85. package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +104 -104
  86. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -62
  87. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +53 -53
  88. package/components/common/wizards/datastore/add/readyComplete/ReadyComplete.vue +86 -86
  89. package/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails.ts +184 -184
  90. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/DeviceSelection.vue +459 -459
  91. package/components/common/wizards/datastore/add/types/Types.vue +80 -80
  92. package/components/common/wizards/datastore/add/types/lib/config/typeOptions.ts +49 -49
  93. package/composables/useAppVersion.ts +22 -22
  94. package/composables/useEnvLanguage.ts +20 -20
  95. package/lib/utils/sendTask.ts +73 -73
  96. package/minify.js +146 -146
  97. package/package.json +2 -1
  98. package/plugins/spice-console/spice.console.ts +147 -147
  99. package/public/spice-console/application/codec.js +263 -263
  100. package/public/spice-console/lib/rasterEngine.js +907 -907
  101. package/public/spice-console/network/spicechannel.js +375 -375
  102. package/store/main/lib/interfaces.ts +9 -9
  103. package/store/tasks/actions.ts +133 -133
  104. package/store/tasks/getters.ts +25 -25
  105. package/store/tasks/lib/models/interfaces.ts +18 -18
  106. package/store/tasks/mutations.ts +58 -58
  107. package/store/tasks/state.ts +16 -16
  108. /package/components/{layout → common/layout}/theHeader/lib/models/enums.ts +0 -0
  109. /package/components/{layout → common/layout}/theHeader/lib/utils/localization.ts +0 -0
@@ -0,0 +1,112 @@
1
+ <template>
2
+ <div class="help-menu-content">
3
+ <button
4
+ id="help-menu-dropdown-toggle"
5
+ data-id="help-menu-dropdown-toggle"
6
+ class="help-menu-dropdown-toggle"
7
+ @click="isShowDropdown = !isShowDropdown"
8
+ >
9
+ <span class="help-icon-container">
10
+ <ui-icon-icon3 name="help" width="24" height="24" />
11
+ </span>
12
+ <span class="arrow-icon-container">
13
+ <ui-icon name="arrow2" width="16" height="8" />
14
+ </span>
15
+ </button>
16
+ </div>
17
+ <ui-dropdown
18
+ test-id="help-menu-dropdown"
19
+ :show="isShowDropdown"
20
+ :items="dropdownItems"
21
+ width="max-content"
22
+ elem-id="help-menu-dropdown-toggle"
23
+ @select="onSelectDropdown"
24
+ @hide="onHideDropdown"
25
+ />
26
+
27
+ <common-layout-the-header-feedback
28
+ :is-show-feedback="isShowFeedback"
29
+ @show="isShowFeedback = true"
30
+ @hide="isShowFeedback = false"
31
+ />
32
+ </template>
33
+
34
+ <script setup lang="ts">
35
+ import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
36
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
37
+ import { helpMenuFunc } from '~/components/common/layout/theHeader/helpMenu/helpMenuNew/lib/config/dropMenu'
38
+
39
+ const emits = defineEmits<{
40
+ (event: 'select-dropdown', value: string): void
41
+ }>()
42
+
43
+ const localization = computed<UI_I_Localization>(() => useLocal())
44
+
45
+ const isShowFeedback = ref<boolean>(false)
46
+
47
+ const isShowDropdown = ref<boolean>(false)
48
+ const dropdownItems = computed<UI_I_Dropdown[]>(() =>
49
+ helpMenuFunc(localization.value)
50
+ )
51
+
52
+ const onHideDropdown = (): void => {
53
+ isShowDropdown.value = false
54
+ }
55
+
56
+ const onSelectDropdown = (value: string): void => {
57
+ switch (value) {
58
+ case 'sendFeedback':
59
+ isShowFeedback.value = true
60
+ break
61
+ default:
62
+ emits('select-dropdown', value)
63
+ }
64
+ onHideDropdown()
65
+ }
66
+ </script>
67
+
68
+ <style scoped lang="scss">
69
+ .help-menu-content {
70
+ .help-menu-dropdown-toggle {
71
+ border: unset;
72
+ padding: 0;
73
+ outline: unset;
74
+ background: transparent;
75
+ cursor: pointer;
76
+ display: flex;
77
+ align-items: center;
78
+
79
+ &:hover {
80
+ .help-icon-container {
81
+ :deep(svg) {
82
+ color: #ffffff;
83
+ }
84
+ }
85
+ .arrow-icon-container {
86
+ color: #ffffff;
87
+ }
88
+ }
89
+
90
+ .help-icon-container {
91
+ display: flex;
92
+ margin-right: 10px;
93
+
94
+ :deep(svg) {
95
+ color: #d3d6da;
96
+ }
97
+ }
98
+ .arrow-icon-container {
99
+ display: flex;
100
+ transform: rotate(90deg);
101
+ color: #d3d6da;
102
+ }
103
+ }
104
+
105
+ :deep(span.nav-icon) {
106
+ padding: 0 !important;
107
+ }
108
+ }
109
+ #dropdown-help-menu-dropdown {
110
+ margin-top: 17px;
111
+ }
112
+ </style>
@@ -0,0 +1,25 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
3
+
4
+ export const helpMenuFunc = (
5
+ localization: UI_I_Localization
6
+ ): UI_I_Dropdown[] => {
7
+ return [
8
+ {
9
+ text: localization.help,
10
+ value: 'help',
11
+ testId: 'information-menu-help',
12
+ },
13
+ {
14
+ text: localization.about,
15
+ value: 'about',
16
+ testId: 'information-menu-about',
17
+ divider: true,
18
+ },
19
+ {
20
+ text: localization.sendFeedback,
21
+ value: 'sendFeedback',
22
+ testId: 'information-menu-send-feedback',
23
+ },
24
+ ]
25
+ }
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <div class="tid-control-bar-help-menu help-menu">
3
+ <atoms-dropdown
4
+ test-id="help-menu-dropdown"
5
+ :drop-menu="helpMenu"
6
+ @select="emits('select-dropdown', $event.action)"
7
+ >
8
+ <template #icon>
9
+ <atoms-the-icon class="help-icon" name="help-icon" />
10
+ </template>
11
+ </atoms-dropdown>
12
+ </div>
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import type { UI_I_DropMenu } from '~/components/atoms/dropdown/dropdown/lib/models/interfaces'
17
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
18
+ import type { UI_T_ActionTypeHelpMenu } from '~/components/common/layout/theHeader/helpMenu/helpMenuOld/lib/models/types'
19
+ import { helpMenuFunc } from '~/components/common/layout/theHeader/helpMenu/helpMenuOld/lib/config/dropMenu'
20
+
21
+ const emits = defineEmits<{
22
+ (event: 'select-dropdown', value: string): void
23
+ }>()
24
+
25
+ const localization = computed<UI_I_Localization>(() => useLocal())
26
+ const helpMenu = computed<UI_I_DropMenu<UI_T_ActionTypeHelpMenu>[]>(() =>
27
+ helpMenuFunc(localization.value)
28
+ )
29
+ </script>
30
+
31
+ <style lang="scss">
32
+ .help-menu {
33
+ .help-icon {
34
+ width: 24px;
35
+ height: 24px;
36
+ margin: 0 6px 0 9px;
37
+ stroke: none;
38
+ fill: #fafafa;
39
+ }
40
+ }
41
+ .about-vsphere-dialog-legal-section {
42
+ color: var(--description-color);
43
+ a {
44
+ color: var(--link-visited-color);
45
+ }
46
+ }
47
+
48
+ .separator {
49
+ content: '';
50
+ border-left: 1px solid #ccc;
51
+ margin: 0 18px;
52
+ height: 22px;
53
+ }
54
+ .close-icon {
55
+ fill: var(--close-icon);
56
+ width: 24px;
57
+ height: 24px;
58
+ }
59
+
60
+ :root {
61
+ --description-color: #414b57;
62
+ --link-visited-color: #5659b8;
63
+ }
64
+
65
+ :root.dark-theme {
66
+ --description-color: #adbbc4;
67
+ --link-visited-color: #49afd9;
68
+ }
69
+ </style>
@@ -0,0 +1,22 @@
1
+ import type { UI_I_DropMenu } from '~/components/atoms/dropdown/dropdown/lib/models/interfaces'
2
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
3
+ import type { UI_T_ActionTypeHelpMenu } from '~/components/common/layout/theHeader/helpMenu/helpMenuOld/lib/models/types'
4
+
5
+ export const helpMenuFunc = (
6
+ localization: UI_I_Localization
7
+ ): UI_I_DropMenu<UI_T_ActionTypeHelpMenu>[] => {
8
+ return [
9
+ {
10
+ text: localization.help,
11
+ action: 'help',
12
+ closeAfterClick: true,
13
+ testId: 'information-menu-help',
14
+ },
15
+ {
16
+ text: localization.about,
17
+ action: 'about',
18
+ closeAfterClick: true,
19
+ testId: 'information-menu-about',
20
+ },
21
+ ]
22
+ }
@@ -0,0 +1 @@
1
+ export type UI_T_ActionTypeHelpMenu = 'help' | 'about'
@@ -0,0 +1,5 @@
1
+ export type UI_T_ActionTypeUserMenu =
2
+ | 'popup'
3
+ | 'logout'
4
+ | 'themeMode'
5
+ | 'popupPreferences'
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <atoms-modal
3
+ test-id="connection-timeout-reconnect-modal"
4
+ width="580px"
5
+ :show="isShow"
6
+ :title="localization.connectionTimeout"
7
+ class="connection-timeout"
8
+ is-hide-close-icon
9
+ >
10
+ <template #modalBody>
11
+ <div class="connection-timeout__body">
12
+ <span>{{ localization.yourSessionExpireAfter }}:</span>
13
+ <common-countdown-timer :timer="timer" :total-time="totalTime" />
14
+ </div>
15
+ </template>
16
+
17
+ <template #modalFooter>
18
+ <button
19
+ id="logout-button"
20
+ data-id="logout-button"
21
+ class="btn btn-outline"
22
+ @click="onLogout"
23
+ >
24
+ {{ localization.logout }}
25
+ </button>
26
+
27
+ <button
28
+ id="reconnect-button"
29
+ data-id="reconnect-button"
30
+ class="btn btn-primary"
31
+ @click="onReconnect"
32
+ >
33
+ {{ localization.reconnect }}
34
+ </button>
35
+ </template>
36
+ </atoms-modal>
37
+ </template>
38
+
39
+ <script lang="ts" setup>
40
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
41
+
42
+ const localization = computed<UI_I_Localization>(() => useLocal())
43
+ const { $store }: any = useNuxtApp()
44
+
45
+ const isShow = computed<boolean>(
46
+ () => $store.getters['main/isShowReconnectModal']
47
+ )
48
+ const hideModal = (): void => {
49
+ $store.dispatch('main/A_SHOW_RECONNECT_MODAL', false)
50
+ }
51
+
52
+ const totalTime = ref<number>(60)
53
+ const timer = ref<NodeJS.Timer | null>(null)
54
+ const countdown = (): void => {
55
+ totalTime.value--
56
+ if (totalTime.value === 0) {
57
+ endTimer()
58
+ }
59
+ }
60
+ const startTimer = (): void => {
61
+ timer.value = setInterval(() => countdown(), 1000)
62
+ }
63
+ const endTimer = (): void => {
64
+ onLogout()
65
+ }
66
+ const onLogout = async (): Promise<void> => {
67
+ await $store.dispatch('auth/A_LOGOUT')
68
+ resetTimer()
69
+ hideModal()
70
+ }
71
+ const onReconnect = async (): Promise<void> => {
72
+ location.reload()
73
+ // await $store.dispatch('auth/A_REFRESH')
74
+ resetTimer()
75
+ hideModal()
76
+ }
77
+
78
+ const resetTimer = (): void => {
79
+ timer.value !== null && clearInterval(timer.value)
80
+ totalTime.value = 60
81
+ }
82
+ watch(
83
+ isShow,
84
+ (newValue) => {
85
+ newValue && startTimer()
86
+ },
87
+ { immediate: true }
88
+ )
89
+ </script>
90
+
91
+ <style lang="scss" scoped>
92
+ .connection-timeout {
93
+ &__body {
94
+ text-align: center;
95
+ margin: 15px 0;
96
+ }
97
+ }
98
+ </style>
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <atoms-modal
3
+ test-id="connection-timeout-modal"
4
+ width="580px"
5
+ :show="isShow"
6
+ :title="localization.connectionTimeout"
7
+ class="connection-timeout"
8
+ is-hide-close-icon
9
+ >
10
+ <template #modalBody>
11
+ <div class="connection-timeout__body">
12
+ <atoms-alert
13
+ v-show="true"
14
+ test-id="connection-timeout-alert"
15
+ status="alert-danger"
16
+ :items="[localization.connectionTimeoutErrorDesc]"
17
+ hide-close-icon
18
+ />
19
+ </div>
20
+ </template>
21
+
22
+ <template #modalFooter>
23
+ <button
24
+ id="redirect-login-page-button"
25
+ data-id="redirect-login-page-button"
26
+ class="btn btn-primary"
27
+ @click="onRedirectLoginPage"
28
+ >
29
+ {{ localization.login }}
30
+ </button>
31
+ </template>
32
+ </atoms-modal>
33
+ </template>
34
+
35
+ <script lang="ts" setup>
36
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
37
+
38
+ const localization = computed<UI_I_Localization>(() => useLocal())
39
+ const { $store }: any = useNuxtApp()
40
+
41
+ const isShow = computed<boolean>(
42
+ () => $store.getters['main/isShowRedirectLoginModal']
43
+ )
44
+ const hideModal = (): void => {
45
+ $store.dispatch('main/A_SHOW_REDIRECT_LOGIN_MODAL', false)
46
+ }
47
+ const onRedirectLoginPage = async (): Promise<void> => {
48
+ await $store.dispatch('auth/A_LOGOUT')
49
+
50
+ hideModal()
51
+ }
52
+ </script>
53
+
54
+ <style lang="scss" scoped>
55
+ .connection-timeout {
56
+ &__body {
57
+ margin: 40px 0;
58
+ }
59
+ }
60
+ </style>
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <common-layout-the-header-user-menu-user-menu-new
3
+ v-if="isNewView"
4
+ :hostname="props.hostname"
5
+ @select-dropdown="onSelectDropdown"
6
+ />
7
+ <common-layout-the-header-user-menu-user-menu-old
8
+ v-else
9
+ :hostname="props.hostname"
10
+ @select-dropdown="onSelectDropdown"
11
+ />
12
+
13
+ <Teleport to="body">
14
+ <common-layout-the-header-user-menu-modals-change-password
15
+ :show="isChangePassword"
16
+ :hostname="props.hostname"
17
+ :project="props.project"
18
+ @hide="isChangePassword = false"
19
+ />
20
+
21
+ <common-layout-the-header-user-menu-modals-preferences
22
+ v-if="props.isPreference"
23
+ :time-format="props.timeFormat"
24
+ :user="props.userFromStore"
25
+ :new-view="props.newView"
26
+ :selected-language-type="props.selectedLanguageType"
27
+ :selected-language="props.selectedLanguage"
28
+ :project="props.project"
29
+ @hide="emits('hide-preference')"
30
+ @update-time-format="emits('update-time-format', $event)"
31
+ @update-language="emits('update-language', $event)"
32
+ @update-language-type="emits('update-language-type', $event)"
33
+ @update-is-browser="emits('update-is-browser', $event)"
34
+ @update-is-new-view="emits('update-is-new-view', $event)"
35
+ @submit="emits('submit-preferences')"
36
+ />
37
+ </Teleport>
38
+ </template>
39
+
40
+ <script setup lang="ts">
41
+ import type { UI_T_LangValue } from '~/lib/models/types'
42
+ import type { UI_I_User } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
43
+ import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
44
+
45
+ const props = defineProps<{
46
+ hostname: string
47
+ project: string
48
+ isPreference: boolean
49
+ newView: boolean
50
+ timeFormat: UI_T_TimeValue
51
+ selectedLanguageType: UI_T_LangValue
52
+ selectedLanguage: UI_T_LangValue
53
+ userFromStore?: UI_I_User
54
+ }>()
55
+ const emits = defineEmits<{
56
+ (event: 'show-preference'): void
57
+ (event: 'hide-preference'): void
58
+ (event: 'change-theme-mode'): void
59
+ (event: 'update-time-format', value: UI_T_TimeValue): void
60
+ (event: 'update-language', value: string): void
61
+ (event: 'update-language-type', value: string): void
62
+ (event: 'update-is-browser', value: string): void
63
+ (event: 'update-is-new-view', value: boolean): void
64
+ (event: 'submit-preferences'): void
65
+ }>()
66
+
67
+ const { $store }: any = useNuxtApp()
68
+
69
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
70
+
71
+ const isChangePassword = ref<boolean>(false)
72
+
73
+ const onLogout = async (): Promise<void> => {
74
+ await $store.dispatch('auth/A_LOGOUT', null)
75
+ }
76
+
77
+ const onSelectDropdown = (value: string): void => {
78
+ switch (value) {
79
+ case 'changePassword':
80
+ isChangePassword.value = true
81
+ break
82
+ case 'preferences':
83
+ emits('show-preference')
84
+ break
85
+ case 'themeMode':
86
+ emits('change-theme-mode')
87
+ break
88
+ case 'logout':
89
+ onLogout()
90
+ break
91
+ }
92
+ }
93
+ </script>
94
+
95
+ <style scoped lang="scss"></style>
@@ -0,0 +1,32 @@
1
+ import type { UI_I_DropMenu } from '~/components/atoms/dropdown/dropdown/lib/models/interfaces'
2
+ import type { UI_T_ActionTypeUserMenu } from '~/components/common/layout/theHeader/lib/models/types'
3
+
4
+ export interface UI_I_ProfileDropMenu
5
+ extends UI_I_DropMenu<UI_T_ActionTypeUserMenu> {}
6
+
7
+ export interface UI_I_RadioItem {
8
+ id: number
9
+ label: string
10
+ value: string
11
+ testId: string
12
+ }
13
+
14
+ export interface UI_I_UserPreferences {
15
+ time_format: string
16
+ vm_in_hosts_clusters: boolean
17
+ dark_color_theme: boolean
18
+ language: string
19
+ remote_console: string
20
+ new_view: boolean
21
+ }
22
+
23
+ export interface UI_I_User {
24
+ id: string
25
+ first_name: string
26
+ last_name: string
27
+ email: string
28
+ username: string
29
+ description: string
30
+ enabled: boolean
31
+ ui_options: UI_I_UserPreferences
32
+ }