bugfix: console responsive select & datetime

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej 2020-12-14 00:11:18 +01:00
parent e40a76f085
commit b4e311277a

View File

@ -64,6 +64,7 @@
disable-pagination
class="event-table"
:custom-sort="customSort"
mobile-breakpoint="0"
>
<template #no-data>
<div class="text-center">empty</div>
@ -71,9 +72,12 @@
<template #item="{ item }">
<tr>
<td class="log-cell title-cell py-2 flex-grow-0 pr-0">
<td class="log-cell title-cell py-2 flex-grow-0 pr-0 d-none d-sm-table-cell">
{{ item.date.toLocaleString() }}
</td>
<td class="log-cell title-cell py-2 flex-grow-0 pr-0 d-sm-none">
{{ formatTimeMobile(item.date)}}
</td>
<td class="log-cell content-cell py-2" colspan="2">
<span v-if="item.message" class="message" v-html="formatMessage(item.message)"></span>
</td>
@ -136,6 +140,17 @@
this.gcode = "";
this.lastCommandNumber = null;
},
formatTimeMobile(date) {
let hours = date.getHours();
if (hours < 10) hours = "0"+hours.toString();
let minutes = date.getMinutes();
if (minutes < 10) minutes = "0"+minutes.toString();
let seconds = date.getSeconds();
if (seconds < 10) seconds = "0"+seconds.toString();
return hours+":"+minutes+":"+seconds;
},
formatMessage(message) {
if (typeof message === "string") message = message.replace(/(?:\r\n|\r|\n)/g, '<br>');