mirror of
https://git.openwrt.org/project/luci.git
synced 2025-12-20 08:49:59 +08:00
luci-app-travelmate: update 2.3.0-2
Some checks failed
LuCI repo CodeQL Analysis / Analyze JavaScript and JSON (javascript-typescript) (push) Has been cancelled
Some checks failed
LuCI repo CodeQL Analysis / Analyze JavaScript and JSON (javascript-typescript) (push) Has been cancelled
* fix a small issue in the new log-template Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
@@ -7,7 +7,7 @@ LUCI_TITLE:=LuCI support for Travelmate
|
|||||||
LUCI_DEPENDS:=+luci-base +luci-lib-uqr +travelmate
|
LUCI_DEPENDS:=+luci-base +luci-lib-uqr +travelmate
|
||||||
|
|
||||||
PKG_VERSION:=2.3.0
|
PKG_VERSION:=2.3.0
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
PKG_LICENSE:=Apache-2.0
|
PKG_LICENSE:=Apache-2.0
|
||||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||||
|
|
||||||
|
|||||||
@@ -18,25 +18,24 @@ function Logview(logtag, name) {
|
|||||||
const logEl = document.getElementById('logfile');
|
const logEl = document.getElementById('logfile');
|
||||||
if (!logEl) return;
|
if (!logEl) return;
|
||||||
|
|
||||||
const entries = res?.log ?? [];
|
const filtered = (res?.log ?? [])
|
||||||
if (entries.length > 0) {
|
.filter(entry => !logtag || entry.msg.includes(logtag))
|
||||||
const filtered = entries
|
.map(entry => {
|
||||||
.filter(entry => !logtag || entry.msg.includes(logtag))
|
const d = new Date(entry.time);
|
||||||
.map(entry => {
|
const date = d.toLocaleDateString([], {
|
||||||
const d = new Date(entry.time);
|
year: 'numeric',
|
||||||
const date = d.toLocaleDateString([], {
|
month: '2-digit',
|
||||||
year: 'numeric',
|
day: '2-digit'
|
||||||
month: '2-digit',
|
});
|
||||||
day: '2-digit'
|
const time = d.toLocaleTimeString([], {
|
||||||
});
|
hour: '2-digit',
|
||||||
const time = d.toLocaleTimeString([], {
|
minute: '2-digit',
|
||||||
hour: '2-digit',
|
second: '2-digit',
|
||||||
minute: '2-digit',
|
hour12: false
|
||||||
second: '2-digit',
|
});
|
||||||
hour12: false
|
return `[${date}-${time}] ${entry.msg}`;
|
||||||
});
|
});
|
||||||
return `[${date}-${time}] ${entry.msg}`;
|
if (filtered.length > 0) {
|
||||||
});
|
|
||||||
logEl.value = filtered.join('\n');
|
logEl.value = filtered.join('\n');
|
||||||
} else {
|
} else {
|
||||||
logEl.value = _('No %s related logs yet!').format(name);
|
logEl.value = _('No %s related logs yet!').format(name);
|
||||||
|
|||||||
Reference in New Issue
Block a user