diff --git a/src/server/admin/api/getHandler.js b/src/server/admin/api/getHandler.js index e3ffbd5..951b6dc 100644 --- a/src/server/admin/api/getHandler.js +++ b/src/server/admin/api/getHandler.js @@ -93,7 +93,11 @@ class GETHandler { reject( { 'code': 500, 'message': 'ERR_DB: ' + err } ); } ); } else if ( call === 'getPaymentGatewaySettings' ) { - pluginManager.loadPaymentGatewaySettings(); + this.pluginManager.loadPaymentGatewaySettings().then( dat => { + resolve( dat ); + } ).catch( err => { + reject( { 'code': 500, 'error': err } ); + } ); } else if ( call === 'getSettings' ) { resolve( this.settings ); } else { diff --git a/src/server/admin/api/postHandler.js b/src/server/admin/api/postHandler.js index 3a73e22..ba880fe 100644 --- a/src/server/admin/api/postHandler.js +++ b/src/server/admin/api/postHandler.js @@ -143,6 +143,8 @@ class POSTHandler { db.writeJSONData( 'events', updated ); } ); resolve( 'ok' ); + } else if ( call === 'updatePaymentGatewaySettings' ) { + resolve( 'ok' ); } else { reject( { 'code': 404, 'error': 'Route not found' } ); } diff --git a/src/server/backend/plugins/manager.js b/src/server/backend/plugins/manager.js index 692cfea..8ead0c8 100644 --- a/src/server/backend/plugins/manager.js +++ b/src/server/backend/plugins/manager.js @@ -41,22 +41,32 @@ class PluginManager { loadPaymentGatewaySettings () { return new Promise( ( resolve, reject ) => { - fs.readFile( path.join( __dirname + '/payments/' + this.paymentGateway + '/configOptions.json' ), ( err, options ) => { + fs.readFile( path.join( __dirname + '/payments/' + this.paymentGateway + '/configOptions.json' ), ( err, optionsBuffer ) => { if ( err ) reject( err ); - fs.readFile( path.join( __dirname + '/payments/' + this.paymentGateway + '/config.payments.json' ), ( err, config ) => { + fs.readFile( path.join( __dirname + '/payments/' + this.paymentGateway + '/config.payments.json' ), ( err, configBuffer ) => { if ( err ) reject( err ); + let options, config; + try { + options = JSON.parse( optionsBuffer ); + config = JSON.parse( configBuffer ); + } catch ( err ) { + reject( err ); + return; + } let f = options; for ( let s in f ) { f[ s ][ 'value' ] = config[ s ]; } - resolve( f ); + resolve( { 'data': f, 'gateway': this.paymentGateway } ); } ); } ); } ); } savePaymentGatewaySettings () { - + return new Promise( ( resolve, reject ) => { + + } ); } saveSettings ( plugin, settings ) { diff --git a/src/server/backend/plugins/payments/payrexx/configOptions.json b/src/server/backend/plugins/payments/payrexx/configOptions.json index e69de29..c140489 100644 --- a/src/server/backend/plugins/payments/payrexx/configOptions.json +++ b/src/server/backend/plugins/payments/payrexx/configOptions.json @@ -0,0 +1,16 @@ +{ + "APIKey": { + "display": "API key", + "id": "APIKey", + "tooltip":"This is the secret key API key you can get from the stripe dashboard. Please make a test purchase (FREE) before you go live!", + "value": "", + "type": "text" + }, + "instance": { + "display": "Instance", + "id": "instance", + "tooltip":"Please specify the instance name you used to create the payrexx account. (e.g. libreevent)", + "value": "", + "type": "text" + } +} \ No newline at end of file diff --git a/src/server/backend/plugins/payments/stripe/configOptions.json b/src/server/backend/plugins/payments/stripe/configOptions.json index e69de29..25ad148 100644 --- a/src/server/backend/plugins/payments/stripe/configOptions.json +++ b/src/server/backend/plugins/payments/stripe/configOptions.json @@ -0,0 +1,16 @@ +{ + "APIKey": { + "display": "API key", + "id": "APIKey", + "tooltip":"This is the secret key API key you can get from the stripe dashboard. Please make a test purchase (FREE) before you go live!", + "value": "", + "type": "text" + }, + "endpointSecret": { + "display": "Webhook endpoint secret", + "id": "endpointSecret", + "tooltip":"Please specify the endpoint secret that you can get from the stripe dashboard when creating the webhook integration", + "value": "", + "type": "text" + } +} \ No newline at end of file diff --git a/src/server/ui/home/active/en/index.html b/src/server/ui/home/active/en/index.html index a33bf92..a0f9a8e 100644 --- a/src/server/ui/home/active/en/index.html +++ b/src/server/ui/home/active/en/index.html @@ -7,7 +7,13 @@ libreevent - +

Welcome to libreevent!

No start page has been configured yet! Please configure one either by using the configurator in the settings or by uploading your own HTML page to the correct folder as detailed here

diff --git a/src/server/ui/home/main.css b/src/server/ui/home/main.css new file mode 100644 index 0000000..9470177 --- /dev/null +++ b/src/server/ui/home/main.css @@ -0,0 +1,62 @@ +:root, :root.light { + --primary-color: #2c3e50; + --accent-background: rgb(30, 30, 82); + --secondary-color: white; + --background-color: white; + --popup-color: rgb(224, 224, 224); + --accent-color: #42b983; + --hover-color: rgb(165, 165, 165); + --accent-background-hover: rgb(124, 140, 236); + --overlay-color: rgba(0, 0, 0, 0.7); + --inactive-color: rgb(100, 100, 100); + --highlight-backdrop: rgb(143, 134, 192); + --hint-color: rgb(174, 210, 221); + --PI: 3.14159265358979; +} + +:root.dark { + --primary-color: white; + --accent-background: rgb(56, 56, 112); + --secondary-color: white; + --background-color: rgb(32, 32, 32); + --popup-color: rgb(58, 58, 58); + --accent-color: #42b983; + --hover-color: rgb(83, 83, 83); + --accent-background-hover: #4380a8; + --overlay-color: rgba(104, 104, 104, 0.575); + --inactive-color: rgb(190, 190, 190); + --highlight-backdrop: rgb(85, 63, 207); + --hint-color: rgb(88, 91, 110); +} + +@media ( prefers-color-scheme: dark ) { + :root { + --primary-color: white; + --accent-background: rgb(56, 56, 112); + --secondary-color: white; + --background-color: rgb(32, 32, 32); + --popup-color: rgb(58, 58, 58); + --accent-color: #42b983; + --hover-color: rgb(83, 83, 83); + --accent-background-hover: #4380a8; + --overlay-color: rgba(104, 104, 104, 0.575); + --inactive-color: rgb(190, 190, 190); + --highlight-backdrop: rgb(85, 63, 207); + --hint-color: rgb(88, 91, 110); + } +} + +::selection { + background-color: var( --highlight-backdrop ); + color: var( --secondary-color ); +} + +#themeSelector { + background-color: rgba( 0, 0, 0, 0 ); + color: var( --primary-color ); + font-size: 130%; + padding: 0; + margin: 0; + border: none; + cursor: pointer; +} \ No newline at end of file diff --git a/src/webapp/main/src/App.vue b/src/webapp/main/src/App.vue index 77a8f44..47c5caa 100644 --- a/src/webapp/main/src/App.vue +++ b/src/webapp/main/src/App.vue @@ -9,7 +9,7 @@