add nodecenterws config
This commit is contained in:
parent
a1a52ffc32
commit
897f59c2eb
@ -1084,6 +1084,21 @@
|
|||||||
</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">
|
||||||
|
@ -10,11 +10,12 @@ 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 port = global.config.nodeCenter.replace(/.*:/g, "");
|
let url = global.config.nodeCenterWS;
|
||||||
const len = global.config.nodeCenter.length - port.length;
|
if (window.location.origin.startsWith("https")){
|
||||||
port = port - 1;
|
url = url.replace("ws://","wss://");
|
||||||
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";
|
||||||
}
|
}
|
||||||
@ -28,7 +29,7 @@ function onLoadNodeConfig(data) {
|
|||||||
}));
|
}));
|
||||||
}, centerportalWSHandler);
|
}, centerportalWSHandler);
|
||||||
}
|
}
|
||||||
showNodeConfig(data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showNodeConfig(data) {
|
function showNodeConfig(data) {
|
||||||
@ -44,6 +45,7 @@ function showNodeConfig(data) {
|
|||||||
$("#expireTime").html(global.config.expireTime);
|
$("#expireTime").html(global.config.expireTime);
|
||||||
$("#yjsInput")[0].value = global.config.yjsPath;
|
$("#yjsInput")[0].value = global.config.yjsPath;
|
||||||
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 {
|
||||||
@ -167,6 +169,14 @@ 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成功")
|
||||||
|
Loading…
Reference in New Issue
Block a user