From e18950b1cb92a8938f952a125b853f6d971efe35 Mon Sep 17 00:00:00 2001 From: DieMyst Date: Sat, 15 Jun 2019 13:13:56 +0300 Subject: [PATCH] list of zones draft --- index.html | 23 +++++++++++------ index.js | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 88 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index e99a3d3..8d400f1 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,20 @@ Init +
@@ -15,13 +29,8 @@ Last Checked -
-
-
-
-
-
-
+
+
diff --git a/index.js b/index.js index 0a5a611..3d582d8 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,83 @@ import "bootstrap/dist/css/bootstrap.min.css"; window.onload = function () { - console.log("hello to1") + console.log("hello to1"); + + let list = document.getElementById("zoneList"); + + let coolZone = { + name: "Cool Zone", + nodesNumber: 12, + lastHeight: 6546, + binaryLink: "#" + }; + list.innerHTML += zoneElement("cool zone", coolZone, true); + + let iris = { + name: "Iris", + nodesNumber: 57, + lastHeight: 12567, + binaryLink: "#" + }; + list.innerHTML += zoneElement("iris", iris, true); + + + + let nameService = { + name: "Name Service", + nodesNumber: 4, + lastHeight: 2566, + binaryLink: "#" + }; + list.innerHTML += zoneElement("name service", nameService, false); }; +/* +
+ Iris, 50 nodes, last height 12023 + Binary link + +
+
+
Height: 2543
+
+
+
+
+
+
+
+
+
+
+
+
+
+ */ + +function zoneElement(id, info, statusOk) { + let barStatus; + if (statusOk) { + barStatus = "progress-bar" + } else { + barStatus = "progress-bar progress-error" + } + console.log("hi " + id); + return `
+
${info.name}, ${info.nodesNumber} nodes, ${info.lastHeight}
+ +
+
+
Height: 2543
+
+
+
` +} + let socket = new WebSocket("ws://ip:port"); socket.onopen = function(e) { - console.log("Waaaa ebsocket was opened: " + JSON.stringify(e)); + console.log("Waa ebsocket was opened: " + JSON.stringify(e)); };