Archived
1
0
Fork 0

FIX client idle time in millis

This commit is contained in:
Varakh 2018-04-05 14:55:44 +02:00
parent 16e787ec0c
commit ab56fde2a1
3 changed files with 7 additions and 2 deletions

View file

@ -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);

View file

@ -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'}

View file

@ -49,7 +49,7 @@
<h2 class="header">{% trans %}online_info.h.details{% endtrans %}</h2>
{% include 'keyvalue.twig' with {'data': data, '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'},