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        },
141        {
142          id: 'security-and-access',
143          label: this.$t('appNavigation.securityAndAccess'),
144          icon: 'iconSecurityAndAccess',
145          children: [
146            {
147              id: 'sessions',
148              label: this.$t('appNavigation.sessions'),
149              route: '/security-and-access/sessions',
150            },
151            {
152              id: 'ldap',
153              label: this.$t('appNavigation.ldap'),
154              route: '/security-and-access/ldap',
155            },
156            {
157              id: 'user-management',
158              label: this.$t('appNavigation.userManagement'),
159              route: '/security-and-access/user-management',
160            },
161            {
162              id: 'policies',
163              label: this.$t('appNavigation.policies'),
164              route: '/security-and-access/policies',
165            },
166            {
167              id: 'certificates',
168              label: this.$t('appNavigation.certificates'),
169              route: '/security-and-access/certificates',
170            },
171          ],
172        },
173        {
174          id: 'resource-management',
175          label: this.$t('appNavigation.resourceManagement'),
176          icon: 'iconResourceManagement',
177          children: [
178            {
179              id: 'power',
180              label: this.$t('appNavigation.power'),
181              route: '/resource-management/power',
182            },
183          ],
184        },
185      ],
186    };
187  },
188};
189
190export default AppNavigationMixin;
191