debian-mirror-gitlab/app/assets/javascripts/registry/explorer/router.js

36 lines
757 B
JavaScript
Raw Normal View History

2020-03-13 15:44:24 +05:30
import Vue from 'vue';
import VueRouter from 'vue-router';
2020-06-23 00:09:42 +05:30
import { CONTAINER_REGISTRY_TITLE } from './constants/index';
2021-03-11 19:13:27 +05:30
import Details from './pages/details.vue';
import List from './pages/list.vue';
2020-03-13 15:44:24 +05:30
Vue.use(VueRouter);
2021-02-22 17:27:13 +05:30
export default function createRouter(base, breadCrumbState) {
2020-03-13 15:44:24 +05:30
const router = new VueRouter({
base,
mode: 'history',
routes: [
{
name: 'list',
path: '/',
component: List,
meta: {
2020-06-23 00:09:42 +05:30
nameGenerator: () => CONTAINER_REGISTRY_TITLE,
2020-03-13 15:44:24 +05:30
root: true,
},
},
{
name: 'details',
path: '/:id',
component: Details,
meta: {
2021-02-22 17:27:13 +05:30
nameGenerator: () => breadCrumbState.name,
2020-03-13 15:44:24 +05:30
},
},
],
});
return router;
}