traxxx/assets/js/router.js

180 lines
3.0 KiB
JavaScript
Raw Normal View History

import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '../components/home/home.vue';
import Release from '../components/releases/release.vue';
2020-06-27 02:50:13 +00:00
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 Tag from '../components/tags/tag.vue';
import Tags from '../components/tags/tags.vue';
2020-02-26 00:15:50 +00:00
import Search from '../components/search/search.vue';
import NotFound from '../components/errors/404.vue';
Vue.use(VueRouter);
const routes = [
{
path: '/',
redirect: {
name: 'updates',
2020-05-22 02:32:16 +00:00
params: {
2020-05-26 23:40:10 +00:00
range: 'latest',
2020-06-27 02:50:13 +00:00
tags: 'all',
pageNumber: 1,
2020-05-22 02:32:16 +00:00
},
},
},
{
path: '/updates',
redirect: {
name: 'updates',
params: {
range: 'latest',
pageNumber: 1,
},
},
},
{
path: '/updates/: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',
2020-05-26 23:40:10 +00:00
pageNumber: 1,
},
}),
},
{
path: '/actor/:actorId/:actorSlug/:range/:pageNumber',
component: Actor,
name: 'actorRange',
},
{
2020-06-27 02:50:13 +00:00
path: '/channel/:entitySlug',
redirect: from => ({
2020-06-27 02:50:13 +00:00
name: 'channel',
params: {
...from.params,
range: 'latest',
2020-05-26 23:40:10 +00:00
pageNumber: 1,
},
}),
},
{
path: '/channel/:entitySlug/:range/:pageNumber',
2020-06-27 02:50:13 +00:00
component: Entity,
name: 'channel',
},
{
2020-06-27 02:50:13 +00:00
path: '/network/:entitySlug',
redirect: from => ({
2020-06-27 02:50:13 +00:00
name: 'network',
params: {
...from.params,
range: 'latest',
2020-05-26 02:11:29 +00:00
pageNumber: 1,
},
}),
},
{
path: '/network/:entitySlug/:range/:pageNumber',
2020-06-27 02:50:13 +00:00
component: Entity,
name: 'network',
},
2020-06-30 22:25:27 +00:00
{
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 => ({
2020-05-29 20:43:03 +00:00
name: 'tag',
params: {
...from.params,
range: 'latest',
},
}),
},
{
2020-06-29 23:07:48 +00:00
path: '/tag/:tagSlug/:range',
component: Tag,
2020-05-29 20:43:03 +00:00
name: 'tag',
},
{
path: '/actors',
redirect: from => ({
name: 'actors',
params: {
...from.params,
gender: 'female',
letter: 'all',
2020-06-27 02:50:13 +00:00
tags: 'all',
2020-05-29 20:43:03 +00:00
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;