Add formatted connected time in listeners report (#4324)
This commit is contained in:
parent
328caf3987
commit
3320520492
|
@ -128,6 +128,26 @@ $(function () {
|
||||||
var tlh_hours = tlh_seconds / 3600;
|
var tlh_hours = tlh_seconds / 3600;
|
||||||
return Math.round((tlh_hours + 0.00001) * 100) / 100;
|
return Math.round((tlh_hours + 0.00001) * 100) / 100;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formatTime (time) {
|
||||||
|
let sec_num = parseInt(time, 10);
|
||||||
|
|
||||||
|
let hours = Math.floor(sec_num / 3600);
|
||||||
|
let minutes = Math.floor((sec_num - (hours * 3600)) / 60);
|
||||||
|
let seconds = sec_num - (hours * 3600) - (minutes * 60);
|
||||||
|
|
||||||
|
if (hours < 10) {
|
||||||
|
hours = '0' + hours;
|
||||||
|
}
|
||||||
|
if (minutes < 10) {
|
||||||
|
minutes = '0' + minutes;
|
||||||
|
}
|
||||||
|
if (seconds < 10) {
|
||||||
|
seconds = '0' + seconds;
|
||||||
|
}
|
||||||
|
return (hours !== '00' ? hours + ':' : '') + minutes + ':' + seconds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ $assets
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?=__('IP')?></th>
|
<th><?=__('IP')?></th>
|
||||||
|
<th><?=__('Time')?></th>
|
||||||
<th><?=__('Time (sec)')?></th>
|
<th><?=__('Time (sec)')?></th>
|
||||||
<th><?=__('User Agent')?></th>
|
<th><?=__('User Agent')?></th>
|
||||||
<th><?=__('Stream')?></th>
|
<th><?=__('Stream')?></th>
|
||||||
|
@ -68,6 +69,7 @@ $assets
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="listener in listeners">
|
<tr v-for="listener in listeners">
|
||||||
<td>{{ listener.ip }}</td>
|
<td>{{ listener.ip }}</td>
|
||||||
|
<td>{{ formatTime(listener.connected_time) }}</td>
|
||||||
<td>{{ listener.connected_time }}</td>
|
<td>{{ listener.connected_time }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span v-if="listener.is_mobile">
|
<span v-if="listener.is_mobile">
|
||||||
|
|
Loading…
Reference in New Issue