Skip to content

Commit 9eee68c

Browse files
committed
node status
1 parent db549e2 commit 9eee68c

File tree

4 files changed

+39
-7
lines changed

4 files changed

+39
-7
lines changed

assets_js_bitrequest_core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2835,7 +2835,7 @@ function topnotify(message) {
28352835
// Displays styled notification in dialog boxes
28362836
function popnotify(result, message) { // notifications in dialogs
28372837
const notify_box = $(".popnotify");
2838-
if (result == "error") {
2838+
if (result === "error") {
28392839
notify_box.removeClass("success warning").addClass("error");
28402840
} else if (result == "warning") {
28412841
notify_box.removeClass("success error").addClass("warning");

assets_js_bitrequest_monitors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ function extract_error_details(error_obj) {
569569
"errormessage": error_obj
570570
}
571571
}
572-
const error = q_obj(error_obj, "error");
572+
const error = error_obj || q_obj(error_obj, "error");
573573
if (!error) return {
574574
"errorcode": 0,
575575
"errormessage": "unknown"

assets_js_bitrequest_rpcs.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,20 +475,19 @@ function validate_and_add_rpc_node(currency_name, api_list, node_id, node_config
475475
function create_rpc_node_element(api_list, is_live, node_id, node_config, is_selected) {
476476
const status_class = is_live ? " live" : " offline",
477477
selected_class = is_selected ? " rpc_selected" : "",
478-
status_icon = is_live ? "connection" : "wifi-off",
479478
node_name = node_config.name,
480479
custom = node_config.custom,
481480
node_url = node_config.url,
482481
stripped_url = custom && (node_name == "alchemy" || node_name == "infura") ? strip_key_from_url(node_url) : node_url,
483482
vendor = node_config.vendor,
484-
vendor_string = (vendor) ? " (" + vendor.slice(5) + ")" : "",
483+
vendor_string = (vendor) ? "<span class='v'> (" + vendor.slice(5) + ")</span>" : "",
485484
version = node_config.v,
486-
version_string = (version) ? " (" + version + ")" : "",
485+
version_string = (version) ? "<span class='v'> (" + version + ")</span>" : "",
487486
display_name = setting_sub_address(node_name, stripped_url, node_config.custom) + vendor_string + version_string,
488487
node_icon_url = get_node_icon(node_name),
489488
default_class = custom ? "" : " default",
490489
node_icon = (node_icon_url) ? "<img src='" + fetch_aws(node_icon_url) + ".png' class='icon'>" : "",
491-
node_element = $("<div class='optionwrap" + status_class + selected_class + default_class + "' style='display:none' data-pe='none' title='" + stripped_url + "'><span data-value='" + node_url + "' data-pe='none'>" + node_icon + display_name + "</span><div class='opt_icon_box' data-pe='none'><div class='opt_icon c_stat icon-" + status_icon + "' data-pe='none'></div><div class='opt_icon icon-bin' data-pe='none'></div></div>");
490+
node_element = $("<div class='optionwrap" + status_class + selected_class + default_class + "' style='display:none' data-pe='none' title='" + stripped_url + "'><span data-value='" + node_url + "' data-pe='none'>" + node_icon + "<span class='cstat'>•</span> " + display_name + "</span><div class='opt_icon_box' data-pe='none'><div class='opt_icon icon-bin' data-pe='none'></div></div>");
492491
node_element.data(node_config).appendTo(api_list);
493492
node_element.slideDown(500);
494493
}
@@ -854,6 +853,11 @@ function test_mempoolspace(input_section, node_config, currency_name) {
854853
const parsed_data = br_result(response),
855854
api_result = parsed_data.result;
856855
if (api_result) {
856+
if (api_result.error) {
857+
const error_obj = extract_error_details(api_result.error);
858+
popnotify("error", error_obj.errormessage);
859+
return
860+
}
857861
const first_tx = api_result[0];
858862
if (first_tx) {
859863
if (first_tx.version) {

assets_styles_settings.css

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ ul.conf_options li .conf_emoji {
248248

249249
.selectbox .options>.optionwrap img.icon {
250250
width:2em;
251-
margin-right:0.4em;
251+
margin-right:0.3em;
252+
margin-left:-0.3em;
252253
vertical-align: middle;
253254
}
254255

@@ -319,6 +320,33 @@ ul.conf_options li .conf_emoji {
319320
opacity: 1;
320321
}
321322

323+
#settingsbox .optionwrap .cstat {
324+
display: inline;
325+
border:none;
326+
padding: 0;
327+
color: rgba(0, 0, 0, 0.5);
328+
opacity: 0;
329+
transition: opacity 1000ms ease;
330+
}
331+
332+
#settingsbox .optionwrap.live .cstat {
333+
color: #00c000;
334+
opacity: 1;
335+
}
336+
337+
#settingsbox .optionwrap.offline .cstat {
338+
color: #FF0000;
339+
opacity: 1;
340+
}
341+
342+
#settingsbox .optionwrap .v {
343+
display: inline;
344+
border: none;
345+
padding: 0;
346+
font-size: 75%;
347+
color: #959595;
348+
}
349+
322350
#settingsbox #rpc_input_box #rpc_username_input,
323351
#settingsbox #rpc_input_box #rpc_password_input {
324352
display: none;

0 commit comments

Comments
 (0)