prs help, why is it dying on me

This commit is contained in:
Daniel Hübleitner
2019-07-28 15:07:34 +02:00
parent f4c26b5aa6
commit 3661e17936
8 changed files with 644 additions and 303 deletions
+1
View File
@@ -2,3 +2,4 @@ node_modules
lib
static/*.js
conf
plugin_packages
+18 -6
View File
@@ -3,13 +3,15 @@
import * as Logger from 'log4js'
import { Plugin, socketioRPC } from 'frontblock-generic/Plugin';
import { ErrorResponse, SuccessResponse } from 'frontblock-generic/Types';
import { FrontblockApiConf } from "frontblock/FrontblockApiClient"
//import { FrontblockApiConf } from "frontblock/FrontblockApiClient"
import {PluginManager} from "live-plugin-manager";
type pluginEntry = {pluginPath:string, conf?:any}
type pluginEntry = {pluginName:string}
const pluginList:pluginEntry[] = [
{pluginName: 'frontblock'}
//{ pluginPath: '../../paymentmanager/static/Plugin', conf:<FrontblockApiConf>{ apiHost: 'localhost' /*/ 'api.testnet.frontblock.me' */, apiPort: 10001 } },
//{ pluginPath: '../../htmlsupplier/static/Plugin' },
{ pluginPath: 'frontblock/FrontblockApiClient', conf:<FrontblockApiConf>{ apiHost: /*/ 'localhost' */ 'api.testnet.frontblock.me' , apiPort: 10001 } }
// { pluginPath: 'frontblock/FrontblockApiClient', conf:<FrontblockApiConf>{ apiHost: /*/ 'localhost' */ 'api.testnet.frontblock.me' , apiPort: 10001 } }
]
const express = require('express')
@@ -27,6 +29,8 @@ Logger.configure({
})
const logger = Logger.getLogger("admin")
const manager = new PluginManager();
type hookRPC = { type: 'hook', generator: (socket) => Function, unhook:(uid:string)=>Promise<ErrorResponse|SuccessResponse>}
type unhookRPC = { type: 'unhook', fn: Function}
type callRPC = { type: 'call', fn: Function}
@@ -74,11 +78,19 @@ export class FrontblockAdmin{
private async loadPlugins(){
this.plugins = []
pluginList.forEach(async (entry:pluginEntry) => {
const clazz = await import(entry.pluginPath)
let obj = new clazz.default(entry.conf)
this.plugins.push(obj)
logger.info("installing plugin " + entry.pluginName)
const info = await manager.installFromNpm(entry.pluginName);
logger.info("loading plugin " + info)
const clazz = manager.require(entry.pluginName);
//let obj = new clazz.default(entry.conf)
//this.plugins.push(obj)
})
}
private initApis(socket){
+623 -272
View File
File diff suppressed because it is too large Load Diff
+1 -12
View File
@@ -21,27 +21,16 @@
"@types/webpack-env": "^1.14.0",
"@uirouter/angularjs": "^1.0.5",
"angular": "^1.7.8",
"autoprefixer": "^9.6.1",
"bsert": "0.0.10",
"bsock": "^0.1.9",
"css-loader": "^3.1.0",
"cssnano": "^4.1.10",
"express": "^4.16.4",
"frontblock": "^0.4.3",
"frontblock-generic": "latest",
"html-loader": "^0.5.5",
"http": "0.0.0",
"key-file-storage": "^2.2.1",
"live-plugin-manager": "^0.13.2",
"log4js": "^4.4.0",
"node-fetch": "^2.6.0",
"node-sass": "^4.12.0",
"postcss-loader": "^3.0.0",
"sass-loader": "^7.1.0",
"socket.io": "^2.2.0",
"style-loader": "^0.23.1",
"ts-loader": "^6.0.4",
"tslint-loader": "^3.5.4"
"socket.io": "^2.2.0"
},
"devDependencies": {
"@types/angular": "^1.6.27",
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
<!doctype html> <html lang=en> <head> <script src=FrontblockLib.js></script> <meta charset=UTF-8> <title>Document</title> <link href="css/app.css?v=1cccf4c9" rel="stylesheet"></head> <body> <root></root> <script type="text/javascript" src="js/vendor.8f6b1fe6.js"></script><script type="text/javascript" src="js/app.246f7cfe.js"></script></body> </html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long