From: Jaroslav Kysela Date: Sat, 6 May 2017 16:56:15 +0000 (+0200) Subject: webui: add peer port and server ip/port to the connections tab X-Git-Tag: v4.2.2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ad4d33b7b4dc78a678bef6eac2675acf4ae4ed7;p=thirdparty%2Ftvheadend.git webui: add peer port and server ip/port to the connections tab --- diff --git a/src/tcp.c b/src/tcp.c index bc336b433..8085a5ede 100644 --- a/src/tcp.c +++ b/src/tcp.c @@ -1074,9 +1074,13 @@ tcp_server_connections ( void ) if (!tsl->status) continue; c++; e = htsmsg_create_map(); - tcp_get_str_from_ip(&tsl->peer, buf, sizeof(buf)); htsmsg_add_u32(e, "id", tsl->id); + tcp_get_str_from_ip(&tsl->self, buf, sizeof(buf)); + htsmsg_add_str(e, "server", buf); + htsmsg_add_u32(e, "server_port", ntohs(IP_PORT(tsl->self))); + tcp_get_str_from_ip(&tsl->peer, buf, sizeof(buf)); htsmsg_add_str(e, "peer", buf); + htsmsg_add_u32(e, "peer_port", ntohs(IP_PORT(tsl->peer))); htsmsg_add_s64(e, "started", tsl->started); tsl->status(tsl->opaque, e); htsmsg_add_msg(l, NULL, e); diff --git a/src/webui/static/app/status.js b/src/webui/static/app/status.js index c35d46411..f6ae7d835 100644 --- a/src/webui/static/app/status.js +++ b/src/webui/static/app/status.js @@ -581,7 +581,10 @@ tvheadend.status_conns = function(panel, index) { fields: [ { name: 'id', sortType: stype }, { name: 'type', sortType: stype }, + { name: 'server', sortType: stype }, + { name: 'server_port' }, { name: 'peer', sortType: stype }, + { name: 'peer_port' }, { name: 'user', sortType: stype }, { name: 'started', @@ -616,6 +619,12 @@ tvheadend.status_conns = function(panel, index) { header: _("IP Address"), dataIndex: 'peer', sortable: true + }, { + width: 50, + id: 'peer_port', + header: _("IP Port"), + dataIndex: 'peer_port', + sortable: true }, { width: 50, id: 'user', @@ -629,6 +638,18 @@ tvheadend.status_conns = function(panel, index) { dataIndex: 'started', renderer: renderDate, sortable: true + }, { + width: 50, + id: 'server', + header: _("Server Address"), + dataIndex: 'server', + sortable: true + }, { + width: 50, + id: 'server_port', + header: _("Server Port"), + dataIndex: 'server_port', + sortable: true }]); grid = new Ext.grid.GridPanel({