Add debug page

This commit is contained in:
Tanner Collin 2022-04-10 07:11:53 +00:00
parent beb8c3ebaa
commit 354d124943
4 changed files with 50 additions and 7 deletions

View File

@ -30,7 +30,7 @@
color: white; color: white;
} }
.errormessage { .errormessage {
animation: showMessage 0s 5s forwards; animation: showMessage 0s 6s forwards;
opacity: 0; opacity: 0;
} }
@ -48,7 +48,7 @@
<noscript><p>You need to enable JavaScript to run this app.</p></noscript> <noscript><p>You need to enable JavaScript to run this app.</p></noscript>
<p> <p>
Try refreshing the page. If that doesn't work,<br/> Try refreshing the page. If that doesn't work,<br/>
please contact Tanner (protospace@tannercollin.com) for help. please contact Tanner for help.
</p> </p>
</div> </div>
</div> </div>

View File

@ -26,6 +26,7 @@ import { Auth } from './Auth.js';
import { Subscribe } from './PayPal.js'; import { Subscribe } from './PayPal.js';
import { PasswordReset, ConfirmReset } from './PasswordReset.js'; import { PasswordReset, ConfirmReset } from './PasswordReset.js';
import { NotFound, PleaseLogin } from './Misc.js'; import { NotFound, PleaseLogin } from './Misc.js';
import { Debug } from './Debug.js';
import { Footer } from './Footer.js'; import { Footer } from './Footer.js';
const APP_VERSION = 3; // TODO: automate this const APP_VERSION = 3; // TODO: automate this
@ -227,6 +228,10 @@ function App() {
<div className='topPadding'> <div className='topPadding'>
<Switch> <Switch>
<Route path='/debug'>
<Debug token={token} user={user} />
</Route>
<Route path='/password/reset/confirm/:uid/:token'> <Route path='/password/reset/confirm/:uid/:token'>
<ConfirmReset /> <ConfirmReset />
</Route> </Route>

35
webclient/src/Debug.js Normal file
View File

@ -0,0 +1,35 @@
import React, { useState, useEffect, useReducer } from 'react';
import { BrowserRouter as Router, Switch, Route, Link, useParams, useLocation } from 'react-router-dom';
import moment from 'moment-timezone';
import QRCode from 'react-qr-code';
import './light.css';
import { Button, Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Popup, Segment, Table } from 'semantic-ui-react';
import { statusColor, BasicTable, siteUrl, staticUrl, requester, isAdmin } from './utils.js';
import { LoginForm, SignupForm } from './LoginSignup.js';
import { AccountForm } from './Account.js';
import { SignForm } from './Sign.js';
import { PayPalSubscribeDeal } from './PayPal.js';
export function Debug(props) {
const { user, token } = props;
return (
<Container>
<Header size='large'>Debug</Header>
<p>No warranty.</p>
<p>
<Button onClick={() => {throw new Error('test')}}>
Cause an error
</Button>
</p>
<p><Link to='/classfeed'>Classfeed</Link></p>
<p><Link to='/usage/trotec'>Trotec Usage</Link></p>
</Container>
);
};

View File

@ -1,4 +1,5 @@
import React, { useRef, useEffect } from 'react'; import React, { useRef, useEffect } from 'react';
import { BrowserRouter as Router, Switch, Route, Link, useParams, useLocation } from 'react-router-dom';
import { Container, Icon } from 'semantic-ui-react'; import { Container, Icon } from 'semantic-ui-react';
import { scene } from './spaceport/scene'; import { scene } from './spaceport/scene';
@ -16,11 +17,13 @@ export const Footer = () => {
<div className="footer" ref={footerRef}> <div className="footer" ref={footerRef}>
<Container className="footer-content"> <Container className="footer-content">
<p> <p>
<Link to='/debug'>
<img <img
alt="site logo" alt="site logo"
src="/logo-short.svg" src="/logo-short.svg"
className="logo" className="logo"
/> />
</Link>
</p> </p>
<p className="text"> <p className="text">