From 1d1f98bd0a4917fe8587198e013d75eb4f8726c4 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:33:52 +0800 Subject: [PATCH] fix log format --- luci-app-openclash/luasrc/view/openclash/log.htm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/luci-app-openclash/luasrc/view/openclash/log.htm b/luci-app-openclash/luasrc/view/openclash/log.htm index 233ed89ac0..3f41336fac 100644 --- a/luci-app-openclash/luasrc/view/openclash/log.htm +++ b/luci-app-openclash/luasrc/view/openclash/log.htm @@ -225,20 +225,20 @@ var cn = 0; var sn = 0; str.trim().split('\n').forEach(function(v, i) { - var regex = /(time=|msg=)"([^"]*)"/g; + var regex = /(time=)"([^"]*)"/g; var res = regex.exec(v); if (res) { - var dt = new Date(res[1]); + var dt = new Date(res[2]); } else { var dtt = new Date(v.substring(0,19)); } if (dt && dt != "Invalid Date"){ if (v.indexOf("level=") != -1) { - var log_info = v.substring(res[1].length + 7); + var log_info = v.substring(res[2].length + 7); } else { - var log_info = v.substring(res[1].length + 2); + var log_info = v.substring(res[2].length + 2); } cstrt[cn]=dt.getFullYear()+"-"+p(dt.getMonth()+1)+"-"+p(dt.getDate())+" "+p(dt.getHours())+":"+p(dt.getMinutes())+":"+p(dt.getSeconds())+log_info; cn = cn + 1;