|
|
|
@ -11,8 +11,9 @@ import md5 from 'md5';
@@ -11,8 +11,9 @@ import md5 from 'md5';
|
|
|
|
|
class Monitor { |
|
|
|
|
|
|
|
|
|
//构造函数,设置默认配置
|
|
|
|
|
constructor() { |
|
|
|
|
constructor(configFilename) { |
|
|
|
|
this.config = null; |
|
|
|
|
this.configFile = typeof(configFilename) != 'undefined' && configFilename ? configFilename : 'config.json'; |
|
|
|
|
|
|
|
|
|
//默认配置
|
|
|
|
|
this.systemLogDir = 'log/'; //系统日志保存目录
|
|
|
|
@ -27,7 +28,8 @@ class Monitor {
@@ -27,7 +28,8 @@ class Monitor {
|
|
|
|
|
const _self = this; |
|
|
|
|
|
|
|
|
|
if ( !this.config || (typeof(forceReload) != 'undefined' && forceReload) ) { |
|
|
|
|
let config = await common.getConfigFromJsonFile('config.json'); |
|
|
|
|
console.log("Load config from %s", this.configFile); |
|
|
|
|
let config = await common.getConfigFromJsonFile(this.configFile); |
|
|
|
|
|
|
|
|
|
//覆盖默认配置
|
|
|
|
|
for (const key in config) { |
|
|
|
|