2025-11-14 17:15:09 +00:00
|
|
|
import { ServersManagePageIndex } from '@modrinth/ui'
|
2023-03-17 15:46:55 -04:00
|
|
|
import { createRouter, createWebHistory } from 'vue-router'
|
2025-08-14 21:48:38 +01:00
|
|
|
|
2023-03-17 15:46:55 -04:00
|
|
|
import * as Pages from '@/pages'
|
2023-03-30 18:37:45 -04:00
|
|
|
import * as Instance from '@/pages/instance'
|
App redesign (#2946)
* Start of app redesign
* format
* continue progress
* Content page nearly done
* Fix recursion issues with content page
* Fix update all alignment
* Discover page progress
* Settings progress
* Removed unlocked-size hack that breaks web
* Revamp project page, refactor web project page to share code with app, fixed loading bar, misc UI/UX enhancements, update ko-fi logo, update arrow icons, fix web issues caused by floating-vue migration, fix tooltip issues, update web tooltips, clean up web hydration issues
* Ads + run prettier
* Begin auth refactor, move common messages to ui lib, add i18n extraction to all apps, begin Library refactor
* fix ads not hiding when plus log in
* rev lockfile changes/conflicts
* Fix sign in page
* Add generated
* (mostly) Data driven search
* Fix search mobile issue
* profile fixes
* Project versions page, fix typescript on UI lib and misc fixes
* Remove unused gallery component
* Fix linkfunction err
* Search filter controls at top, localization for locked filters
* Fix provided filter names
* Fix navigating from instance browse to main browse
* Friends frontend (#2995)
* Friends system frontend
* (almost) finish frontend
* finish friends, fix lint
* Fix lint
---------
Signed-off-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
* Refresh macOS app icon
* Update web search UI more
* Fix link opens
* Fix frontend build
---------
Signed-off-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
Co-authored-by: Jai A <jaiagr+gpg@pm.me>
Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
2024-12-11 19:54:18 -08:00
|
|
|
import * as Library from '@/pages/library'
|
2025-08-14 21:48:38 +01:00
|
|
|
import * as Project from '@/pages/project'
|
2023-03-17 15:46:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Configures application routing. Add page to pages/index and then add to route table here.
|
|
|
|
|
*/
|
|
|
|
|
export default new createRouter({
|
2025-08-14 21:48:38 +01:00
|
|
|
history: createWebHistory(),
|
|
|
|
|
routes: [
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
|
|
|
|
name: 'Home',
|
|
|
|
|
component: Pages.Index,
|
|
|
|
|
meta: {
|
|
|
|
|
breadcrumb: [{ name: 'Home' }],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/worlds',
|
|
|
|
|
name: 'Worlds',
|
|
|
|
|
component: Pages.Worlds,
|
|
|
|
|
meta: {
|
|
|
|
|
breadcrumb: [{ name: 'Worlds' }],
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-11-14 17:15:09 +00:00
|
|
|
{
|
2025-12-03 14:15:36 -08:00
|
|
|
path: '/hosting/manage/',
|
2025-11-14 17:15:09 +00:00
|
|
|
name: 'Servers',
|
|
|
|
|
component: ServersManagePageIndex,
|
|
|
|
|
meta: {
|
|
|
|
|
breadcrumb: [{ name: 'Servers' }],
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-08-14 21:48:38 +01:00
|
|
|
{
|
|
|
|
|
path: '/browse/:projectType',
|
|
|
|
|
name: 'Discover content',
|
|
|
|
|
component: Pages.Browse,
|
|
|
|
|
meta: {
|
|
|
|
|
breadcrumb: [{ name: 'Discover content' }],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/skins',
|
|
|
|
|
name: 'Skins',
|
|
|
|
|
component: Pages.Skins,
|
|
|
|
|
meta: {
|
|
|
|
|
breadcrumb: [{ name: 'Skins' }],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/library',
|
|
|
|
|
name: 'Library',
|
|
|
|
|
component: Library.Index,
|
|
|
|
|
meta: {
|
|
|
|
|
breadcrumb: [{ name: 'Library' }],
|
|
|
|
|
},
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
path: '',
|
|
|
|
|
name: 'Overview',
|
|
|
|
|
component: Library.Overview,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'downloaded',
|
|
|
|
|
name: 'Downloaded',
|
|
|
|
|
component: Library.Downloaded,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'custom',
|
|
|
|
|
name: 'Custom',
|
|
|
|
|
component: Library.Custom,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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: 'Overview',
|
|
|
|
|
// component: Instance.Overview,
|
|
|
|
|
// meta: {
|
|
|
|
|
// useRootContext: true,
|
|
|
|
|
// breadcrumb: [{ name: '?Instance' }],
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
path: 'worlds',
|
|
|
|
|
name: 'InstanceWorlds',
|
|
|
|
|
component: Instance.Worlds,
|
|
|
|
|
meta: {
|
|
|
|
|
useRootContext: true,
|
|
|
|
|
breadcrumb: [{ name: '?Instance', link: '/instance/{id}/' }, { name: 'Worlds' }],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '',
|
|
|
|
|
name: 'Mods',
|
|
|
|
|
component: Instance.Mods,
|
|
|
|
|
meta: {
|
|
|
|
|
useRootContext: true,
|
|
|
|
|
breadcrumb: [{ name: '?Instance', link: '/instance/{id}/' }, { name: 'Content' }],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'projects/:type',
|
|
|
|
|
name: 'ModsFilter',
|
|
|
|
|
component: Instance.Mods,
|
|
|
|
|
meta: {
|
|
|
|
|
useRootContext: true,
|
|
|
|
|
breadcrumb: [{ name: '?Instance', link: '/instance/{id}/' }, { name: 'Content' }],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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('.app-viewport')?.scrollTo(0, 0)
|
|
|
|
|
return {
|
|
|
|
|
el: '.app-viewport',
|
|
|
|
|
top: 0,
|
|
|
|
|
}
|
|
|
|
|
},
|
2023-03-17 15:46:55 -04:00
|
|
|
})
|