15 Commits

Author SHA1 Message Date
root
8fefeb8b08 fix: security bugs for zhizhen 2021-08-19 17:29:10 +08:00
root
7482d0a1ae style update 2021-08-09 23:24:09 +08:00
zhanghongwei
2aa98c4f17 Merge branch 'master' of https://phabricator.internetapi.cn/source/bdcontract-web-ide 2021-08-09 21:58:18 +08:00
Frank.R.Wu
de634576fd feat: change title
change title with node addr
2021-08-09 21:19:43 +08:00
Frank.R.Wu
e600c386da feat: change title
change title with node addr
2021-08-09 21:08:57 +08:00
fe1dcf7e79 NodePortal 2021-08-09 09:48:56 +08:00
root
5758a3ae78 fix: /td> in NodePortal.html/合约实例管理 2021-08-04 10:49:44 +08:00
root
e48679db44 feat: decouple mockjs 2021-08-03 14:24:27 +08:00
root
1ff93a3e76 fix: BaasOnlineIDE.html hidden overflowed part 2021-07-26 16:57:28 +08:00
root
44d288f147 fix: BaasOnlineIDE.html hidden overflowed part 2021-07-26 16:12:23 +08:00
root
178ef875c1 feat: use new bdledger jar
# Conflicts:
#	front-agent/src/main/java/org/bdware/server/nodecenter/client/NodeCenterClientController.java
#	front-cluster/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java
2021-07-19 21:51:45 +08:00
root
8d56502a87 feat: Shading model
# Conflicts:
#	front-agent/WebContent/ide
2021-07-06 01:45:21 +08:00
root
698b76babb update onlineIDE.js 2021-07-05 18:09:43 +08:00
root
bf2ff67cfa Revert "feat: try to index readme.md at front-cluster"
This reverts commit 466e474fbb.
2021-07-05 18:07:30 +08:00
root
466e474fbb feat: try to index readme.md at front-cluster 2021-07-05 18:00:16 +08:00
14 changed files with 267 additions and 47 deletions

View File

@@ -2,7 +2,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="no-cache"/>
<title>数瑞智能合约在线编辑器</title>
<title>智能合约在线编辑器</title>
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
<link href="./jqueryui1.12/jquery-ui.css" rel="stylesheet">
<script src="./jqueryui1.12/jquery-ui.js"></script>
@@ -127,14 +127,14 @@
</style>
</head>
<body>
<body style="overflow-x: hidden;">
<header
class="headerFooter navbar navbar-default navbar-fixed-top navColor ">
<div class="col-4">
<a class="navbar-brand" href="#"> <img alt="Brand"
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;">
</div>
<div class="nav navbar-right userName" data-toggle="modal"
@@ -142,7 +142,7 @@
</div>
</header>
<div class="container-fluid" id="main">
<div class="row h-100">
<div class="row h-100" style="overflow:hidden">
<div class="col-2 h-100" id="horiNav">
<div class="container-fluid d-flex flex-column h-100">
<div class="row" style="display: none;">
@@ -271,7 +271,7 @@
</div>
</div>
<div id="box" style="overflow:auto; height:100%">
<div id="box" style="overflow:hidden; height:100%">
<div id="contractCode" class="flex-grow-1" style="height:100%">
<div id="textareaDiv" class="col-sm-12" style="width: 100%; height: 100%; padding:0">
<textarea id="scriptEditor" style="width: 100%; height: 100%"

View File

@@ -2,7 +2,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="no-cache"/>
<title>数瑞智能合约节点管理中心</title>
<title>智能合约节点管理中心</title>
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
<script src="./js/popper.min.js"></script>
@@ -60,14 +60,14 @@
<script src="./js/bootstrap4-toggle.min.js"></script>
</head>
<body>
<body style="overflow-x: hidden;">
<header
class="headerFooter navbar navbar-default navbar-fixed-top navColor ">
<div class="col-4">
<a class="navbar-brand" href="#"> <img alt="Brand"
src="./images/logo-1.png" style="height: 30px">
</a> <span>数瑞智能合约节点管理中心</span>
</a> <span>智能合约节点管理中心</span>
</div>
<div class="nav navbar-right userName" data-toggle="modal"
@@ -544,6 +544,73 @@
<textarea class="form-control" id="responseArea"></textarea>
</div>
</div>
<div class="row d-flex justify-content-flex-start">
<h6 class="card-title" style="margin-top: 2%">Mask配置</h6>
<div class="input-group mb-3">
<div class="input-group-append">
<span class="input-group-text">参数</span>
</div>
<input type="text" class="form-control" placeholder="输入参数" id="maskArg">
<div class="input-group-append">
<button onclick="getMask()" type="button"
class="btn btn-outline-primary">get
</button>
</div>
<div class="input-group-append">
<button onclick="setMask()"
type="button" class="btn btn-outline-primary">set
</button>
</div>
</div>
</div>
<div class="row d-flex justify-content-flex-start">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="maskStatus">当前配置:</span>
</div>
<textarea class="form-control" id="maskResponseArea"></textarea>
</div>
</div>
<div class="row d-flex justify-content-flex-start">
<h6 class="card-title" style="margin-top: 2%">Mock配置</h6>
<div class="input-group mb-3">
<div class="input-group-append">
<span class="input-group-text">参数</span>
</div>
<input type="text" class="form-control" placeholder="输入参数" id="mockArg">
<div class="input-group-append">
<button onclick="getMock()" type="button"
class="btn btn-outline-primary">get
</button>
</div>
<div class="input-group-append">
<button onclick="setMock()"
type="button" class="btn btn-outline-primary">set
</button>
</div>
</div>
</div>
<div class="row d-flex justify-content-flex-start">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="mockStatus">当前配置:</span>
</div>
<textarea class="form-control" id="mockResponseArea"></textarea>
</div>
</div>
<div class="row d-flex justify-content-flex-start">
<h6 class="card-title" style="margin-top: 2%">权限管理</h6>
</div>

View File

@@ -35,11 +35,7 @@
<!--script src="./js/echartsTheme.js"></script -->
<!-- script src="./js/echarts-gl.min.js"></script -->
<script src="./js/sm2.js"></script>
<script src="./js/sm3.js"></script>
<script src="./js/sm4.js"></script>
<script src="./js/sm/index.js"></script>
<script src="./js/d3.v5.min.js"></script>
<!-- script src="./js/dagre-d3.min.js"></script -->
<script src="./js/tipsy/jquery.tipsy.min.js"></script>
@@ -68,7 +64,7 @@
}
.projectButton.ui-state-active {
background: #2E324C;
background: #304156;
color: white;
}
@@ -82,8 +78,8 @@
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
color: white;
background-color: #2E324C;
border-color: #2E324C;
background-color: #304156;
border-color: #304156;
}
.ui-tabs {
@@ -99,14 +95,14 @@
}
.ui-menu-item.ui-state-active:hover {
background: #2E324C;
background: #304156;
color: white;
border: 1px solid #999;
}
.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 {
background: #2E324C;
background: #304156;
color: white;
border: 1px solid #999;
}
@@ -120,7 +116,7 @@
}
.fileLine:hover {
background: #2E324C;
background: #304156;
color: white;
cursor: pointer;
}
@@ -132,14 +128,14 @@
</style>
</head>
<body>
<body style="overflow-x: hidden;">
<header
class="headerFooter navbar navbar-default navbar-fixed-top navColor ">
<div class="col-4">
<a class="navbar-brand" href="#"> <img alt="Brand"
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;">
</div>
<div class="nav navbar-right userName" data-toggle="modal"
@@ -147,7 +143,7 @@
</div>
</header>
<div class="container-fluid" id="main">
<div class="row h-100">
<div class="row h-100" style="overflow:hidden">
<div class="col-2 h-100" id="horiNav">
<div class="container-fluid d-flex flex-column h-100">
<div class="row">
@@ -278,7 +274,7 @@
</div>
</div>
<div id="box" style="overflow:auto; height:100%">
<div id="box" style="overflow:hidden; height:100%">
<div id="contractCode" class="flex-grow-1" style="height:100%">
<div id="textareaDiv" class="col-sm-12" style="width: 100%; height: 100%; padding:0">
<textarea id="scriptEditor" style="width: 100%; height: 100%"

View File

@@ -58,7 +58,7 @@
}
.projectButton.ui-state-active {
background: #2E324C;
background: #304156;
color: white;
}
@@ -72,8 +72,8 @@
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
color: white;
background-color: #2E324C;
border-color: #2E324C;
background-color: #304156;
border-color: #304156;
}
.ui-tabs {
@@ -89,14 +89,14 @@
}
.ui-menu-item.ui-state-active:hover {
background: #2E324C;
background: #304156;
color: white;
border: 1px solid #999;
}
.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 {
background: #2E324C;
background: #304156;
color: white;
border: 1px solid #999;
}
@@ -110,7 +110,7 @@
}
.fileLine:hover {
background: #2E324C;
background: #304156;
color: white;
cursor: pointer;
}

File diff suppressed because one or more lines are too long

View File

@@ -9,7 +9,7 @@
border: 1px solid rgba(0, 0, 0, .125);
border-radius: 5px;
background: white;
color: #2E324C;
color: #304156;
}
.userName:hover {
@@ -22,17 +22,17 @@
#horiNav {
padding-top: 10px;
border: 1px solid rgba(0, 0, 0, .05);
background: #f8f9fa;
background: #e9f6ff;
}
#outputNav {
padding-top: 10px;
border: 1px solid rgba(0, 0, 0, .05);
background: #f8f9fa;
background: #e9f6ff;
}
div .card {
background: #f8f9fa;
background: #e9f6ff;
}
#main {
@@ -85,16 +85,16 @@ div .card {
.projectLine.collapsed {
background: #D5D6DB;
color: #2E324C;
color: #304156;
}
.projectLine {
background: #2E324C;
background: #304156;
color: white;
}
.projectLine.collapsed:hover {
background: #2E324C;
background: #304156;
color: white;
}
@@ -111,7 +111,7 @@ div .card {
}
.headerFooter {
background: #2E324C;
background: #304156;
color: white;
}

BIN
images/logo-1.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 37 KiB

BIN
images/logo.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

@@ -85,7 +85,7 @@
padding-bottom: 30px;
width: 28%;
cursor: hand;
background: #2E324C;
background: #304156;
color: white;
}
@@ -100,7 +100,7 @@
</style>
</header>
<body style="background: #2E324C; color: white;">
<body style="background: #304156; 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%">

View File

@@ -443,6 +443,155 @@ function onExecuteResult(obj) {
}
}
function getMask() {
const argDiv = $('#maskArg')[0];
const request = {};
request.action = "getMask";
request.requestID = new Date().getTime() + "";
request.contractID = global.contractInstance;
const operation = $("#selectContractFunction")[0].value;
if (operation === " " && !operation) {
myToast("执行合约", "请选择合约方法!");
return;
}
//request.operation = operation;
request.arg = argDiv.value;
request.pubkey = global.sm2Key.publicKey;
//request.isDebug = executeContractAsDebug.checked;
console.log(request.arg);
//const gasLimit = $('#gasLimit').val()/1;
var toSign = request.contractID + "|"
+ request.operation + "|" + arg ;
/*if (gasLimit>0){
request.gasLimit = gasLimit;
toSign+= "|" + gasLimit;
}*/
toSign+= "|" + global.sm2Key.publicKey;
request.signature = sm2.doSignature(
toSign,
global.sm2Key.privateKey,
{hash: true, der: true});
localStorage.setItem("persisArg", JSON.stringify(request));
global.wssocket.send(JSON.stringify(request));
}
function setMask() {
const argDiv = $('#maskArg')[0];
const request = {};
request.action = "setMask";
request.requestID = new Date().getTime() + "";
request.contractID = global.contractInstance;
const operation = $("#selectContractFunction")[0].value;
if (operation === " " && !operation) {
myToast("执行合约", "请选择合约方法!");
return;
}
//request.operation = operation;
request.arg = argDiv.value;
request.pubkey = global.sm2Key.publicKey;
//request.isDebug = executeContractAsDebug.checked;
console.log(request.arg);
//const gasLimit = $('#gasLimit').val()/1;
var toSign = request.contractID + "|"
+ request.operation + "|" + arg ;
/*if (gasLimit>0){
request.gasLimit = gasLimit;
toSign+= "|" + gasLimit;
}*/
toSign+= "|" + global.sm2Key.publicKey;
request.signature = sm2.doSignature(
toSign,
global.sm2Key.privateKey,
{hash: true, der: true});
localStorage.setItem("persisArg", JSON.stringify(request));
global.wssocket.send(JSON.stringify(request));
}
function onGetMask(obj) {
console.log("onGetMask obj.data", obj.data);
try {
const result = obj;
$("#maskResponseArea")[0].value = JSON.stringify(obj.data);
} catch (e) {
$("#maskResponseArea")[0].value = JSON.stringify(obj.data);
}
}
function getMock() {
const argDiv = $('#mockArg')[0];
const request = {};
request.action = "getMock";
request.requestID = new Date().getTime() + "";
request.contractID = global.contractInstance;
const operation = $("#selectContractFunction")[0].value;
if (operation === " " && !operation) {
myToast("执行合约", "请选择合约方法!");
return;
}
//request.operation = operation;
request.arg = argDiv.value;
request.pubkey = global.sm2Key.publicKey;
//request.isDebug = executeContractAsDebug.checked;
console.log(request.arg);
//const gasLimit = $('#gasLimit').val()/1;
var toSign = request.contractID + "|"
+ request.operation + "|" + arg ;
/*if (gasLimit>0){
request.gasLimit = gasLimit;
toSign+= "|" + gasLimit;
}*/
toSign+= "|" + global.sm2Key.publicKey;
request.signature = sm2.doSignature(
toSign,
global.sm2Key.privateKey,
{hash: true, der: true});
localStorage.setItem("persisArg", JSON.stringify(request));
global.wssocket.send(JSON.stringify(request));
}
function setMock() {
const argDiv = $('#mockArg')[0];
const request = {};
request.action = "setMock";
request.requestID = new Date().getTime() + "";
request.contractID = global.contractInstance;
const operation = $("#selectContractFunction")[0].value;
if (operation === " " && !operation) {
myToast("执行合约", "请选择合约方法!");
return;
}
//request.operation = operation;
request.arg = argDiv.value;
request.pubkey = global.sm2Key.publicKey;
//request.isDebug = executeContractAsDebug.checked;
console.log(request.arg);
//const gasLimit = $('#gasLimit').val()/1;
var toSign = request.contractID + "|"
+ request.operation + "|" + arg ;
/*if (gasLimit>0){
request.gasLimit = gasLimit;
toSign+= "|" + gasLimit;
}*/
toSign+= "|" + global.sm2Key.publicKey;
request.signature = sm2.doSignature(
toSign,
global.sm2Key.privateKey,
{hash: true, der: true});
localStorage.setItem("persisArg", JSON.stringify(request));
global.wssocket.send(JSON.stringify(request));
}
function onGetMock(obj) {
console.log("onGetMask obj.data", obj.data);
try {
const result = obj;
$("#mockResponseArea")[0].value = JSON.stringify(obj.data);
} catch (e) {
$("#mockResponseArea")[0].value = JSON.stringify(obj.data);
}
}
function onHashResult(obj) {
$("#hashResult").html("数链指纹:" + obj.data);
}
@@ -502,7 +651,7 @@ function drawCPTable(table) {
<td>${i + 1}</td>
<td>${table[i].pid}</td>
<td>${table[i]['isLeak']}</td>
<td>${new Date(table[i]['cpuStart']).toLocaleString()}/td>
<td>${new Date(table[i]['cpuStart']).toLocaleString()}</td>
<td>${table[i]['cpuTotal']}</td>
<td>${table[i]['cpuSys']}</td>
<td>${(table[i]['resident'] / (1024 * 1024)).toFixed(2)}MB</td>

View File

@@ -200,6 +200,12 @@ function WSHandler(event) {
case 'onListLeakContractProcess':
onListLeakContractProcess(obj);
break;
case 'onGetMask':
onGetMask(obj);
break;
case 'onGetMock':
onGetMock(obj);
break;
default:
displayOutput(obj);
break;
@@ -276,6 +282,7 @@ function getControlWsUrl(host) {
function initWSocket() {
const host = document.location.host;
const url = getControlWsUrl(host);
document.title = `数瑞智能合约节点管理中心(${host}`;
// console.log("connect ws:" + url);
global.wssocket = createWssocket(url, function () {
getSession();
@@ -518,6 +525,3 @@ function addNodeUnit(obj) {
option.value = obj.key;
x.add(option, null);
}

View File

@@ -142,6 +142,7 @@ function getControlWsUrl(host) {
function initWSocket() {
console.log("[OnlineIDE.js] initWSocket : ");
let host = document.location.host;
document.title = `数瑞智能合约在线编辑器(${host}`
let url = getControlWsUrl(
global.urlparam && global.urlparam['nodeAddr'] ? global.urlparam['nodeAddr'] : host);
// console.log("connect ws:" + url);
@@ -361,8 +362,12 @@ function onExecuteResult(obj) {
const executeResultTitleEl = $("#executeResultTitle");
const data = obj;
var sytleTail = "未知格式";
if (data.result instanceof Object) {
if (data.result==undefined) {
styleTail = "Undefined";
data.result = "";
} else if (data.result instanceof Object) {
sytleTail = "JSON格式";
data.result =JSON.stringify(data.result);
} else if (typeof data.result == 'string') {
styleTail = "字符串格式";
} else if (typeof data.result == 'boolean'){

View File

@@ -3,7 +3,7 @@ function getDateDaysBefore(daysAgo) {
return new Date(dateStr).getTime() - daysAgo * 24 * 3600 * 1000;
}
let primaryColor = "#2E324C";
let primaryColor = "#304156";
// ======Vue start
let headerVue = "";

View File

@@ -342,7 +342,6 @@ var onStaticVerify = function (obj) {
data.name = data.path = "/tmp/result_" + (new Date().getTime() % 1000)
+ ".txt";
obj = JSON.parse(obj.data);
obj.result = JSON.parse(obj.result);
data.val = JSON.stringify(obj, null, 4);
mainVue.openedFiles.push(data);
setTimeout(function () {