diff --git a/public/index.php b/public/index.php index 9e94c56..fbe7d86 100644 --- a/public/index.php +++ b/public/index.php @@ -124,6 +124,11 @@ $container['view'] = function ($container) use ($app) { }); $view->getEnvironment()->addFilter($timeInSecondsFilter); + $timeInMillisFilter = new Twig_SimpleFilter('timeInMillis', function($millis) use ($container) { + return $container['ts']->getInstance()->convertSecondsToStrTime(floor($millis/1000)); + }); + $view->getEnvironment()->addFilter($timeInMillisFilter); + // timestamp to carbon $timestampFilter = new Twig_SimpleFilter('timestamp', function($timestamp) { return Carbon::createFromTimestamp($timestamp); diff --git a/src/View/material/online.twig b/src/View/material/online.twig index 5713d2c..cb45270 100644 --- a/src/View/material/online.twig +++ b/src/View/material/online.twig @@ -12,7 +12,7 @@ {% include 'table.twig' with {'data': data, 'hide': [{'key': 'client_type', 'values': ['1']}], 'filters': [ - {'key': 'client_idle_time', 'apply': 'timeInSeconds'}, + {'key': 'client_idle_time', 'apply': 'timeInMillis'}, {'key': 'connection_connected_time', 'apply': 'timeInSeconds'}, {'key': 'client_created', 'apply': 'timestamp'}, {'key': 'client_lastconnected', 'apply': 'timestamp'} diff --git a/src/View/material/online_info.twig b/src/View/material/online_info.twig index 8f07853..23f53c1 100644 --- a/src/View/material/online_info.twig +++ b/src/View/material/online_info.twig @@ -49,7 +49,7 @@