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