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