Compare commits
2 Commits
master
...
proj/zhizh
Author | SHA1 | Date | |
---|---|---|---|
|
8fefeb8b08 | ||
|
7482d0a1ae |
@ -2,7 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
<meta http-equiv="Cache-Control" content="no-cache"/>
|
||||||
<title>数瑞智能合约在线编辑器</title>
|
<title>智能合约在线编辑器</title>
|
||||||
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
||||||
<link href="./jqueryui1.12/jquery-ui.css" rel="stylesheet">
|
<link href="./jqueryui1.12/jquery-ui.css" rel="stylesheet">
|
||||||
<script src="./jqueryui1.12/jquery-ui.js"></script>
|
<script src="./jqueryui1.12/jquery-ui.js"></script>
|
||||||
@ -134,7 +134,7 @@
|
|||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<a class="navbar-brand" href="#"> <img alt="Brand"
|
<a class="navbar-brand" href="#"> <img alt="Brand"
|
||||||
src="./images/logo-1.png" style="height: 30px;">
|
src="./images/logo-1.png" style="height: 30px;">
|
||||||
</a> <span>数瑞智能合约在线编辑器</span><input id="uploadFileInput" type="file"
|
</a> <span>智能合约在线编辑器</span><input id="uploadFileInput" type="file"
|
||||||
name="file" multiple onchange="uploadFile()" style="display: none;">
|
name="file" multiple onchange="uploadFile()" style="display: none;">
|
||||||
</div>
|
</div>
|
||||||
<div class="nav navbar-right userName" data-toggle="modal"
|
<div class="nav navbar-right userName" data-toggle="modal"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
<meta http-equiv="Cache-Control" content="no-cache"/>
|
||||||
<title>数瑞智能合约节点管理中心</title>
|
<title>智能合约节点管理中心</title>
|
||||||
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
||||||
<script src="./js/popper.min.js"></script>
|
<script src="./js/popper.min.js"></script>
|
||||||
|
|
||||||
@ -67,7 +67,7 @@
|
|||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<a class="navbar-brand" href="#"> <img alt="Brand"
|
<a class="navbar-brand" href="#"> <img alt="Brand"
|
||||||
src="./images/logo-1.png" style="height: 30px">
|
src="./images/logo-1.png" style="height: 30px">
|
||||||
</a> <span>合约引擎管理中心</span>
|
</a> <span>智能合约节点管理中心</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav navbar-right userName" data-toggle="modal"
|
<div class="nav navbar-right userName" data-toggle="modal"
|
||||||
@ -230,29 +230,16 @@
|
|||||||
onchange="changeYpkName(this.value)">
|
onchange="changeYpkName(this.value)">
|
||||||
<option selected>请选择ypk文件</option>
|
<option selected>请选择ypk文件</option>
|
||||||
</select>
|
</select>
|
||||||
<input class="form-control" id="createParam"
|
|
||||||
placeholder="填写启动参数" class="modal_input"/>
|
|
||||||
<div class="input-group-text">
|
|
||||||
<input type="checkbox" id="autoConvertStr"
|
|
||||||
aria-label="Checkbox for convertParam"
|
|
||||||
data-toggle="tooltip"
|
|
||||||
checked
|
|
||||||
title="" data-original-title="自动将参数转为JSON对象"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<input class="form-control input-group-small"
|
|
||||||
id="remoteDebugPort"
|
|
||||||
placeholder="远程调试端口" class="modal_input"/>
|
|
||||||
|
|
||||||
<select id="selectDumpPeriod" class="custom-select"
|
<select id="selectDumpPeriod" class="custom-select"
|
||||||
style="appearance: none">
|
style="appearance: none">
|
||||||
<option selected>不保存</option>
|
|
||||||
<option>/12hours</option>
|
|
||||||
<option>/1day</option>
|
|
||||||
<option>/2days</option>
|
|
||||||
<option>状态保存模式</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
<option selected>不保存</option>
|
||||||
|
<option selected>/12hours自动保存</option>
|
||||||
|
<option selected>/1day自动保存</option>
|
||||||
|
<option selected>/2days自动保存</option>
|
||||||
|
<option selected>选择状态保存模式</option>
|
||||||
|
|
||||||
|
</select>
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button onclick="deleteYpk()"
|
<button onclick="deleteYpk()"
|
||||||
type="button" title="删除该合约ypk文件" data-toggle="tooltip"
|
type="button" title="删除该合约ypk文件" data-toggle="tooltip"
|
||||||
@ -263,15 +250,9 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button type="button" class="btn btn-outline-primary"
|
|
||||||
title="使用该ypk单点调试启动" data-toggle="tooltip"
|
|
||||||
onclick="startContractAtSlave(true)">
|
|
||||||
<img alt="Brand" src="./images/onlineide/debug.png"
|
|
||||||
class="buttonimg">
|
|
||||||
</button>
|
|
||||||
<button type="button" class="btn btn-outline-primary"
|
<button type="button" class="btn btn-outline-primary"
|
||||||
title="使用该ypk单点启动合约" data-toggle="tooltip"
|
title="使用该ypk单点启动合约" data-toggle="tooltip"
|
||||||
onclick="startContractAtSlave(false)">
|
onclick="startContractAtSlave()">
|
||||||
<img alt="Brand" src="./images/onlineide/start.png"
|
<img alt="Brand" src="./images/onlineide/start.png"
|
||||||
class="buttonimg">
|
class="buttonimg">
|
||||||
</button>
|
</button>
|
||||||
@ -299,10 +280,7 @@
|
|||||||
<option value="3">RARF</option>
|
<option value="3">RARF</option>
|
||||||
<option value="4">RARH</option>
|
<option value="4">RARH</option>
|
||||||
<option value="5">RARA</option>
|
<option value="5">RARA</option>
|
||||||
<option value="6">Sharding</option>
|
<option value="6">Shading</option>
|
||||||
<option value="7">SASharding</option>
|
|
||||||
<option value="8">PBFT</option>
|
|
||||||
<option value="9">RAFT</option>
|
|
||||||
</select>
|
</select>
|
||||||
<div class="btn-group mr-3" role="group"
|
<div class="btn-group mr-3" role="group"
|
||||||
style="margin-left: 2%">
|
style="margin-left: 2%">
|
||||||
@ -526,8 +504,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="text" class="form-control" placeholder="输入参数" id="arg">
|
<input type="text" class="form-control" placeholder="输入参数" id="arg">
|
||||||
<input type="text" class="form-control col-2" placeholder="输入gas"
|
<input type="text" class="form-control col-2" placeholder="输入gas" id="gasLimit">
|
||||||
id="gasLimit">
|
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<div class="input-group-text">
|
<div class="input-group-text">
|
||||||
<input type="checkbox" id="executeContractAsDebug"
|
<input type="checkbox" id="executeContractAsDebug"
|
||||||
@ -576,8 +553,7 @@
|
|||||||
<span class="input-group-text">参数</span>
|
<span class="input-group-text">参数</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="text" class="form-control" placeholder="输入参数"
|
<input type="text" class="form-control" placeholder="输入参数" id="maskArg">
|
||||||
id="maskArg">
|
|
||||||
|
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button onclick="getMask()" type="button"
|
<button onclick="getMask()" type="button"
|
||||||
@ -610,8 +586,7 @@
|
|||||||
<span class="input-group-text">参数</span>
|
<span class="input-group-text">参数</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="text" class="form-control" placeholder="输入参数"
|
<input type="text" class="form-control" placeholder="输入参数" id="mockArg">
|
||||||
id="mockArg">
|
|
||||||
|
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button onclick="getMock()" type="button"
|
<button onclick="getMock()" type="button"
|
||||||
@ -1056,9 +1031,9 @@
|
|||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"
|
<span class="input-group-text"
|
||||||
id="inputGroup-sizing-default">节点公钥</span>
|
id="inputGroup-sizing-default">PeerID</span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" id="nodePubKeyInput">
|
<input type="text" class="form-control" id="peerIDInput">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
@ -1075,6 +1050,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"
|
||||||
|
id="inputGroup-sizing-default">MasterAddr</span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" id="masterAddrInput">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<button class="btn btn-outline-secondary" type="button"
|
||||||
|
onclick="changeMasterAddress()">修改
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
<div class='input-group mb-3'>
|
<div class='input-group mb-3'>
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
@ -1090,22 +1079,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-center">
|
|
||||||
<div class='input-group mb-3'>
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"
|
|
||||||
id="inputGroup-sizing-default">加入网络WS</span>
|
|
||||||
</div>
|
|
||||||
<input type='text' class='form-control'
|
|
||||||
id='nodeCenterWSInput'>
|
|
||||||
<div class='input-group-append'>
|
|
||||||
<button class='btn btn-outline-secondary' type='button'
|
|
||||||
id='changeNodeCenterWS' onclick='changeNodeCenterWS()'>
|
|
||||||
修改
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
@ -1362,11 +1335,6 @@
|
|||||||
//initWSocket();
|
//initWSocket();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
<meta http-equiv="Cache-Control" content="no-cache"/>
|
||||||
<meta name="sharedArrayBuffer" description="using cross-origin-isolation in the web browser">
|
<title>数瑞智能合约在线编辑器</title>
|
||||||
<title>智能合约在线编辑器</title>
|
|
||||||
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
||||||
<link href="./jqueryui1.12/jquery-ui.css" rel="stylesheet">
|
<link href="./jqueryui1.12/jquery-ui.css" rel="stylesheet">
|
||||||
<script src="./jqueryui1.12/jquery-ui.js"></script>
|
<script src="./jqueryui1.12/jquery-ui.js"></script>
|
||||||
@ -36,6 +35,7 @@
|
|||||||
<!--script src="./js/echartsTheme.js"></script -->
|
<!--script src="./js/echartsTheme.js"></script -->
|
||||||
<!-- script src="./js/echarts-gl.min.js"></script -->
|
<!-- script src="./js/echarts-gl.min.js"></script -->
|
||||||
<script src="./js/sm2.js"></script>
|
<script src="./js/sm2.js"></script>
|
||||||
|
|
||||||
<script src="./js/d3.v5.min.js"></script>
|
<script src="./js/d3.v5.min.js"></script>
|
||||||
<!-- script src="./js/dagre-d3.min.js"></script -->
|
<!-- script src="./js/dagre-d3.min.js"></script -->
|
||||||
<script src="./js/tipsy/jquery.tipsy.min.js"></script>
|
<script src="./js/tipsy/jquery.tipsy.min.js"></script>
|
||||||
@ -64,7 +64,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.projectButton.ui-state-active {
|
.projectButton.ui-state-active {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,8 +78,8 @@
|
|||||||
|
|
||||||
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
|
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
|
||||||
color: white;
|
color: white;
|
||||||
background-color: #2E324C;
|
background-color: #304156;
|
||||||
border-color: #2E324C;
|
border-color: #304156;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-tabs {
|
.ui-tabs {
|
||||||
@ -95,14 +95,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ui-menu-item.ui-state-active:hover {
|
.ui-menu-item.ui-state-active:hover {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
border: 1px solid #999;
|
border: 1px solid #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active,
|
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active,
|
||||||
a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
|
a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
border: 1px solid #999;
|
border: 1px solid #999;
|
||||||
}
|
}
|
||||||
@ -116,7 +116,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.fileLine:hover {
|
.fileLine:hover {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@ -386,35 +386,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="input-group mb-1">
|
<div class="input-group mb-1">
|
||||||
<div class="btn-group btn-block" role="group">
|
<div class="btn-group btn-block" role="group">
|
||||||
<input class="form-control input-group-small"
|
|
||||||
id="createParam"
|
|
||||||
placeholder="启动参数" class="modal_input"/>
|
|
||||||
<div class="input-group-text">
|
|
||||||
<input type="checkbox" id="autoConvertStr"
|
|
||||||
aria-label="Checkbox for convertParam"
|
|
||||||
data-toggle="tooltip"
|
|
||||||
checked
|
|
||||||
title="" data-original-title="自动将参数转为JSON对象"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="input-group mb-1">
|
|
||||||
<div class="btn-group btn-block" role="group">
|
|
||||||
<input class="form-control input-group-small"
|
|
||||||
id="remoteDebugPort"
|
|
||||||
placeholder="调试端口" class="modal_input"/>
|
|
||||||
<button class="btn btn-outline-primary"
|
<button class="btn btn-outline-primary"
|
||||||
onclick="startContractAsDebug(true)" type="button" id="button-debug"
|
onclick="startContractAsDebug()" type="button" id="button-debug"
|
||||||
title="调试启动" data-toggle="tooltip">
|
title="调试" data-toggle="tooltip">
|
||||||
<img alt="Brand" src="./images/onlineide/debug.png"
|
<img alt="Brand" src="./images/onlineide/debug.png"
|
||||||
class="buttonimg">
|
class="buttonimg">
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-outline-primary"
|
|
||||||
onclick="startContractAsDebug(false)" type="button" id="button-start"
|
|
||||||
title="启动" data-toggle="tooltip">
|
|
||||||
<img alt="Brand" src="./images/onlineide/start.png"
|
|
||||||
class="buttonimg">
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group mt-1 mb-3">
|
<div class="input-group mt-1 mb-3">
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.projectButton.ui-state-active {
|
.projectButton.ui-state-active {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,8 +72,8 @@
|
|||||||
|
|
||||||
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
|
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
|
||||||
color: white;
|
color: white;
|
||||||
background-color: #2E324C;
|
background-color: #304156;
|
||||||
border-color: #2E324C;
|
border-color: #304156;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-tabs {
|
.ui-tabs {
|
||||||
@ -89,14 +89,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ui-menu-item.ui-state-active:hover {
|
.ui-menu-item.ui-state-active:hover {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
border: 1px solid #999;
|
border: 1px solid #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active,
|
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active,
|
||||||
a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
|
a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
border: 1px solid #999;
|
border: 1px solid #999;
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.fileLine:hover {
|
.fileLine:hover {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
2
css/bootstrap.min.css
vendored
@ -9,7 +9,7 @@
|
|||||||
border: 1px solid rgba(0, 0, 0, .125);
|
border: 1px solid rgba(0, 0, 0, .125);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background: white;
|
background: white;
|
||||||
color: #2E324C;
|
color: #304156;
|
||||||
}
|
}
|
||||||
|
|
||||||
.userName:hover {
|
.userName:hover {
|
||||||
@ -22,17 +22,17 @@
|
|||||||
#horiNav {
|
#horiNav {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
border: 1px solid rgba(0, 0, 0, .05);
|
border: 1px solid rgba(0, 0, 0, .05);
|
||||||
background: #f8f9fa;
|
background: #e9f6ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#outputNav {
|
#outputNav {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
border: 1px solid rgba(0, 0, 0, .05);
|
border: 1px solid rgba(0, 0, 0, .05);
|
||||||
background: #f8f9fa;
|
background: #e9f6ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
div .card {
|
div .card {
|
||||||
background: #f8f9fa;
|
background: #e9f6ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#main {
|
#main {
|
||||||
@ -85,16 +85,16 @@ div .card {
|
|||||||
|
|
||||||
.projectLine.collapsed {
|
.projectLine.collapsed {
|
||||||
background: #D5D6DB;
|
background: #D5D6DB;
|
||||||
color: #2E324C;
|
color: #304156;
|
||||||
}
|
}
|
||||||
|
|
||||||
.projectLine {
|
.projectLine {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.projectLine.collapsed:hover {
|
.projectLine.collapsed:hover {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ div .card {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.headerFooter {
|
.headerFooter {
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 25 KiB |
BIN
images/logo-1.png
Executable file → Normal file
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 37 KiB |
BIN
images/logo.png
Executable file → Normal file
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 118 KiB |
@ -85,7 +85,7 @@
|
|||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
width: 28%;
|
width: 28%;
|
||||||
cursor: hand;
|
cursor: hand;
|
||||||
background: #2E324C;
|
background: #304156;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
<body style="background: #2E324C; color: white;">
|
<body style="background: #304156; color: white;">
|
||||||
<div
|
<div
|
||||||
style="width: 90%; max-width: 1000px; min-width: 850px; margin: 0 auto; margin-top: 3%;">
|
style="width: 90%; max-width: 1000px; min-width: 850px; margin: 0 auto; margin-top: 3%;">
|
||||||
<div style="width: 20%; float: right; margin-right: 0%">
|
<div style="width: 20%; float: right; margin-right: 0%">
|
||||||
|
@ -1,314 +0,0 @@
|
|||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
||||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
|
||||||
<title>数瑞数联网系统</title>
|
|
||||||
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
|
||||||
<script src="./js/createWS.js"></script>
|
|
||||||
<script src="./js/cryptico.js"></script>
|
|
||||||
<script src="./js/bootstrap.min.js"></script>
|
|
||||||
<script src="./js/commonutil.js"></script>
|
|
||||||
<script src="./js/vue.js"></script>
|
|
||||||
<script src="./client/js/bdwareclient.js"></script>
|
|
||||||
<script src="./js/sm2.js"></script>
|
|
||||||
<link href="./css/common.css" rel="stylesheet">
|
|
||||||
<link href="./css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
</head>
|
|
||||||
<body style="background: #2E324C; color: white;">
|
|
||||||
|
|
||||||
<div class="modal fade" id="pubkeyDialog" data-backdrop="static">
|
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title" id="exampleModalLongTitle" style="color:black;">用户信息</h5>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
|
||||||
<div class="input-group mb-3">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<label class="input-group-text" for="localKeyList">本地密钥</label>
|
|
||||||
</div>
|
|
||||||
<select class="custom-select"
|
|
||||||
aria-label="Example select with button addon"
|
|
||||||
style="appearance: none" v-model="selectedSM2Key"
|
|
||||||
@change="changeSM2Key($event)">
|
|
||||||
<option v-for="(item,index) in sm2KeyList" :key="index"
|
|
||||||
:value='item.id'>{{item.title}}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<div class="input-group-append">
|
|
||||||
<button class="btn btn-outline-primary" for="localKeyList"
|
|
||||||
v-on:click="exportPubkey">导出密钥
|
|
||||||
</button>
|
|
||||||
|
|
||||||
|
|
||||||
<button type="button" class="btn btn-outline-primary"
|
|
||||||
id="generatePubkeyBtn" v-on:click="generatePubkey">生成新密钥
|
|
||||||
</button>
|
|
||||||
|
|
||||||
|
|
||||||
<button class="btn btn-outline-danger" for="localKeyList"
|
|
||||||
v-on:click="deletePubkey">删除密钥
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<textarea class="form-control mb-3" title="复制密钥,并妥善保存"
|
|
||||||
id="sm2KeyTextarea" v-model="sm2KeyStr"
|
|
||||||
style="width: 100%; min-height: 150px; resize:none" rows="" cols="">
|
|
||||||
</textarea>
|
|
||||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
|
||||||
<div class="input-group mb-1">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<label class="input-group-text" for="localKeyList">以上为当前SM2密钥,请复制或导出密钥,并妥善保存</label>
|
|
||||||
</div>
|
|
||||||
<div class="input-group-append">
|
|
||||||
<button type="button" class="btn btn-primary"
|
|
||||||
data-dismiss="modal" id="importPubkeyBtn"
|
|
||||||
v-on:click="importPubkey">确认
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div style="width: 90%; height:10px; max-width: 1000px; min-width: 850px; margin: 3% auto 0px;">
|
|
||||||
<header class="" style="float:right">
|
|
||||||
<div class=" nav navbar-right userName" data-toggle="modal" id="user"
|
|
||||||
data-target="#pubkeyDialog">当前用户: {{shortName}}
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.halfDiv {
|
|
||||||
float: left;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.projectTreeDiv {
|
|
||||||
height: auto;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halfDivRight {
|
|
||||||
float: left;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-tabs {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-accordion .ui-accordion-content {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tabs-1 {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-tabs .ui-tabs-panel {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.context-menu-root {
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
#projectDiv {
|
|
||||||
height: 83%;
|
|
||||||
width: 20%;
|
|
||||||
border: 0px solid grey;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.CodeMirror {
|
|
||||||
height: auto
|
|
||||||
}
|
|
||||||
|
|
||||||
.logoimg {
|
|
||||||
width: auto;
|
|
||||||
height: auto;
|
|
||||||
max-width: 100%;
|
|
||||||
max-height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
height: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sendTransInput {
|
|
||||||
background-color: #f0e4e4;
|
|
||||||
border-radius: 5px;
|
|
||||||
margin: 5px;
|
|
||||||
width: 15%;
|
|
||||||
margin-left: 4%;
|
|
||||||
border: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.normalDiv {
|
|
||||||
float: left;
|
|
||||||
text-align: center;
|
|
||||||
border-radius: 5px;
|
|
||||||
margin: 2%;
|
|
||||||
padding: 5px;
|
|
||||||
padding-top: 30px;
|
|
||||||
padding-bottom: 30px;
|
|
||||||
width: 29%;
|
|
||||||
cursor: hand;
|
|
||||||
background: #2E324C;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconimg {
|
|
||||||
width: auto;
|
|
||||||
height: auto;
|
|
||||||
max-width: 48px;
|
|
||||||
max-height: 48px;
|
|
||||||
vertical-align: middle;
|
|
||||||
filter: invert(100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
|
||||||
<div id="main" style="background: #2E324C; color: white;">
|
|
||||||
<input id="urlInput" style="display:none"/>
|
|
||||||
<input id="selectContract" style="display:none"/>
|
|
||||||
<div
|
|
||||||
style="width: 90%; max-width: 1000px; min-width: 850px; margin: 0 auto; margin-top: 3%;">
|
|
||||||
<div style="width: 20%; float: right; margin-right: 0%">
|
|
||||||
<img src="./images/logo.png" class="logoimg"></img>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style="width: fit-content; margin: 0; font-size: 200%; background-color: white; color: black; border-radius: 10px; float: left; padding: 10px;">
|
|
||||||
导航
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style="width: 100%; margin-top: 2%; float: left; background-color: white; border-radius: 10px;">
|
|
||||||
<div class="normalDiv" onclick="jumpTo('./DOIP/GlobalRouter/assets/#')">
|
|
||||||
<img src="./images/datanet/identifier.png" class="iconimg"></img><br/>
|
|
||||||
<span style="vertical-align: middle">标识解析系统</span>
|
|
||||||
</div>
|
|
||||||
<div class="normalDiv" onclick="jumpTo('./DOIP/Registry/assets/#')">
|
|
||||||
<img src="./images/datanet/search.png" class="iconimg"></img><br/>
|
|
||||||
<span style="vertical-align: middle">数字对象注册表</span>
|
|
||||||
</div>
|
|
||||||
<div class="normalDiv"
|
|
||||||
onclick="jumpTo('./client/bdwareclient.html?self=true&contract=RepositoryExample')">
|
|
||||||
<img src="./images/datanet/repo.png" class="iconimg"></img><br/>
|
|
||||||
<span style="vertical-align: middle">数字对象仓库</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<br/>
|
|
||||||
<div style="width: fit-content; margin-top: 2%; float: right; border-radius: 10px; font-size: 50%">
|
|
||||||
Icons made by
|
|
||||||
<a href="https://www.flaticon.com/authors/monkik"
|
|
||||||
title="monkik" style="color: white;">monkik</a>
|
|
||||||
from
|
|
||||||
<a href="https://www.flaticon.com/" title="Flaticon"
|
|
||||||
style="color: white;">www.flaticon.com</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
jumpTo = function (addr) {
|
|
||||||
document.location.href = addr;
|
|
||||||
};
|
|
||||||
const isBaaS = false
|
|
||||||
const h = document.body.clientHeight
|
|
||||||
- $("header").css("height").replace("px", "")
|
|
||||||
$("#main").css("height", h + "px");
|
|
||||||
function init() {
|
|
||||||
const urlParams = getRequestParameters();
|
|
||||||
initVue();
|
|
||||||
initGlobal(urlParams);
|
|
||||||
|
|
||||||
if (global.urlparam["noRender"] === "true") {
|
|
||||||
switchRenderBtn.innerHTML = "加载界面";
|
|
||||||
}
|
|
||||||
global.cbs = {};
|
|
||||||
|
|
||||||
const urlInput = $("#urlInput");
|
|
||||||
if (global.urlparam["self"] === "true") {
|
|
||||||
if (document.location.href.startsWith("http")) {
|
|
||||||
let path = document.location.origin + document.location.pathname;
|
|
||||||
path = path.replace("/client/bdwareclient.html", "");
|
|
||||||
urlInput[0].value = path.replace("http",
|
|
||||||
"ws");
|
|
||||||
if (global.urlparam["withNodeCenterWS"] === "true") {
|
|
||||||
urlInput[0].value += "/NodeCenterWS";
|
|
||||||
}
|
|
||||||
connectNode();
|
|
||||||
}
|
|
||||||
} else if (global.urlparam["nodeAddr"]) {
|
|
||||||
urlInput[0].value = global.urlparam["nodeAddr"];
|
|
||||||
connectNode();
|
|
||||||
} else {
|
|
||||||
const lastNode = localStorage.getItem("lastNode");
|
|
||||||
if (lastNode) {
|
|
||||||
urlInput[0].value = lastNode;
|
|
||||||
connectNode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
init();
|
|
||||||
$(document).ready(function(){
|
|
||||||
if(localStorage.getItem("PrivKeyList") == null || localStorage.getItem("agent") == null){
|
|
||||||
$('#pubkeyDialog').modal();
|
|
||||||
}else{
|
|
||||||
var div = document.getElementById("user");
|
|
||||||
// div.setAttribute("style","display:none");
|
|
||||||
}
|
|
||||||
})
|
|
||||||
$('#pubkeyDialog').on('hide.bs.modal', function () {
|
|
||||||
var div = document.getElementById("user");
|
|
||||||
var lst = JSON.parse(localStorage.getItem("PrivKeyList"));
|
|
||||||
lst.pop();
|
|
||||||
localStorage.setItem("PrivKeyList",JSON.stringify(lst));
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
<!--
|
|
||||||
============ NodeCenter的一些链接:其中39.106.6.6监听的是1817端口。 查看节点是否启动
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=ping 查看NodeCenter当前连接的节点
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=listCMInfo
|
|
||||||
|
|
||||||
刷新NodeCenter已连接节点的合约数据
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=updateContract
|
|
||||||
|
|
||||||
检查节点是否已连接,删除断开连接的节点
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=checkAlive
|
|
||||||
|
|
||||||
获取某个合约的日志数量
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=getLogSize&contractID=BDCoin
|
|
||||||
|
|
||||||
获取某个合约的日志,从第offset条,取count条
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=requestLog&contractID=BDCoin&offset=16&count=10
|
|
||||||
|
|
||||||
获取某个合约的日志,取最新的count条
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=requestLastLog&contractID=BDCoin&count=10
|
|
||||||
-->
|
|
1333
index_gate.html
@ -1,165 +0,0 @@
|
|||||||
<html>
|
|
||||||
<header>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
||||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
|
||||||
<title>北大数瑞数联网网关</title>
|
|
||||||
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.halfDiv {
|
|
||||||
float: left;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.projectTreeDiv {
|
|
||||||
height: auto;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halfDivRight {
|
|
||||||
float: left;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-tabs {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-accordion .ui-accordion-content {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tabs-1 {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-tabs .ui-tabs-panel {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.context-menu-root {
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
#projectDiv {
|
|
||||||
height: 83%;
|
|
||||||
width: 20%;
|
|
||||||
border: 0px solid grey;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.CodeMirror {
|
|
||||||
height: auto
|
|
||||||
}
|
|
||||||
|
|
||||||
.logoimg {
|
|
||||||
width: auto;
|
|
||||||
height: auto;
|
|
||||||
max-width: 100%;
|
|
||||||
max-height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
height: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sendTransInput {
|
|
||||||
background-color: #f0e4e4;
|
|
||||||
border-radius: 5px;
|
|
||||||
margin: 5px;
|
|
||||||
width: 15%;
|
|
||||||
margin-left: 4%;
|
|
||||||
border: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.normalDiv {
|
|
||||||
float: left;
|
|
||||||
text-align: center;
|
|
||||||
border-radius: 5px;
|
|
||||||
margin: 2%;
|
|
||||||
padding: 5px;
|
|
||||||
padding-top: 30px;
|
|
||||||
padding-bottom: 30px;
|
|
||||||
width: 45%;
|
|
||||||
cursor: hand;
|
|
||||||
background: #2E324C;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconimg {
|
|
||||||
width: auto;
|
|
||||||
height: auto;
|
|
||||||
max-width: 48px;
|
|
||||||
max-height: 48px;
|
|
||||||
vertical-align: middle;
|
|
||||||
filter: invert(100%);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
<body style="background: #2E324C; color: white;">
|
|
||||||
<div
|
|
||||||
style="width: 90%; max-width: 1000px; min-width: 850px; margin: 0 auto; margin-top: 3%;">
|
|
||||||
<div style="width: 20%; float: right; margin-right: 0%">
|
|
||||||
<img src="./images/logo.png" class="logoimg"></img>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style="width: fit-content; margin: 0; font-size: 200%; background-color: white; color: black; border-radius: 10px; float: left; padding: 10px;">
|
|
||||||
导航
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
style="width: 100%; margin-top: 2%; float: left; background-color: white; border-radius: 10px;">
|
|
||||||
|
|
||||||
<div class="normalDiv" onclick="jumpTo('./OnlineIDE.html')">
|
|
||||||
<img src="./images/index/web.png" class="iconimg"></img><br/>
|
|
||||||
<span style="vertical-align: middle">网关接入管理</span>
|
|
||||||
</div>
|
|
||||||
<div class="normalDiv" onclick="jumpTo('./NodePortal_Gateway.html')">
|
|
||||||
<img src="./images/index/analysis.png" class="iconimg"></img><br/>
|
|
||||||
<span style="vertical-align: middle">网关配置管理</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
jumpTo = function (addr) {
|
|
||||||
document.location.href = addr;
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
<div style="width: fit-content; margin-top: 2%; float: right; border-radius: 10px; font-size: 50%">
|
|
||||||
Icons made by
|
|
||||||
<a href="https://www.flaticon.com/authors/monkik"
|
|
||||||
title="monkik" style="color: white;">monkik</a>
|
|
||||||
from
|
|
||||||
<a href="https://www.flaticon.com/" title="Flaticon"
|
|
||||||
style="color: white;">www.flaticon.com</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
<!--
|
|
||||||
============ NodeCenter的一些链接:其中39.106.6.6监听的是1817端口。 查看节点是否启动
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=ping 查看NodeCenter当前连接的节点
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=listCMInfo
|
|
||||||
|
|
||||||
刷新NodeCenter已连接节点的合约数据
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=updateContract
|
|
||||||
|
|
||||||
检查节点是否已连接,删除断开连接的节点
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=checkAlive
|
|
||||||
|
|
||||||
获取某个合约的日志数量
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=getLogSize&contractID=BDCoin
|
|
||||||
|
|
||||||
获取某个合约的日志,从第offset条,取count条
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=requestLog&contractID=BDCoin&offset=16&count=10
|
|
||||||
|
|
||||||
获取某个合约的日志,取最新的count条
|
|
||||||
http://39.106.6.6:18001/SCIDE/NodeCenter?action=requestLastLog&contractID=BDCoin&count=10
|
|
||||||
-->
|
|
BIN
jqueryui1.12/.index.html.swp
Executable file
9214
jqueryui1.12/jquery-2.1.4.js
vendored
Normal file → Executable file
@ -10,12 +10,11 @@ function loadNodeConfig(event) {
|
|||||||
|
|
||||||
function onLoadNodeConfig(data) {
|
function onLoadNodeConfig(data) {
|
||||||
global.config = data.data;
|
global.config = data.data;
|
||||||
showNodeConfig(data);
|
|
||||||
if (!global.centerportalws) {
|
if (!global.centerportalws) {
|
||||||
let url = global.config.nodeCenterWS;
|
let port = global.config.nodeCenter.replace(/.*:/g, "");
|
||||||
if (window.location.origin.startsWith("https")){
|
const len = global.config.nodeCenter.length - port.length;
|
||||||
url = url.replace("ws://","wss://");
|
port = port - 1;
|
||||||
}
|
let url = global.config.nodeCenter.substring(0, len) + port + "/NodeCenterWS";
|
||||||
if (window.location.origin === "https://contract.internetapi.cn") {
|
if (window.location.origin === "https://contract.internetapi.cn") {
|
||||||
url = "wss://cluster.contract.internetapi.cn/NodeCenterWS";
|
url = "wss://cluster.contract.internetapi.cn/NodeCenterWS";
|
||||||
}
|
}
|
||||||
@ -29,7 +28,7 @@ function onLoadNodeConfig(data) {
|
|||||||
}));
|
}));
|
||||||
}, centerportalWSHandler);
|
}, centerportalWSHandler);
|
||||||
}
|
}
|
||||||
|
showNodeConfig(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showNodeConfig(data) {
|
function showNodeConfig(data) {
|
||||||
@ -39,12 +38,12 @@ function showNodeConfig(data) {
|
|||||||
$("#nodeNameInput")[0].value = global.config.nodeName;
|
$("#nodeNameInput")[0].value = global.config.nodeName;
|
||||||
$("#ipPortInput")[0].value = global.config.ipPort;
|
$("#ipPortInput")[0].value = global.config.ipPort;
|
||||||
$("#doipConfigInput")[0].value = global.config.doipConfig;
|
$("#doipConfigInput")[0].value = global.config.doipConfig;
|
||||||
|
$("#masterAddrInput")[0].value = global.config.masterAddress;
|
||||||
|
$("#peerIDInput")[0].value = global.config.peerID;
|
||||||
$("#licence")[0].value = global.config.licence
|
$("#licence")[0].value = global.config.licence
|
||||||
$("#expireTime").html(global.config.expireTime);
|
$("#expireTime").html(global.config.expireTime);
|
||||||
$("#yjsInput")[0].value = global.config.yjsPath;
|
$("#yjsInput")[0].value = global.config.yjsPath;
|
||||||
$("#nodePubKeyInput")[0].value = global.config.nodePubKey;
|
|
||||||
nodeCenterInputEl[0].value = global.config.nodeCenter;
|
nodeCenterInputEl[0].value = global.config.nodeCenter;
|
||||||
$("#nodeCenterWSInput")[0].value = global.config.nodeCenterWS;
|
|
||||||
if (global.config.clusterConnected && global.config.clusterConnected === "true") {
|
if (global.config.clusterConnected && global.config.clusterConnected === "true") {
|
||||||
nodeCenterInputEl.css("color", "green");
|
nodeCenterInputEl.css("color", "green");
|
||||||
} else {
|
} else {
|
||||||
@ -115,6 +114,14 @@ function changeDOIPConfig(event) {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeMasterAddress(event) {
|
||||||
|
global.wssocket.send(JSON.stringify({
|
||||||
|
action: 'updateConfig',
|
||||||
|
key: 'masterAddress',
|
||||||
|
val: $("#masterAddrInput")[0].value
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
function onChangeNodeName(data) {
|
function onChangeNodeName(data) {
|
||||||
console.log("onChangeNodeName", data);
|
console.log("onChangeNodeName", data);
|
||||||
//$("#nodeNameInput")[0].value = data;
|
//$("#nodeNameInput")[0].value = data;
|
||||||
@ -160,14 +167,6 @@ function changeNodeCenter(event) {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeNodeCenterWS(event) {
|
|
||||||
console.log("changeNodeCenterWS");
|
|
||||||
global.wssocket.send(JSON.stringify({
|
|
||||||
action: 'changeNodeCenterWS',
|
|
||||||
data: $("#nodeCenterWSInput")[0].value
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
function onChangeNodeCenter(event) {
|
function onChangeNodeCenter(event) {
|
||||||
// console.log("onChangeNodeCenter", data);
|
// console.log("onChangeNodeCenter", data);
|
||||||
myToast("成功", "修改NodeCenter成功")
|
myToast("成功", "修改NodeCenter成功")
|
||||||
@ -263,7 +262,7 @@ function showNodeTrustUnits(obj) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
let html = "<table class='table display row-border' id='trustNodesUnitTabDivTab'>" +
|
let html = "<table class='table display row-border' id='trustNodesUnitTabDivTab'>" +
|
||||||
"<thead><tr><th>序号</th><th>ID</th><th>类型</th><th>创建者</th><th>节点数目</th><th>节点列表</th></tr></thead>" +
|
"<thead><tr><th>序号</th><th>ID</th><th>类型</th><th>创建者</th><th>节点数目</th><th>节点公钥</th></tr></thead>" +
|
||||||
"<tbody>";
|
"<tbody>";
|
||||||
const tableTail = "</tbody></table>";
|
const tableTail = "</tbody></table>";
|
||||||
if (global.nodeUnits) {
|
if (global.nodeUnits) {
|
||||||
@ -276,13 +275,13 @@ function showNodeTrustUnits(obj) {
|
|||||||
<td>TCP</td>
|
<td>TCP</td>
|
||||||
<td>${global.nodeUnits[i].key.substring(0, at_ - 1)}</td>
|
<td>${global.nodeUnits[i].key.substring(0, at_ - 1)}</td>
|
||||||
<td>${nodes.length}</td>
|
<td>${nodes.length}</td>
|
||||||
<td>${nodes.map(x => x.nodeName).sort().join(',')}</td>
|
<td>${JSON.stringify(nodes)}</td>
|
||||||
</tr>`
|
</tr>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (global.p2pNodes) {
|
if (global.p2pNodes) {
|
||||||
html += "<tr><td>" + (i + 1) + "</td> <td>P2PUnit</td><td>P2P</td> <td>bdledger</td> <td>" + global.p2pNodes.length + "</td> <td>" + JSON.stringify(global.p2pNodes) + "</td> </tr>";
|
html += "<tr><td>" + (i+1) + "</td> <td>P2PUnit</td><td>P2P</td> <td>bdledger</td> <td>" + global.p2pNodes.length + "</td> <td>" + JSON.stringify(global.p2pNodes) + "</td> </tr>";
|
||||||
}
|
}
|
||||||
html += tableTail;
|
html += tableTail;
|
||||||
$("#trustNodesUnitTabDiv").html(html);
|
$("#trustNodesUnitTabDiv").html(html);
|
||||||
$("#trustNodesUnitTabDivTab").DataTable({
|
$("#trustNodesUnitTabDivTab").DataTable({
|
||||||
|
@ -102,6 +102,8 @@ function drawConInfoTable(table) {
|
|||||||
<th>状态</th>
|
<th>状态</th>
|
||||||
<th>端口</th>
|
<th>端口</th>
|
||||||
<th>类型</th>
|
<th>类型</th>
|
||||||
|
<th>通讯</th>
|
||||||
|
<th>共识</th>
|
||||||
<!--<th>返回方式</th>-->
|
<!--<th>返回方式</th>-->
|
||||||
<th>次数</th>
|
<th>次数</th>
|
||||||
<th>流量</th>
|
<th>流量</th>
|
||||||
@ -123,20 +125,19 @@ ${table[i].name}
|
|||||||
<td>${table[i]['contractStatus']}</td>
|
<td>${table[i]['contractStatus']}</td>
|
||||||
<td>${table[i].port || '-'}</td>
|
<td>${table[i].port || '-'}</td>
|
||||||
<td>${table[i].type}</td>
|
<td>${table[i].type}</td>
|
||||||
<!--<td>${table[i]['networkType'] ? "P2P" : "TCP"}</td>-->
|
<td>${table[i]['networkType'] ? "P2P" : "TCP"}</td>
|
||||||
<!--<td>${table[i]['consensusType'] ? CONSENSUS_TABLE[table[i]['consensusType']] : '无'}</td>-->
|
<td>${table[i]['consensusType'] ? CONSENSUS_TABLE[table[i]['consensusType']] : '无'}</td>
|
||||||
<!--<td>${table[i].responseType ? RESPONSE_TYPE_TABLE[table[i].responseType] : '-'}</td>-->
|
<!--<td>${table[i].responseType ? RESPONSE_TYPE_TABLE[table[i].responseType] : '-'}</td>-->
|
||||||
<td>${table[i].times}</td>
|
<td>${table[i].times}</td>
|
||||||
<td>${table[i]['traffic'] || '-'}</td>
|
<td>${table[i]['traffic'] || '-'}</td>
|
||||||
<td>${table[i].storage || '-'}</td>
|
<td>${table[i].storage || '-'}</td>
|
||||||
<td style='padding:2px 12px 2px 12px'>
|
<td style='padding:2px 12px 2px 12px'>
|
||||||
<button onclick="stopContractByID('${table[i].id}')" class="btn btn-secondary">停止</button>
|
<button onclick="stopContractByID('${table[i].id}')" class="btn btn-secondary">停止</button>
|
||||||
<button onclick="restartContractByID('${table[i].id}')" class="btn btn-secondary">重启</button>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>`
|
</tr>`
|
||||||
}
|
}
|
||||||
html += tableTail;
|
html += tableTail;
|
||||||
html = "<h5 class='card-title'>合约实例列表</h5>" + "<button onclick='pruneKilledContract()' class='btn btn-secondary' style='float:right'>清除已停合约</button>"+html;
|
html = "<h5 class='card-title'>合约实例列表</h5>" + html;
|
||||||
ciTabDiv.html(html);
|
ciTabDiv.html(html);
|
||||||
|
|
||||||
$("#ciTabDivTab").DataTable(
|
$("#ciTabDivTab").DataTable(
|
||||||
@ -183,29 +184,6 @@ function stopContractByID(contractID) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function pruneKilledContract() {
|
|
||||||
$("#dialogBodyDiv").html("是否清除已停合约" );
|
|
||||||
showDialog("请确认", function () {
|
|
||||||
global.wssocket.send(JSON.stringify({
|
|
||||||
action: 'pruneKilledContract',
|
|
||||||
requestID: new Date().getTime().toString()
|
|
||||||
}));
|
|
||||||
setTimeout(listContractProcess,1000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function restartContractByID(contractID) {
|
|
||||||
$("#dialogBodyDiv").html("是否重启合约,ContractID:" + contractID);
|
|
||||||
showDialog("请确认", function () {
|
|
||||||
global.wssocket.send(JSON.stringify({
|
|
||||||
action: 'restartContractProcess',
|
|
||||||
requestID: new Date().getTime().toString(),
|
|
||||||
id: contractID
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function drawContractInstanceStatusPie(table) {
|
function drawContractInstanceStatusPie(table) {
|
||||||
const ciStatusPieDiv = $("#ciStatusPieDiv")
|
const ciStatusPieDiv = $("#ciStatusPieDiv")
|
||||||
if (ciStatusPieDiv.css("height") === "0px") {
|
if (ciStatusPieDiv.css("height") === "0px") {
|
||||||
@ -420,14 +398,14 @@ function executeContract() {
|
|||||||
request.pubkey = global.sm2Key.publicKey;
|
request.pubkey = global.sm2Key.publicKey;
|
||||||
request.isDebug = executeContractAsDebug.checked;
|
request.isDebug = executeContractAsDebug.checked;
|
||||||
console.log(request.arg);
|
console.log(request.arg);
|
||||||
const gasLimit = $('#gasLimit').val() / 1;
|
const gasLimit = $('#gasLimit').val()/1;
|
||||||
var toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + request.arg;
|
+ request.operation + "|" + arg ;
|
||||||
if (gasLimit > 0) {
|
if (gasLimit>0){
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign += "|" + gasLimit;
|
toSign+= "|" + gasLimit;
|
||||||
}
|
}
|
||||||
toSign += "|" + global.sm2Key.publicKey;
|
toSign+= "|" + global.sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
global.sm2Key.privateKey,
|
global.sm2Key.privateKey,
|
||||||
@ -453,9 +431,9 @@ function onExecuteResult(obj) {
|
|||||||
$("#responseArea")[0].value = result.result;
|
$("#responseArea")[0].value = result.result;
|
||||||
}
|
}
|
||||||
$("#responseID").html(`请求ID:${obj['responseID']}`);
|
$("#responseID").html(`请求ID:${obj['responseID']}`);
|
||||||
var gasInfo = "";
|
var gasInfo="";
|
||||||
if (obj.executionGas != undefined && obj.executionGas > 0)
|
if (obj.executionGas!=undefined && obj.executionGas>0)
|
||||||
gasInfo = "<br>" + obj.executionGas + "gas";
|
gasInfo="<br>"+obj.executionGas+"gas";
|
||||||
$("#responseTime").html(`响应时间:${obj['executeTime']}ms${gasInfo}${styleTail}`);
|
$("#responseTime").html(`响应时间:${obj['executeTime']}ms${gasInfo}${styleTail}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
$("#responseStatus").html("执行状态:Failed");
|
$("#responseStatus").html("执行状态:Failed");
|
||||||
@ -483,12 +461,12 @@ function getMask() {
|
|||||||
console.log(request.arg);
|
console.log(request.arg);
|
||||||
//const gasLimit = $('#gasLimit').val()/1;
|
//const gasLimit = $('#gasLimit').val()/1;
|
||||||
var toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg;
|
+ request.operation + "|" + arg ;
|
||||||
/*if (gasLimit>0){
|
/*if (gasLimit>0){
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign+= "|" + gasLimit;
|
toSign+= "|" + gasLimit;
|
||||||
}*/
|
}*/
|
||||||
toSign += "|" + global.sm2Key.publicKey;
|
toSign+= "|" + global.sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
global.sm2Key.privateKey,
|
global.sm2Key.privateKey,
|
||||||
@ -496,7 +474,6 @@ function getMask() {
|
|||||||
localStorage.setItem("persisArg", JSON.stringify(request));
|
localStorage.setItem("persisArg", JSON.stringify(request));
|
||||||
global.wssocket.send(JSON.stringify(request));
|
global.wssocket.send(JSON.stringify(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
function setMask() {
|
function setMask() {
|
||||||
const argDiv = $('#maskArg')[0];
|
const argDiv = $('#maskArg')[0];
|
||||||
const request = {};
|
const request = {};
|
||||||
@ -515,12 +492,12 @@ function setMask() {
|
|||||||
console.log(request.arg);
|
console.log(request.arg);
|
||||||
//const gasLimit = $('#gasLimit').val()/1;
|
//const gasLimit = $('#gasLimit').val()/1;
|
||||||
var toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg;
|
+ request.operation + "|" + arg ;
|
||||||
/*if (gasLimit>0){
|
/*if (gasLimit>0){
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign+= "|" + gasLimit;
|
toSign+= "|" + gasLimit;
|
||||||
}*/
|
}*/
|
||||||
toSign += "|" + global.sm2Key.publicKey;
|
toSign+= "|" + global.sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
global.sm2Key.privateKey,
|
global.sm2Key.privateKey,
|
||||||
@ -558,12 +535,12 @@ function getMock() {
|
|||||||
console.log(request.arg);
|
console.log(request.arg);
|
||||||
//const gasLimit = $('#gasLimit').val()/1;
|
//const gasLimit = $('#gasLimit').val()/1;
|
||||||
var toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg;
|
+ request.operation + "|" + arg ;
|
||||||
/*if (gasLimit>0){
|
/*if (gasLimit>0){
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign+= "|" + gasLimit;
|
toSign+= "|" + gasLimit;
|
||||||
}*/
|
}*/
|
||||||
toSign += "|" + global.sm2Key.publicKey;
|
toSign+= "|" + global.sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
global.sm2Key.privateKey,
|
global.sm2Key.privateKey,
|
||||||
@ -590,12 +567,12 @@ function setMock() {
|
|||||||
console.log(request.arg);
|
console.log(request.arg);
|
||||||
//const gasLimit = $('#gasLimit').val()/1;
|
//const gasLimit = $('#gasLimit').val()/1;
|
||||||
var toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg;
|
+ request.operation + "|" + arg ;
|
||||||
/*if (gasLimit>0){
|
/*if (gasLimit>0){
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign+= "|" + gasLimit;
|
toSign+= "|" + gasLimit;
|
||||||
}*/
|
}*/
|
||||||
toSign += "|" + global.sm2Key.publicKey;
|
toSign+= "|" + global.sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
global.sm2Key.privateKey,
|
global.sm2Key.privateKey,
|
||||||
|
@ -274,7 +274,7 @@ function getControlWsUrl(host) {
|
|||||||
}
|
}
|
||||||
path += "SCExecutor";
|
path += "SCExecutor";
|
||||||
if (isBaaS) {
|
if (isBaaS) {
|
||||||
path = "/SCIDE/SCExecutor"
|
path = path.replace("ide/", "")
|
||||||
}
|
}
|
||||||
return prefix + host + path;
|
return prefix + host + path;
|
||||||
}
|
}
|
||||||
@ -316,8 +316,8 @@ function onNodeLogin(data) {
|
|||||||
console.log("onNodeLogin");
|
console.log("onNodeLogin");
|
||||||
pubkeyDialogVue.myRole = data.data;
|
pubkeyDialogVue.myRole = data.data;
|
||||||
global.myRole = data.data;
|
global.myRole = data.data;
|
||||||
loadNodeConfig();
|
|
||||||
loadUserMan();
|
loadUserMan();
|
||||||
|
loadNodeConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
function apply() {
|
function apply() {
|
||||||
|
@ -127,7 +127,15 @@ function getControlWsUrl(host) {
|
|||||||
if (document.location.href.startsWith("https")) {
|
if (document.location.href.startsWith("https")) {
|
||||||
prefix = "wss://";
|
prefix = "wss://";
|
||||||
}
|
}
|
||||||
path = "/SCIDE/SCExecutor";
|
let path = document.location.pathname.lastIndexOf("/");
|
||||||
|
path = document.location.pathname.substr(0, path + 1);
|
||||||
|
if (path.indexOf("SCIDE") < 0) {
|
||||||
|
path += "SCIDE/";
|
||||||
|
}
|
||||||
|
path += "SCExecutor";
|
||||||
|
if (isBaaS) {
|
||||||
|
path = path.replace("ide/", "")
|
||||||
|
}
|
||||||
return prefix + host + path;
|
return prefix + host + path;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,12 +361,12 @@ function initResponseAndOutputArea() {
|
|||||||
function onExecuteResult(obj) {
|
function onExecuteResult(obj) {
|
||||||
const executeResultTitleEl = $("#executeResultTitle");
|
const executeResultTitleEl = $("#executeResultTitle");
|
||||||
const data = obj;
|
const data = obj;
|
||||||
var styleTail = "未知格式";
|
var sytleTail = "未知格式";
|
||||||
if (data.result==undefined) {
|
if (data.result==undefined) {
|
||||||
styleTail = "Undefined";
|
styleTail = "Undefined";
|
||||||
data.result = "";
|
data.result = "";
|
||||||
} else if (data.result instanceof Object) {
|
} else if (data.result instanceof Object) {
|
||||||
styleTail = "JSON格式";
|
sytleTail = "JSON格式";
|
||||||
data.result =JSON.stringify(data.result);
|
data.result =JSON.stringify(data.result);
|
||||||
} else if (typeof data.result == 'string') {
|
} else if (typeof data.result == 'string') {
|
||||||
styleTail = "字符串格式";
|
styleTail = "字符串格式";
|
||||||
|
4
js/cm.js
@ -75,7 +75,9 @@ var getControlWsUrl = function (host) {
|
|||||||
var prefix = "ws://";
|
var prefix = "ws://";
|
||||||
if (document.location.href.startsWith("https"))
|
if (document.location.href.startsWith("https"))
|
||||||
prefix = "wss://";
|
prefix = "wss://";
|
||||||
var path = "/SCIDE/SCExecutor";
|
var path = document.location.pathname.lastIndexOf("/");
|
||||||
|
path = document.location.pathname.substr(0, path + 1);
|
||||||
|
path += "SCExecutor";
|
||||||
return prefix + host + path;
|
return prefix + host + path;
|
||||||
};
|
};
|
||||||
var initWSocket = function () {
|
var initWSocket = function () {
|
||||||
|
@ -120,8 +120,9 @@ var switchPeriod = function(per) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 本地启动
|
// 本地启动
|
||||||
var startContractAtSlave = function(isDebug) {
|
var startContractAtSlave = function() {
|
||||||
//this is for fixed contract,not for the unit contract
|
//this is for fixed contract,not for the unit contract
|
||||||
var period = $("#selectDumpPeriod")[0].value;
|
var period = $("#selectDumpPeriod")[0].value;
|
||||||
if (period == "选择状态保存模式") {
|
if (period == "选择状态保存模式") {
|
||||||
@ -130,29 +131,10 @@ var startContractAtSlave = function(isDebug) {
|
|||||||
}
|
}
|
||||||
var dumpPeriod = switchPeriod(period);
|
var dumpPeriod = switchPeriod(period);
|
||||||
var project = global.ypkName;
|
var project = global.ypkName;
|
||||||
|
|
||||||
$("#result")[0].innerHTML="正在启动,请稍候";
|
$("#result")[0].innerHTML="正在启动,请稍候";
|
||||||
var request = {};
|
var request = {};
|
||||||
request.action = "startContractByYPK";
|
request.action = "startContractByYPK";
|
||||||
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{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (remoteDebugPort.value !='') {
|
|
||||||
request.remoteDebugPort = remoteDebugPort.value;
|
|
||||||
}
|
|
||||||
request.isDebug = isDebug;
|
|
||||||
request.dumpPeriod = dumpPeriod;
|
request.dumpPeriod = dumpPeriod;
|
||||||
request.isPrivate = global.ypkIsPrivate;
|
request.isPrivate = global.ypkIsPrivate;
|
||||||
request.owner = global.sm2Key.publicKey;
|
request.owner = global.sm2Key.publicKey;
|
||||||
@ -176,60 +158,39 @@ var onStartContract = function(obj) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 集群启动合约
|
// 集群启动合约
|
||||||
function startContractUnits(place) {
|
var startContractUnits = function(place) {
|
||||||
// ZYX
|
// ZYX
|
||||||
const unitsID = $("#selectUnits")[0].value.split("_")[1];
|
var unitsID = $("#selectUnits")[0].value.split("_")[1];
|
||||||
if (!unitsID || unitsID === "选择节点集群") {
|
if(unitsID == undefined || unitsID == "选择节点集群"){
|
||||||
myToast("提示", "请选择节点集群!");
|
myToast("提示","请选择节点集群!");
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
let peersID = "";
|
|
||||||
for (let i in global.units[unitsID]) {
|
|
||||||
peersID += global.units[unitsID][i].pubKey + ",";
|
|
||||||
}
|
|
||||||
|
|
||||||
const request = {};
|
|
||||||
|
|
||||||
request.action = "startContractMultiPoint";
|
|
||||||
request.peersID = peersID;
|
|
||||||
request.type = $("#sequence")[0].value;
|
|
||||||
console.log(request.type);
|
|
||||||
if (request.type == 0) {
|
|
||||||
myToast("提示", "请选择集群合约模式!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
request.selectUnitNum = Number($("#selectUnitNum")[0].value);
|
|
||||||
if (!request.selectUnitNum || isNaN(request.selectUnitNum)) {
|
|
||||||
myToast("提示", "请填写集群规模!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
request.projectName = global.ypkName;
|
|
||||||
if (!request.projectName || request.projectName == "请选择ypk文件") {
|
|
||||||
myToast("提示", "请选择合约!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
request.isPrivate = global.ypkIsPrivate;
|
|
||||||
request.sponsorPeerID = global.peerID; //peerID of the node
|
|
||||||
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{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
console.log(request);
|
|
||||||
global.wssocket.send(JSON.stringify(request));
|
var peersID = "";
|
||||||
}
|
for ( var i in global.units[unitsID]) {
|
||||||
|
peersID += global.units[unitsID][i].pubKey + ",";
|
||||||
|
}
|
||||||
|
|
||||||
|
var request = {};
|
||||||
|
|
||||||
|
request.action = "startContractMultiPoint";
|
||||||
|
request.peersID = peersID;
|
||||||
|
request.type = $("#sequence")[0].value;
|
||||||
|
console.log(request.type);
|
||||||
|
if (request.type==0){
|
||||||
|
myToast("提示","请选择集群合约模式!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
request.projectName = global.ypkName;
|
||||||
|
if (request.projectName==undefined || request.projectName == "请选择ypk文件"){
|
||||||
|
myToast("提示","请选择合约!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
request.isPrivate = global.ypkIsPrivate;
|
||||||
|
request.sponsorPeerID = global.peerID; //peerID of the node
|
||||||
|
console.log(request);
|
||||||
|
global.wssocket.send(JSON.stringify(request));
|
||||||
|
};
|
||||||
|
|
||||||
var onStartTrustfulContract = function(obj) {
|
var onStartTrustfulContract = function(obj) {
|
||||||
console.log(obj);
|
console.log(obj);
|
||||||
|
@ -3,7 +3,7 @@ function getDateDaysBefore(daysAgo) {
|
|||||||
return new Date(dateStr).getTime() - daysAgo * 24 * 3600 * 1000;
|
return new Date(dateStr).getTime() - daysAgo * 24 * 3600 * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
let primaryColor = "#2E324C";
|
let primaryColor = "#304156";
|
||||||
|
|
||||||
// ======Vue start
|
// ======Vue start
|
||||||
let headerVue = "";
|
let headerVue = "";
|
||||||
@ -62,15 +62,7 @@ function initVue() {
|
|||||||
newKey.id = this.sm2KeyList.length;
|
newKey.id = this.sm2KeyList.length;
|
||||||
newKey.title = headerVue.shortName;
|
newKey.title = headerVue.shortName;
|
||||||
newKey.sm2Key = this.sm2KeyStr;
|
newKey.sm2Key = this.sm2KeyStr;
|
||||||
var exist = false;
|
this.sm2KeyList.push(newKey);
|
||||||
for (var i=0;i<this.sm2KeyList.length;i++){
|
|
||||||
var iterKey = this.sm2KeyList[i];
|
|
||||||
if (iterKey.sm2Key==newKey.sm2Key)
|
|
||||||
exist = true;
|
|
||||||
}
|
|
||||||
if (!exist)
|
|
||||||
this.sm2KeyList.push(newKey);
|
|
||||||
|
|
||||||
localStorage.setItem("PrivKeyList", JSON.stringify(this.sm2KeyList));
|
localStorage.setItem("PrivKeyList", JSON.stringify(this.sm2KeyList));
|
||||||
getSession();
|
getSession();
|
||||||
listProjects("priv");
|
listProjects("priv");
|
||||||
|
@ -176,6 +176,8 @@ var getControlWsUrl = function(host) {
|
|||||||
var prefix = "ws://";
|
var prefix = "ws://";
|
||||||
if (document.location.href.startsWith("https"))
|
if (document.location.href.startsWith("https"))
|
||||||
prefix = "wss://";
|
prefix = "wss://";
|
||||||
var path = "/SCIDE/SCExecutor";
|
var path = document.location.pathname.lastIndexOf("/");
|
||||||
|
path = document.location.pathname.substr(0, path + 1);
|
||||||
|
path += "SCExecutor";
|
||||||
return prefix + host + path;
|
return prefix + host + path;
|
||||||
};
|
};
|
@ -43,7 +43,7 @@ function startContract() {
|
|||||||
global.wssocket.send(JSON.stringify(request));
|
global.wssocket.send(JSON.stringify(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
function startContractAsDebug(isDebug) {
|
function startContractAsDebug() {
|
||||||
const key = pubkeyDialogVue.sm2KeyList[pubkeyDialogVue.selectedSM2Key];
|
const key = pubkeyDialogVue.sm2KeyList[pubkeyDialogVue.selectedSM2Key];
|
||||||
const sm2Key = JSON.parse(key.sm2Key);
|
const sm2Key = JSON.parse(key.sm2Key);
|
||||||
const projectId = $("#selectedProject")[0].value;
|
const projectId = $("#selectedProject")[0].value;
|
||||||
@ -51,28 +51,9 @@ function startContractAsDebug(isDebug) {
|
|||||||
startResult.innerText = "正在以调试模式启动合约:" + project;
|
startResult.innerText = "正在以调试模式启动合约:" + project;
|
||||||
|
|
||||||
const request = {};
|
const request = {};
|
||||||
request.action = "startContract";
|
request.action = "startContractAsDebug";
|
||||||
request.isPrivate = $("#privateprojecttab").hasClass("active");
|
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.owner = sm2Key.publicKey;
|
||||||
request.requestID = new Date().getTime() + "";
|
request.requestID = new Date().getTime() + "";
|
||||||
// request.contractid = $("#tabdiv")[0].value;
|
// request.contractid = $("#tabdiv")[0].value;
|
||||||
@ -192,13 +173,9 @@ function importContractInstanceCodeByDOI() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openInClient() {
|
function openInClient() {
|
||||||
let path = document.location.pathname.lastIndexOf("/ide");
|
|
||||||
if (path > 0)
|
|
||||||
path = document.location.pathname.substr(0, path + 1);
|
|
||||||
else path = "/";
|
|
||||||
window.open(isBaaS ?
|
window.open(isBaaS ?
|
||||||
`${location.origin}${path}client/BaaSClient.html${location.search}` :
|
`${location.origin}/client/BaaSClient.html${location.search}` :
|
||||||
`${location.origin}${path}client/bdwareclient.html?self=true&` +
|
`${location.origin}/client/bdwareclient.html?self=true&` +
|
||||||
`contract=${mainVue.contracts[selectedContract.value].id}`);
|
`contract=${mainVue.contracts[selectedContract.value].id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,15 +218,15 @@ function executeContract() {
|
|||||||
request.contractID = contract.id;
|
request.contractID = contract.id;
|
||||||
request.operation = contract.exportedFunctions[selectedFunction.value].functionName;
|
request.operation = contract.exportedFunctions[selectedFunction.value].functionName;
|
||||||
const arg = executeContractArgInput.value;
|
const arg = executeContractArgInput.value;
|
||||||
const gasLimit = $('#gasLimit').val() / 1;
|
const gasLimit = $('#gasLimit').val()/1;
|
||||||
request.pubkey = sm2Key.publicKey;
|
request.pubkey = sm2Key.publicKey;
|
||||||
let toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg;
|
+ request.operation + "|" + arg ;
|
||||||
if (gasLimit > 0) {
|
if (gasLimit>0){
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign += "|" + gasLimit;
|
toSign+= "|" + gasLimit;
|
||||||
}
|
}
|
||||||
toSign += "|" + sm2Key.publicKey;
|
toSign+= "|" + sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
sm2Key.privateKey,
|
sm2Key.privateKey,
|
||||||
|