diff --git a/css/styles.scss b/css/styles.scss index 2a3572257..1949caf7c 100644 --- a/css/styles.scss +++ b/css/styles.scss @@ -550,3 +550,11 @@ a:visited { .accordion-panel ul > li { background-color: #555; } + +/* override the global styling */ +#active-scripts-total-production-active, +#active-scripts-total-prod-aug-total, +#active-scripts-total-prod-aug-avg { + margin: 0; + padding: 0; +} diff --git a/index.html b/index.html index 7440e0e05..ad99dd4ab 100644 --- a/index.html +++ b/index.html @@ -187,7 +187,10 @@

This page displays a list of all of your scripts that are currently running across every machine. It also provides information about each script's production. The scripts are categorized by the hostname of the servers on which they are running.

-

Total online production rate:

+

Total online production of + Active scripts: $0.000 / sec
+ Total online production since last Aug installation: $0.000 + ($0.000 / sec)

diff --git a/src/ActiveScriptsUI.js b/src/ActiveScriptsUI.js index d62673031..a57cb0d74 100644 --- a/src/ActiveScriptsUI.js +++ b/src/ActiveScriptsUI.js @@ -1,6 +1,5 @@ import {Engine} from "./engine"; import {workerScripts, - addWorkerScript, killWorkerScript} from "./NetscriptWorker"; import {Player} from "./Player"; import {getServer} from "./Server"; @@ -9,6 +8,7 @@ import {createAccordionElement} from "../utils/uiHelpers/createAccordionEleme import {arrayToString} from "../utils/helpers/arrayToString"; import {createElement} from "../utils/uiHelpers/createElement"; import {exceptionAlert} from "../utils/helpers/exceptionAlert"; +import {getElementById} from "../utils/uiHelpers/getElementById"; import {logBoxCreate} from "../utils/LogBox"; import numeral from "numeral/min/numeral.min"; import {formatNumber} from "../utils/StringHelperFunctions"; @@ -116,20 +116,27 @@ function addActiveScriptsItem(workerscript) { "Args: " + arrayToString(workerscript.args) })); var panelText = createElement("p", { - innerText:"Loading...", fontSize:"14px", + innerText: "Loading...", + fontSize: "14px", }); panel.appendChild(panelText); panel.appendChild(createElement("br")); panel.appendChild(createElement("span", { - innerText:"Log", class:"active-scripts-button", margin:"4px", padding:"4px", - clickListener:()=>{ + innerText: "Log", + class: "active-scripts-button", + margin: "4px", + padding: "4px", + clickListener: () => { logBoxCreate(workerscript.scriptRef); return false; } })); panel.appendChild(createElement("span", { - innerText:"Kill Script", class:"active-scripts-button", margin:"4px", padding:"4px", - clickListener:()=>{ + innerText: "Kill Script", + class: "active-scripts-button", + margin: "4px", + padding: "4px", + clickListener: () => { killWorkerScript(workerscript.scriptRef, workerscript.scriptRef.scriptRef.server); dialogBoxCreate("Killing script, may take a few minutes to complete..."); return false; @@ -205,11 +212,10 @@ function updateActiveScriptsItems(maxTasks=150) { exceptionAlert(e); } } - document.getElementById("active-scripts-total-prod").innerHTML = - "Total online production of Active Scripts: " + numeral(total).format('$0.000a') + " / sec
" + - "Total online production since last Aug installation: " + - numeral(Player.scriptProdSinceLastAug).format('$0.000a') + " (" + - numeral(Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug/1000)).format('$0.000a') + " / sec)"; + + getElementById("active-scripts-total-production-active").innerText = numeral(total).format('$0.000a'); + getElementById("active-scripts-total-prod-aug-total").innerText = numeral(Player.scriptProdSinceLastAug).format('$0.000a'); + getElementById("active-scripts-total-prod-aug-avg").innerText = numeral(Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug/1000)).format('$0.000a'); return total; }