nicer red + better welcome

This commit is contained in:
2023-03-30 15:55:40 +02:00
parent aa38572aa4
commit cd3f551374
4 changed files with 53 additions and 3 deletions

View File

@@ -49,6 +49,11 @@ module.exports = ( app, settings ) => {
} ); } );
} ); } );
app.get( '/admin/logout', ( request, response ) => {
request.session.loggedIn = false;
response.send( 'logged out' );
} );
/* /*
main admin panel access route. Will serve an html file main admin panel access route. Will serve an html file
that uses vue.js in its SPA form to make the admin panel that uses vue.js in its SPA form to make the admin panel
@@ -60,10 +65,18 @@ module.exports = ( app, settings ) => {
if ( settings[ 'init' ] ) { if ( settings[ 'init' ] ) {
response.sendFile( path.join( __dirname + '/ui/panel.html' ) ); response.sendFile( path.join( __dirname + '/ui/panel.html' ) );
} else { } else {
response.sendFile( path.join( __dirname + '/ui/setup.html' ) ); response.sendFile( path.join( __dirname + '/ui/welcome.html' ) );
} }
} else { } else {
response.redirect( '/admin/login' ); response.redirect( '/admin/login' );
} }
} ); } );
app.get( '/admin/setup', ( request, response ) => {
if ( request.session.loggedIn ) {
response.sendFile( path.join( __dirname + '/ui/setup.html' ) );
} else {
response.redirect( '/admin/login' );
}
} );
}; };

View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome :: myevent - admin panel</title>
<link rel="stylesheet" href="/admin/css/loginstyle.css">
<style>
.myevent-logo-welcome {
height: 50vh;
}
</style>
</head>
<body>
<div class="content">
<h1>Welcome to myevent!</h1>
<a href="https://myevent.janishutz.com"><img src="/assets/logo.png" alt="myevent-logo" class="myevent-logo-welcome"></a>
<p>myevent, the new way to sell your tickets online!</p>
<p>Let's get started setting up your event!</p>
<p id="warranty">Note: As a project licensed under the GNU General Public License Version 3.0-or-later (GPL 3.0+), this software comes with ABSOLUTELY NO WARRANTY TO THE EXTENT PERMITTED BY APPLICABLE LAW</p>
<a href="/admin/setup">Getting Started!</a>
</div>
<!--Script for dark mode-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
if ( window.matchMedia( '(prefers-color-scheme: dark)' ).matches || sessionStorage.getItem( 'theme' ) === 'dark' ) {
document.documentElement.classList.add( 'dark' );
} else {
document.documentElement.classList.add( 'light' );
};
</script>
</body>
</html>

View File

@@ -21,8 +21,10 @@ body {
} }
.dev { .dev {
background-color: red; background-color: rgb(182, 69, 69, 0.9);
padding: 10px;
text-align: center; text-align: center;
border-radius: 50px;
} }
/* /*

View File

@@ -16,7 +16,7 @@
<a class="navitem inactive" id="docs" href="/docs">Documentation</a> <a class="navitem inactive" id="docs" href="/docs">Documentation</a>
<a class="navitem inactive" id="download" href="/download">Download</a> <a class="navitem inactive" id="download" href="/download">Download</a>
<a class="navitem inactive" id="about" href="/about">About</a> <a class="navitem inactive" id="about" href="/about">About</a>
<a class="navitem inactive" id="gh" href="https://github.com/simplePCBuilding/myevent">GitHub</a> <a class="navitem inactive" id="gh" href="https://github.com/simplePCBuilding/myevent" target="_blank" onclick="sessionStorage.setItem( 'menuOpen', String( false ) );">GitHub</a>
</div> </div>
</div> </div>
</div> </div>