Derick Montague | 828dda9 | 2021-06-28 15:52:22 -0500 | [diff] [blame] | 1 | import IconDashboard from '@carbon/icons-vue/es/dashboard/16'; |
| 2 | import IconTextLinkAnalysis from '@carbon/icons-vue/es/text-link--analysis/16'; |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 3 | import IconDataCheck from '@carbon/icons-vue/es/data--check/16'; |
| 4 | import IconSettingsAdjust from '@carbon/icons-vue/es/settings--adjust/16'; |
| 5 | import IconSettings from '@carbon/icons-vue/es/settings/16'; |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 6 | import IconSecurity from '@carbon/icons-vue/es/security/16'; |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 7 | import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16'; |
Sandeepa Singh | 6dba4be | 2021-07-28 15:25:14 +0530 | [diff] [blame] | 8 | import IconDataBase from '@carbon/icons-vue/es/data--base--alt/16'; |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 9 | import i18n from '@/i18n'; |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 10 | |
| 11 | const AppNavigationMixin = { |
| 12 | components: { |
Derick Montague | 828dda9 | 2021-06-28 15:52:22 -0500 | [diff] [blame] | 13 | iconOverview: IconDashboard, |
| 14 | iconLogs: IconTextLinkAnalysis, |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 15 | iconHealth: IconDataCheck, |
| 16 | iconControl: IconSettingsAdjust, |
Sandeepa Singh | f67f769 | 2021-07-19 18:04:18 +0530 | [diff] [blame] | 17 | iconSettings: IconSettings, |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 18 | iconSecurityAndAccess: IconSecurity, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 19 | iconExpand: IconChevronUp, |
Sandeepa Singh | 6dba4be | 2021-07-28 15:25:14 +0530 | [diff] [blame] | 20 | iconResourceManagement: IconDataBase, |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 21 | }, |
| 22 | data() { |
| 23 | return { |
| 24 | navigationItems: [ |
| 25 | { |
| 26 | id: 'overview', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 27 | label: i18n.global.t('appNavigation.overview'), |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 28 | route: '/', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 29 | icon: 'iconOverview', |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 30 | }, |
| 31 | { |
Derick Montague | 828dda9 | 2021-06-28 15:52:22 -0500 | [diff] [blame] | 32 | id: 'logs', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 33 | label: i18n.global.t('appNavigation.logs'), |
Derick Montague | 828dda9 | 2021-06-28 15:52:22 -0500 | [diff] [blame] | 34 | icon: 'iconLogs', |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 35 | children: [ |
| 36 | { |
Yoshie Muranaka | 22d4d52 | 2020-12-03 10:58:35 -0800 | [diff] [blame] | 37 | id: 'dumps', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 38 | label: i18n.global.t('appNavigation.dumps'), |
Derick Montague | 828dda9 | 2021-06-28 15:52:22 -0500 | [diff] [blame] | 39 | route: '/logs/dumps', |
Yoshie Muranaka | 22d4d52 | 2020-12-03 10:58:35 -0800 | [diff] [blame] | 40 | }, |
| 41 | { |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 42 | id: 'event-logs', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 43 | label: i18n.global.t('appNavigation.eventLogs'), |
Derick Montague | 828dda9 | 2021-06-28 15:52:22 -0500 | [diff] [blame] | 44 | route: '/logs/event-logs', |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 45 | }, |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 46 | { |
Sandeepa Singh | 06d5386 | 2021-05-24 13:51:09 +0530 | [diff] [blame] | 47 | id: 'post-code-logs', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 48 | label: i18n.global.t('appNavigation.postCodeLogs'), |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 49 | route: '/logs/post-code-logs', |
| 50 | }, |
| 51 | ], |
| 52 | }, |
| 53 | { |
| 54 | id: 'hardware-status', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 55 | label: i18n.global.t('appNavigation.hardwareStatus'), |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 56 | icon: 'iconHealth', |
| 57 | children: [ |
| 58 | { |
| 59 | id: 'inventory', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 60 | label: i18n.global.t('appNavigation.inventory'), |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 61 | route: '/hardware-status/inventory', |
Sandeepa Singh | 06d5386 | 2021-05-24 13:51:09 +0530 | [diff] [blame] | 62 | }, |
| 63 | { |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 64 | id: 'sensors', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 65 | label: i18n.global.t('appNavigation.sensors'), |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 66 | route: '/hardware-status/sensors', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 67 | }, |
| 68 | ], |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 69 | }, |
| 70 | { |
Sandeepa Singh | 68cbbe9 | 2021-07-14 16:02:22 +0530 | [diff] [blame] | 71 | id: 'operations', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 72 | label: i18n.global.t('appNavigation.operations'), |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 73 | icon: 'iconControl', |
Sandeepa Singh | 05887b5 | 2022-01-10 19:19:36 +0530 | [diff] [blame] | 74 | children: this.operationsNavigationItems(), |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 75 | }, |
| 76 | { |
Sandeepa Singh | f67f769 | 2021-07-19 18:04:18 +0530 | [diff] [blame] | 77 | id: 'settings', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 78 | label: i18n.global.t('appNavigation.settings'), |
Sandeepa Singh | f67f769 | 2021-07-19 18:04:18 +0530 | [diff] [blame] | 79 | icon: 'iconSettings', |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 80 | children: [ |
| 81 | { |
Sandeepa Singh | f67f769 | 2021-07-19 18:04:18 +0530 | [diff] [blame] | 82 | id: 'date-time', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 83 | label: i18n.global.t('appNavigation.dateTime'), |
Sandeepa Singh | f67f769 | 2021-07-19 18:04:18 +0530 | [diff] [blame] | 84 | route: '/settings/date-time', |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 85 | }, |
| 86 | { |
Sandeepa Singh | f67f769 | 2021-07-19 18:04:18 +0530 | [diff] [blame] | 87 | id: 'network', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 88 | label: i18n.global.t('appNavigation.network'), |
Sandeepa Singh | f67f769 | 2021-07-19 18:04:18 +0530 | [diff] [blame] | 89 | route: '/settings/network', |
| 90 | }, |
| 91 | { |
| 92 | id: 'power-restore-policy', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 93 | label: i18n.global.t('appNavigation.powerRestorePolicy'), |
Sandeepa Singh | f67f769 | 2021-07-19 18:04:18 +0530 | [diff] [blame] | 94 | route: '/settings/power-restore-policy', |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 95 | }, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 96 | ], |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 97 | }, |
| 98 | { |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 99 | id: 'security-and-access', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 100 | label: i18n.global.t('appNavigation.securityAndAccess'), |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 101 | icon: 'iconSecurityAndAccess', |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 102 | children: [ |
| 103 | { |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 104 | id: 'sessions', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 105 | label: i18n.global.t('appNavigation.sessions'), |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 106 | route: '/security-and-access/sessions', |
Yoshie Muranaka | ca22a42 | 2021-01-04 14:13:34 -0800 | [diff] [blame] | 107 | }, |
| 108 | { |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 109 | id: 'ldap', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 110 | label: i18n.global.t('appNavigation.ldap'), |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 111 | route: '/security-and-access/ldap', |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 112 | }, |
| 113 | { |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 114 | id: 'user-management', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 115 | label: i18n.global.t('appNavigation.userManagement'), |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 116 | route: '/security-and-access/user-management', |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 117 | }, |
| 118 | { |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 119 | id: 'policies', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 120 | label: i18n.global.t('appNavigation.policies'), |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 121 | route: '/security-and-access/policies', |
| 122 | }, |
| 123 | { |
| 124 | id: 'certificates', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 125 | label: i18n.global.t('appNavigation.certificates'), |
Sandeepa Singh | b440616 | 2021-07-26 15:05:39 +0530 | [diff] [blame] | 126 | route: '/security-and-access/certificates', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 127 | }, |
| 128 | ], |
| 129 | }, |
Sandeepa Singh | 6dba4be | 2021-07-28 15:25:14 +0530 | [diff] [blame] | 130 | { |
| 131 | id: 'resource-management', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 132 | label: i18n.global.t('appNavigation.resourceManagement'), |
Sandeepa Singh | 6dba4be | 2021-07-28 15:25:14 +0530 | [diff] [blame] | 133 | icon: 'iconResourceManagement', |
| 134 | children: [ |
| 135 | { |
| 136 | id: 'power', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 137 | label: i18n.global.t('appNavigation.power'), |
Sandeepa Singh | 6dba4be | 2021-07-28 15:25:14 +0530 | [diff] [blame] | 138 | route: '/resource-management/power', |
| 139 | }, |
| 140 | ], |
| 141 | }, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 142 | ], |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 143 | }; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 144 | }, |
Sandeepa Singh | 05887b5 | 2022-01-10 19:19:36 +0530 | [diff] [blame] | 145 | methods: { |
| 146 | operationsNavigationItems() { |
| 147 | const username = this.$store.getters['global/username']; |
| 148 | let operationNavigationItems = [ |
| 149 | { |
| 150 | id: 'factory-reset', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 151 | label: i18n.global.t('appNavigation.factoryReset'), |
Sandeepa Singh | 05887b5 | 2022-01-10 19:19:36 +0530 | [diff] [blame] | 152 | route: '/operations/factory-reset', |
| 153 | }, |
| 154 | { |
| 155 | id: 'firmware', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 156 | label: i18n.global.t('appNavigation.firmware'), |
Sandeepa Singh | 05887b5 | 2022-01-10 19:19:36 +0530 | [diff] [blame] | 157 | route: '/operations/firmware', |
| 158 | }, |
| 159 | { |
| 160 | id: 'reboot-bmc', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 161 | label: i18n.global.t('appNavigation.rebootBmc'), |
Sandeepa Singh | 05887b5 | 2022-01-10 19:19:36 +0530 | [diff] [blame] | 162 | route: '/operations/reboot-bmc', |
| 163 | }, |
| 164 | { |
| 165 | id: 'serial-over-lan', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 166 | label: i18n.global.t('appNavigation.serialOverLan'), |
Sandeepa Singh | 05887b5 | 2022-01-10 19:19:36 +0530 | [diff] [blame] | 167 | route: '/operations/serial-over-lan', |
| 168 | }, |
| 169 | { |
| 170 | id: 'server-power-operations', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 171 | label: i18n.global.t('appNavigation.serverPowerOperations'), |
Sandeepa Singh | 05887b5 | 2022-01-10 19:19:36 +0530 | [diff] [blame] | 172 | route: '/operations/server-power-operations', |
| 173 | }, |
| 174 | ]; |
| 175 | let pageKeyClear = { |
| 176 | id: 'key-clear', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 177 | label: i18n.global.t('appNavigation.keyClear'), |
Sandeepa Singh | 05887b5 | 2022-01-10 19:19:36 +0530 | [diff] [blame] | 178 | route: '/operations/key-clear', |
| 179 | }; |
| 180 | if (username === 'service' || username === 'admin') { |
| 181 | operationNavigationItems.splice(2, 0, pageKeyClear); |
| 182 | } |
| 183 | return operationNavigationItems; |
| 184 | }, |
| 185 | }, |
Yoshie Muranaka | 0214fed | 2020-09-03 13:25:50 -0700 | [diff] [blame] | 186 | }; |
| 187 | |
| 188 | export default AppNavigationMixin; |