From fa2b70dbdb550a7d3eb66e83ca4da3888335a629 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Fri, 25 Sep 2020 15:41:21 -0600 Subject: [PATCH] WIP --- core/wfc.js | 50 +++++++++++++++++++++++ misc/menu_templates/message_base.in.hjson | 4 +- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/core/wfc.js b/core/wfc.js index 941ed305..c08b9ffa 100644 --- a/core/wfc.js +++ b/core/wfc.js @@ -1,17 +1,67 @@ // ENiGMA½ const { MenuModule } = require('./menu_module'); +// deps +const async = require('async'); +const _ = require('lodash'); + exports.moduleInfo = { name : 'WFC', desc : 'Semi-Traditional Waiting For Caller', author : 'NuSkooler', }; +const FormIds = { + main : 0, +}; + +const MciViewIds = { + main : { + nodeStatus : 0, + quickLogView : 1, + + customRangeStart : 10, + } +}; + +// Secure + 2FA + root user + 'wfc' group. +const DefaultACS = 'SCAF2ID1GM[wfc]'; + exports.getModule = class WaitingForCallerModule extends MenuModule { constructor(options) { super(options); this.config = Object.assign({}, _.get(options, 'menuConfig.config'), { extraArgs : options.extraArgs }); + + this.config.acs = this.config.acs || DefaultACS; + if (!this.config.acs.includes('SC')) { + this.config.acs = 'SC' + this.config.acs; // secure connection at the very, very least + } + } + + mciReady(mciData, cb) { + super.mciReady(mciData, err => { + if (err) { + return cb(err); + } + + async.series( + [ + (callback) => { + return this.prepViewController('main', FormIds.main, mciData.menu, callback); + }, + (callback) => { + // const requiredCodes = [ + // ]; + // return this.validateMCIByViewIds('main', requiredCodes, callback); + return callback(null); + }, + ], + err => { + return cb(err); + } + ); + }); } }; diff --git a/misc/menu_templates/message_base.in.hjson b/misc/menu_templates/message_base.in.hjson index fd4adf97..51bf4a19 100644 --- a/misc/menu_templates/message_base.in.hjson +++ b/misc/menu_templates/message_base.in.hjson @@ -251,7 +251,7 @@ submit: { *: [ { - value: { message: null } + value: { messageIndex: null } action: @method:selectMessage } ] @@ -799,7 +799,7 @@ } }, - // default prompt entry used by the 'msg_lsit' module + // default prompt entry used by the 'msg_list' module deleteMessageFromListPrompt: { art: MSGDELPMPT mci: {