mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
fix bug in start page settings + a bit of progress
This commit is contained in:
@@ -28,7 +28,7 @@ module.exports = ( app ) => {
|
||||
getHandler.handleCall( req.params.call, req.query ).then( data => {
|
||||
res.send( data );
|
||||
} ).catch( error => {
|
||||
res.status( error.code ).send( error.error );
|
||||
res.status( error.code ?? 500 ).send( error.error );
|
||||
} );
|
||||
} else {
|
||||
res.status( 403 ).sendFile( path.join( __dirname + '/../ui/' + ( req.query.lang ?? 'en' ) + '/errors/403.html' ) );
|
||||
@@ -41,7 +41,7 @@ module.exports = ( app ) => {
|
||||
res.send( data );
|
||||
} ).catch( error => {
|
||||
console.error( error );
|
||||
res.status( error.code ).send( error.error );
|
||||
res.status( error.code ?? 500 ).send( error.error );
|
||||
} );
|
||||
} else {
|
||||
res.status( 403 ).sendFile( path.join( __dirname + '/../ui/' + ( req.query.lang ?? 'en' ) + '/errors/403.html' ) );
|
||||
|
||||
@@ -22,7 +22,14 @@ class StartPageManager {
|
||||
}
|
||||
|
||||
loadStartPagePreferences( startPageName ) {
|
||||
return JSON.parse( fs.readFileSync( path.join( __dirname + '/../ui/home/templates/' + startPageName + '/startPage.config.html' ) ) );
|
||||
let conf, options;
|
||||
try {
|
||||
conf = JSON.parse( fs.readFileSync( path.join( __dirname + '/../ui/home/templates/' + startPageName + '/startPage.json' ) ) );
|
||||
options = JSON.parse( fs.readFileSync( path.join( __dirname + '/../ui/home/templates/' + startPageName + '/startPage.config.json' ) ) );
|
||||
return { 'conf': conf, 'options': options };
|
||||
} catch ( err ) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
findAllStartPageTemplates() {
|
||||
|
||||
Reference in New Issue
Block a user