Apply repository-wide ESLint auto-fix formatting pass
Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
@@ -9,29 +9,29 @@
|
||||
* navigation guards, and authentication redirect logic.
|
||||
*/
|
||||
|
||||
import { createRouter, createWebHistory, } from "vue-router";
|
||||
import AuthContainer from '@/views/AuthContainer.vue';
|
||||
import MainContainer from '@/views/MainContainer.vue';
|
||||
import Login from '@/views/Login/Login.vue';
|
||||
import Files from '@/views/Files/Files.vue';
|
||||
import Upload from '@/views/Upload/index.vue';
|
||||
import Map from '@/views/Discover/Map/Map.vue';
|
||||
import Conformance from '@/views/Discover/Conformance/index.vue';
|
||||
import Performance from '@/views/Discover/Performance/index.vue';
|
||||
import CompareDashboard from '@/views/Compare/Dashboard/Compare.vue';
|
||||
import MapCompare from '@/views/Compare/MapCompare.vue';
|
||||
import AccountAdmin from '@/views/AccountManagement/AccountAdmin/AccountAdmin.vue';
|
||||
import MyAccount from '@/views/AccountManagement/MyAccount.vue';
|
||||
import MemberArea from '@/views/MemberArea/index.vue';
|
||||
import NotFound404 from '@/views/NotFound404.vue';
|
||||
import { createRouter, createWebHistory } from "vue-router";
|
||||
import AuthContainer from "@/views/AuthContainer.vue";
|
||||
import MainContainer from "@/views/MainContainer.vue";
|
||||
import Login from "@/views/Login/Login.vue";
|
||||
import Files from "@/views/Files/Files.vue";
|
||||
import Upload from "@/views/Upload/index.vue";
|
||||
import Map from "@/views/Discover/Map/Map.vue";
|
||||
import Conformance from "@/views/Discover/Conformance/index.vue";
|
||||
import Performance from "@/views/Discover/Performance/index.vue";
|
||||
import CompareDashboard from "@/views/Compare/Dashboard/Compare.vue";
|
||||
import MapCompare from "@/views/Compare/MapCompare.vue";
|
||||
import AccountAdmin from "@/views/AccountManagement/AccountAdmin/AccountAdmin.vue";
|
||||
import MyAccount from "@/views/AccountManagement/MyAccount.vue";
|
||||
import MemberArea from "@/views/MemberArea/index.vue";
|
||||
import NotFound404 from "@/views/NotFound404.vue";
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/', // Default entry route
|
||||
redirect: '/files', // Redirect to /files
|
||||
},
|
||||
path: "/", // Default entry route
|
||||
redirect: "/files", // Redirect to /files
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
path: "/",
|
||||
name: "AuthContainer",
|
||||
component: AuthContainer,
|
||||
children: [
|
||||
@@ -40,7 +40,7 @@ const routes = [
|
||||
name: "Login",
|
||||
component: Login,
|
||||
},
|
||||
]
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/",
|
||||
@@ -48,7 +48,7 @@ const routes = [
|
||||
component: MainContainer,
|
||||
meta: {
|
||||
title: "MainContainer",
|
||||
requiresAuth: true
|
||||
requiresAuth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@@ -70,16 +70,17 @@ const routes = [
|
||||
name: "AcctAdmin",
|
||||
component: AccountAdmin,
|
||||
},
|
||||
]
|
||||
},{
|
||||
path: "/my-account",
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/my-account",
|
||||
name: "My Account",
|
||||
component: MyAccount,
|
||||
},
|
||||
{
|
||||
path: "/upload", // router.push({ replace: true }) does not add the path to history
|
||||
name: "Upload",
|
||||
component: Upload
|
||||
component: Upload,
|
||||
},
|
||||
{
|
||||
path: "/discover",
|
||||
@@ -114,7 +115,7 @@ const routes = [
|
||||
component: Map,
|
||||
meta: {
|
||||
file: {}, // parent log or parent filter
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
// type: log | filter, the parameter can be either.
|
||||
@@ -124,7 +125,7 @@ const routes = [
|
||||
component: Conformance,
|
||||
meta: {
|
||||
file: {}, // parent log or parent filter
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
// type: log | filter, the parameter can be either.
|
||||
@@ -134,9 +135,9 @@ const routes = [
|
||||
component: Performance,
|
||||
meta: {
|
||||
file: {}, // parent log or parent filter
|
||||
}
|
||||
},
|
||||
},
|
||||
]
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/compare",
|
||||
@@ -146,14 +147,15 @@ const routes = [
|
||||
path: "/compare/dashboard/:primaryType/:primaryId/:secondaryType/:secondaryId",
|
||||
name: "CompareDashboard",
|
||||
component: CompareDashboard,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
path: "/compare/map/:primaryType/:primaryId/:secondaryType/:secondaryId",
|
||||
name: "MapCompare",
|
||||
component: MapCompare,
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/:pathMatch(.*)*",
|
||||
@@ -166,7 +168,7 @@ const base_url = import.meta.env.BASE_URL;
|
||||
const router = createRouter({
|
||||
history: createWebHistory(base_url), //(/)
|
||||
// history: createWebHashHistory(base_url), // (/#)
|
||||
routes
|
||||
routes,
|
||||
});
|
||||
|
||||
// Global navigation guard
|
||||
@@ -175,9 +177,11 @@ router.beforeEach((to, from) => {
|
||||
// from: Route: the current route being navigated away from
|
||||
|
||||
// When navigating to the login page, redirect to Files if already logged in
|
||||
if (to.name === 'Login') {
|
||||
const isLoggedIn = document.cookie.split(';').some(c => c.trim().startsWith('isLuciaLoggedIn='));
|
||||
if (isLoggedIn) return { name: 'Files' };
|
||||
if (to.name === "Login") {
|
||||
const isLoggedIn = document.cookie
|
||||
.split(";")
|
||||
.some((c) => c.trim().startsWith("isLuciaLoggedIn="));
|
||||
if (isLoggedIn) return { name: "Files" };
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user