forked from DebaucheryLibrarian/traxxx
174 lines
3.0 KiB
JavaScript
174 lines
3.0 KiB
JavaScript
import Vue from 'vue';
|
|
import VueRouter from 'vue-router';
|
|
|
|
import Home from '../components/home/home.vue';
|
|
import Release from '../components/releases/release.vue';
|
|
import Site from '../components/sites/site.vue';
|
|
import Network from '../components/networks/network.vue';
|
|
import Networks from '../components/networks/networks.vue';
|
|
import Actor from '../components/actors/actor.vue';
|
|
import Actors from '../components/actors/actors.vue';
|
|
import Tag from '../components/tags/tag.vue';
|
|
import Tags from '../components/tags/tags.vue';
|
|
import Search from '../components/search/search.vue';
|
|
import NotFound from '../components/errors/404.vue';
|
|
|
|
Vue.use(VueRouter);
|
|
|
|
const routes = [
|
|
{
|
|
path: '/',
|
|
redirect: {
|
|
name: 'updates',
|
|
params: {
|
|
range: 'latest',
|
|
tags: 'all-tags',
|
|
pageNumber: 1,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: '/updates',
|
|
redirect: {
|
|
name: 'updates',
|
|
params: {
|
|
range: 'latest',
|
|
tags: 'all-tags',
|
|
pageNumber: 1,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: '/updates/:tags/:range/:pageNumber',
|
|
component: Home,
|
|
name: 'updates',
|
|
},
|
|
{
|
|
path: '/scene/:releaseId/:releaseSlug?',
|
|
component: Release,
|
|
name: 'scene',
|
|
},
|
|
{
|
|
path: '/movie/:releaseId/:releaseSlug?',
|
|
component: Release,
|
|
name: 'movie',
|
|
},
|
|
{
|
|
path: '/actor/:actorId/:actorSlug',
|
|
name: 'actor',
|
|
redirect: from => ({
|
|
name: 'actorRange',
|
|
params: {
|
|
...from.params,
|
|
range: 'latest',
|
|
tags: 'all-tags',
|
|
pageNumber: 1,
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/actor/:actorId/:actorSlug/:tags/:range/:pageNumber',
|
|
component: Actor,
|
|
name: 'actorRange',
|
|
},
|
|
{
|
|
path: '/site/:siteSlug',
|
|
component: Site,
|
|
name: 'site',
|
|
redirect: from => ({
|
|
name: 'siteRange',
|
|
params: {
|
|
...from.params,
|
|
range: 'latest',
|
|
tags: 'all-tags',
|
|
pageNumber: 1,
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/site/:siteSlug/:tags/:range/:pageNumber',
|
|
component: Site,
|
|
name: 'siteRange',
|
|
},
|
|
{
|
|
path: '/network/:networkSlug',
|
|
component: Network,
|
|
name: 'network',
|
|
redirect: from => ({
|
|
name: 'networkRange',
|
|
params: {
|
|
...from.params,
|
|
range: 'latest',
|
|
tags: 'all-tags',
|
|
pageNumber: 1,
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/network/:networkSlug/:tags/:range/:pageNumber',
|
|
component: Network,
|
|
name: 'networkRange',
|
|
},
|
|
{
|
|
path: '/tag/:tagSlug',
|
|
redirect: from => ({
|
|
name: 'tag',
|
|
params: {
|
|
...from.params,
|
|
range: 'latest',
|
|
tags: 'all-tags',
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/tag/:tagSlug/:tags/:range',
|
|
component: Tag,
|
|
name: 'tag',
|
|
},
|
|
{
|
|
path: '/actors',
|
|
redirect: from => ({
|
|
name: 'actors',
|
|
params: {
|
|
...from.params,
|
|
gender: 'female',
|
|
letter: 'all',
|
|
tags: 'all-tags',
|
|
range: 'latest',
|
|
pageNumber: 1,
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/actors/:gender?/:letter?/:pageNumber',
|
|
component: Actors,
|
|
name: 'actors',
|
|
},
|
|
{
|
|
path: '/networks',
|
|
component: Networks,
|
|
name: 'networks',
|
|
},
|
|
{
|
|
path: '/tags',
|
|
component: Tags,
|
|
name: 'tags',
|
|
},
|
|
{
|
|
path: '/search',
|
|
component: Search,
|
|
name: 'search',
|
|
},
|
|
{
|
|
path: '*',
|
|
component: NotFound,
|
|
},
|
|
];
|
|
|
|
const router = new VueRouter({
|
|
mode: 'history',
|
|
routes,
|
|
});
|
|
|
|
export default router;
|