mirror of https://github.com/rancher/ui.git
17 lines
494 B
JavaScript
17 lines
494 B
JavaScript
import Route from '@ember/routing/route';
|
|
import C from 'ui/utils/constants';
|
|
|
|
const DEFAULT_ROUTE = 'containers';
|
|
const VALID_ROUTES = [DEFAULT_ROUTE,'scaling-groups','ingresses', 'authenticated.project.dns','volumes', 'authenticated.project.pipeline.pipelines'];
|
|
|
|
export default Route.extend({
|
|
redirect() {
|
|
let route = this.get(`session.${C.SESSION.CONTAINER_ROUTE}`);
|
|
if ( !VALID_ROUTES.includes(route) ) {
|
|
route = DEFAULT_ROUTE;
|
|
}
|
|
|
|
this.replaceWith(route);
|
|
},
|
|
});
|