mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 05:14:23 +00:00
various small changes and fixes
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 );
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +230,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// TODO: Load categories from server
|
||||
loadInternal () {
|
||||
for ( let value in this.draggables ) {
|
||||
this.internal[ value ] = {};
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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',
|
||||
|
||||
@@ -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' ) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user