traxxx/assets/js/router.js

192 lines
3.2 KiB
JavaScript
Raw Normal View History

import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '../components/home/home.vue';
2020-09-08 00:20:15 +00:00
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 Movies from '../components/releases/movies.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';
2020-08-15 17:04:33 +00:00
import Stats from '../components/stats/stats.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?',
2020-09-08 00:20:15 +00:00
component: Release,
name: 'scene',
},
{
2020-09-08 00:20:15 +00:00
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,
2020-08-02 01:51:52 +00:00
gender: 'all',
2020-05-29 20:43:03 +00:00
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',
},
2020-07-25 01:44:19 +00:00
{
path: '/movies',
component: Movies,
name: 'movies',
},
{
path: '/tags',
component: Tags,
name: 'tags',
},
{
path: '/search',
component: Search,
name: 'search',
},
2020-08-15 17:04:33 +00:00
{
path: '/stats',
component: Stats,
name: 'stats',
},
{
path: '*',
component: NotFound,
},
];
const router = new VueRouter({
mode: 'history',
routes,
});
export default router;