routermon: replace ISP column with Target Service badge in WAN table

- Remove ISP column (always empty with local MMDB — no ISP data)
- Add Target Service column with color-coded badges (SSH/RDP/VNC/SMB=red,
  HTTP/HTTPS=blue, MySQL/PostgreSQL/Redis/MongoDB=purple, SMTP/POP3/IMAP=green,
  DNS=yellow, FTP=orange)
- Restore inline service label in Dst Port cell (e.g. '22 SSH')
- Expand port mapping: 21 ports covered (FTP, Telnet, SMTP, DNS, POP3,
  IMAP, SMB, MSSQL, MySQL, RDP, PostgreSQL, VNC, Redis, HTTP-alt,
  HTTPS-alt, Elasticsearch, MongoDB)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-04-16 17:06:55 +10:00
co-authored by Copilot
parent f8a341f932
commit 11fa2ad673
+42 -3
View File
@@ -7,7 +7,7 @@
<th class="px-3 py-2 text-left">Dst Port</th> <th class="px-3 py-2 text-left">Dst Port</th>
<th class="px-3 py-2 text-left">Src Port</th> <th class="px-3 py-2 text-left">Src Port</th>
<th class="px-3 py-2 text-left">Geo</th> <th class="px-3 py-2 text-left">Geo</th>
<th class="px-3 py-2 text-left">ISP</th> <th class="px-3 py-2 text-left">Target Service</th>
</tr> </tr>
</thead> </thead>
<tbody class="divide-y divide-gray-50"> <tbody class="divide-y divide-gray-50">
@@ -26,12 +26,26 @@
<button class="text-indigo-600 hover:underline" <button class="text-indigo-600 hover:underline"
onclick="setWanFilter('dst_port','{{ ev.dst_port }}')">{{ ev.dst_port }}</button> onclick="setWanFilter('dst_port','{{ ev.dst_port }}')">{{ ev.dst_port }}</button>
{% with p=ev.dst_port %} {% with p=ev.dst_port %}
{% if p == 22 %}<span class="text-gray-400 ml-1">SSH</span> {% if p == 21 %}<span class="text-gray-400 ml-1">FTP</span>
{% elif p == 22 %}<span class="text-gray-400 ml-1">SSH</span>
{% elif p == 23 %}<span class="text-gray-400 ml-1">Telnet</span> {% elif p == 23 %}<span class="text-gray-400 ml-1">Telnet</span>
{% elif p == 25 %}<span class="text-gray-400 ml-1">SMTP</span>
{% elif p == 53 %}<span class="text-gray-400 ml-1">DNS</span>
{% elif p == 80 %}<span class="text-gray-400 ml-1">HTTP</span> {% elif p == 80 %}<span class="text-gray-400 ml-1">HTTP</span>
{% elif p == 110 %}<span class="text-gray-400 ml-1">POP3</span>
{% elif p == 143 %}<span class="text-gray-400 ml-1">IMAP</span>
{% elif p == 443 %}<span class="text-gray-400 ml-1">HTTPS</span> {% elif p == 443 %}<span class="text-gray-400 ml-1">HTTPS</span>
{% elif p == 445 %}<span class="text-gray-400 ml-1">SMB</span>
{% elif p == 1433 %}<span class="text-gray-400 ml-1">MSSQL</span>
{% elif p == 3306 %}<span class="text-gray-400 ml-1">MySQL</span>
{% elif p == 3389 %}<span class="text-gray-400 ml-1">RDP</span> {% elif p == 3389 %}<span class="text-gray-400 ml-1">RDP</span>
{% elif p == 5432 %}<span class="text-gray-400 ml-1">PostgreSQL</span>
{% elif p == 5900 %}<span class="text-gray-400 ml-1">VNC</span>
{% elif p == 6379 %}<span class="text-gray-400 ml-1">Redis</span>
{% elif p == 8080 %}<span class="text-gray-400 ml-1">HTTP-alt</span> {% elif p == 8080 %}<span class="text-gray-400 ml-1">HTTP-alt</span>
{% elif p == 8443 %}<span class="text-gray-400 ml-1">HTTPS-alt</span>
{% elif p == 9200 %}<span class="text-gray-400 ml-1">Elastic</span>
{% elif p == 27017 %}<span class="text-gray-400 ml-1">MongoDB</span>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
{% else %} {% else %}
@@ -46,7 +60,32 @@
<span class="text-gray-300"></span> <span class="text-gray-300"></span>
{% endif %} {% endif %}
</td> </td>
<td class="px-3 py-2 text-gray-500 truncate max-w-[180px]">{{ ev.isp|default:"—" }}</td> <td class="px-3 py-2">
{% with p=ev.dst_port %}
{% if p == 21 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-orange-100 text-orange-700">FTP</span>
{% elif p == 22 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-red-100 text-red-700">SSH</span>
{% elif p == 23 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-red-100 text-red-700">Telnet</span>
{% elif p == 25 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-green-100 text-green-700">SMTP</span>
{% elif p == 53 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-yellow-100 text-yellow-700">DNS</span>
{% elif p == 80 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-blue-100 text-blue-700">HTTP</span>
{% elif p == 110 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-green-100 text-green-700">POP3</span>
{% elif p == 143 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-green-100 text-green-700">IMAP</span>
{% elif p == 443 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-blue-100 text-blue-700">HTTPS</span>
{% elif p == 445 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-red-100 text-red-700">SMB</span>
{% elif p == 1433 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-purple-100 text-purple-700">MSSQL</span>
{% elif p == 3306 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-purple-100 text-purple-700">MySQL</span>
{% elif p == 3389 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-red-100 text-red-700">RDP</span>
{% elif p == 5432 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-purple-100 text-purple-700">PostgreSQL</span>
{% elif p == 5900 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-red-100 text-red-700">VNC</span>
{% elif p == 6379 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-purple-100 text-purple-700">Redis</span>
{% elif p == 8080 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-blue-100 text-blue-700">HTTP-alt</span>
{% elif p == 8443 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-blue-100 text-blue-700">HTTPS-alt</span>
{% elif p == 9200 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-purple-100 text-purple-700">Elastic</span>
{% elif p == 27017 %}<span class="inline-block px-1.5 py-0.5 rounded text-[10px] font-semibold bg-purple-100 text-purple-700">MongoDB</span>
{% else %}<span class="text-gray-400"></span>
{% endif %}
{% endwith %}
</td>
</tr> </tr>
{% empty %} {% empty %}
<tr> <tr>