mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 05:14:23 +00:00
various small changes + almost complete ticket gen
This commit is contained in:
@@ -14,6 +14,7 @@ const twoFA = new auth();
|
|||||||
const path = require( 'path' );
|
const path = require( 'path' );
|
||||||
|
|
||||||
let responseObjects = {};
|
let responseObjects = {};
|
||||||
|
let authOk = {};
|
||||||
|
|
||||||
module.exports = ( app, settings ) => {
|
module.exports = ( app, settings ) => {
|
||||||
/*
|
/*
|
||||||
@@ -85,6 +86,14 @@ module.exports = ( app, settings ) => {
|
|||||||
responseObjects[ request.session.token ] = response;
|
responseObjects[ request.session.token ] = response;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
app.get( '/admin/2fa/ping', ( request, response ) => {
|
||||||
|
if ( authOk[ request.session.token ] === 'ok' ) {
|
||||||
|
response.send( { 'status': 'ok' } );
|
||||||
|
} else {
|
||||||
|
response.send( '' );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
app.get( '/test/login', ( request, response ) => {
|
app.get( '/test/login', ( request, response ) => {
|
||||||
request.session.loggedInAdmin = true;
|
request.session.loggedInAdmin = true;
|
||||||
response.send( 'Logged in' );
|
response.send( 'Logged in' );
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class GETHandler {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCall ( call, query, session ) {
|
handleCall ( call, query, session, settings ) {
|
||||||
return new Promise( ( resolve, reject ) => {
|
return new Promise( ( resolve, reject ) => {
|
||||||
if ( call === 'getSeatplan' ) {
|
if ( call === 'getSeatplan' ) {
|
||||||
db.getJSONDataSimple( 'seatplan', query.location ).then( data => {
|
db.getJSONDataSimple( 'seatplan', query.location ).then( data => {
|
||||||
@@ -40,6 +40,8 @@ class GETHandler {
|
|||||||
} else {
|
} else {
|
||||||
reject( { 'code': 400, 'message': 'Bad request, missing event query' } );
|
reject( { 'code': 400, 'message': 'Bad request, missing event query' } );
|
||||||
}
|
}
|
||||||
|
} else if ( call === 'getName' ) {
|
||||||
|
resolve( { 'name': settings.name } );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ module.exports = ( app, settings ) => {
|
|||||||
'success_url': settings.yourDomain + '/payments/success',
|
'success_url': settings.yourDomain + '/payments/success',
|
||||||
'cancel_url': settings.yourDomain + '/payments/canceled',
|
'cancel_url': settings.yourDomain + '/payments/canceled',
|
||||||
'submit_type': 'book',
|
'submit_type': 'book',
|
||||||
'customer_email': req.body.customer.mail
|
'customer_email': req.body.mail
|
||||||
};
|
};
|
||||||
|
|
||||||
for ( let item in req.body.products ) {
|
for ( let item in req.body.products ) {
|
||||||
|
|||||||
@@ -14,22 +14,31 @@ const db = require( '../db/db.js' );
|
|||||||
class TicketGenerator {
|
class TicketGenerator {
|
||||||
constructor () {
|
constructor () {
|
||||||
this.ticketQueue = {};
|
this.ticketQueue = {};
|
||||||
|
this.jobId = 0;
|
||||||
this.isRunning = false;
|
this.isRunning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Save to disk in case of crash of server / reboot / whatever
|
||||||
|
// and continue processing once back online
|
||||||
generateTicket ( event, data ) {
|
generateTicket ( event, data ) {
|
||||||
|
this.ticketQueue [ this.jobId ] = { 'event': event, 'data': data };
|
||||||
|
this.jobId += 1;
|
||||||
|
this.queueHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Maybe move to subprocesses
|
// TODO: Maybe move to subprocesses
|
||||||
queueHandler () {
|
queueHandler () {
|
||||||
if ( !this.isRunning ) {
|
if ( !this.isRunning ) {
|
||||||
this.isRunning = true;
|
this.isRunning = true;
|
||||||
this.ticketGenerator( this.ticketQueue[ Object.keys( this.ticketQueue )[ 0 ] ] ).then( res => {
|
this.ticketGenerator( this.ticketQueue[ this.jobId ][ 'event' ], this.ticketQueue[ this.jobId ][ 'data' ] ).then( pdf => {
|
||||||
|
console.log( pdf );
|
||||||
// TODO: Maybe write to disk
|
// TODO: Maybe write to disk
|
||||||
this.isRunning = false;
|
this.isRunning = false;
|
||||||
|
this.queueHandler();
|
||||||
} ).catch( error => {
|
} ).catch( error => {
|
||||||
|
console.error( '[ PDF GENERATOR ] ERROR: ' + error );
|
||||||
this.isRunning = false;
|
this.isRunning = false;
|
||||||
|
this.queueHandler();
|
||||||
// TODO: Add to FAILED db
|
// TODO: Add to FAILED db
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ const getHandler = new geth();
|
|||||||
const path = require( 'path' );
|
const path = require( 'path' );
|
||||||
|
|
||||||
// settings is missing in arguments which shouldn't pose any problem
|
// settings is missing in arguments which shouldn't pose any problem
|
||||||
module.exports = ( app ) => {
|
module.exports = ( app, settings ) => {
|
||||||
// Add specific routes here to have them be checked first to not get general handling
|
// Add specific routes here to have them be checked first to not get general handling
|
||||||
|
|
||||||
app.get( '/getAPI/:call', ( req, res ) => {
|
app.get( '/getAPI/:call', ( req, res ) => {
|
||||||
getHandler.handleCall( req.params.call, req.query, req.session ).then( data => {
|
getHandler.handleCall( req.params.call, req.query, req.session, settings ).then( data => {
|
||||||
if ( req.params.call === 'getReservedSeats' ) {
|
if ( req.params.call === 'getReservedSeats' ) {
|
||||||
let dat = data;
|
let dat = data;
|
||||||
dat[ 'reserved' ] = postHandler.getReservedSeats( req.query.event );
|
dat[ 'reserved' ] = postHandler.getReservedSeats( req.query.event );
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const twoFA = new auth();
|
|||||||
const path = require( 'path' );
|
const path = require( 'path' );
|
||||||
|
|
||||||
let responseObjects = {};
|
let responseObjects = {};
|
||||||
|
let authOk = {};
|
||||||
|
|
||||||
module.exports = ( app, settings ) => {
|
module.exports = ( app, settings ) => {
|
||||||
app.post( '/api/reserveTicket', ( request, response ) => {
|
app.post( '/api/reserveTicket', ( request, response ) => {
|
||||||
@@ -55,7 +56,11 @@ module.exports = ( app, settings ) => {
|
|||||||
let tokType = twoFA.verifySimple( request.query.token );
|
let tokType = twoFA.verifySimple( request.query.token );
|
||||||
if ( tokType === 'standard' ) {
|
if ( tokType === 'standard' ) {
|
||||||
request.session.loggedInUser = true;
|
request.session.loggedInUser = true;
|
||||||
|
if ( responseObjects[ request.query.token ] ) {
|
||||||
responseObjects[ request.query.token ].write( 'data: authenticated\n\n' );
|
responseObjects[ request.query.token ].write( 'data: authenticated\n\n' );
|
||||||
|
} else {
|
||||||
|
authOk[ request.query.token ] = 'ok';
|
||||||
|
}
|
||||||
response.sendFile( path.join( __dirname + '/../ui/en/2fa/2faSimple.html' ) );
|
response.sendFile( path.join( __dirname + '/../ui/en/2fa/2faSimple.html' ) );
|
||||||
} else if ( tokType === 'enhanced' ) {
|
} else if ( tokType === 'enhanced' ) {
|
||||||
response.sendFile( path.join( __dirname + '/../ui/en/2fa/2faEnhanced.html' ) );
|
response.sendFile( path.join( __dirname + '/../ui/en/2fa/2faEnhanced.html' ) );
|
||||||
@@ -68,7 +73,11 @@ module.exports = ( app, settings ) => {
|
|||||||
let verified = twoFA.verifyEnhanced( request.body.token, request.body.code );
|
let verified = twoFA.verifyEnhanced( request.body.token, request.body.code );
|
||||||
if ( verified ) {
|
if ( verified ) {
|
||||||
request.session.loggedInUser = true;
|
request.session.loggedInUser = true;
|
||||||
|
if ( responseObjects[ request.body.token ] ) {
|
||||||
responseObjects[ request.body.token ].write( 'data: authenticated\n\n' );
|
responseObjects[ request.body.token ].write( 'data: authenticated\n\n' );
|
||||||
|
} else {
|
||||||
|
authOk[ request.body.token ] = 'ok';
|
||||||
|
}
|
||||||
response.send( 'ok' );
|
response.send( 'ok' );
|
||||||
} else response.send( 'wrong' );
|
} else response.send( 'wrong' );
|
||||||
} );
|
} );
|
||||||
@@ -85,8 +94,20 @@ module.exports = ( app, settings ) => {
|
|||||||
responseObjects[ request.session.token ] = response;
|
responseObjects[ request.session.token ] = response;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
app.get( '/user/2fa/ping', ( request, response ) => {
|
||||||
|
if ( authOk[ request.session.token ] === 'ok' ) {
|
||||||
|
response.send( { 'status': 'ok' } );
|
||||||
|
} else {
|
||||||
|
response.send( '' );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
app.get( '/user/logout', ( request, response ) => {
|
app.get( '/user/logout', ( request, response ) => {
|
||||||
request.session.loggedInUser = false;
|
request.session.loggedInUser = false;
|
||||||
response.send( 'logoutOk' );
|
response.send( 'logoutOk' );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
app.post( '/user/signup', ( request, response ) => {
|
||||||
|
response.send( 'ok' );
|
||||||
|
} );
|
||||||
};
|
};
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
"twoFA": "enhanced",
|
"twoFA": "enhanced",
|
||||||
"db": "mysql",
|
"db": "mysql",
|
||||||
"payments": "stripe",
|
"payments": "stripe",
|
||||||
|
"name": "libreevent",
|
||||||
"yourDomain": "http://localhost:8081"
|
"yourDomain": "http://localhost:8081"
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
# Account view:
|
# Account view:
|
||||||
- set page title based on settings
|
|
||||||
|
|
||||||
- make pricing groups changeable in UI (event categories)
|
- make pricing groups changeable in UI (event categories)
|
||||||
|
|
||||||
- Fix text field overflow (text too big for box)
|
- Fix text field overflow (text too big for box)
|
||||||
@@ -8,6 +6,7 @@
|
|||||||
|
|
||||||
- Implement Permission system
|
- Implement Permission system
|
||||||
|
|
||||||
|
- Seat numbering
|
||||||
|
|
||||||
|
|
||||||
- add webpack to project website to decrease file size
|
- add webpack (or any other minifying tool) to project website to decrease file size (OPTIONAL)
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="sideCartView" :style="'width: ' + width + 'vw; top: ' + height + 'vh;'">
|
<div id="sideCartView">
|
||||||
<h2>Cart</h2>
|
<h2>Cart</h2>
|
||||||
<div v-if="Object.keys( cart ).length > 0" style="height: 100%; width: 100%;">
|
<div v-if="Object.keys( cart ).length > 0" style="height: 100%; width: 100%;">
|
||||||
<div class="scroll-wrapper">
|
<div class="scroll-wrapper">
|
||||||
@@ -92,6 +92,8 @@ export default {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
right: 0;
|
right: 0;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
top: 17vh;
|
||||||
|
width: 25vw;
|
||||||
background-color: var( --accent-background );
|
background-color: var( --accent-background );
|
||||||
color: var( --secondary-color );
|
color: var( --secondary-color );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,16 +27,21 @@ if ( prod ) {
|
|||||||
res.json().then( data => {
|
res.json().then( data => {
|
||||||
userStore.setUserAuth( data.user );
|
userStore.setUserAuth( data.user );
|
||||||
userStore.setAdminAuth( data.admin );
|
userStore.setAdminAuth( data.admin );
|
||||||
|
localStorage.setItem( 'url', '' );
|
||||||
|
fetch( '/getAPI/getName' ).then( res => {
|
||||||
|
res.json().then( data => {
|
||||||
|
userStore.setPageName( data.name );
|
||||||
app.use( router );
|
app.use( router );
|
||||||
app.mount( '#app' );
|
app.mount( '#app' );
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
localStorage.setItem( 'url', '' );
|
} );
|
||||||
|
} );
|
||||||
} else {
|
} else {
|
||||||
localStorage.setItem( 'url', 'http://localhost:8081' );
|
localStorage.setItem( 'url', 'http://localhost:8081' );
|
||||||
userStore.setUserAuth( true );
|
userStore.setUserAuth( true );
|
||||||
userStore.setAdminAuth( true );
|
userStore.setAdminAuth( true );
|
||||||
|
localStorage.setItem( 'name', 'libreevent' );
|
||||||
app.use( router );
|
app.use( router );
|
||||||
app.mount( '#app' );
|
app.mount( '#app' );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default {
|
|||||||
name: 'admin',
|
name: 'admin',
|
||||||
component: () => import( '../views/admin/AdminView.vue' ),
|
component: () => import( '../views/admin/AdminView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Admin - libreevent',
|
title: 'Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
@@ -21,7 +21,7 @@ export default {
|
|||||||
name: 'adminHome',
|
name: 'adminHome',
|
||||||
component: () => import( '../views/admin/HomeView.vue' ),
|
component: () => import( '../views/admin/HomeView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Home :: Admin - libreevent',
|
title: 'Home :: Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -30,7 +30,7 @@ export default {
|
|||||||
name: 'adminLocations',
|
name: 'adminLocations',
|
||||||
component: () => import( '../views/admin/LocationsView.vue' ),
|
component: () => import( '../views/admin/LocationsView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Accounts :: Admin - libreevent',
|
title: 'Accounts :: Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
permissions: 'root'
|
permissions: 'root'
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ export default {
|
|||||||
name: 'adminPages',
|
name: 'adminPages',
|
||||||
component: () => import( '../views/admin/PagesView.vue' ),
|
component: () => import( '../views/admin/PagesView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Pages :: Admin - libreevent',
|
title: 'Pages :: Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -49,7 +49,7 @@ export default {
|
|||||||
name: 'adminEvents',
|
name: 'adminEvents',
|
||||||
component: () => import( '../views/admin/EventsView.vue' ),
|
component: () => import( '../views/admin/EventsView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Events :: Admin - libreevent',
|
title: 'Events :: Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
name: 'adminPlugins',
|
name: 'adminPlugins',
|
||||||
component: () => import( '../views/admin/PluginsView.vue' ),
|
component: () => import( '../views/admin/PluginsView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Plugins :: Admin - libreevent',
|
title: 'Plugins :: Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -67,7 +67,7 @@ export default {
|
|||||||
name: 'adminSettings',
|
name: 'adminSettings',
|
||||||
component: () => import( '../views/admin/SettingsView.vue' ),
|
component: () => import( '../views/admin/SettingsView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Admin - libreevent',
|
title: 'Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -76,7 +76,7 @@ export default {
|
|||||||
name: 'eventDetails',
|
name: 'eventDetails',
|
||||||
component: () => import( '../views/admin/events/EventsDetailsView.vue' ),
|
component: () => import( '../views/admin/events/EventsDetailsView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Event details :: Admin - libreevent',
|
title: 'Event details :: Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -85,7 +85,7 @@ export default {
|
|||||||
name: 'eventAnalytics',
|
name: 'eventAnalytics',
|
||||||
component: () => import( '../views/admin/events/AnalyticsView.vue' ),
|
component: () => import( '../views/admin/events/AnalyticsView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Event analytics :: Admin - libreevent',
|
title: 'Event analytics :: Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,14 +27,13 @@ const router = createRouter( {
|
|||||||
routes,
|
routes,
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
||||||
router.afterEach( ( to, from ) => {
|
router.afterEach( ( to, from ) => {
|
||||||
document.title = to.meta.title ? to.meta.title : 'libreevent';
|
let userStore = useUserStore();
|
||||||
|
document.title = to.meta.title ? to.meta.title + userStore.getPageName : 'libreevent';
|
||||||
} );
|
} );
|
||||||
|
|
||||||
let UserAccountPages = [ 'account' ];
|
let UserAccountPages = [ 'account' ];
|
||||||
|
|
||||||
let authRequired = false;
|
|
||||||
|
|
||||||
router.beforeEach( ( to, from ) => {
|
router.beforeEach( ( to, from ) => {
|
||||||
let userStore = useUserStore();
|
let userStore = useUserStore();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default [
|
|||||||
name: 'home',
|
name: 'home',
|
||||||
component: HomeView,
|
component: HomeView,
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Home - libreevent'
|
title: 'Home - '
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -29,7 +29,7 @@ export default [
|
|||||||
name: 'tickets',
|
name: 'tickets',
|
||||||
component: () => import( '../views/purchasing/OrderView.vue' ),
|
component: () => import( '../views/purchasing/OrderView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Order ticket - libreevent'
|
title: 'Order ticket - '
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -37,7 +37,7 @@ export default [
|
|||||||
name: 'login',
|
name: 'login',
|
||||||
component: () => import( '../views/user/LoginView.vue' ),
|
component: () => import( '../views/user/LoginView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Login - libreevent'
|
title: 'Login - '
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -45,7 +45,7 @@ export default [
|
|||||||
name: 'adminLogin',
|
name: 'adminLogin',
|
||||||
component: () => import( '../views/admin/AdminLoginView.vue' ),
|
component: () => import( '../views/admin/AdminLoginView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Login :: Admin - libreevent'
|
title: 'Login :: Admin - '
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -53,7 +53,7 @@ export default [
|
|||||||
name: 'admin2FA',
|
name: 'admin2FA',
|
||||||
component: () => import( '../views/admin/TwoFA.vue' ),
|
component: () => import( '../views/admin/TwoFA.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Two Factor Authentication :: Admin - libreevent'
|
title: 'Two Factor Authentication :: Admin - '
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -61,7 +61,7 @@ export default [
|
|||||||
name: 'signup',
|
name: 'signup',
|
||||||
component: () => import( '../views/user/SignupView.vue' ),
|
component: () => import( '../views/user/SignupView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Signup - libreevent'
|
title: 'Signup - '
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -69,7 +69,7 @@ export default [
|
|||||||
name: 'account',
|
name: 'account',
|
||||||
component: () => import( '../views/user/AccountView.vue' ),
|
component: () => import( '../views/user/AccountView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Account - libreevent'
|
title: 'Account - '
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -77,7 +77,7 @@ export default [
|
|||||||
name: '2fa',
|
name: '2fa',
|
||||||
component: () => import( '../views/user/TwoFA.vue' ),
|
component: () => import( '../views/user/TwoFA.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Two Factor Authentication - libreevent'
|
title: 'Two Factor Authentication - '
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -85,7 +85,7 @@ export default [
|
|||||||
name: 'ticketDetails',
|
name: 'ticketDetails',
|
||||||
component: () => import( '../views/purchasing/TicketsDetailsView.vue' ),
|
component: () => import( '../views/purchasing/TicketsDetailsView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Details - libreevent',
|
title: 'Details - ',
|
||||||
transition: 'scale'
|
transition: 'scale'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -94,7 +94,7 @@ export default [
|
|||||||
name: 'ticketOrder',
|
name: 'ticketOrder',
|
||||||
component: () => import( '../views/purchasing/TicketsOrderingView.vue' ),
|
component: () => import( '../views/purchasing/TicketsOrderingView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Order ticket - libreevent',
|
title: 'Order ticket - ',
|
||||||
transition: 'scale'
|
transition: 'scale'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -103,7 +103,7 @@ export default [
|
|||||||
name: 'cart',
|
name: 'cart',
|
||||||
component: () => import( '../views/purchasing/CartView.vue' ),
|
component: () => import( '../views/purchasing/CartView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Cart - libreevent',
|
title: 'Cart - ',
|
||||||
transition: 'scale'
|
transition: 'scale'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -112,7 +112,7 @@ export default [
|
|||||||
name: 'purchase',
|
name: 'purchase',
|
||||||
component: () => import( '@/views/purchasing/PurchaseView.vue' ),
|
component: () => import( '@/views/purchasing/PurchaseView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Purchase - libreevent',
|
title: 'Purchase - ',
|
||||||
transition: 'scale'
|
transition: 'scale'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -121,7 +121,7 @@ export default [
|
|||||||
name: 'adminSeatplanEditor',
|
name: 'adminSeatplanEditor',
|
||||||
component: () => import( '@/views/admin/events/EditorView.vue' ),
|
component: () => import( '@/views/admin/events/EditorView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Seatplan Editor :: Admin - libreevent',
|
title: 'Seatplan Editor :: Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -130,7 +130,7 @@ export default [
|
|||||||
name: 'adminTicketEditor',
|
name: 'adminTicketEditor',
|
||||||
component: () => import( '@/views/admin/events/TicketEditorView.vue' ),
|
component: () => import( '@/views/admin/events/TicketEditorView.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Ticket Editor :: Admin - libreevent',
|
title: 'Ticket Editor :: Admin - ',
|
||||||
adminAuthRequired: true,
|
adminAuthRequired: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -139,7 +139,7 @@ export default [
|
|||||||
name: 'NotFound',
|
name: 'NotFound',
|
||||||
component: () => import( '@/views/404.vue' ),
|
component: () => import( '@/views/404.vue' ),
|
||||||
meta: {
|
meta: {
|
||||||
title: '404 - Page not found :: libreevent',
|
title: '404 - Page not found :: ',
|
||||||
transition: 'scale',
|
transition: 'scale',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,12 +10,13 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
|
|
||||||
export const useUserStore = defineStore ( 'user', {
|
export const useUserStore = defineStore ( 'user', {
|
||||||
state: () => ( { 'isUserAuth': false, 'isAdminAuth': false, 'userData': {}, 'isTwoFACompliantUser': false, 'isTwoFACompliantAdmin': false } ),
|
state: () => ( { 'isUserAuth': false, 'isAdminAuth': false, 'userData': {}, 'isTwoFACompliantUser': false, 'isTwoFACompliantAdmin': false, 'pageName': 'libreevent' } ),
|
||||||
getters: {
|
getters: {
|
||||||
getUserAuthenticated: ( state ) => state.isUserAuth,
|
getUserAuthenticated: ( state ) => state.isUserAuth,
|
||||||
getAdminAuthenticated: ( state ) => state.isAdminAuth,
|
getAdminAuthenticated: ( state ) => state.isAdminAuth,
|
||||||
getUserTwoFACompliant: ( state ) => state.isTwoFACompliantUser,
|
getUserTwoFACompliant: ( state ) => state.isTwoFACompliantUser,
|
||||||
getAdminTwoFACompliant: ( state ) => state.isTwoFACompliantAdmin,
|
getAdminTwoFACompliant: ( state ) => state.isTwoFACompliantAdmin,
|
||||||
|
getPageName: ( state ) => state.pageName,
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
setUserAuth ( auth ) {
|
setUserAuth ( auth ) {
|
||||||
@@ -29,6 +30,9 @@ export const useUserStore = defineStore ( 'user', {
|
|||||||
},
|
},
|
||||||
setAdmin2fa ( auth ) {
|
setAdmin2fa ( auth ) {
|
||||||
this.isTwoFACompliantAdmin = auth;
|
this.isTwoFACompliantAdmin = auth;
|
||||||
|
},
|
||||||
|
setPageName ( name ) {
|
||||||
|
this.pageName = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
@@ -66,6 +66,27 @@
|
|||||||
setTimeout( () => {
|
setTimeout( () => {
|
||||||
this.$refs.notification.createNotification( 'Unsupported browser detected. Redirection might take longer to occur!', 20, 'warning', 'normal' );
|
this.$refs.notification.createNotification( 'Unsupported browser detected. Redirection might take longer to occur!', 20, 'warning', 'normal' );
|
||||||
}, 300 );
|
}, 300 );
|
||||||
|
// ping server every 5s to check if logged in
|
||||||
|
this.serverPing = setInterval( () => {
|
||||||
|
fetch( '/admin/2fa/ping' ).then( res => {
|
||||||
|
if ( res.status === 200 ) {
|
||||||
|
res.json().then( data => {
|
||||||
|
if ( data ) {
|
||||||
|
if ( data.status === 'ok' ) {
|
||||||
|
this.userStore.setUserAuth( true );
|
||||||
|
this.$router.push( sessionStorage.getItem( 'redirect' ) ?? '/account' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
} else {
|
||||||
|
console.error( 'Request failed' );
|
||||||
|
this.$refs.notification.createNotification( 'We are sorry, but an error occurred. You will not be redirected automatically', 300, 'error', 'normal' );
|
||||||
|
}
|
||||||
|
} ).catch( error => {
|
||||||
|
console.error( error );
|
||||||
|
this.$refs.notification.createNotification( 'We are sorry, but an error occurred. You will not be redirected automatically', 300, 'error', 'normal' );
|
||||||
|
} );
|
||||||
|
}, 5000 );
|
||||||
}
|
}
|
||||||
let code = sessionStorage.getItem( '2faCode' ) ? sessionStorage.getItem( '2faCode' ) : '';
|
let code = sessionStorage.getItem( '2faCode' ) ? sessionStorage.getItem( '2faCode' ) : '';
|
||||||
this.code = { '1': code.slice( 0, 3 ), '2': code.substring( 3 ) };
|
this.code = { '1': code.slice( 0, 3 ), '2': code.substring( 3 ) };
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="order">
|
<div class="order">
|
||||||
<h1>Order tickets</h1>
|
<h1>Order tickets</h1>
|
||||||
<div class="order-app" v-if="events">
|
<div class="order-app" v-if="Object.keys( orderedEvents ).length">
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="event in orderedEvents">
|
<li v-for="event in orderedEvents">
|
||||||
<router-link to="/tickets/details" class="ticket" @click="setActiveTicket( event.eventID );">
|
<router-link to="/tickets/details" class="ticket" @click="setActiveTicket( event.eventID );">
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
events: { 'test':{ 'name': 'TestEvent', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'2023-07-31T09:00:00Z', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test', 'currency': 'CHF', 'logo': new URL( '/src/assets/logo.png', import.meta.url ).href }, 'test2':{ 'name': 'TestEvent2', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'2023-08-01T09:00:00Z', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test2', 'currency': 'CHF', 'logo': new URL( '/src/assets/logo.png', import.meta.url ).href } },
|
events: { 'test':{ 'name': 'TestEvent', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'2023-08-31T09:00:00Z', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test', 'currency': 'CHF', 'logo': new URL( '/src/assets/logo.png', import.meta.url ).href }, 'test2':{ 'name': 'TestEvent2', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'2023-08-15T09:00:00Z', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test2', 'currency': 'CHF', 'logo': new URL( '/src/assets/logo.png', import.meta.url ).href } },
|
||||||
today: new Date().getTime()
|
today: new Date().getTime()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user