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
|
@@ -1,160 +1,160 @@
|
|
|
1
|
-
export const clusterLocalizationByState = [
|
|
2
|
-
'unknown',
|
|
3
|
-
'connected',
|
|
4
|
-
'warning',
|
|
5
|
-
'error',
|
|
6
|
-
]
|
|
7
|
-
|
|
8
|
-
export const clusterIconByState = [
|
|
9
|
-
'cluster-error',
|
|
10
|
-
'cluster',
|
|
11
|
-
'cluster-warning',
|
|
12
|
-
'cluster-error',
|
|
13
|
-
// TODO Добавил на скорую руку нужно дополнить, если есть что добавить
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
export const hostLocalizationByState = [
|
|
17
|
-
'unknown',
|
|
18
|
-
'connected',
|
|
19
|
-
'warning',
|
|
20
|
-
'error',
|
|
21
|
-
'maintenance',
|
|
22
|
-
'notResponding',
|
|
23
|
-
'disconnected',
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
export const hostIconByState = [
|
|
27
|
-
'host-error',
|
|
28
|
-
'host',
|
|
29
|
-
'host-warning',
|
|
30
|
-
'host-error',
|
|
31
|
-
'host-maintenance',
|
|
32
|
-
'host-not-responding',
|
|
33
|
-
'host-disconnected',
|
|
34
|
-
]
|
|
35
|
-
|
|
36
|
-
export const vmLocalizationByState = [
|
|
37
|
-
'unknown',
|
|
38
|
-
'powerOff',
|
|
39
|
-
'poweredOn',
|
|
40
|
-
'suspended',
|
|
41
|
-
'error',
|
|
42
|
-
'warning',
|
|
43
|
-
'pending',
|
|
44
|
-
'paused',
|
|
45
|
-
'blocked',
|
|
46
|
-
'shuttingDown',
|
|
47
|
-
'shuttingOff',
|
|
48
|
-
]
|
|
49
|
-
|
|
50
|
-
export const vmIconByState = [
|
|
51
|
-
'vm-error',
|
|
52
|
-
'vm',
|
|
53
|
-
'vm-on',
|
|
54
|
-
'vm-suspended',
|
|
55
|
-
'vm-error',
|
|
56
|
-
'vm-warning',
|
|
57
|
-
'vm-warning',
|
|
58
|
-
'vm-suspended',
|
|
59
|
-
'vm-warning',
|
|
60
|
-
'vm-warning',
|
|
61
|
-
'vm-warning',
|
|
62
|
-
]
|
|
63
|
-
|
|
64
|
-
export const datastoreLocalizationByState = [
|
|
65
|
-
'unknown',
|
|
66
|
-
'connected',
|
|
67
|
-
'warning',
|
|
68
|
-
'error',
|
|
69
|
-
'maintenance',
|
|
70
|
-
'inaccessible',
|
|
71
|
-
'disconnected',
|
|
72
|
-
]
|
|
73
|
-
|
|
74
|
-
export const datastoreIconByState = [
|
|
75
|
-
'datastore-error',
|
|
76
|
-
'datastore',
|
|
77
|
-
'datastore-warning',
|
|
78
|
-
'datastore-error',
|
|
79
|
-
'datastore-maintenance',
|
|
80
|
-
'datastore-inaccessible',
|
|
81
|
-
'datastore-unmount', // 'datastore-disconnected',
|
|
82
|
-
]
|
|
83
|
-
|
|
84
|
-
export const networkLocalizationByState = [
|
|
85
|
-
'unknown',
|
|
86
|
-
'connected',
|
|
87
|
-
'warning',
|
|
88
|
-
'error',
|
|
89
|
-
]
|
|
90
|
-
|
|
91
|
-
export const networkIconByState = [
|
|
92
|
-
'network-error',
|
|
93
|
-
'network',
|
|
94
|
-
'network-warning',
|
|
95
|
-
'network-error',
|
|
96
|
-
]
|
|
97
|
-
|
|
98
|
-
export const switchLocalizationByState = [
|
|
99
|
-
'unknown',
|
|
100
|
-
'connected',
|
|
101
|
-
'warning',
|
|
102
|
-
'error',
|
|
103
|
-
]
|
|
104
|
-
|
|
105
|
-
export const switchIconByState = [
|
|
106
|
-
'switch-error',
|
|
107
|
-
'switch',
|
|
108
|
-
'switch-warning',
|
|
109
|
-
'switch-error',
|
|
110
|
-
]
|
|
111
|
-
|
|
112
|
-
export const resourcePoolLocalizationByState = [
|
|
113
|
-
'unknown',
|
|
114
|
-
'normal',
|
|
115
|
-
'warning',
|
|
116
|
-
'error',
|
|
117
|
-
'alert',
|
|
118
|
-
]
|
|
119
|
-
|
|
120
|
-
export const resourcePoolIconByState = [
|
|
121
|
-
'resourcePoolAlert',
|
|
122
|
-
'resource-pool',
|
|
123
|
-
'resourcePoolWarning',
|
|
124
|
-
'resourcePoolAlert',
|
|
125
|
-
'resourcePoolAlert',
|
|
126
|
-
]
|
|
127
|
-
|
|
128
|
-
export const backupStorageLocalizationByState = [
|
|
129
|
-
'unknown',
|
|
130
|
-
'connected',
|
|
131
|
-
'warning',
|
|
132
|
-
'error',
|
|
133
|
-
'maintenance',
|
|
134
|
-
'inaccessible',
|
|
135
|
-
'disconnected',
|
|
136
|
-
]
|
|
137
|
-
|
|
138
|
-
export const backupStorageIconByState = [
|
|
139
|
-
'datastore-error',
|
|
140
|
-
'datastore',
|
|
141
|
-
'datastore-warning',
|
|
142
|
-
'datastore-error',
|
|
143
|
-
'datastore-maintenance',
|
|
144
|
-
'datastore-inaccessible',
|
|
145
|
-
'datastore-unmount', // 'datastore-disconnected',
|
|
146
|
-
]
|
|
147
|
-
|
|
148
|
-
export const bucketLocalizationByState = [
|
|
149
|
-
'unknown',
|
|
150
|
-
'connected',
|
|
151
|
-
'warning',
|
|
152
|
-
'error',
|
|
153
|
-
]
|
|
154
|
-
|
|
155
|
-
export const bucketIconByState = [
|
|
156
|
-
'vm-error',
|
|
157
|
-
'vm',
|
|
158
|
-
'vm-warning',
|
|
159
|
-
'vm-error',
|
|
160
|
-
]
|
|
1
|
+
export const clusterLocalizationByState = [
|
|
2
|
+
'unknown',
|
|
3
|
+
'connected',
|
|
4
|
+
'warning',
|
|
5
|
+
'error',
|
|
6
|
+
]
|
|
7
|
+
|
|
8
|
+
export const clusterIconByState = [
|
|
9
|
+
'cluster-error',
|
|
10
|
+
'cluster',
|
|
11
|
+
'cluster-warning',
|
|
12
|
+
'cluster-error',
|
|
13
|
+
// TODO Добавил на скорую руку нужно дополнить, если есть что добавить
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
export const hostLocalizationByState = [
|
|
17
|
+
'unknown',
|
|
18
|
+
'connected',
|
|
19
|
+
'warning',
|
|
20
|
+
'error',
|
|
21
|
+
'maintenance',
|
|
22
|
+
'notResponding',
|
|
23
|
+
'disconnected',
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
export const hostIconByState = [
|
|
27
|
+
'host-error',
|
|
28
|
+
'host',
|
|
29
|
+
'host-warning',
|
|
30
|
+
'host-error',
|
|
31
|
+
'host-maintenance',
|
|
32
|
+
'host-not-responding',
|
|
33
|
+
'host-disconnected',
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
export const vmLocalizationByState = [
|
|
37
|
+
'unknown',
|
|
38
|
+
'powerOff',
|
|
39
|
+
'poweredOn',
|
|
40
|
+
'suspended',
|
|
41
|
+
'error',
|
|
42
|
+
'warning',
|
|
43
|
+
'pending',
|
|
44
|
+
'paused',
|
|
45
|
+
'blocked',
|
|
46
|
+
'shuttingDown',
|
|
47
|
+
'shuttingOff',
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
export const vmIconByState = [
|
|
51
|
+
'vm-error',
|
|
52
|
+
'vm',
|
|
53
|
+
'vm-on',
|
|
54
|
+
'vm-suspended',
|
|
55
|
+
'vm-error',
|
|
56
|
+
'vm-warning',
|
|
57
|
+
'vm-warning',
|
|
58
|
+
'vm-suspended',
|
|
59
|
+
'vm-warning',
|
|
60
|
+
'vm-warning',
|
|
61
|
+
'vm-warning',
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
export const datastoreLocalizationByState = [
|
|
65
|
+
'unknown',
|
|
66
|
+
'connected',
|
|
67
|
+
'warning',
|
|
68
|
+
'error',
|
|
69
|
+
'maintenance',
|
|
70
|
+
'inaccessible',
|
|
71
|
+
'disconnected',
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
export const datastoreIconByState = [
|
|
75
|
+
'datastore-error',
|
|
76
|
+
'datastore',
|
|
77
|
+
'datastore-warning',
|
|
78
|
+
'datastore-error',
|
|
79
|
+
'datastore-maintenance',
|
|
80
|
+
'datastore-inaccessible',
|
|
81
|
+
'datastore-unmount', // 'datastore-disconnected',
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
export const networkLocalizationByState = [
|
|
85
|
+
'unknown',
|
|
86
|
+
'connected',
|
|
87
|
+
'warning',
|
|
88
|
+
'error',
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
export const networkIconByState = [
|
|
92
|
+
'network-error',
|
|
93
|
+
'network',
|
|
94
|
+
'network-warning',
|
|
95
|
+
'network-error',
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
export const switchLocalizationByState = [
|
|
99
|
+
'unknown',
|
|
100
|
+
'connected',
|
|
101
|
+
'warning',
|
|
102
|
+
'error',
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
export const switchIconByState = [
|
|
106
|
+
'switch-error',
|
|
107
|
+
'switch',
|
|
108
|
+
'switch-warning',
|
|
109
|
+
'switch-error',
|
|
110
|
+
]
|
|
111
|
+
|
|
112
|
+
export const resourcePoolLocalizationByState = [
|
|
113
|
+
'unknown',
|
|
114
|
+
'normal',
|
|
115
|
+
'warning',
|
|
116
|
+
'error',
|
|
117
|
+
'alert',
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
export const resourcePoolIconByState = [
|
|
121
|
+
'resourcePoolAlert',
|
|
122
|
+
'resource-pool',
|
|
123
|
+
'resourcePoolWarning',
|
|
124
|
+
'resourcePoolAlert',
|
|
125
|
+
'resourcePoolAlert',
|
|
126
|
+
]
|
|
127
|
+
|
|
128
|
+
export const backupStorageLocalizationByState = [
|
|
129
|
+
'unknown',
|
|
130
|
+
'connected',
|
|
131
|
+
'warning',
|
|
132
|
+
'error',
|
|
133
|
+
'maintenance',
|
|
134
|
+
'inaccessible',
|
|
135
|
+
'disconnected',
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
export const backupStorageIconByState = [
|
|
139
|
+
'datastore-error',
|
|
140
|
+
'datastore',
|
|
141
|
+
'datastore-warning',
|
|
142
|
+
'datastore-error',
|
|
143
|
+
'datastore-maintenance',
|
|
144
|
+
'datastore-inaccessible',
|
|
145
|
+
'datastore-unmount', // 'datastore-disconnected',
|
|
146
|
+
]
|
|
147
|
+
|
|
148
|
+
export const bucketLocalizationByState = [
|
|
149
|
+
'unknown',
|
|
150
|
+
'connected',
|
|
151
|
+
'warning',
|
|
152
|
+
'error',
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
export const bucketIconByState = [
|
|
156
|
+
'vm-error',
|
|
157
|
+
'vm',
|
|
158
|
+
'vm-warning',
|
|
159
|
+
'vm-error',
|
|
160
|
+
]
|
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<common-main-navigation-panel-new
|
|
3
|
-
v-if="props.isNewView"
|
|
4
|
-
v-model:main-menu-hovered="mainMenuHovered"
|
|
5
|
-
v-model:menu-pined="menuPined"
|
|
6
|
-
:main-menu-status="props.mainMenuStatus"
|
|
7
|
-
:navigation-items="props.navigationItems"
|
|
8
|
-
:parent-status="props.parentStatus"
|
|
9
|
-
:disabled-pin="props.disabledPin"
|
|
10
|
-
:menu-collapsed="menuCollapsed"
|
|
11
|
-
:show-menu="showMenu"
|
|
12
|
-
@toggle="emits('toggle', $event)"
|
|
13
|
-
@collapse-menu="collapseMenu"
|
|
14
|
-
@change-menu-pin="changeMenuPin"
|
|
15
|
-
@hide-main-menu="hideMainMenu"
|
|
16
|
-
/>
|
|
17
|
-
<common-main-navigation-panel-old
|
|
18
|
-
v-else
|
|
19
|
-
v-model:main-menu-hovered="mainMenuHovered"
|
|
20
|
-
v-model:menu-pined="menuPined"
|
|
21
|
-
:main-menu-status="props.mainMenuStatus"
|
|
22
|
-
:navigation-items="props.navigationItems"
|
|
23
|
-
:parent-status="props.parentStatus"
|
|
24
|
-
:disabled-pin="props.disabledPin"
|
|
25
|
-
:menu-collapsed="menuCollapsed"
|
|
26
|
-
:show-menu="showMenu"
|
|
27
|
-
@toggle="emits('toggle', $event)"
|
|
28
|
-
@collapse-menu="collapseMenu"
|
|
29
|
-
@change-menu-pin="changeMenuPin"
|
|
30
|
-
@hide-main-menu="hideMainMenu"
|
|
31
|
-
/>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script setup lang="ts">
|
|
35
|
-
import type { UI_I_NavigationItem } from '~/components/common/mainNavigationPanel/lib/models/interfaces'
|
|
36
|
-
import type { UI_T_ParentStatus } from '~/components/common/mainNavigationPanel/lib/models/types'
|
|
37
|
-
|
|
38
|
-
const props = withDefaults(
|
|
39
|
-
defineProps<{
|
|
40
|
-
mainMenuStatus: boolean
|
|
41
|
-
navigationItems: UI_I_NavigationItem[][]
|
|
42
|
-
parentStatus: UI_T_ParentStatus
|
|
43
|
-
disabledPin: boolean
|
|
44
|
-
isNewView?: boolean
|
|
45
|
-
}>(),
|
|
46
|
-
{
|
|
47
|
-
isNewView: false,
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
const emits = defineEmits<{
|
|
52
|
-
(event: 'toggle', value: boolean): void
|
|
53
|
-
}>()
|
|
54
|
-
|
|
55
|
-
const route = useRoute()
|
|
56
|
-
|
|
57
|
-
const showMenu = computed<boolean>(
|
|
58
|
-
() => props.mainMenuStatus || menuPined.value
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
const menuPined = ref<boolean>(false)
|
|
62
|
-
const changeMenuPin = (): void => {
|
|
63
|
-
useLocalStorage('menuPined', menuPined.value)
|
|
64
|
-
}
|
|
65
|
-
const setMenuPined = (): void => {
|
|
66
|
-
menuPined.value = props.disabledPin ? false : useLocalStorage('menuPined')
|
|
67
|
-
}
|
|
68
|
-
watch(
|
|
69
|
-
() => props.disabledPin,
|
|
70
|
-
() => {
|
|
71
|
-
setMenuPined()
|
|
72
|
-
},
|
|
73
|
-
{ immediate: true }
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
const menuCollapsed = ref<boolean>(false)
|
|
77
|
-
const collapseMenu = (): void => {
|
|
78
|
-
menuCollapsed.value = !menuCollapsed.value
|
|
79
|
-
useLocalStorage('menuCollapsed', menuCollapsed.value)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const mainMenuHovered = ref<boolean>(false)
|
|
83
|
-
|
|
84
|
-
const clickWindow = (event: Event): void => {
|
|
85
|
-
const target = event.target as any
|
|
86
|
-
if (
|
|
87
|
-
menuPined.value ||
|
|
88
|
-
mainMenuHovered.value ||
|
|
89
|
-
target.className.baseVal?.includes('menu-icon') ||
|
|
90
|
-
target.className.baseVal?.includes('clr-i-outline')
|
|
91
|
-
) {
|
|
92
|
-
return
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
emits('toggle', false)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const mountedReady = ref<boolean>(false)
|
|
99
|
-
onMounted(() => {
|
|
100
|
-
mountedReady.value = true
|
|
101
|
-
window.addEventListener('click', clickWindow)
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
onUnmounted(() => {
|
|
105
|
-
window.removeEventListener('click', clickWindow)
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
watch(
|
|
109
|
-
[mountedReady, (): any => route.fullPath, (): any => props.parentStatus],
|
|
110
|
-
([newValue1, newValue2, newValue3]: [
|
|
111
|
-
boolean,
|
|
112
|
-
any,
|
|
113
|
-
UI_T_ParentStatus
|
|
114
|
-
]): void => {
|
|
115
|
-
if (newValue3 === 1) return
|
|
116
|
-
|
|
117
|
-
const name = location.pathname.split('/')[1]
|
|
118
|
-
|
|
119
|
-
if (!newValue1 || name === 'auth') return
|
|
120
|
-
|
|
121
|
-
setSidebarOptions()
|
|
122
|
-
useLocalStorage('navigationHistoryRoute', newValue2)
|
|
123
|
-
},
|
|
124
|
-
{ immediate: true, deep: true }
|
|
125
|
-
)
|
|
126
|
-
|
|
127
|
-
const setSidebarOptions = (): void => {
|
|
128
|
-
setMenuPined()
|
|
129
|
-
menuCollapsed.value = useLocalStorage('menuCollapsed')
|
|
130
|
-
|
|
131
|
-
if (menuPined.value) {
|
|
132
|
-
emits('toggle', true)
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const hideMainMenu = (): void => {
|
|
137
|
-
if (menuPined.value) return
|
|
138
|
-
emits('toggle', false)
|
|
139
|
-
}
|
|
140
|
-
</script>
|
|
141
|
-
|
|
142
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<template>
|
|
2
|
+
<common-main-navigation-panel-new
|
|
3
|
+
v-if="props.isNewView"
|
|
4
|
+
v-model:main-menu-hovered="mainMenuHovered"
|
|
5
|
+
v-model:menu-pined="menuPined"
|
|
6
|
+
:main-menu-status="props.mainMenuStatus"
|
|
7
|
+
:navigation-items="props.navigationItems"
|
|
8
|
+
:parent-status="props.parentStatus"
|
|
9
|
+
:disabled-pin="props.disabledPin"
|
|
10
|
+
:menu-collapsed="menuCollapsed"
|
|
11
|
+
:show-menu="showMenu"
|
|
12
|
+
@toggle="emits('toggle', $event)"
|
|
13
|
+
@collapse-menu="collapseMenu"
|
|
14
|
+
@change-menu-pin="changeMenuPin"
|
|
15
|
+
@hide-main-menu="hideMainMenu"
|
|
16
|
+
/>
|
|
17
|
+
<common-main-navigation-panel-old
|
|
18
|
+
v-else
|
|
19
|
+
v-model:main-menu-hovered="mainMenuHovered"
|
|
20
|
+
v-model:menu-pined="menuPined"
|
|
21
|
+
:main-menu-status="props.mainMenuStatus"
|
|
22
|
+
:navigation-items="props.navigationItems"
|
|
23
|
+
:parent-status="props.parentStatus"
|
|
24
|
+
:disabled-pin="props.disabledPin"
|
|
25
|
+
:menu-collapsed="menuCollapsed"
|
|
26
|
+
:show-menu="showMenu"
|
|
27
|
+
@toggle="emits('toggle', $event)"
|
|
28
|
+
@collapse-menu="collapseMenu"
|
|
29
|
+
@change-menu-pin="changeMenuPin"
|
|
30
|
+
@hide-main-menu="hideMainMenu"
|
|
31
|
+
/>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import type { UI_I_NavigationItem } from '~/components/common/mainNavigationPanel/lib/models/interfaces'
|
|
36
|
+
import type { UI_T_ParentStatus } from '~/components/common/mainNavigationPanel/lib/models/types'
|
|
37
|
+
|
|
38
|
+
const props = withDefaults(
|
|
39
|
+
defineProps<{
|
|
40
|
+
mainMenuStatus: boolean
|
|
41
|
+
navigationItems: UI_I_NavigationItem[][]
|
|
42
|
+
parentStatus: UI_T_ParentStatus
|
|
43
|
+
disabledPin: boolean
|
|
44
|
+
isNewView?: boolean
|
|
45
|
+
}>(),
|
|
46
|
+
{
|
|
47
|
+
isNewView: false,
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
const emits = defineEmits<{
|
|
52
|
+
(event: 'toggle', value: boolean): void
|
|
53
|
+
}>()
|
|
54
|
+
|
|
55
|
+
const route = useRoute()
|
|
56
|
+
|
|
57
|
+
const showMenu = computed<boolean>(
|
|
58
|
+
() => props.mainMenuStatus || menuPined.value
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
const menuPined = ref<boolean>(false)
|
|
62
|
+
const changeMenuPin = (): void => {
|
|
63
|
+
useLocalStorage('menuPined', menuPined.value)
|
|
64
|
+
}
|
|
65
|
+
const setMenuPined = (): void => {
|
|
66
|
+
menuPined.value = props.disabledPin ? false : useLocalStorage('menuPined')
|
|
67
|
+
}
|
|
68
|
+
watch(
|
|
69
|
+
() => props.disabledPin,
|
|
70
|
+
() => {
|
|
71
|
+
setMenuPined()
|
|
72
|
+
},
|
|
73
|
+
{ immediate: true }
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
const menuCollapsed = ref<boolean>(false)
|
|
77
|
+
const collapseMenu = (): void => {
|
|
78
|
+
menuCollapsed.value = !menuCollapsed.value
|
|
79
|
+
useLocalStorage('menuCollapsed', menuCollapsed.value)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const mainMenuHovered = ref<boolean>(false)
|
|
83
|
+
|
|
84
|
+
const clickWindow = (event: Event): void => {
|
|
85
|
+
const target = event.target as any
|
|
86
|
+
if (
|
|
87
|
+
menuPined.value ||
|
|
88
|
+
mainMenuHovered.value ||
|
|
89
|
+
target.className.baseVal?.includes('menu-icon') ||
|
|
90
|
+
target.className.baseVal?.includes('clr-i-outline')
|
|
91
|
+
) {
|
|
92
|
+
return
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
emits('toggle', false)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const mountedReady = ref<boolean>(false)
|
|
99
|
+
onMounted(() => {
|
|
100
|
+
mountedReady.value = true
|
|
101
|
+
window.addEventListener('click', clickWindow)
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
onUnmounted(() => {
|
|
105
|
+
window.removeEventListener('click', clickWindow)
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
watch(
|
|
109
|
+
[mountedReady, (): any => route.fullPath, (): any => props.parentStatus],
|
|
110
|
+
([newValue1, newValue2, newValue3]: [
|
|
111
|
+
boolean,
|
|
112
|
+
any,
|
|
113
|
+
UI_T_ParentStatus
|
|
114
|
+
]): void => {
|
|
115
|
+
if (newValue3 === 1) return
|
|
116
|
+
|
|
117
|
+
const name = location.pathname.split('/')[1]
|
|
118
|
+
|
|
119
|
+
if (!newValue1 || name === 'auth') return
|
|
120
|
+
|
|
121
|
+
setSidebarOptions()
|
|
122
|
+
useLocalStorage('navigationHistoryRoute', newValue2)
|
|
123
|
+
},
|
|
124
|
+
{ immediate: true, deep: true }
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
const setSidebarOptions = (): void => {
|
|
128
|
+
setMenuPined()
|
|
129
|
+
menuCollapsed.value = useLocalStorage('menuCollapsed')
|
|
130
|
+
|
|
131
|
+
if (menuPined.value) {
|
|
132
|
+
emits('toggle', true)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const hideMainMenu = (): void => {
|
|
137
|
+
if (menuPined.value) return
|
|
138
|
+
emits('toggle', false)
|
|
139
|
+
}
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<style scoped lang="scss"></style>
|