adds eslint

This commit is contained in:
geoffsee
2025-06-24 17:29:52 -04:00
committed by Geoff Seemueller
parent 9698fc6f3b
commit 02c3253343
169 changed files with 4896 additions and 4804 deletions

View File

@@ -1,4 +1,4 @@
// runs before anything else
import UserOptionsStore from "../stores/UserOptionsStore";
import UserOptionsStore from '../stores/UserOptionsStore';
UserOptionsStore.initialize();

View File

@@ -1,18 +1,19 @@
import Routes from "../renderer/routes";
import type { PageContextServer } from 'vike/types';
import Routes from '../renderer/routes';
export { data };
export type Data = Awaited<ReturnType<typeof data>>;
import type { PageContextServer } from "vike/types";
// sets the window title depending on the route
const data = async (pageContext: PageContextServer) => {
const getTitle = (path) => {
return Routes[normalizePath(path)]?.heroLabel || "";
const getTitle = path => {
return Routes[normalizePath(path)]?.heroLabel || '';
};
const normalizePath = (path) => {
if (!path) return "/";
if (path.length > 1 && path.endsWith("/")) {
const normalizePath = path => {
if (!path) return '/';
if (path.length > 1 && path.endsWith('/')) {
path = path.slice(0, -1);
}
return path.toLowerCase();

View File

@@ -1,6 +1,7 @@
// client error catcher
import { usePageContext } from "../../renderer/usePageContext";
import { Center, Text } from "@chakra-ui/react";
import { Center, Text } from '@chakra-ui/react';
import { usePageContext } from '../../renderer/usePageContext';
export { Page };
@@ -11,18 +12,16 @@ function Page() {
const { abortReason, abortStatusCode } = pageContext;
if (abortReason?.notAdmin) {
msg = "You cannot access this page because you aren't an administrator.";
} else if (typeof abortReason === "string") {
} else if (typeof abortReason === 'string') {
msg = abortReason;
} else if (abortStatusCode === 403) {
msg =
"You cannot access this page because you don't have enough privileges.";
msg = "You cannot access this page because you don't have enough privileges.";
} else if (abortStatusCode === 401) {
msg =
"You cannot access this page because you aren't logged in. Please log in.";
msg = "You cannot access this page because you aren't logged in. Please log in.";
} else {
msg = pageContext.is404
? "This page doesn't exist."
: "Something went wrong. Try again (later).";
: 'Something went wrong. Try again (later).';
}
return (
@@ -32,6 +31,7 @@ function Page() {
);
}
/* eslint-disable @typescript-eslint/no-namespace */
declare global {
namespace Vike {
interface PageContext {

View File

@@ -1,21 +1,16 @@
import React from "react";
import { Box, VStack } from "@chakra-ui/react";
import ConnectComponent from "../../components/connect/ConnectComponent";
import { Fragment } from "react";
import { useIsMobile } from "../../components/contexts/MobileContext";
import { Box, VStack } from '@chakra-ui/react';
import React, { Fragment } from 'react';
import ConnectComponent from '../../components/connect/ConnectComponent';
import { useIsMobile } from '../../components/contexts/MobileContext';
export default function ConnectPage() {
const isMobile = useIsMobile();
return (
<Fragment>
<VStack
minH={"100%"}
maxW={"40rem"}
align="start"
h={!isMobile ? "90vh" : "70vh"}
>
<Box maxW={"710px"} p={2} overflowY={"auto"} mt={isMobile ? 24 : 0}>
<VStack minH={'100%'} maxW={'40rem'} align="start" h={!isMobile ? '90vh' : '70vh'}>
<Box maxW={'710px'} p={2} overflowY={'auto'} mt={isMobile ? 24 : 0}>
<ConnectComponent />
</Box>
</VStack>

View File

@@ -1,13 +1,14 @@
import React, { useEffect } from "react";
import { Stack } from "@chakra-ui/react";
import Chat from "../../components/chat/Chat";
import clientChatStore from "../../stores/ClientChatStore";
import { Stack } from '@chakra-ui/react';
import React, { useEffect } from 'react';
import Chat from '../../components/chat/Chat';
import clientChatStore from '../../stores/ClientChatStore';
// renders "/"
export default function IndexPage() {
useEffect(() => {
try {
const model = localStorage.getItem("recentModel");
const model = localStorage.getItem('recentModel');
clientChatStore.setModel(model as string);
} catch (_) {

View File

@@ -1,22 +1,24 @@
import React, { Fragment } from "react";
import { Box, VStack } from "@chakra-ui/react";
import PrivacyPolicy from "../../components/legal/LegalDoc";
import privacy_policy from "./privacy_policy";
import { useIsMobile } from "../../components/contexts/MobileContext";
import { Box, VStack } from '@chakra-ui/react';
import React, { Fragment } from 'react';
import { useIsMobile } from '../../components/contexts/MobileContext';
import PrivacyPolicy from '../../components/legal/LegalDoc';
import privacy_policy from './privacy_policy';
export default function Page() {
const isMobile = useIsMobile();
return (
<Fragment>
<VStack
width={"100%"}
align={"center"}
height={!isMobile ? "100%" : "100%"}
overflowX={"auto"}
width={'100%'}
align={'center'}
height={!isMobile ? '100%' : '100%'}
overflowX={'auto'}
>
<Box
overflowY={isMobile ? "scroll" : undefined}
maxH={!isMobile ? "70vh" : "89vh"}
overflowY={isMobile ? 'scroll' : undefined}
maxH={!isMobile ? '70vh' : '89vh'}
mt={isMobile ? 24 : undefined}
>
<PrivacyPolicy text={privacy_policy} />

View File

@@ -1,4 +1,4 @@
const privacyPolicyUpdateDate = new Date().toISOString().split("T")[0];
const privacyPolicyUpdateDate = new Date().toISOString().split('T')[0];
export default `
### Privacy Policy

View File

@@ -1,22 +1,24 @@
import React, { Fragment } from "react";
import { Box, VStack } from "@chakra-ui/react";
import TermsOfService from "../../components/legal/LegalDoc";
import terms_of_service from "./terms_of_service";
import { useIsMobile } from "../../components/contexts/MobileContext";
import { Box, VStack } from '@chakra-ui/react';
import React, { Fragment } from 'react';
import { useIsMobile } from '../../components/contexts/MobileContext';
import TermsOfService from '../../components/legal/LegalDoc';
import terms_of_service from './terms_of_service';
export default function Page() {
const isMobile = useIsMobile();
return (
<Fragment>
<VStack
width={"100%"}
align={"center"}
height={!isMobile ? "100%" : "100%"}
overflowX={"auto"}
width={'100%'}
align={'center'}
height={!isMobile ? '100%' : '100%'}
overflowX={'auto'}
>
<Box
overflowY={isMobile ? "scroll" : undefined}
maxH={!isMobile ? "70vh" : "89vh"}
overflowY={isMobile ? 'scroll' : undefined}
maxH={!isMobile ? '70vh' : '89vh'}
mt={isMobile ? 24 : undefined}
>
<TermsOfService text={terms_of_service} />

View File

@@ -1,4 +1,4 @@
const tosUpdateDate = new Date().toISOString().split("T")[0];
const tosUpdateDate = new Date().toISOString().split('T')[0];
export default `
### Terms of Service