From 19d0c533047c2e419a5b2344df1e00556de9c91a Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Fri, 2 Sep 2022 21:26:21 +0800 Subject: [PATCH] support remote debug --- NodePortal.html | 25 ++++++++++++++++++++----- OnlineIDE.html | 32 +++++++++++++++++++++++++------- js/codeManage/operManage.js | 7 +++++-- js/onlineide/rightmenu.js | 25 ++++++++++++++++++++++--- 4 files changed, 72 insertions(+), 17 deletions(-) diff --git a/NodePortal.html b/NodePortal.html index de3ae0d..5c01403 100644 --- a/NodePortal.html +++ b/NodePortal.html @@ -239,14 +239,20 @@ checked title="" data-original-title="自动将参数转为JSON对象"/> + + + +
+ @@ -1366,6 +1378,9 @@ + + + diff --git a/OnlineIDE.html b/OnlineIDE.html index 02740b4..00f668c 100644 --- a/OnlineIDE.html +++ b/OnlineIDE.html @@ -35,11 +35,6 @@ - - - - - @@ -390,12 +385,35 @@
+ +
+ +
+
+
+
+
+ +
diff --git a/js/codeManage/operManage.js b/js/codeManage/operManage.js index b88f619..e0c36f1 100644 --- a/js/codeManage/operManage.js +++ b/js/codeManage/operManage.js @@ -120,9 +120,8 @@ var switchPeriod = function(per) { return ""; } }; - // 本地启动 -var startContractAtSlave = function() { +var startContractAtSlave = function(isDebug) { //this is for fixed contract,not for the unit contract var period = $("#selectDumpPeriod")[0].value; if (period == "选择状态保存模式") { @@ -150,6 +149,10 @@ var startContractAtSlave = function() { }else{ } } + if (remoteDebugPort.value !='') { + request.remoteDebugPort = remoteDebugPort.value; + } + request.isDebug = isDebug; request.dumpPeriod = dumpPeriod; request.isPrivate = global.ypkIsPrivate; request.owner = global.sm2Key.publicKey; diff --git a/js/onlineide/rightmenu.js b/js/onlineide/rightmenu.js index af0d124..019791b 100644 --- a/js/onlineide/rightmenu.js +++ b/js/onlineide/rightmenu.js @@ -43,7 +43,7 @@ function startContract() { global.wssocket.send(JSON.stringify(request)); } -function startContractAsDebug() { +function startContractAsDebug(isDebug) { const key = pubkeyDialogVue.sm2KeyList[pubkeyDialogVue.selectedSM2Key]; const sm2Key = JSON.parse(key.sm2Key); const projectId = $("#selectedProject")[0].value; @@ -51,9 +51,28 @@ function startContractAsDebug() { startResult.innerText = "正在以调试模式启动合约:" + project; const request = {}; - request.action = "startContractAsDebug"; + request.action = "startContract"; request.isPrivate = $("#privateprojecttab").hasClass("active"); - + if (createParam.value !='') { + request.createParam = createParam.value; + $("#createParam").css("color",""); + if (autoConvertStr.value=='on') { + try{ + request.createParam = JSON.parse(request.createParam); + $("#createParam").css("color",""); + }catch(e){ + console.log(e); + $("#createParam").css("color","red"); + alert("Create Param not JSON Format"); + return; + } + }else{ + } + } + request.isDebug = isDebug; + if (remoteDebugPort.value !='') { + request.remoteDebugPort = remoteDebugPort.value; + } request.owner = sm2Key.publicKey; request.requestID = new Date().getTime() + ""; // request.contractid = $("#tabdiv")[0].value;