blob: 85fbdc15a3254ea06c159d19a97481d62f6a1e63 [file] [log] [blame]
Derick Montague828dda92021-06-28 15:52:22 -05001import IconDashboard from '@carbon/icons-vue/es/dashboard/16';
2import IconTextLinkAnalysis from '@carbon/icons-vue/es/text-link--analysis/16';
Yoshie Muranaka0214fed2020-09-03 13:25:50 -07003import IconDataCheck from '@carbon/icons-vue/es/data--check/16';
4import IconSettingsAdjust from '@carbon/icons-vue/es/settings--adjust/16';
5import IconSettings from '@carbon/icons-vue/es/settings/16';
Sandeepa Singhb4406162021-07-26 15:05:39 +05306import IconSecurity from '@carbon/icons-vue/es/security/16';
Yoshie Muranaka0214fed2020-09-03 13:25:50 -07007import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16';
Sandeepa Singh6dba4be2021-07-28 15:25:14 +05308import IconDataBase from '@carbon/icons-vue/es/data--base--alt/16';
Surya Vde23ea22024-07-11 15:19:46 +05309import i18n from '@/i18n';
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070010
11const AppNavigationMixin = {
12 components: {
Derick Montague828dda92021-06-28 15:52:22 -050013 iconOverview: IconDashboard,
14 iconLogs: IconTextLinkAnalysis,
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070015 iconHealth: IconDataCheck,
16 iconControl: IconSettingsAdjust,
Sandeepa Singhf67f7692021-07-19 18:04:18 +053017 iconSettings: IconSettings,
Sandeepa Singhb4406162021-07-26 15:05:39 +053018 iconSecurityAndAccess: IconSecurity,
Derick Montague602e98a2020-10-21 16:20:00 -050019 iconExpand: IconChevronUp,
Sandeepa Singh6dba4be2021-07-28 15:25:14 +053020 iconResourceManagement: IconDataBase,
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070021 },
22 data() {
23 return {
24 navigationItems: [
25 {
26 id: 'overview',
Surya Vde23ea22024-07-11 15:19:46 +053027 label: i18n.global.t('appNavigation.overview'),
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070028 route: '/',
Derick Montague602e98a2020-10-21 16:20:00 -050029 icon: 'iconOverview',
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070030 },
31 {
Derick Montague828dda92021-06-28 15:52:22 -050032 id: 'logs',
Surya Vde23ea22024-07-11 15:19:46 +053033 label: i18n.global.t('appNavigation.logs'),
Derick Montague828dda92021-06-28 15:52:22 -050034 icon: 'iconLogs',
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070035 children: [
36 {
Yoshie Muranaka22d4d522020-12-03 10:58:35 -080037 id: 'dumps',
Surya Vde23ea22024-07-11 15:19:46 +053038 label: i18n.global.t('appNavigation.dumps'),
Derick Montague828dda92021-06-28 15:52:22 -050039 route: '/logs/dumps',
Yoshie Muranaka22d4d522020-12-03 10:58:35 -080040 },
41 {
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070042 id: 'event-logs',
Surya Vde23ea22024-07-11 15:19:46 +053043 label: i18n.global.t('appNavigation.eventLogs'),
Derick Montague828dda92021-06-28 15:52:22 -050044 route: '/logs/event-logs',
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070045 },
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070046 {
Sandeepa Singh06d53862021-05-24 13:51:09 +053047 id: 'post-code-logs',
Surya Vde23ea22024-07-11 15:19:46 +053048 label: i18n.global.t('appNavigation.postCodeLogs'),
Sandeepa Singh7affc522021-07-06 16:29:10 +053049 route: '/logs/post-code-logs',
50 },
51 ],
52 },
53 {
54 id: 'hardware-status',
Surya Vde23ea22024-07-11 15:19:46 +053055 label: i18n.global.t('appNavigation.hardwareStatus'),
Sandeepa Singh7affc522021-07-06 16:29:10 +053056 icon: 'iconHealth',
57 children: [
58 {
59 id: 'inventory',
Surya Vde23ea22024-07-11 15:19:46 +053060 label: i18n.global.t('appNavigation.inventory'),
Sandeepa Singh7affc522021-07-06 16:29:10 +053061 route: '/hardware-status/inventory',
Sandeepa Singh06d53862021-05-24 13:51:09 +053062 },
63 {
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070064 id: 'sensors',
Surya Vde23ea22024-07-11 15:19:46 +053065 label: i18n.global.t('appNavigation.sensors'),
Sandeepa Singh7affc522021-07-06 16:29:10 +053066 route: '/hardware-status/sensors',
Derick Montague602e98a2020-10-21 16:20:00 -050067 },
68 ],
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070069 },
70 {
Sandeepa Singh68cbbe92021-07-14 16:02:22 +053071 id: 'operations',
Surya Vde23ea22024-07-11 15:19:46 +053072 label: i18n.global.t('appNavigation.operations'),
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070073 icon: 'iconControl',
Sandeepa Singh05887b52022-01-10 19:19:36 +053074 children: this.operationsNavigationItems(),
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070075 },
76 {
Sandeepa Singhf67f7692021-07-19 18:04:18 +053077 id: 'settings',
Surya Vde23ea22024-07-11 15:19:46 +053078 label: i18n.global.t('appNavigation.settings'),
Sandeepa Singhf67f7692021-07-19 18:04:18 +053079 icon: 'iconSettings',
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070080 children: [
81 {
Sandeepa Singhf67f7692021-07-19 18:04:18 +053082 id: 'date-time',
Surya Vde23ea22024-07-11 15:19:46 +053083 label: i18n.global.t('appNavigation.dateTime'),
Sandeepa Singhf67f7692021-07-19 18:04:18 +053084 route: '/settings/date-time',
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070085 },
86 {
Sandeepa Singhf67f7692021-07-19 18:04:18 +053087 id: 'network',
Surya Vde23ea22024-07-11 15:19:46 +053088 label: i18n.global.t('appNavigation.network'),
Sandeepa Singhf67f7692021-07-19 18:04:18 +053089 route: '/settings/network',
90 },
91 {
92 id: 'power-restore-policy',
Surya Vde23ea22024-07-11 15:19:46 +053093 label: i18n.global.t('appNavigation.powerRestorePolicy'),
Sandeepa Singhf67f7692021-07-19 18:04:18 +053094 route: '/settings/power-restore-policy',
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070095 },
Derick Montague602e98a2020-10-21 16:20:00 -050096 ],
Yoshie Muranaka0214fed2020-09-03 13:25:50 -070097 },
98 {
Sandeepa Singhb4406162021-07-26 15:05:39 +053099 id: 'security-and-access',
Surya Vde23ea22024-07-11 15:19:46 +0530100 label: i18n.global.t('appNavigation.securityAndAccess'),
Sandeepa Singhb4406162021-07-26 15:05:39 +0530101 icon: 'iconSecurityAndAccess',
Yoshie Muranaka0214fed2020-09-03 13:25:50 -0700102 children: [
103 {
Sandeepa Singhb4406162021-07-26 15:05:39 +0530104 id: 'sessions',
Surya Vde23ea22024-07-11 15:19:46 +0530105 label: i18n.global.t('appNavigation.sessions'),
Sandeepa Singhb4406162021-07-26 15:05:39 +0530106 route: '/security-and-access/sessions',
Yoshie Muranakaca22a422021-01-04 14:13:34 -0800107 },
108 {
Yoshie Muranaka0214fed2020-09-03 13:25:50 -0700109 id: 'ldap',
Surya Vde23ea22024-07-11 15:19:46 +0530110 label: i18n.global.t('appNavigation.ldap'),
Sandeepa Singhb4406162021-07-26 15:05:39 +0530111 route: '/security-and-access/ldap',
Yoshie Muranaka0214fed2020-09-03 13:25:50 -0700112 },
113 {
Sandeepa Singhb4406162021-07-26 15:05:39 +0530114 id: 'user-management',
Surya Vde23ea22024-07-11 15:19:46 +0530115 label: i18n.global.t('appNavigation.userManagement'),
Sandeepa Singhb4406162021-07-26 15:05:39 +0530116 route: '/security-and-access/user-management',
Yoshie Muranaka0214fed2020-09-03 13:25:50 -0700117 },
118 {
Sandeepa Singhb4406162021-07-26 15:05:39 +0530119 id: 'policies',
Surya Vde23ea22024-07-11 15:19:46 +0530120 label: i18n.global.t('appNavigation.policies'),
Sandeepa Singhb4406162021-07-26 15:05:39 +0530121 route: '/security-and-access/policies',
122 },
123 {
124 id: 'certificates',
Surya Vde23ea22024-07-11 15:19:46 +0530125 label: i18n.global.t('appNavigation.certificates'),
Sandeepa Singhb4406162021-07-26 15:05:39 +0530126 route: '/security-and-access/certificates',
Derick Montague602e98a2020-10-21 16:20:00 -0500127 },
128 ],
129 },
Sandeepa Singh6dba4be2021-07-28 15:25:14 +0530130 {
131 id: 'resource-management',
Surya Vde23ea22024-07-11 15:19:46 +0530132 label: i18n.global.t('appNavigation.resourceManagement'),
Sandeepa Singh6dba4be2021-07-28 15:25:14 +0530133 icon: 'iconResourceManagement',
134 children: [
135 {
136 id: 'power',
Surya Vde23ea22024-07-11 15:19:46 +0530137 label: i18n.global.t('appNavigation.power'),
Sandeepa Singh6dba4be2021-07-28 15:25:14 +0530138 route: '/resource-management/power',
139 },
140 ],
141 },
Derick Montague602e98a2020-10-21 16:20:00 -0500142 ],
Yoshie Muranaka0214fed2020-09-03 13:25:50 -0700143 };
Derick Montague602e98a2020-10-21 16:20:00 -0500144 },
Sandeepa Singh05887b52022-01-10 19:19:36 +0530145 methods: {
146 operationsNavigationItems() {
147 const username = this.$store.getters['global/username'];
148 let operationNavigationItems = [
149 {
150 id: 'factory-reset',
Surya Vde23ea22024-07-11 15:19:46 +0530151 label: i18n.global.t('appNavigation.factoryReset'),
Sandeepa Singh05887b52022-01-10 19:19:36 +0530152 route: '/operations/factory-reset',
153 },
154 {
155 id: 'firmware',
Surya Vde23ea22024-07-11 15:19:46 +0530156 label: i18n.global.t('appNavigation.firmware'),
Sandeepa Singh05887b52022-01-10 19:19:36 +0530157 route: '/operations/firmware',
158 },
159 {
160 id: 'reboot-bmc',
Surya Vde23ea22024-07-11 15:19:46 +0530161 label: i18n.global.t('appNavigation.rebootBmc'),
Sandeepa Singh05887b52022-01-10 19:19:36 +0530162 route: '/operations/reboot-bmc',
163 },
164 {
165 id: 'serial-over-lan',
Surya Vde23ea22024-07-11 15:19:46 +0530166 label: i18n.global.t('appNavigation.serialOverLan'),
Sandeepa Singh05887b52022-01-10 19:19:36 +0530167 route: '/operations/serial-over-lan',
168 },
169 {
170 id: 'server-power-operations',
Surya Vde23ea22024-07-11 15:19:46 +0530171 label: i18n.global.t('appNavigation.serverPowerOperations'),
Sandeepa Singh05887b52022-01-10 19:19:36 +0530172 route: '/operations/server-power-operations',
173 },
174 ];
175 let pageKeyClear = {
176 id: 'key-clear',
Surya Vde23ea22024-07-11 15:19:46 +0530177 label: i18n.global.t('appNavigation.keyClear'),
Sandeepa Singh05887b52022-01-10 19:19:36 +0530178 route: '/operations/key-clear',
179 };
180 if (username === 'service' || username === 'admin') {
181 operationNavigationItems.splice(2, 0, pageKeyClear);
182 }
183 return operationNavigationItems;
184 },
185 },
Yoshie Muranaka0214fed2020-09-03 13:25:50 -0700186};
187
188export default AppNavigationMixin;