werks here

This commit is contained in:
peter
2019-08-03 20:28:36 +02:00
parent d9ccd4d9d3
commit 52ec9c8201
53 changed files with 561 additions and 349 deletions
+9 -4
View File
@@ -112,7 +112,7 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
//translate RPCs to socket-bound function metadata
const loadedPlugins = this.pm.getLoadedPlugins()
for(const name in loadedPlugins){
loadedPlugins[name].exportRPCs().forEach(rpc => {
loadedPlugins[name].backend.exportRPCs().forEach(rpc => {
const info = this.rpcToRpcInfo(name, rpc)
rpcInfos.push(info)
})
@@ -170,6 +170,13 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
this.express = express()
this.express.use(express.static('static'))
this.express.get('/plugins/:id'+".js", (request, response) => {
let frontend = this.pm.getFrontend(request.params.id)
response.status(200)
response.set('Content-Type', 'application/javascript')
response.send(frontend)
})
this.httpServer = new http.Server(this.express)
this.httpServer.listen(port, () => {
logger.info('Admin panel listening for HTTP on *'+port)
@@ -257,6 +264,4 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
}
}
(async() => {
new FrontblockAdmin()
})()
new FrontblockAdmin()