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.
- package/assets/scss/common/normalize.scss +340 -340
- package/components/atoms/TheIcon2.vue +1353 -1353
- package/components/atoms/loader/Loader.vue +30 -30
- package/components/atoms/loader/PreLoader.vue +38 -38
- package/components/atoms/switch/Switch.vue +111 -111
- package/components/atoms/table/compact/Compact.vue +526 -526
- package/components/common/adapterManager/ui/table/Header.vue +93 -93
- package/components/common/adapterManager/ui/table/Table.vue +162 -162
- package/components/common/context/Context.vue +99 -99
- package/components/common/layout/theHeader/LanguageSwitch.vue +102 -0
- package/components/common/layout/theHeader/TheHeader.vue +91 -0
- package/components/common/layout/theHeader/TheHeaderNew.vue +229 -0
- package/components/common/layout/theHeader/TheHeaderOld.vue +241 -0
- package/components/common/layout/theHeader/feedback/Feedback.vue +104 -0
- package/components/common/layout/theHeader/feedback/FeedbackNew.vue +63 -0
- package/components/common/layout/theHeader/feedback/FeedbackOld.vue +73 -0
- package/components/common/layout/theHeader/helpMenu/About.vue +110 -0
- package/components/common/layout/theHeader/helpMenu/HelpMenu.vue +45 -0
- package/components/common/layout/theHeader/helpMenu/helpMenuNew/HelpMenuNew.vue +112 -0
- package/components/common/layout/theHeader/helpMenu/helpMenuNew/lib/config/dropMenu.ts +25 -0
- package/components/common/layout/theHeader/helpMenu/helpMenuOld/HelpMenuOld.vue +69 -0
- package/components/common/layout/theHeader/helpMenu/helpMenuOld/lib/config/dropMenu.ts +22 -0
- package/components/common/layout/theHeader/helpMenu/helpMenuOld/lib/models/types.ts +1 -0
- package/components/common/layout/theHeader/lib/models/types.ts +5 -0
- package/components/common/layout/theHeader/modals/Reconnect.vue +98 -0
- package/components/common/layout/theHeader/modals/RedirectLogin.vue +60 -0
- package/components/common/layout/theHeader/userMenu/UserMenu.vue +95 -0
- package/components/common/layout/theHeader/userMenu/lib/models/interfaces.ts +32 -0
- package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePassword.vue +210 -0
- package/components/common/layout/theHeader/userMenu/modals/changePassword/lib/config/form.ts +31 -0
- package/components/common/layout/theHeader/userMenu/modals/changePassword/lib/models/interfaces.ts +12 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/Inventory.vue +43 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/Preferences.vue +119 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/View.vue +113 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +148 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/config/lang.ts +10 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/config/radioOptions.ts +22 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/enums.ts +9 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/interfaces.ts +11 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/types.ts +1 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsole.vue +66 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/config/consoleOptions.ts +30 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/models/interfaces.ts +5 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/lib/config/preferencesTabs.ts +68 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types.ts +1 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormat.vue +67 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions.ts +27 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types.ts +1 -0
- package/components/common/layout/theHeader/userMenu/userMenuNew/UserMenuNew.vue +114 -0
- package/components/common/layout/theHeader/userMenu/userMenuNew/lib/config/dropMenu.ts +28 -0
- package/components/common/layout/theHeader/userMenu/userMenuOld/UserMenuOld.vue +36 -0
- package/components/common/layout/theHeader/userMenu/userMenuOld/lib/config/dropMenu.ts +36 -0
- package/components/common/layout/theHeader/userMenu/userMenuOld/lib/models/types.ts +5 -0
- package/components/common/lib/config/states.ts +160 -160
- package/components/common/mainNavigationPanel/MainNavigationPanel.vue +142 -142
- package/components/common/mainNavigationPanel/MainNavigationPanelNew.vue +248 -248
- package/components/common/mainNavigationPanel/MainNavigationPanelOld.vue +288 -288
- package/components/common/readyToComplete/ReadyToComplete.vue +15 -15
- package/components/common/resource/progressBlock/ProgressBlock.vue +142 -142
- package/components/common/split/horizontal/Horizontal.vue +70 -70
- package/components/common/vm/actions/clone/Clone.vue +511 -511
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +273 -273
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +697 -697
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +400 -400
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +329 -329
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +305 -305
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +168 -168
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +82 -82
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +32 -32
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +182 -182
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +114 -114
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +192 -192
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +72 -72
- package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +164 -164
- package/components/common/vm/actions/common/select/name/Name.vue +235 -235
- package/components/common/vm/actions/common/select/storage/Storage.vue +198 -198
- package/components/common/vm/actions/editSettings/EditSettings.vue +316 -316
- package/components/common/weekSelect/lib/config/options.ts +10 -10
- package/components/common/wizards/datastore/add/Add.vue +436 -436
- package/components/common/wizards/datastore/add/lib/config/stepItems.ts +191 -191
- package/components/common/wizards/datastore/add/lib/models/interfaces.ts +38 -38
- package/components/common/wizards/datastore/add/lib/utils.ts +70 -70
- package/components/common/wizards/datastore/add/local/createName/CreateName.vue +160 -160
- package/components/common/wizards/datastore/add/nfs/Nfs.vue +112 -112
- package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +104 -104
- package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -62
- package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +53 -53
- package/components/common/wizards/datastore/add/readyComplete/ReadyComplete.vue +86 -86
- package/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails.ts +184 -184
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/DeviceSelection.vue +459 -459
- package/components/common/wizards/datastore/add/types/Types.vue +80 -80
- package/components/common/wizards/datastore/add/types/lib/config/typeOptions.ts +49 -49
- package/composables/useAppVersion.ts +22 -22
- package/composables/useEnvLanguage.ts +20 -20
- package/lib/utils/sendTask.ts +73 -73
- package/minify.js +146 -146
- package/package.json +2 -1
- package/plugins/spice-console/spice.console.ts +147 -147
- package/public/spice-console/application/codec.js +263 -263
- package/public/spice-console/lib/rasterEngine.js +907 -907
- package/public/spice-console/network/spicechannel.js +375 -375
- package/store/main/lib/interfaces.ts +9 -9
- package/store/tasks/actions.ts +133 -133
- package/store/tasks/getters.ts +25 -25
- package/store/tasks/lib/models/interfaces.ts +18 -18
- package/store/tasks/mutations.ts +58 -58
- package/store/tasks/state.ts +16 -16
- /package/components/{layout → common/layout}/theHeader/lib/models/enums.ts +0 -0
- /package/components/{layout → common/layout}/theHeader/lib/utils/localization.ts +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_RadioItemLang } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/interfaces'
|
|
3
|
+
|
|
4
|
+
export const radioOptionsFunc = (
|
|
5
|
+
localization: UI_I_Localization
|
|
6
|
+
): UI_I_RadioItemLang[] => {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
id: 1,
|
|
10
|
+
label: localization.browserDefault,
|
|
11
|
+
value: 'BROWSER',
|
|
12
|
+
testId: 'browser-type',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 2,
|
|
16
|
+
label: localization.specifyLanguage,
|
|
17
|
+
value: 'LANG',
|
|
18
|
+
selectLang: true,
|
|
19
|
+
testId: 'specify-language-type',
|
|
20
|
+
},
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
|
|
2
|
+
|
|
3
|
+
export interface UI_I_RadioItemLang extends UI_I_RadioItem {
|
|
4
|
+
selectLang?: boolean
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface UI_I_LanguageItem {
|
|
8
|
+
text: string
|
|
9
|
+
value: string
|
|
10
|
+
lang: string
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UI_T_SelectedRadio = 'BROWSER' | 'LANG'
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form class="compact change-default-console ng-valid ng-dirty ng-touched">
|
|
3
|
+
<div class="description">
|
|
4
|
+
{{ localization.defaultConsoleDesc }}
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div
|
|
8
|
+
v-for="(item, key) in consoleOptions"
|
|
9
|
+
:key="key"
|
|
10
|
+
:class="['radio', item.disabled && 'disabled']"
|
|
11
|
+
>
|
|
12
|
+
<input
|
|
13
|
+
:id="item.label"
|
|
14
|
+
v-model="consoleValue"
|
|
15
|
+
:data-id="item.testId"
|
|
16
|
+
type="radio"
|
|
17
|
+
:value="item.value"
|
|
18
|
+
:disabled="item.disabled"
|
|
19
|
+
@change="onChange"
|
|
20
|
+
/>
|
|
21
|
+
<label :for="item.label">
|
|
22
|
+
{{ item.label }}
|
|
23
|
+
</label>
|
|
24
|
+
</div>
|
|
25
|
+
</form>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
30
|
+
import type { UI_I_RadioItemConsole } from '~/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/models/interfaces'
|
|
31
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
32
|
+
import { consoleOptionsFunc } from '~/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/config/consoleOptions'
|
|
33
|
+
|
|
34
|
+
const props = defineProps<{
|
|
35
|
+
remoteConsole: string
|
|
36
|
+
project: UI_T_Project
|
|
37
|
+
}>()
|
|
38
|
+
|
|
39
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
40
|
+
const { $store }: any = useNuxtApp()
|
|
41
|
+
|
|
42
|
+
const consoleValue = ref<string>(props.remoteConsole)
|
|
43
|
+
const consoleOptions = readonly<UI_I_RadioItemConsole[]>(
|
|
44
|
+
consoleOptionsFunc(localization.value)
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
const onChange = (): void => {
|
|
48
|
+
if (props.project === 'sphere')
|
|
49
|
+
$store.dispatch('profile/A_PREFERENCES_FOR_CHANGING', {
|
|
50
|
+
remote_console: consoleValue.value,
|
|
51
|
+
})
|
|
52
|
+
else if (props.project === 'procurator')
|
|
53
|
+
$store.commit('profile/M_UPDATE_USER_PREFERENCE', {
|
|
54
|
+
remote_console: consoleValue.value,
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<style lang="scss" scoped>
|
|
60
|
+
.radio {
|
|
61
|
+
margin-bottom: 5px;
|
|
62
|
+
&:nth-child(2) {
|
|
63
|
+
margin-top: 10px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_RadioItemConsole } from '~/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/models/interfaces'
|
|
3
|
+
|
|
4
|
+
export const consoleOptionsFunc = (
|
|
5
|
+
localization: UI_I_Localization
|
|
6
|
+
): UI_I_RadioItemConsole[] => {
|
|
7
|
+
const config = useRuntimeConfig()
|
|
8
|
+
|
|
9
|
+
const remoteConsole = localization.remoteConsoleVmrc.replaceAll(
|
|
10
|
+
'{trademark}',
|
|
11
|
+
String(config.public[`TRADEMARK_${useEnvLanguage()}`])
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
id: 1,
|
|
17
|
+
label: localization.webConsole,
|
|
18
|
+
value: 'spice',
|
|
19
|
+
disabled: false,
|
|
20
|
+
testId: 'web-type',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 2,
|
|
24
|
+
label: remoteConsole,
|
|
25
|
+
value: 'VMRC',
|
|
26
|
+
disabled: true,
|
|
27
|
+
testId: 'vmrc-type',
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
}
|
package/components/common/layout/theHeader/userMenu/modals/preferences/lib/config/preferencesTabs.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
2
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
3
|
+
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
4
|
+
|
|
5
|
+
export const preferencesTabs = (
|
|
6
|
+
localization: UI_I_Localization,
|
|
7
|
+
project: UI_T_Project
|
|
8
|
+
): UI_I_CollapseNavItem[] => {
|
|
9
|
+
let result: UI_I_CollapseNavItem[] = []
|
|
10
|
+
|
|
11
|
+
if (project === 'sphere') {
|
|
12
|
+
result = [
|
|
13
|
+
{
|
|
14
|
+
text: `${localization.timeFormat}`,
|
|
15
|
+
value: 'time-tab',
|
|
16
|
+
disabled: false,
|
|
17
|
+
testId: 'user-preferences-time-format',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
text: `${localization.language}`,
|
|
21
|
+
value: 'language-tab',
|
|
22
|
+
disabled: false,
|
|
23
|
+
testId: 'user-preferences-language',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
text: `${localization.defaultConsole}`,
|
|
27
|
+
value: 'console-tab',
|
|
28
|
+
disabled: false,
|
|
29
|
+
testId: 'user-preferences-default-console',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
text: `${localization.inventory}`,
|
|
33
|
+
value: 'inventory-tab',
|
|
34
|
+
disabled: false,
|
|
35
|
+
testId: 'user-preferences-inventory',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
text: `${localization.view}`,
|
|
39
|
+
value: 'view-tab',
|
|
40
|
+
disabled: false,
|
|
41
|
+
testId: 'user-preferences-view',
|
|
42
|
+
},
|
|
43
|
+
]
|
|
44
|
+
} else if (project === 'procurator') {
|
|
45
|
+
result = [
|
|
46
|
+
{
|
|
47
|
+
text: `${localization.timeFormat}`,
|
|
48
|
+
value: 'time-tab',
|
|
49
|
+
disabled: false,
|
|
50
|
+
testId: 'time-format',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
text: `${localization.language}`,
|
|
54
|
+
value: 'language-tab',
|
|
55
|
+
disabled: false,
|
|
56
|
+
testId: 'language',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
text: `${localization.view}`,
|
|
60
|
+
value: 'view-tab',
|
|
61
|
+
disabled: false,
|
|
62
|
+
testId: 'view',
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return result
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UI_T_UserPreferenceTab = 'time-tab' | 'language-tab' | 'console-tab' | 'inventory-tab'
|
package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormat.vue
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form id="time-format-form" class="compact ng-valid ng-dirty ng-touched">
|
|
3
|
+
<div class="description">
|
|
4
|
+
{{ description }}
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div v-for="(item, key) in formatOptions" :key="key" class="radio">
|
|
8
|
+
<input
|
|
9
|
+
:id="item.value"
|
|
10
|
+
v-model="timeItem"
|
|
11
|
+
:data-id="item.testId"
|
|
12
|
+
type="radio"
|
|
13
|
+
:value="item.value"
|
|
14
|
+
@change="onChange"
|
|
15
|
+
/>
|
|
16
|
+
<label :for="item.value">
|
|
17
|
+
{{ item.label }}
|
|
18
|
+
</label>
|
|
19
|
+
</div>
|
|
20
|
+
</form>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
25
|
+
import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
|
|
26
|
+
import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
|
|
27
|
+
import { formatOptionsFunc } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions'
|
|
28
|
+
|
|
29
|
+
const props = defineProps<{
|
|
30
|
+
timeFormat: UI_T_TimeValue
|
|
31
|
+
}>()
|
|
32
|
+
const emits = defineEmits<{
|
|
33
|
+
(event: 'update', value: UI_T_TimeValue): void
|
|
34
|
+
}>()
|
|
35
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
36
|
+
|
|
37
|
+
const config = useRuntimeConfig()
|
|
38
|
+
const description = computed<string>(() =>
|
|
39
|
+
localization.value.timeFormatDesc.replaceAll(
|
|
40
|
+
'{trademark}',
|
|
41
|
+
String(config.public[`TRADEMARK_${useEnvLanguage()}`])
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
const formatOptions = readonly<UI_I_RadioItem[]>(
|
|
46
|
+
formatOptionsFunc(localization.value)
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
const timeItem = ref<UI_T_TimeValue>(props.timeFormat)
|
|
50
|
+
|
|
51
|
+
const onChange = (): void => {
|
|
52
|
+
emits('update', timeItem.value)
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped>
|
|
57
|
+
.radio {
|
|
58
|
+
margin-bottom: 5px;
|
|
59
|
+
&:nth-child(2) {
|
|
60
|
+
margin-top: 10px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
input[type='radio']:focus:checked + label::before,
|
|
64
|
+
input[type='radio']:focus + label::before {
|
|
65
|
+
box-shadow: inset 0 0 0 0.25rem #0094d2;
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
|
|
3
|
+
|
|
4
|
+
export const formatOptionsFunc = (
|
|
5
|
+
localization: UI_I_Localization
|
|
6
|
+
): UI_I_RadioItem[] => {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
id: 1,
|
|
10
|
+
label: localization.languageDefault,
|
|
11
|
+
value: 'DEFAULT',
|
|
12
|
+
testId: 'default-type',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 2,
|
|
16
|
+
label: localization.hourFormat12,
|
|
17
|
+
value: '12H',
|
|
18
|
+
testId: '12h-type',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: 3,
|
|
22
|
+
label: localization.hourFormat24,
|
|
23
|
+
value: '24H',
|
|
24
|
+
testId: '24h-type',
|
|
25
|
+
},
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UI_T_TimeValue = '12H' | '24H' | 'DEFAULT'
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="user-menu-content">
|
|
3
|
+
<button
|
|
4
|
+
id="user-menu-dropdown-toggle"
|
|
5
|
+
data-id="user-menu-dropdown-toggle"
|
|
6
|
+
class="user-menu-dropdown-toggle"
|
|
7
|
+
@click="isShowDropdown = !isShowDropdown"
|
|
8
|
+
>
|
|
9
|
+
<span class="user-icon-container">
|
|
10
|
+
<ui-icon-icon3 name="user-icon" width="24" height="24" />
|
|
11
|
+
</span>
|
|
12
|
+
<span class="title">{{ props.hostname }}</span>
|
|
13
|
+
<span class="arrow-icon-container">
|
|
14
|
+
<ui-icon name="arrow2" width="16" height="8" />
|
|
15
|
+
</span>
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
<ui-dropdown
|
|
19
|
+
test-id="user-menu-dropdown"
|
|
20
|
+
:show="isShowDropdown"
|
|
21
|
+
:items="dropdownItems"
|
|
22
|
+
width="max-content"
|
|
23
|
+
elem-id="user-menu-dropdown-toggle"
|
|
24
|
+
@select="onSelectDropdown"
|
|
25
|
+
@hide="onHideDropdown"
|
|
26
|
+
>
|
|
27
|
+
<template #row="{ item }">
|
|
28
|
+
<a
|
|
29
|
+
:id="item.testId"
|
|
30
|
+
:data-id="item.testId"
|
|
31
|
+
:class="['w-full flex items-center dropdown-item', item.iconName]"
|
|
32
|
+
>
|
|
33
|
+
<span v-if="item.iconName === 'lock'" class="flex ui-item-text">
|
|
34
|
+
<ui-icon-icon3 :name="item.iconName" width="18" height="18" />
|
|
35
|
+
</span>
|
|
36
|
+
<span v-if="item.iconName === 'info'" class="flex ui-item-text">
|
|
37
|
+
<ui-icon :name="item.iconName" width="18" height="18" />
|
|
38
|
+
</span>
|
|
39
|
+
<span v-if="item.iconName === 'logout'" class="flex ui-item-text">
|
|
40
|
+
<ui-icon :name="item.iconName" width="18" height="18" />
|
|
41
|
+
</span>
|
|
42
|
+
<p class="ui-item-text truncate text-sm font-medium mt-0 mb-0 ml-2">
|
|
43
|
+
{{ item.text }}
|
|
44
|
+
</p>
|
|
45
|
+
</a>
|
|
46
|
+
</template>
|
|
47
|
+
</ui-dropdown>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script setup lang="ts">
|
|
51
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
52
|
+
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
53
|
+
import { userMenuFunc } from '~/components/common/layout/theHeader/userMenu/userMenuNew/lib/config/dropMenu'
|
|
54
|
+
|
|
55
|
+
const props = defineProps<{
|
|
56
|
+
hostname: string
|
|
57
|
+
}>()
|
|
58
|
+
|
|
59
|
+
const emits = defineEmits<{
|
|
60
|
+
(event: 'select-dropdown', value: string): void
|
|
61
|
+
}>()
|
|
62
|
+
|
|
63
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
64
|
+
|
|
65
|
+
const isShowDropdown = ref<boolean>(false)
|
|
66
|
+
|
|
67
|
+
const dropdownItems = computed<UI_I_Dropdown[]>(() =>
|
|
68
|
+
userMenuFunc(localization.value)
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
const onHideDropdown = (): void => {
|
|
72
|
+
isShowDropdown.value = false
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const onSelectDropdown = (value: string): void => {
|
|
76
|
+
emits('select-dropdown', value)
|
|
77
|
+
onHideDropdown()
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style lang="scss">
|
|
82
|
+
.user-menu-content {
|
|
83
|
+
.user-menu-dropdown-toggle {
|
|
84
|
+
border: unset;
|
|
85
|
+
padding: 0;
|
|
86
|
+
outline: unset;
|
|
87
|
+
background: transparent;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
grid-gap: 10px;
|
|
92
|
+
color: #d3d6da;
|
|
93
|
+
|
|
94
|
+
&:hover {
|
|
95
|
+
color: #ffffff;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.arrow-icon-container {
|
|
99
|
+
display: flex;
|
|
100
|
+
transform: rotate(90deg);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
#dropdown-user-menu-dropdown {
|
|
106
|
+
margin-top: 17px;
|
|
107
|
+
|
|
108
|
+
.ui-dropdown-menu-item:has(.logout) {
|
|
109
|
+
.ui-item-text {
|
|
110
|
+
color: #ea3223;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
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 userMenuFunc = (
|
|
5
|
+
localization: UI_I_Localization
|
|
6
|
+
): UI_I_Dropdown[] => {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
text: localization.changePassword,
|
|
10
|
+
value: 'changePassword',
|
|
11
|
+
testId: 'user-menu-change-password',
|
|
12
|
+
iconName: 'lock',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
text: localization.preferences,
|
|
16
|
+
value: 'preferences',
|
|
17
|
+
testId: 'user-menu-preferences',
|
|
18
|
+
divider: true,
|
|
19
|
+
iconName: 'info',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
text: localization.logout,
|
|
23
|
+
value: 'logout',
|
|
24
|
+
testId: 'user-menu-logout',
|
|
25
|
+
iconName: 'logout',
|
|
26
|
+
},
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tid-control-bar-user-menu user-menu">
|
|
3
|
+
<atoms-dropdown
|
|
4
|
+
test-id="user-menu-host-name-drop-down"
|
|
5
|
+
:title="props.hostname"
|
|
6
|
+
:drop-menu="accountMenu"
|
|
7
|
+
@select="clickMenuItem"
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import type { UI_I_DropMenu } from '~/components/atoms/dropdown/dropdown/lib/models/interfaces'
|
|
14
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
15
|
+
import type { T_ActionTypeUserMenu } from '~/components/common/layout/theHeader/userMenu/userMenuOld/lib/models/types'
|
|
16
|
+
import { accountMenuFunc } from '~/components/common/layout/theHeader/userMenu/userMenuOld/lib/config/dropMenu'
|
|
17
|
+
|
|
18
|
+
const props = defineProps<{
|
|
19
|
+
hostname: string
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
const emits = defineEmits<{
|
|
23
|
+
(event: 'select-dropdown', value: string): void
|
|
24
|
+
}>()
|
|
25
|
+
|
|
26
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
27
|
+
const accountMenu = computed<UI_I_DropMenu<T_ActionTypeUserMenu>[]>(() =>
|
|
28
|
+
accountMenuFunc(localization.value)
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
const clickMenuItem = (item: UI_I_DropMenu<T_ActionTypeUserMenu>): void => {
|
|
32
|
+
item.action && emits('select-dropdown', item.action)
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_DropMenu } from '~/components/atoms/dropdown/dropdown/lib/models/interfaces'
|
|
3
|
+
import type { T_ActionTypeUserMenu } from '~/components/common/layout/theHeader/userMenu/userMenuOld/lib/models/types'
|
|
4
|
+
|
|
5
|
+
export const accountMenuFunc = (
|
|
6
|
+
localization: UI_I_Localization
|
|
7
|
+
): UI_I_DropMenu<T_ActionTypeUserMenu>[] => {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
text: localization.changePassword,
|
|
11
|
+
action: 'changePassword',
|
|
12
|
+
closeAfterClick: true,
|
|
13
|
+
testId: 'user-menu-change-password',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
text: localization.preferences,
|
|
17
|
+
action: 'preferences',
|
|
18
|
+
closeAfterClick: true,
|
|
19
|
+
testId: 'user-menu-preferences',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
text: localization.switchTheme,
|
|
23
|
+
action: 'themeMode',
|
|
24
|
+
disabled: false,
|
|
25
|
+
divider: true,
|
|
26
|
+
closeAfterClick: true,
|
|
27
|
+
testId: 'user-menu-switch-theme',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
text: localization.logout,
|
|
31
|
+
action: 'logout',
|
|
32
|
+
closeAfterClick: true,
|
|
33
|
+
testId: 'user-menu-logout',
|
|
34
|
+
},
|
|
35
|
+
]
|
|
36
|
+
}
|