1
0
mirror of https://github.com/MailHops/mailhops-plugin.git synced 2025-05-21 08:30:23 -07:00

js/mailhops_details.js: move auth data out of routes calculation.

Auth data needs only be processed once and is independent from the
actual route data.

This has the added benefit that auth data, which is entirely local, is
shown even if the API returned an error.
This commit is contained in:
Mihai Moldovan 2024-04-17 10:37:41 +02:00
parent 9638412388
commit 37546872f9

View File

@ -130,6 +130,10 @@ function updateContent(msg, noauth) {
asn += ' (<a href="https://dnschecker.org/asn-whois-lookup.php?query='+route[i].asn.autonomous_system_number+'" target="_blank" title="ASN Lookup">' + route[i].asn.autonomous_system_number + '</a>)'
}
// append child
items.push('<div class="item"><div class="content"><div class="header"><img src="'+ icon + '" /> ' + header + weather +' <label class="ui circular label icon" style="float: right;">'+ (i + 1) +'</label></div><div class="description">'+ description + asn + '</div></div></div>');
}
var auth = '';
if (!noauth && msg.message.auth.length) {
for (var a = 0; a < msg.message.auth.length; a++){
@ -146,9 +150,6 @@ function updateContent(msg, noauth) {
}
}
}
// append child
items.push('<div class="item"><div class="content"><div class="header"><img src="'+ icon + '" /> ' + header + weather +' <label class="ui circular label icon" style="float: right;">'+ (i + 1) +'</label></div><div class="description">'+ description + asn + '</div></div></div>');
}
// header
if (!msg.message.error) {