various small changes and fixes

This commit is contained in:
2023-08-19 13:35:46 +02:00
parent 6051b18796
commit 71a2927372
11 changed files with 35 additions and 15 deletions

View File

@@ -75,9 +75,13 @@ class GETHandler {
} else if ( call === 'getCurrency' ) { } else if ( call === 'getCurrency' ) {
resolve( this.settings.currency ); resolve( this.settings.currency );
} else if ( call === 'getAdminAccounts' ) { } else if ( call === 'getAdminAccounts' ) {
// TODO: Finish db.getData( 'admin' ).then( data => {
resolve( data );
} ).catch( err => {
reject( { 'code': 500, 'message': 'ERR_DB: ' + err } );
} );
} else if ( call === 'getPaymentGatewaySettings' ) { } else if ( call === 'getPaymentGatewaySettings' ) {
// TODO: Finish // TODO: Finish with plugin manager
} else if ( call === 'getSettings' ) { } else if ( call === 'getSettings' ) {
resolve( this.settings ); resolve( this.settings );
} else { } else {

View File

@@ -29,11 +29,11 @@ class POSTHandler {
} }
} }
console.log( this.ticketTotals ); // console.log( this.ticketTotals );
// for ( let order in this.allSelectedSeats ) { // for ( let order in this.allSelectedSeats ) {
// } // }
console.log( this.allSelectedSeats ); // console.log( this.allSelectedSeats );
} ); } );
} ); } );
} ); } );

View File

@@ -36,6 +36,16 @@ module.exports.getDataSimple = ( db, column, searchQuery ) => {
} ); } );
}; };
module.exports.getData = ( db ) => {
return new Promise( ( resolve, reject ) => {
dbh.query( { 'command': 'getAllData' }, dbRef[ db ] ).then( data => {
resolve( data );
} ).catch( error => {
reject( error );
} );
} );
};
module.exports.writeDataSimple = ( db, column, searchQuery, data ) => { module.exports.writeDataSimple = ( db, column, searchQuery, data ) => {
return new Promise( ( resolve, reject ) => { return new Promise( ( resolve, reject ) => {
dbh.query( { 'command': 'checkDataAvailability', 'property': column, 'searchQuery': searchQuery }, dbRef[ db ] ).then( res => { dbh.query( { 'command': 'checkDataAvailability', 'property': column, 'searchQuery': searchQuery }, dbRef[ db ] ).then( res => {

View File

@@ -65,7 +65,7 @@ class SQLDB {
} ); } );
this.sqlConnection.query( 'CREATE TABLE libreevent_users ( account_id INT ( 10 ) NOT NULL AUTO_INCREMENT, email TINYTEXT NOT NULL, pass TEXT, name TEXT, first_name TEXT, two_fa TINYTEXT, user_data VARCHAR( 60000 ), mail_confirmed TINYTEXT, marketing TINYTEXT, PRIMARY KEY ( account_id ) ) ENGINE=INNODB;', ( error ) => { this.sqlConnection.query( 'CREATE TABLE libreevent_users ( account_id INT ( 10 ) NOT NULL AUTO_INCREMENT, email TINYTEXT NOT NULL, pass TEXT, name TEXT, first_name TEXT, two_fa TINYTEXT, user_data VARCHAR( 60000 ), mail_confirmed TINYTEXT, marketing TINYTEXT, PRIMARY KEY ( account_id ) ) ENGINE=INNODB;', ( error ) => {
if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error; if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error;
this.sqlConnection.query( 'CREATE TABLE libreevent_orders ( order_id INT ( 10 ) NOT NULL AUTO_INCREMENT, order_name TINYTEXT, account_id INT ( 10 ) NOT NULL, tickets VARCHAR( 60000 ), processed TINYTEXT, PRIMARY KEY ( order_id ), FOREIGN KEY ( account_id ) REFERENCES libreevent_users( account_id ) ) ENGINE=INNODB;', ( error ) => { this.sqlConnection.query( 'CREATE TABLE libreevent_orders ( order_id INT ( 10 ) NOT NULL AUTO_INCREMENT, order_name TINYTEXT, account_id INT ( 10 ) NOT NULL, tickets VARCHAR( 60000 ), processed TINYTEXT, timestamp TINYTEXT, PRIMARY KEY ( order_id ), FOREIGN KEY ( account_id ) REFERENCES libreevent_users( account_id ) ) ENGINE=INNODB;', ( error ) => {
if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error; if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error;
this.sqlConnection.query( 'CREATE TABLE libreevent_admin ( account_id INT NOT NULL AUTO_INCREMENT, email TINYTEXT, pass TEXT, permissions VARCHAR( 1000 ), username TINYTEXT, two_fa TINYTEXT, PRIMARY KEY ( account_id ) );', ( error ) => { this.sqlConnection.query( 'CREATE TABLE libreevent_admin ( account_id INT NOT NULL AUTO_INCREMENT, email TINYTEXT, pass TEXT, permissions VARCHAR( 1000 ), username TINYTEXT, two_fa TINYTEXT, PRIMARY KEY ( account_id ) );', ( error ) => {
if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error; if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error;

View File

@@ -33,9 +33,19 @@ class TicketGenerator {
this.events = events; this.events = events;
} ); } );
this.runningTickets = {}; this.runningTickets = {};
db.getData( 'orders' ).then( orders => {
for ( let order in orders ) {
if ( orders[ order ][ 'processed' ] != 'true' ) {
this.ticketQueue[ this.jobId ] = { 'order': orders[ order ][ 'order_name' ] };
this.jobId += 1;
}
}
if ( this.jobId > 0 ) {
this.queueHandler();
}
} );
} }
// TODO: continue processing once back online
generateTickets ( order ) { generateTickets ( order ) {
this.ticketQueue[ this.jobId ] = { 'order': order }; this.ticketQueue[ this.jobId ] = { 'order': order };
this.runningTickets[ order.tok ] = 'processing'; this.runningTickets[ order.tok ] = 'processing';
@@ -96,7 +106,6 @@ class TicketGenerator {
} ).catch( error => { } ).catch( error => {
console.error( '[ PDF GENERATOR ] ERROR: ' + error ); console.error( '[ PDF GENERATOR ] ERROR: ' + error );
this.isRunning = false; this.isRunning = false;
// TODO: Add to FAILED db
} ); } );
} }
} }

View File

@@ -230,7 +230,6 @@ export default {
} }
}, },
methods: { methods: {
// TODO: Load categories from server
loadInternal () { loadInternal () {
for ( let value in this.draggables ) { for ( let value in this.draggables ) {
this.internal[ value ] = {}; this.internal[ value ] = {};

View File

@@ -162,7 +162,7 @@
} }
this.seatChecks(); this.seatChecks();
// TODO: Trim scroll box to about 200px more than seatplan size // TODO: FUTURE Trim scroll box to about 200px more than seatplan size
sessionStorage.setItem( 'seatplan', JSON.stringify( this.scaleDown( this.draggables ) ) ); sessionStorage.setItem( 'seatplan', JSON.stringify( this.scaleDown( this.draggables ) ) );
window.addEventListener( 'visibilitychange', ( e ) => { window.addEventListener( 'visibilitychange', ( e ) => {
this.seatPlanInit(); this.seatPlanInit();

View File

@@ -10,8 +10,8 @@
<template> <template>
<div> <div>
<!-- <h2>Setup check</h2> --> <!-- <h2>Setup check</h2> -->
<!-- TODO: Maybe add --> <!-- TODO: FUTURE add -->
<!-- TODO: call config check of payment + check if events are deployed --> <!-- call config check of payment + check if events are deployed -->
<h2>Settings</h2> <h2>Settings</h2>
<p>Changing any of these settings requires a restart of libreevent.</p> <p>Changing any of these settings requires a restart of libreevent.</p>
<p>Currency codes used must be valid ISO 4217 codes. Read more on <a href="https://libreevent.janishutz.com/docs/admin-panel/settings#currency" target="_blank">this page</a> of the documentation <!-- https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes"--></p> <p>Currency codes used must be valid ISO 4217 codes. Read more on <a href="https://libreevent.janishutz.com/docs/admin-panel/settings#currency" target="_blank">this page</a> of the documentation <!-- https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes"--></p>
@@ -269,7 +269,6 @@
} }
}; };
// TODO: Load gateways and settings in general from server. // TODO: Load gateways and settings in general from server.
</script> </script>

View File

@@ -12,7 +12,7 @@
<h2>Event analytics</h2> <h2>Event analytics</h2>
<p>Get insights into tickets sold, people checked in, available tickets, revenue, etc, in real time!</p> <p>Get insights into tickets sold, people checked in, available tickets, revenue, etc, in real time!</p>
<p>Coming soon! (in the next major update)</p> <p>Coming soon! (in the next major update)</p>
<!-- TODO: Add toggle for real-time update (gets live updates from sse) --> <!-- TODO: FUTURE Add toggle for real-time update (gets live updates from sse) -->
<!-- Use chart.js for visualisations --> <!-- Use chart.js for visualisations -->
</div> </div>
</template> </template>

View File

@@ -192,7 +192,6 @@
import notifications from '@/components/notifications/notifications.vue'; import notifications from '@/components/notifications/notifications.vue';
import popups from '@/components/notifications/popups.vue'; import popups from '@/components/notifications/popups.vue';
import PictureInput from 'vue-picture-input'; import PictureInput from 'vue-picture-input';
// TODO: Save info if draft or live
export default { export default {
name: 'TicketsDetailsView', name: 'TicketsDetailsView',

View File

@@ -236,7 +236,7 @@ export default {
}, },
methods: { methods: {
loadData () { loadData () {
// TODO: Also load the customer data from server! // TODO: FUTURE Also load the customer data from server!
this.cartNotEmpty = false; this.cartNotEmpty = false;
let cart = JSON.parse( localStorage.getItem( 'cart' ) ); let cart = JSON.parse( localStorage.getItem( 'cart' ) );