diff --git a/js/bdwareclient.js b/js/bdwareclient.js index 5b2030c..5b32df0 100644 --- a/js/bdwareclient.js +++ b/js/bdwareclient.js @@ -313,6 +313,7 @@ function displayOutput(obj) { function initWSocket() { let host = $("#urlInput")[0].value; + document.title = `数瑞浏览器(${host})` if (!host.startsWith("ws")) { if (location.href.startsWith("https")) { host = "wss://" + host; @@ -375,6 +376,7 @@ function changeApp() { return; } console.log(global.currentContract); + document.title = `数瑞浏览器(${global.currentContract} - ${$("#urlInput")[0].value})` changeAppInternal(needRender(global.currentContract)); } @@ -474,21 +476,21 @@ function triggerExecuteCurrentContract() { console.log(funNode); const argInput = $("#argInput"); var contract = global.currentContract; - var gas = $("#gasInput")[0].value/1; - executeContractWithGas(contract.id, funNode.functionName, argInput[0].value,gas, + var gas = $("#gasInput")[0].value / 1; + executeContractWithGas(contract.id, funNode.functionName, argInput[0].value, gas, fillResultInternal, executeContractAsDebug.checked); var iHtml = "/SCIDE/SCManager?action=executeContract&contractID=" + global.currentContract.name + "&operation=" + funNode.functionName + "&arg=" + argInput[0].value; var toSign = global.currentContract.name + "|" + funNode.functionName + "|" - + argInput[0].value ; - if (gas>0){ - toSign+="|"+gas; - iHtml+="&gasLimit="+gas; + + argInput[0].value; + if (gas > 0) { + toSign += "|" + gas; + iHtml += "&gasLimit=" + gas; } - iHtml+= "&pubkey=" + global.sm2Key.publicKey + "&signature="; - toSign+= "|" + global.sm2Key.publicKey; + iHtml += "&pubkey=" + global.sm2Key.publicKey + "&signature="; + toSign += "|" + global.sm2Key.publicKey; const signature = sm2.doSignature(toSign, global.sm2Key.privateKey, {hash: true, der: true}); let urlPre = $("#urlInput")[0].value; if (urlPre.startsWith("ws")) { @@ -528,8 +530,8 @@ function fillResultInternal(result, data) { global.responseCollector[data.responseID].push(data); $("#statusSpan")[0].innerHTML = result.status; $("#timeSpan")[0].innerHTML = "调用耗时:" + data.executeTime + "(ms)"; - if (data.executionGas !=undefined && data.executionGas>0) - $("#timeSpan")[0].innerHTML+="
"+data.executionGas+"(gas)"; + if (data.executionGas != undefined && data.executionGas > 0) + $("#timeSpan")[0].innerHTML += "
" + data.executionGas + "(gas)"; $("#timeSpan")[0].innerHTML if (result.result instanceof Object) { $("#responseArea")[0].value = JSON.stringify(result.result);