From 64df44c6f9c78a5763bf89bd8ec4fa25439ebdaf Mon Sep 17 00:00:00 2001
From: Egor Tensin <Egor.Tensin@gmail.com>
Date: Sat, 24 Dec 2022 21:05:40 +0100
Subject: html: add links to infobyip.com

---
 html/index.html | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

(limited to 'html/index.html')

diff --git a/html/index.html b/html/index.html
index d8ce009..4a9ac19 100644
--- a/html/index.html
+++ b/html/index.html
@@ -237,6 +237,22 @@ Endpoint.prototype.sortable_value = function(value) {
     return value;
 }
 
+Endpoint.prototype.cell_contents = function(value) {
+    value = this.sortable_value(value);
+    if (value == '-')
+        return Field.prototype.cell_contents.call(this, value);
+
+    let parts = value.split(':');
+    let ip = parts[0];
+
+    let elem = document.createElement('a');
+    elem.setAttribute('href', 'https://infobyip.com/ip-' + ip + '.html');
+    elem.setAttribute('target', '_blank');
+    elem.appendChild(document.createTextNode(value));
+
+    return [elem];
+}
+
 var Rx = function() {
     Field.call(this, 'receive_bytes');
 }
-- 
cgit v1.2.3