From 8e777ee2814d7b0c480937fb1802d2c6751845e3 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Mon, 24 Jul 2023 18:59:55 +0200 Subject: [PATCH] add console styling --- src/server/app.js | 38 +++++++++++++++++-- src/server/backend/db/mysqldb.js | 4 +- .../views/admin/events/EventsDetailsView.vue | 9 ++++- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/src/server/app.js b/src/server/app.js index 95dae62..090c462 100644 --- a/src/server/app.js +++ b/src/server/app.js @@ -16,19 +16,48 @@ const cookieParser = require( 'cookie-parser' ); const http = require( 'http' ); 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 mail = require( './backend/mail/mailSender.js' ); // const mailManager = new mail(); -console.log( settings ); - +console.log( '[ Server ] Setting up static routes' ); if ( settings.init ) { app.use( express.static( '../webapp/main/dist' ) ); } else { app.use( express.static( '../webapp/setup/dist' ) ); } +console.log( '[ Server ] loading and initializing middlewares' ); // initialise express with middlewares // TODO: Generate random token app.use( expressSession( { @@ -46,6 +75,7 @@ app.use( cookieParser() ); let file = path.join( __dirname + '/../webapp/main/dist/index.html' ); +console.log( '[ Server ] loading backend components' ); if ( settings.init ) { require( './admin/adminRoutes.js' )( app, settings ); // admin routes require( './admin/adminAPIRoutes.js' )( app, settings ); // admin api routes @@ -63,6 +93,8 @@ app.use( ( request, response ) => { response.sendFile( file ); } ); +console.log( '\n\n[ Server ] loading complete!\n\n' ); + 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 ); \ No newline at end of file diff --git a/src/server/backend/db/mysqldb.js b/src/server/backend/db/mysqldb.js index 20da2f2..3535f30 100644 --- a/src/server/backend/db/mysqldb.js +++ b/src/server/backend/db/mysqldb.js @@ -22,10 +22,10 @@ class SQLDB { connect ( ) { this.sqlConnection.connect( function( err ) { if ( err ) { - console.error( 'error connecting: ' + err.stack ); + console.error( '[ SQL ]: An error ocurred whilst connecting: ' + err.stack ); return; } - console.log( 'connected' ); + console.log( '[ SQL ] Connected to database successfully' ); return 'connection'; } ); } diff --git a/src/webapp/main/src/views/admin/events/EventsDetailsView.vue b/src/webapp/main/src/views/admin/events/EventsDetailsView.vue index 3332b1f..1c8d660 100644 --- a/src/webapp/main/src/views/admin/events/EventsDetailsView.vue +++ b/src/webapp/main/src/views/admin/events/EventsDetailsView.vue @@ -11,7 +11,8 @@

{{ event.name }}

-

Event Description

+

Event Details

+

Event description

@@ -32,6 +33,10 @@ Edit ticket layout
+
+

Assets

+

Here you can view and change the event assets, meaning the images

+

Ticket Settings

@@ -68,7 +73,7 @@
-

Please read into the documentation of this section if you want to use the requirements. It requires specific syntax to work. See here for more information

+

Please read the documentation of this section if you want to use the requirements. It requires specific syntax to work. See here for more information