show pages in iframe

This commit is contained in:
Jan Prochazka
2020-05-17 10:57:24 +02:00
parent b024ef5a9b
commit a682df9253
7 changed files with 57 additions and 1 deletions

View File

@@ -1,8 +1,18 @@
module.exports = {
get_meta: 'get',
async get() {
const toolbarButtons = process.env.TOOLBAR;
const toolbar = toolbarButtons
? toolbarButtons.split(',').map((name) => ({
name,
icon: process.env[`ICON_${name}`],
title: process.env[`TITLE_${name}`],
page: process.env[`PAGE_${name}`],
}))
: null;
return {
runAsPortal: !!process.env.CONNECTIONS,
toolbar,
};
},
};

View File

@@ -37,6 +37,10 @@ function start(argument = null) {
useController(app, '/jsldata', jsldata);
useController(app, '/config', config);
if (process.env.PAGES_DIRECTORY) {
app.use('/pages', express.static(process.env.PAGES_DIRECTORY));
}
if (fs.existsSync('/home/dbgate-docker/build')) {
// server static files inside docker container
app.use(express.static('/home/dbgate-docker/build'));