From 7383a7091bf928d76d77ba50655ce88c194a820a Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Wed, 17 Aug 2016 22:09:35 +0300 Subject: [PATCH] status web: In client list, only display local port number, not local address --- src/web/aprsc.js | 9 ++++++++- src/web/index.html | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/web/aprsc.js b/src/web/aprsc.js index fa83e58..21f8194 100644 --- a/src/web/aprsc.js +++ b/src/web/aprsc.js @@ -93,7 +93,13 @@ var key_tooltips = { -/* ******** NEW angular.js ********* */ +/* filters */ + +/* return only port of an addr:port string */ +function onlyport(s) +{ + return s.substr(s.lastIndexOf(':') + 1); +} function ratestr(rate) { @@ -359,6 +365,7 @@ var app = angular.module('aprsc', [ 'pascalprecht.translate', 'graph', 'ngDialog app.filter('duration', function() { return dur_str; }); app.filter('datetime', function() { return timestr; }); app.filter('ratestr', function() { return ratestr; }); +app.filter('onlyport', function() { return onlyport; }); app.controller('aprscc', [ '$scope', '$http', 'graphs', 'ngDialog', '$sce', function($scope, $http, graphs, ngDialog, $sce) { console.log('aprsc init'); diff --git a/src/web/index.html b/src/web/index.html index b746d1f..31d2ee6 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -207,7 +207,7 @@ ng-click="changeSorting(clients_sort, k)">{{ 'TH_' + k | translate }} - {{ c.addr_loc }} + {{ c.addr_loc | onlyport }} {{ c.username }} {{ c.addr_rem }} {{ c.addr_rem }}