10 Commits

Author SHA1 Message Date
Frank.R.Wu
cdcdfbdfde fix: add a lost file
add jquery-2.1.4.js to fix frontend bugs
2021-12-23 21:40:54 +08:00
CaiHQ
d0f8af9851 optimize: use jquery 2.1.4.min
refactor: DOA Contract
update: use doip sdk 1.0.2
2021-12-22 22:07:51 +08:00
Frank.R.Wu
965ee67409 fix: fix bugs in executeContract of NodeContractInstances.js 2021-12-12 12:25:36 +08:00
Frank.R.Wu
0dfa8a555a style 2021-12-11 19:15:13 +08:00
CaiHQ
37476bd506 merge pbft algorithm 2021-11-22 11:50:39 +08:00
Frank.R.Wu
89360bbf0c feat: add SelfAdaptiveShardingExecutor
add new type of multi-point contract "SelfAdaptiveSharding"
2021-11-11 12:52:38 +08:00
bitvincent
f6c898dc9e fix:typo error (shading->sharding) 2021-11-04 18:31:16 +08:00
CaiHQ
c73d1cfabf fix openInClientBug 2021-10-26 14:17:31 +08:00
CaiHQ
e96048de2a fix: path bug 2021-10-26 11:22:45 +08:00
Frank.R.Wu
a117a53b0b feat: optimize the view of TrustUnits
just show node names in the view of TrustUnits
2021-08-14 21:05:50 +08:00
14 changed files with 2923 additions and 9294 deletions

View File

@@ -280,7 +280,9 @@
<option value="3">RARF</option>
<option value="4">RARH</option>
<option value="5">RARA</option>
<option value="6">Shading</option>
<option value="6">Sharding</option>
<option value="7">SASharding</option>
<option value="8">PBFT</option>
</select>
<div class="btn-group mr-3" role="group"
style="margin-left: 2%">
@@ -504,7 +506,8 @@
</div>
<input type="text" class="form-control" placeholder="输入参数" id="arg">
<input type="text" class="form-control col-2" placeholder="输入gas" id="gasLimit">
<input type="text" class="form-control col-2" placeholder="输入gas"
id="gasLimit">
<div class="input-group-append">
<div class="input-group-text">
<input type="checkbox" id="executeContractAsDebug"
@@ -553,7 +556,8 @@
<span class="input-group-text">参数</span>
</div>
<input type="text" class="form-control" placeholder="输入参数" id="maskArg">
<input type="text" class="form-control" placeholder="输入参数"
id="maskArg">
<div class="input-group-append">
<button onclick="getMask()" type="button"
@@ -586,7 +590,8 @@
<span class="input-group-text">参数</span>
</div>
<input type="text" class="form-control" placeholder="输入参数" id="mockArg">
<input type="text" class="form-control" placeholder="输入参数"
id="mockArg">
<div class="input-group-append">
<button onclick="getMock()" type="button"
@@ -1335,6 +1340,7 @@
//initWSocket();
</script>
</body>

1333
NodePortal_Gateway.html Normal file

File diff suppressed because it is too large Load Diff

1333
index_gate.html Normal file

File diff suppressed because it is too large Load Diff

165
index_gateway.html Normal file
View File

@@ -0,0 +1,165 @@
<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;">
&nbsp;&nbsp;导航&nbsp;&nbsp;
</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
-->

Binary file not shown.

9214
jqueryui1.12/jquery-2.1.4.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

View File

@@ -262,7 +262,7 @@ function showNodeTrustUnits(obj) {
}
};
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>";
const tableTail = "</tbody></table>";
if (global.nodeUnits) {
@@ -275,7 +275,7 @@ function showNodeTrustUnits(obj) {
<td>TCP</td>
<td>${global.nodeUnits[i].key.substring(0, at_ - 1)}</td>
<td>${nodes.length}</td>
<td>${JSON.stringify(nodes)}</td>
<td>${nodes.map(x => x.nodeName).sort().join(',')}</td>
</tr>`
}
}

View File

@@ -137,7 +137,7 @@ ${table[i].name}
</tr>`
}
html += tableTail;
html = "<h5 class='card-title'>合约实例列表</h5>" + html;
html = "<h5 class='card-title'>DO实例列表</h5>" + html;
ciTabDiv.html(html);
$("#ciTabDivTab").DataTable(
@@ -400,7 +400,7 @@ function executeContract() {
console.log(request.arg);
const gasLimit = $('#gasLimit').val() / 1;
var toSign = request.contractID + "|"
+ request.operation + "|" + arg ;
+ request.operation + "|" + request.arg;
if (gasLimit > 0) {
request.gasLimit = gasLimit;
toSign += "|" + gasLimit;
@@ -474,6 +474,7 @@ function getMask() {
localStorage.setItem("persisArg", JSON.stringify(request));
global.wssocket.send(JSON.stringify(request));
}
function setMask() {
const argDiv = $('#maskArg')[0];
const request = {};

View File

@@ -274,7 +274,7 @@ function getControlWsUrl(host) {
}
path += "SCExecutor";
if (isBaaS) {
path = path.replace("ide/", "")
path = "/SCIDE/SCExecutor"
}
return prefix + host + path;
}
@@ -316,8 +316,8 @@ function onNodeLogin(data) {
console.log("onNodeLogin");
pubkeyDialogVue.myRole = data.data;
global.myRole = data.data;
loadUserMan();
loadNodeConfig();
loadUserMan();
}
function apply() {

View File

@@ -127,15 +127,7 @@ function getControlWsUrl(host) {
if (document.location.href.startsWith("https")) {
prefix = "wss://";
}
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/", "")
}
path = "/SCIDE/SCExecutor";
return prefix + host + path;
}

View File

@@ -75,9 +75,7 @@ var getControlWsUrl = function (host) {
var prefix = "ws://";
if (document.location.href.startsWith("https"))
prefix = "wss://";
var path = document.location.pathname.lastIndexOf("/");
path = document.location.pathname.substr(0, path + 1);
path += "SCExecutor";
var path = "/SCIDE/SCExecutor";
return prefix + host + path;
};
var initWSocket = function () {

View File

@@ -158,20 +158,20 @@ var onStartContract = function(obj) {
};
// 集群启动合约
var startContractUnits = function(place) {
function startContractUnits(place) {
// ZYX
var unitsID = $("#selectUnits")[0].value.split("_")[1];
if(unitsID == undefined || unitsID == "选择节点集群"){
const unitsID = $("#selectUnits")[0].value.split("_")[1];
if (!unitsID || unitsID === "选择节点集群") {
myToast("提示", "请选择节点集群!");
return;
}
var peersID = "";
for ( var i in global.units[unitsID]) {
let peersID = "";
for (let i in global.units[unitsID]) {
peersID += global.units[unitsID][i].pubKey + ",";
}
var request = {};
const request = {};
request.action = "startContractMultiPoint";
request.peersID = peersID;
@@ -181,8 +181,13 @@ var startContractUnits = function(place) {
myToast("提示", "请选择集群合约模式!");
return;
}
request.selectUnitNum = Number($("#selectUnitNum")[0].value);
if (!request.selectUnitNum || isNaN(request.selectUnitNum)) {
myToast("提示", "请填写集群规模!");
return;
}
request.projectName = global.ypkName;
if (request.projectName==undefined || request.projectName == "请选择ypk文件"){
if (!request.projectName || request.projectName == "请选择ypk文件") {
myToast("提示", "请选择合约!");
return;
}
@@ -190,7 +195,7 @@ var startContractUnits = function(place) {
request.sponsorPeerID = global.peerID; //peerID of the node
console.log(request);
global.wssocket.send(JSON.stringify(request));
};
}
var onStartTrustfulContract = function(obj) {
console.log(obj);

View File

@@ -176,8 +176,6 @@ var getControlWsUrl = function(host) {
var prefix = "ws://";
if (document.location.href.startsWith("https"))
prefix = "wss://";
var path = document.location.pathname.lastIndexOf("/");
path = document.location.pathname.substr(0, path + 1);
path += "SCExecutor";
var path = "/SCIDE/SCExecutor";
return prefix + host + path;
};

View File

@@ -173,9 +173,13 @@ function importContractInstanceCodeByDOI() {
}
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 ?
`${location.origin}/client/BaaSClient.html${location.search}` :
`${location.origin}/client/bdwareclient.html?self=true&` +
`${location.origin}${path}client/BaaSClient.html${location.search}` :
`${location.origin}${path}client/bdwareclient.html?self=true&` +
`contract=${mainVue.contracts[selectedContract.value].id}`);
}
@@ -220,7 +224,7 @@ function executeContract() {
const arg = executeContractArgInput.value;
const gasLimit = $('#gasLimit').val() / 1;
request.pubkey = sm2Key.publicKey;
var toSign = request.contractID + "|"
let toSign = request.contractID + "|"
+ request.operation + "|" + arg;
if (gasLimit > 0) {
request.gasLimit = gasLimit;