aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-03-12 22:58:31 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-03-12 23:05:47 +0100
commit3b1532e9753e574dd11820dafda49014c69449d7 (patch)
tree85c347d6ffcffc0b43438dfd699ff1afcd5c1c55
parentfix a typo (diff)
downloadwg-api-web-3b1532e9753e574dd11820dafda49014c69449d7.tar.gz
wg-api-web-3b1532e9753e574dd11820dafda49014c69449d7.zip
html: fix links to infobyip.com for IPv6v1.1.4
Diffstat (limited to '')
-rw-r--r--html/index.html12
1 files changed, 9 insertions, 3 deletions
diff --git a/html/index.html b/html/index.html
index 4a9ac19..7ac4100 100644
--- a/html/index.html
+++ b/html/index.html
@@ -239,11 +239,17 @@ Endpoint.prototype.sortable_value = function(value) {
Endpoint.prototype.cell_contents = function(value) {
value = this.sortable_value(value);
- if (value == '-')
+ if (value == '' || value == '-')
return Field.prototype.cell_contents.call(this, value);
- let parts = value.split(':');
- let ip = parts[0];
+ let ip = value;
+
+ let idx = value.lastIndexOf(':');
+ if (idx >= 0)
+ ip = value.substring(0, idx);
+
+ if (ip.charAt(0) == '[' && ip.slice(-1) == ']')
+ ip = ip.slice(1, -1);
let elem = document.createElement('a');
elem.setAttribute('href', 'https://infobyip.com/ip-' + ip + '.html');