You've already forked AstralRinth
forked from didirus/AstralRinth
* feat(theseus): Initial migration to Tauri v2 * feat(theseus): Added a way to zoom / scale UI * chore(theseus): Started cleaning up some plugins * fix(theseus): Github Actions * refactor(theseus): Reduced boilerplate & more work * feat(theseus): Allow multiple app instances to be open at once (#995) * fix(theseus): Lint & more * fix(theseus): App Release github action * fix(theseus): Open links in browser & macos builds * fix(theseus): Rebase fixes * fix(theseus): Updater & app release action * fix(theseus): Fixed definitions in `build.rs` * Fix MacOS deep linking, window decorations * fix(theseus): Closing & maximizing app * Fix macos build * add back release conf * acc fix build * make updater for release builds only * focus window on startup --------- Co-authored-by: Jai A <jaiagr+gpg@pm.me> Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
149 lines
3.7 KiB
JavaScript
149 lines
3.7 KiB
JavaScript
import { createRouter, createWebHistory } from 'vue-router'
|
|
import * as Pages from '@/pages'
|
|
import * as Project from '@/pages/project'
|
|
import * as Instance from '@/pages/instance'
|
|
|
|
/**
|
|
* Configures application routing. Add page to pages/index and then add to route table here.
|
|
*/
|
|
export default new createRouter({
|
|
history: createWebHistory(),
|
|
routes: [
|
|
{
|
|
path: '/',
|
|
name: 'Home',
|
|
component: Pages.Index,
|
|
meta: {
|
|
breadcrumb: [{ name: 'Home' }],
|
|
},
|
|
},
|
|
{
|
|
path: '/browse/:projectType',
|
|
name: 'Browse',
|
|
component: Pages.Browse,
|
|
meta: {
|
|
breadcrumb: [{ name: 'Browse' }],
|
|
},
|
|
},
|
|
{
|
|
path: '/library',
|
|
name: 'Library',
|
|
component: Pages.Library,
|
|
meta: {
|
|
breadcrumb: [{ name: 'Library' }],
|
|
},
|
|
},
|
|
{
|
|
path: '/settings',
|
|
name: 'Settings',
|
|
component: Pages.Settings,
|
|
meta: {
|
|
breadcrumb: [{ name: 'Settings' }],
|
|
},
|
|
},
|
|
{
|
|
path: '/project/:id',
|
|
name: 'Project',
|
|
component: Project.Index,
|
|
props: true,
|
|
children: [
|
|
{
|
|
path: '',
|
|
name: 'Description',
|
|
component: Project.Description,
|
|
meta: {
|
|
useContext: true,
|
|
breadcrumb: [{ name: '?Project' }],
|
|
},
|
|
},
|
|
{
|
|
path: 'versions',
|
|
name: 'Versions',
|
|
component: Project.Versions,
|
|
meta: {
|
|
useContext: true,
|
|
breadcrumb: [{ name: '?Project', link: '/project/{id}/' }, { name: 'Versions' }],
|
|
},
|
|
},
|
|
{
|
|
path: 'version/:version',
|
|
name: 'Version',
|
|
component: Project.Version,
|
|
props: true,
|
|
meta: {
|
|
useContext: true,
|
|
breadcrumb: [
|
|
{ name: '?Project', link: '/project/{id}/' },
|
|
{ name: 'Versions', link: '/project/{id}/versions' },
|
|
{ name: '?Version' },
|
|
],
|
|
},
|
|
},
|
|
{
|
|
path: 'gallery',
|
|
name: 'Gallery',
|
|
component: Project.Gallery,
|
|
meta: {
|
|
useContext: true,
|
|
breadcrumb: [{ name: '?Project', link: '/project/{id}/' }, { name: 'Gallery' }],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/instance/:id',
|
|
name: 'Instance',
|
|
component: Instance.Index,
|
|
props: true,
|
|
children: [
|
|
{
|
|
path: '',
|
|
name: 'Mods',
|
|
component: Instance.Mods,
|
|
meta: {
|
|
useRootContext: true,
|
|
breadcrumb: [{ name: '?Instance' }],
|
|
},
|
|
},
|
|
{
|
|
path: 'projects/:type',
|
|
name: 'ModsFilter',
|
|
component: Instance.Mods,
|
|
meta: {
|
|
useRootContext: true,
|
|
breadcrumb: [{ name: '?Instance' }],
|
|
},
|
|
},
|
|
{
|
|
path: 'options',
|
|
name: 'Options',
|
|
component: Instance.Options,
|
|
meta: {
|
|
useRootContext: true,
|
|
breadcrumb: [{ name: '?Instance', link: '/instance/{id}/' }, { name: 'Options' }],
|
|
},
|
|
},
|
|
{
|
|
path: 'logs',
|
|
name: 'Logs',
|
|
component: Instance.Logs,
|
|
meta: {
|
|
useRootContext: true,
|
|
breadcrumb: [{ name: '?Instance', link: '/instance/{id}/' }, { name: 'Logs' }],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
linkActiveClass: 'router-link-active',
|
|
linkExactActiveClass: 'router-link-exact-active',
|
|
scrollBehavior() {
|
|
// Sometimes Vue's scroll behavior is not working as expected, so we need to manually scroll to top (especially on Linux)
|
|
document.querySelector('.router-view')?.scrollTo(0, 0)
|
|
return {
|
|
el: '.router-view',
|
|
top: 0,
|
|
}
|
|
},
|
|
})
|