mirror of
https://github.com/fluencelabs/cosmos-hackathon-frontend
synced 2025-04-30 08:02:18 +00:00
add button with error info
This commit is contained in:
parent
7d4b3dda45
commit
d1ac2959eb
@ -13,6 +13,7 @@
|
|||||||
.progress-bar {
|
.progress-bar {
|
||||||
background-color: #e8fbe8;
|
background-color: #e8fbe8;
|
||||||
color: black;
|
color: black;
|
||||||
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-error {
|
.progress-error {
|
||||||
|
32
index.js
32
index.js
@ -1,5 +1,7 @@
|
|||||||
import "bootstrap/dist/css/bootstrap.min.css";
|
import "bootstrap/dist/css/bootstrap.min.css";
|
||||||
|
|
||||||
|
let state = {};
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
console.log("hello to1");
|
console.log("hello to1");
|
||||||
|
|
||||||
@ -40,12 +42,23 @@ window.onload = function () {
|
|||||||
list.innerHTML += zoneElement("name service", nameService, nameStatus);
|
list.innerHTML += zoneElement("name service", nameService, nameStatus);
|
||||||
|
|
||||||
let buttonEl = document.getElementById("start-check");
|
let buttonEl = document.getElementById("start-check");
|
||||||
buttonEl.onclick = startCheckEvent()
|
buttonEl.onclick = function() {
|
||||||
|
startCheckEvent()
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function startCheckEvent() {
|
function startCheckEvent() {
|
||||||
let nodeIpEl = document.getElementById("node-ip");
|
let nodeIpEl = document.getElementById("node-ip");
|
||||||
let binaryUrlEl = document.getElementById("binary-url");
|
let binaryUrlEl = document.getElementById("binary-url");
|
||||||
|
|
||||||
|
let someInfo = {
|
||||||
|
name: nodeIpEl.value,
|
||||||
|
nodesNumber: 34,
|
||||||
|
lastHeight: 49771,
|
||||||
|
binaryLink: "#"
|
||||||
|
};
|
||||||
|
|
||||||
|
startCheck(someInfo.name, someInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
function appendNewZone(id, info) {
|
function appendNewZone(id, info) {
|
||||||
@ -55,7 +68,7 @@ function appendNewZone(id, info) {
|
|||||||
height: 0
|
height: 0
|
||||||
};
|
};
|
||||||
let zoneInfo = zoneElement(id, info, status);
|
let zoneInfo = zoneElement(id, info, status);
|
||||||
list.innerHTML += zoneInfo
|
list.innerHTML = zoneInfo + list.innerHTML
|
||||||
}
|
}
|
||||||
|
|
||||||
function setHeightAndWidth(el, currentHeight, lastHeight) {
|
function setHeightAndWidth(el, currentHeight, lastHeight) {
|
||||||
@ -71,7 +84,8 @@ function changeHeight(el, currentHeight) {
|
|||||||
|
|
||||||
function setError(el) {
|
function setError(el) {
|
||||||
console.log("ERROR!!!!!!!!!!!");
|
console.log("ERROR!!!!!!!!!!!");
|
||||||
el.classList.add("progress-error")
|
el.classList.add("progress-error");
|
||||||
|
el.parentElement.innerHTML += `<button type="button" class="btn btn-block btn-danger" style="width: 60%;">Get Error Info</button>`
|
||||||
}
|
}
|
||||||
|
|
||||||
function zoneElement(id, info, status) {
|
function zoneElement(id, info, status) {
|
||||||
@ -102,18 +116,6 @@ function zoneElement(id, info, status) {
|
|||||||
</div>`
|
</div>`
|
||||||
}
|
}
|
||||||
|
|
||||||
let state = {};
|
|
||||||
|
|
||||||
|
|
||||||
let someInfo = {
|
|
||||||
name: "new-zone",
|
|
||||||
nodesNumber: 34,
|
|
||||||
lastHeight: 13,
|
|
||||||
binaryLink: "#"
|
|
||||||
};
|
|
||||||
|
|
||||||
startCheck(someInfo.name, someInfo);
|
|
||||||
|
|
||||||
function startCheck(zoneId, info) {
|
function startCheck(zoneId, info) {
|
||||||
|
|
||||||
var xmlHttp = new XMLHttpRequest();
|
var xmlHttp = new XMLHttpRequest();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user