1import IconDashboard from '@carbon/icons-vue/es/dashboard/16';
2import IconTextLinkAnalysis from '@carbon/icons-vue/es/text-link--analysis/16';
3import 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';
6import IconSecurity from '@carbon/icons-vue/es/security/16';
7import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16';
8import IconDataBase from '@carbon/icons-vue/es/data--base--alt/16';
9import i18n from '@/i18n';
10const roles = {
11  administrator: 'Administrator',
12  operator: 'Operator',
13  readonly: 'ReadOnly',
14  noaccess: 'NoAccess',
15};
16
17const AppNavigationMixin = {
18  components: {
19    iconOverview: IconDashboard,
20    iconLogs: IconTextLinkAnalysis,
21    iconHealth: IconDataCheck,
22    iconControl: IconSettingsAdjust,
23    iconSettings: IconSettings,
24    iconSecurityAndAccess: IconSecurity,
25    iconExpand: IconChevronUp,
26    iconResourceManagement: IconDataBase,
27  },
28  data() {
29    return {
30      navigationItems: [
31        {
32          id: 'overview',
33          label: i18n.global.t('appNavigation.overview'),
34          route: '/',
35          icon: 'iconOverview',
36        },
37        {
38          id: 'logs',
39          label: i18n.global.t('appNavigation.logs'),
40          icon: 'iconLogs',
41          children: [
42            {
43              id: 'event-logs',
44              label: i18n.global.t('appNavigation.eventLogs'),
45              route: '/logs/event-logs',
46            },
47            {
48              id: 'post-code-logs',
49              label: i18n.global.t('appNavigation.postCodeLogs'),
50              route: '/logs/post-code-logs',
51            },
52          ],
53        },
54        {
55          id: 'hardware-status',
56          label: i18n.global.t('appNavigation.hardwareStatus'),
57          icon: 'iconHealth',
58          children: [
59            {
60              id: 'inventory',
61              label: i18n.global.t('appNavigation.inventory'),
62              route: '/hardware-status/inventory',
63            },
64            {
65              id: 'sensors',
66              label: i18n.global.t('appNavigation.sensors'),
67              route: '/hardware-status/sensors',
68            },
69          ],
70        },
71        {
72          id: 'operations',
73          label: i18n.global.t('appNavigation.operations'),
74          icon: 'iconControl',
75          children: [
76            {
77              id: 'factory-reset',
78              label: i18n.global.t('appNavigation.factoryReset'),
79              route: '/operations/factory-reset',
80            },
81            {
82              id: 'kvm',
83              label: i18n.global.t('appNavigation.kvm'),
84              route: '/operations/kvm',
85            },
86            {
87              id: 'key-clear',
88              label: i18n.global.t('appNavigation.keyClear'),
89              route: '/operations/key-clear',
90            },
91            {
92              id: 'firmware',
93              label: i18n.global.t('appNavigation.firmware'),
94              route: '/operations/firmware',
95            },
96            {
97              id: 'reboot-bmc',
98              label: i18n.global.t('appNavigation.rebootBmc'),
99              route: '/operations/reboot-bmc',
100            },
101            {
102              id: 'serial-over-lan',
103              label: i18n.global.t('appNavigation.serialOverLan'),
104              route: '/operations/serial-over-lan',
105              exclusiveToRoles: [roles.administrator],
106            },
107            {
108              id: 'server-power-operations',
109              label: i18n.global.t('appNavigation.serverPowerOperations'),
110              route: '/operations/server-power-operations',
111            },
112            {
113              id: 'virtual-media',
114              label: i18n.global.t('appNavigation.virtualMedia'),
115              route: '/operations/virtual-media',
116              exclusiveToRoles: [roles.administrator],
117            },
118          ],
119        },
120        {
121          id: 'settings',
122          label: i18n.global.t('appNavigation.settings'),
123          icon: 'iconSettings',
124          children: [
125            {
126              id: 'date-time',
127              label: i18n.global.t('appNavigation.dateTime'),
128              route: '/settings/date-time',
129            },
130            {
131              id: 'network',
132              label: i18n.global.t('appNavigation.network'),
133              route: '/settings/network',
134            },
135            {
136              id: 'power-restore-policy',
137              label: i18n.global.t('appNavigation.powerRestorePolicy'),
138              route: '/settings/power-restore-policy',
139            },
140            {
141              id: 'snmp-alerts',
142              label: i18n.global.t('appNavigation.snmpAlerts'),
143              route: '/settings/snmp-alerts',
144            },
145          ],
146        },
147        {
148          id: 'security-and-access',
149          label: i18n.global.t('appNavigation.securityAndAccess'),
150          icon: 'iconSecurityAndAccess',
151          children: [
152            {
153              id: 'sessions',
154              label: i18n.global.t('appNavigation.sessions'),
155              route: '/security-and-access/sessions',
156            },
157            {
158              id: 'ldap',
159              label: i18n.global.t('appNavigation.ldap'),
160              route: '/security-and-access/ldap',
161            },
162            {
163              id: 'user-management',
164              label: i18n.global.t('appNavigation.userManagement'),
165              route: '/security-and-access/user-management',
166            },
167            {
168              id: 'policies',
169              label: i18n.global.t('appNavigation.policies'),
170              route: '/security-and-access/policies',
171            },
172            {
173              id: 'certificates',
174              label: i18n.global.t('appNavigation.certificates'),
175              route: '/security-and-access/certificates',
176            },
177          ],
178        },
179        {
180          id: 'resource-management',
181          label: i18n.global.t('appNavigation.resourceManagement'),
182          icon: 'iconResourceManagement',
183          children: [
184            {
185              id: 'power',
186              label: i18n.global.t('appNavigation.power'),
187              route: '/resource-management/power',
188            },
189          ],
190        },
191      ],
192    };
193  },
194};
195
196export default AppNavigationMixin;
197