187 lines
3.2 KiB
JavaScript
187 lines
3.2 KiB
JavaScript
import Vue from 'vue';
|
|
import VueRouter from 'vue-router';
|
|
|
|
import Home from '../components/home/home.vue';
|
|
import Scene from '../components/releases/scene.vue';
|
|
import Movie from '../components/releases/movie.vue';
|
|
import Entity from '../components/entities/entity.vue';
|
|
import Networks from '../components/networks/networks.vue';
|
|
import Actor from '../components/actors/actor.vue';
|
|
import Actors from '../components/actors/actors.vue';
|
|
import Movies from '../components/releases/movies.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',
|
|
pageNumber: 1,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: '/updates',
|
|
redirect: {
|
|
name: 'updates',
|
|
params: {
|
|
range: 'latest',
|
|
pageNumber: 1,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: '/updates/:range/:pageNumber',
|
|
component: Home,
|
|
name: 'updates',
|
|
},
|
|
{
|
|
path: '/scene/:releaseId/:releaseSlug?',
|
|
component: Scene,
|
|
name: 'scene',
|
|
},
|
|
{
|
|
path: '/movie/:movieId/:movieSlug?',
|
|
component: Movie,
|
|
name: 'movie',
|
|
},
|
|
{
|
|
path: '/actor/:actorId/:actorSlug',
|
|
name: 'actor',
|
|
redirect: from => ({
|
|
name: 'actorRange',
|
|
params: {
|
|
...from.params,
|
|
range: 'latest',
|
|
pageNumber: 1,
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/actor/:actorId/:actorSlug/:range/:pageNumber',
|
|
component: Actor,
|
|
name: 'actorRange',
|
|
},
|
|
{
|
|
path: '/channel/:entitySlug',
|
|
redirect: from => ({
|
|
name: 'channel',
|
|
params: {
|
|
...from.params,
|
|
range: 'latest',
|
|
pageNumber: 1,
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/channel/:entitySlug/:range/:pageNumber',
|
|
component: Entity,
|
|
name: 'channel',
|
|
},
|
|
{
|
|
path: '/network/:entitySlug',
|
|
redirect: from => ({
|
|
name: 'network',
|
|
params: {
|
|
...from.params,
|
|
range: 'latest',
|
|
pageNumber: 1,
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/network/:entitySlug/:range/:pageNumber',
|
|
component: Entity,
|
|
name: 'network',
|
|
},
|
|
{
|
|
path: '/studio/:entitySlug',
|
|
redirect: from => ({
|
|
name: 'studio',
|
|
params: {
|
|
...from.params,
|
|
range: 'latest',
|
|
pageNumber: 1,
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/studio/:entitySlug/:range/:pageNumber',
|
|
component: Entity,
|
|
name: 'studio',
|
|
},
|
|
{
|
|
path: '/tag/:tagSlug',
|
|
redirect: from => ({
|
|
name: 'tag',
|
|
params: {
|
|
...from.params,
|
|
range: 'latest',
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/tag/:tagSlug/:range',
|
|
component: Tag,
|
|
name: 'tag',
|
|
},
|
|
{
|
|
path: '/actors',
|
|
redirect: from => ({
|
|
name: 'actors',
|
|
params: {
|
|
...from.params,
|
|
gender: 'all',
|
|
letter: 'all',
|
|
tags: 'all',
|
|
range: 'latest',
|
|
pageNumber: 1,
|
|
},
|
|
}),
|
|
},
|
|
{
|
|
path: '/actors/:gender?/:letter?/:pageNumber',
|
|
component: Actors,
|
|
name: 'actors',
|
|
},
|
|
{
|
|
path: '/networks',
|
|
component: Networks,
|
|
name: 'networks',
|
|
},
|
|
{
|
|
path: '/movies',
|
|
component: Movies,
|
|
name: 'movies',
|
|
},
|
|
{
|
|
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;
|