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' ) {
resolve( this.settings.currency );
} 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' ) {
// TODO: Finish
// TODO: Finish with plugin manager
} else if ( call === 'getSettings' ) {
resolve( this.settings );
} else {

View File

@@ -29,11 +29,11 @@ class POSTHandler {
}
}
console.log( this.ticketTotals );
// console.log( this.ticketTotals );
// 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 ) => {
return new Promise( ( resolve, reject ) => {
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 ) => {
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;
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;

View File

@@ -33,9 +33,19 @@ class TicketGenerator {
this.events = events;
} );
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 ) {
this.ticketQueue[ this.jobId ] = { 'order': order };
this.runningTickets[ order.tok ] = 'processing';
@@ -96,7 +106,6 @@ class TicketGenerator {
} ).catch( error => {
console.error( '[ PDF GENERATOR ] ERROR: ' + error );
this.isRunning = false;
// TODO: Add to FAILED db
} );
}
}

View File

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

View File

@@ -162,7 +162,7 @@
}
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 ) ) );
window.addEventListener( 'visibilitychange', ( e ) => {
this.seatPlanInit();

View File

@@ -10,8 +10,8 @@
<template>
<div>
<!-- <h2>Setup check</h2> -->
<!-- TODO: Maybe add -->
<!-- TODO: call config check of payment + check if events are deployed -->
<!-- TODO: FUTURE add -->
<!-- call config check of payment + check if events are deployed -->
<h2>Settings</h2>
<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>
@@ -269,7 +269,6 @@
}
};
// TODO: Load gateways and settings in general from server.
</script>

View File

@@ -12,7 +12,7 @@
<h2>Event analytics</h2>
<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>
<!-- 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 -->
</div>
</template>

View File

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

View File

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