add console styling

This commit is contained in:
2023-07-24 18:59:55 +02:00
parent 84c0017e2a
commit 8e777ee281
3 changed files with 44 additions and 7 deletions

View File

@@ -16,19 +16,48 @@ const cookieParser = require( 'cookie-parser' );
const http = require( 'http' ); const http = require( 'http' );
const fs = require( 'fs' ); const fs = require( 'fs' );
console.log( `
_ _ _ _
| (_) | | |
| |_| |__ _ __ ___ _____ _____ _ __ | |_
| | | '_ \\| '__/ _ \\/ _ \\ \\ / / _ \\ '_ \\| __|
| | | |_) | | | __/ __/\\ V / __/ | | | |_
|_|_|_.__/|_| \\___|\\___| \\_/ \\___|_| |_|\\__|
-------------------------------
==> Welcome to libreevent!
==> You are running Version V1.0.0
==> You should deploy this on a server!
Below you can see all important things that happen during operation.
libreevent logs all errors in the console such that they appear in the
log files when running it with an output pipe.
` );
console.log( '[ Server ] loading settings' );
const settings = JSON.parse( fs.readFileSync( path.join( __dirname + '/config/settings.config.json' ) ) ); const settings = JSON.parse( fs.readFileSync( path.join( __dirname + '/config/settings.config.json' ) ) );
// const mail = require( './backend/mail/mailSender.js' ); // const mail = require( './backend/mail/mailSender.js' );
// const mailManager = new mail(); // const mailManager = new mail();
console.log( settings ); console.log( '[ Server ] Setting up static routes' );
if ( settings.init ) { if ( settings.init ) {
app.use( express.static( '../webapp/main/dist' ) ); app.use( express.static( '../webapp/main/dist' ) );
} else { } else {
app.use( express.static( '../webapp/setup/dist' ) ); app.use( express.static( '../webapp/setup/dist' ) );
} }
console.log( '[ Server ] loading and initializing middlewares' );
// initialise express with middlewares // initialise express with middlewares
// TODO: Generate random token // TODO: Generate random token
app.use( expressSession( { app.use( expressSession( {
@@ -46,6 +75,7 @@ app.use( cookieParser() );
let file = path.join( __dirname + '/../webapp/main/dist/index.html' ); let file = path.join( __dirname + '/../webapp/main/dist/index.html' );
console.log( '[ Server ] loading backend components' );
if ( settings.init ) { if ( settings.init ) {
require( './admin/adminRoutes.js' )( app, settings ); // admin routes require( './admin/adminRoutes.js' )( app, settings ); // admin routes
require( './admin/adminAPIRoutes.js' )( app, settings ); // admin api routes require( './admin/adminAPIRoutes.js' )( app, settings ); // admin api routes
@@ -63,6 +93,8 @@ app.use( ( request, response ) => {
response.sendFile( file ); response.sendFile( file );
} ); } );
console.log( '\n\n[ Server ] loading complete!\n\n' );
const PORT = process.env.PORT || 8081; const PORT = process.env.PORT || 8081;
console.log( 'Server listening on Port ' + PORT ); console.log( '[ Server ] listening on port ' + PORT );
http.createServer( app ).listen( PORT ); http.createServer( app ).listen( PORT );

View File

@@ -22,10 +22,10 @@ class SQLDB {
connect ( ) { connect ( ) {
this.sqlConnection.connect( function( err ) { this.sqlConnection.connect( function( err ) {
if ( err ) { if ( err ) {
console.error( 'error connecting: ' + err.stack ); console.error( '[ SQL ]: An error ocurred whilst connecting: ' + err.stack );
return; return;
} }
console.log( 'connected' ); console.log( '[ SQL ] Connected to database successfully' );
return 'connection'; return 'connection';
} ); } );
} }

View File

@@ -11,7 +11,8 @@
<div class="details"> <div class="details">
<h2>{{ event.name }}</h2> <h2>{{ event.name }}</h2>
<div class="category-wrapper"> <div class="category-wrapper">
<p>Event Description</p> <h3>Event Details</h3>
<p>Event description</p>
<textarea v-model="event.description" class="big-text" cols="70" rows="3" placeholder="Event description..."></textarea> <textarea v-model="event.description" class="big-text" cols="70" rows="3" placeholder="Event description..."></textarea>
<table class="category"> <table class="category">
<tr> <tr>
@@ -32,6 +33,10 @@
<router-link to="/admin/ticketEditor">Edit ticket layout</router-link> <router-link to="/admin/ticketEditor">Edit ticket layout</router-link>
</tr> </tr>
</table> </table>
<div>
<h3>Assets</h3>
<p>Here you can view and change the event assets, meaning the images</p>
</div>
</div> </div>
<div class="ticket-settings"> <div class="ticket-settings">
<h3>Ticket Settings</h3> <h3>Ticket Settings</h3>
@@ -68,7 +73,7 @@
<settings v-model:settings="specialSettings"></settings> <settings v-model:settings="specialSettings"></settings>
</div> </div>
<div> <div>
<p>Please read into the documentation of this section if you want to use the requirements. It requires specific syntax to work. See <a href="https://libreevent.janishutz.com/docs/admin-panel/events#special-requirements" target="_blank">here</a> for more information</p> <p>Please read the documentation of this section if you want to use the requirements. It requires specific syntax to work. See <a href="https://libreevent.janishutz.com/docs/admin-panel/events#special-requirements" target="_blank">here</a> for more information</p>
</div> </div>
<notifications ref="notification" location="topright"></notifications> <notifications ref="notification" location="topright"></notifications>
</div> </div>