scripts/net-monitor.js
/**
 * Given a logType and a box element, update the box with appropriate data.
 * @param {string} logType
 * @param {any} logTarget
 * @param {Element} box
 * @param {NS} ns
 */
Given a logType and a box element, update the box with appropriate data.
Given a logType and a box element update the box with appropriate data .
function dispatchMonitorUpdate(logType, logTarget, box, ns) {
    const dispatch = {
        Targets1Up: printTargetStatus,
        Targets2Up: printTargetStatus,
        Short: printOverviewStatus,
        Log: printLogMessages,
        Stocks: printStockStatus,
    };
    if (dispatch[logType] != undefined) {
        dispatch[logType](logType, logTarget, box, ns);
    } else {
        ns.tprint(`Trying to update a window with logType '${logType}', but I don't know how to handle that log type.`);
    }
}
function dispatchMonitorUpdate ( logType , logTarget , box , ns ) { const dispatch = { Targets1Up : printTargetStatus , Targets2Up : printTargetStatus , Short : printOverviewStatus , Log : printLogMessages , Stocks : printStockStatus , } ; if ( dispatch [ logType ] != undefined ) { dispatch [ logType ] ( logType , logTarget , box , ns ) ; } else { ns . tprint ( ` ${ logType } ` ) ; } }
Given a logType and a box element, update the box with appropriate data.
Given a logType and a box element update the box with appropriate data .