xref: /openbmc/webui-vue/src/env/router/intel.js (revision aeb19816)
1import AppLayout from '@/layouts/AppLayout.vue';
2import ChangePassword from '@/views/ChangePassword';
3import Sessions from '@/views/SecurityAndAccess/Sessions';
4import ConsoleLayout from '@/layouts/ConsoleLayout.vue';
5import DateTime from '@/views/Settings/DateTime';
6import EventLogs from '@/views/Logs/EventLogs';
7import Firmware from '@/views/Operations/Firmware';
8import Inventory from '@/views/HardwareStatus/Inventory';
9import Kvm from '@/views/Operations/Kvm';
10import KvmConsole from '@/views/Operations/Kvm/KvmConsole';
11import UserManagement from '@/views/SecurityAndAccess/UserManagement';
12import Login from '@/views/Login';
13import LoginLayout from '@/layouts/LoginLayout';
14import Network from '@/views/Settings/Network';
15import Overview from '@/views/Overview';
16import PageNotFound from '@/views/PageNotFound';
17import PostCodeLogs from '@/views/Logs/PostCodeLogs';
18import ProfileSettings from '@/views/ProfileSettings';
19import RebootBmc from '@/views/Operations/RebootBmc';
20import Policies from '@/views/SecurityAndAccess/Policies';
21import Sensors from '@/views/HardwareStatus/Sensors';
22import SerialOverLan from '@/views/Operations/SerialOverLan';
23import SerialOverLanConsole from '@/views/Operations/SerialOverLan/SerialOverLanConsole';
24import ServerPowerOperations from '@/views/Operations/ServerPowerOperations';
25import Certificates from '@/views/SecurityAndAccess/Certificates';
26import VirtualMedia from '@/views/Operations/VirtualMedia';
27import Power from '@/views/ResourceManagement/Power';
28import i18n from '@/i18n';
29
30const roles = {
31  administrator: 'Administrator',
32  operator: 'Operator',
33  readonly: 'ReadOnly',
34  noaccess: 'NoAccess',
35};
36
37const routes = [
38  {
39    path: '/login',
40    component: LoginLayout,
41    children: [
42      {
43        path: '',
44        name: 'login',
45        component: Login,
46        meta: {
47          title: i18n.t('appPageTitle.login'),
48        },
49      },
50      {
51        path: '/change-password',
52        name: 'change-password',
53        component: ChangePassword,
54        meta: {
55          title: i18n.t('appPageTitle.changePassword'),
56          requiresAuth: true,
57        },
58      },
59    ],
60  },
61  {
62    path: '/console',
63    component: ConsoleLayout,
64    meta: {
65      requiresAuth: true,
66    },
67    children: [
68      {
69        path: 'serial-over-lan-console',
70        name: 'serial-over-lan-console',
71        component: SerialOverLanConsole,
72        meta: {
73          title: i18n.t('appPageTitle.serialOverLan'),
74        },
75      },
76      {
77        path: 'kvm',
78        name: 'kvm-console',
79        component: KvmConsole,
80        meta: {
81          title: i18n.t('appPageTitle.kvm'),
82        },
83      },
84    ],
85  },
86  {
87    path: '/',
88    meta: {
89      requiresAuth: true,
90    },
91    component: AppLayout,
92    children: [
93      {
94        path: '',
95        name: 'overview',
96        component: Overview,
97        meta: {
98          title: i18n.t('appPageTitle.overview'),
99        },
100      },
101      {
102        path: '/profile-settings',
103        name: 'profile-settings',
104        component: ProfileSettings,
105        meta: {
106          title: i18n.t('appPageTitle.profileSettings'),
107        },
108      },
109      {
110        path: '/logs/event-logs',
111        name: 'event-logs',
112        component: EventLogs,
113        meta: {
114          title: i18n.t('appPageTitle.eventLogs'),
115        },
116      },
117      {
118        path: '/logs/post-code-logs',
119        name: 'post-code-logs',
120        component: PostCodeLogs,
121        meta: {
122          title: i18n.t('appPageTitle.postCodeLogs'),
123        },
124      },
125      {
126        path: '/hardware-status/inventory',
127        name: 'inventory',
128        component: Inventory,
129        meta: {
130          title: i18n.t('appPageTitle.inventory'),
131        },
132      },
133      {
134        path: '/hardware-status/sensors',
135        name: 'sensors',
136        component: Sensors,
137        meta: {
138          title: i18n.t('appPageTitle.sensors'),
139        },
140      },
141      {
142        path: '/security-and-access/sessions',
143        name: 'sessions',
144        component: Sessions,
145        meta: {
146          title: i18n.t('appPageTitle.sessions'),
147        },
148      },
149      {
150        path: '/security-and-access/user-management',
151        name: 'user-management',
152        component: UserManagement,
153        meta: {
154          title: i18n.t('appPageTitle.userManagement'),
155        },
156      },
157      {
158        path: '/security-and-access/policies',
159        name: 'policies',
160        component: Policies,
161        meta: {
162          title: i18n.t('appPageTitle.policies'),
163        },
164      },
165      {
166        path: '/security-and-access/certificates',
167        name: 'certificates',
168        component: Certificates,
169        meta: {
170          title: i18n.t('appPageTitle.certificates'),
171        },
172      },
173      {
174        path: '/settings/date-time',
175        name: 'date-time',
176        component: DateTime,
177        meta: {
178          title: i18n.t('appPageTitle.dateTime'),
179        },
180      },
181      {
182        path: '/operations/kvm',
183        name: 'kvm',
184        component: Kvm,
185        meta: {
186          title: i18n.t('appPageTitle.kvm'),
187        },
188      },
189      {
190        path: '/operations/firmware',
191        name: 'firmware',
192        component: Firmware,
193        meta: {
194          title: i18n.t('appPageTitle.firmware'),
195        },
196      },
197      {
198        path: '/settings/network',
199        name: 'network',
200        component: Network,
201        meta: {
202          title: i18n.t('appPageTitle.network'),
203        },
204      },
205      {
206        path: '/resource-management/power',
207        name: 'power',
208        component: Power,
209        meta: {
210          title: i18n.t('appPageTitle.power'),
211        },
212      },
213      {
214        path: '/operations/reboot-bmc',
215        name: 'reboot-bmc',
216        component: RebootBmc,
217        meta: {
218          title: i18n.t('appPageTitle.rebootBmc'),
219        },
220      },
221      {
222        path: '/operations/serial-over-lan',
223        name: 'serial-over-lan',
224        component: SerialOverLan,
225        meta: {
226          title: i18n.t('appPageTitle.serialOverLan'),
227          exclusiveToRoles: [roles.administrator],
228        },
229      },
230      {
231        path: '/operations/server-power-operations',
232        name: 'server-power-operations',
233        component: ServerPowerOperations,
234        meta: {
235          title: i18n.t('appPageTitle.serverPowerOperations'),
236        },
237      },
238      {
239        path: '/operations/virtual-media',
240        name: 'virtual-media',
241        component: VirtualMedia,
242        meta: {
243          title: i18n.t('appPageTitle.virtualMedia'),
244          exclusiveToRoles: [roles.administrator],
245        },
246      },
247      {
248        path: '*',
249        name: 'page-not-found',
250        component: PageNotFound,
251        meta: {
252          title: i18n.t('appPageTitle.pageNotFound'),
253        },
254      },
255    ],
256  },
257];
258
259export default routes;
260