From 8dd8c7b3eb747b13b36773bd592c0e6cf2d6576a Mon Sep 17 00:00:00 2001 From: prey87 <12467410+prey87@users.noreply.github.com> Date: Mon, 21 Sep 2020 18:29:30 +0200 Subject: [PATCH] Update quarantine.js (#3767) * Update quarantine.js changed created formatter like in site/user.js, site/mailbox.js & site/admin.js to get month and day in 2-ditgit format * Update debug.js changed created formatter like in site/user.js, site/mailbox.js & site/admin.js to get month and day in 2-ditgit format * Update debug.js missed two old toLocaleString() --- data/web/js/site/debug.js | 22 +++++++++++----------- data/web/js/site/quarantine.js | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/data/web/js/site/debug.js b/data/web/js/site/debug.js index 557e431c..83145e10 100644 --- a/data/web/js/site/debug.js +++ b/data/web/js/site/debug.js @@ -36,7 +36,7 @@ jQuery(function($){ function draw_autodiscover_logs() { ft_autodiscover_logs = FooTable.init('#autodiscover_log', { "columns": [ - {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}}, + {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}}, {"name":"ua","title":"User-Agent","style":{"min-width":"200px"}}, {"name":"user","title":"Username","style":{"min-width":"200px"}}, {"name":"service","title":"Service"}, @@ -72,7 +72,7 @@ jQuery(function($){ function draw_postfix_logs() { ft_postfix_logs = FooTable.init('#postfix_log', { "columns": [ - {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}}, + {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}}, {"name":"priority","title":lang.priority,"style":{"width":"80px"}}, {"name":"message","title":lang.message}, ], @@ -107,7 +107,7 @@ jQuery(function($){ function draw_watchdog_logs() { ft_watchdog_logs = FooTable.init('#watchdog_log', { "columns": [ - {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}}, + {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}}, {"name":"service","title":"Service"}, {"name":"trend","title":"Trend"}, {"name":"message","title":lang.message}, @@ -143,7 +143,7 @@ jQuery(function($){ function draw_api_logs() { ft_api_logs = FooTable.init('#api_log', { "columns": [ - {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}}, + {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}}, {"name":"uri","title":"URI","style":{"width":"310px"}}, {"name":"method","title":"Method","style":{"width":"80px"}}, {"name":"remote","title":"IP","style":{"width":"80px"}}, @@ -181,7 +181,7 @@ jQuery(function($){ ft_rl_logs = FooTable.init('#rl_log', { "columns": [ {"name":"indicator","title":" ","style":{"width":"50px"}}, - {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.last_applied,"style":{"width":"170px"}}, + {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.last_applied,"style":{"width":"170px"}}, {"name":"rl_name","title":lang.rate_name}, {"name":"from","title":lang.sender}, {"name":"rcpt","title":lang.recipients}, @@ -225,7 +225,7 @@ jQuery(function($){ function draw_ui_logs() { ft_api_logs = FooTable.init('#ui_logs', { "columns": [ - {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}}, + {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}}, {"name":"type","title":"Type"}, {"name":"task","title":"Task"}, {"name":"user","title":"User"}, @@ -265,7 +265,7 @@ jQuery(function($){ function draw_acme_logs() { ft_acme_logs = FooTable.init('#acme_log', { "columns": [ - {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}}, + {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}}, {"name":"message","title":lang.message,"style":{"word-break":"break-all"}}, ], "rows": $.ajax({ @@ -299,7 +299,7 @@ jQuery(function($){ function draw_netfilter_logs() { ft_netfilter_logs = FooTable.init('#netfilter_log', { "columns": [ - {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}}, + {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}}, {"name":"priority","title":lang.priority,"style":{"width":"80px"}}, {"name":"message","title":lang.message}, ], @@ -334,7 +334,7 @@ jQuery(function($){ function draw_sogo_logs() { ft_sogo_logs = FooTable.init('#sogo_log', { "columns": [ - {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}}, + {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}}, {"name":"priority","title":lang.priority,"style":{"width":"80px"}}, {"name":"message","title":lang.message}, ], @@ -369,7 +369,7 @@ jQuery(function($){ function draw_dovecot_logs() { ft_dovecot_logs = FooTable.init('#dovecot_log', { "columns": [ - {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}}, + {"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}}, {"name":"priority","title":lang.priority,"style":{"width":"80px"}}, {"name":"message","title":lang.message}, ], @@ -463,7 +463,7 @@ jQuery(function($){ function draw_rspamd_history() { ft_rspamd_history = FooTable.init('#rspamd_history', { "columns": [ - {"name":"unix_time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.time,"style":{"width":"170px"}}, + {"name":"unix_time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}}, {"name": "ip","title": "IP address","breakpoints": "all","style": {"minWidth": 88}}, {"name": "sender_mime","title": "From","breakpoints": "xs sm md","style": {"minWidth": 100}}, {"name": "rcpt","title": "To","breakpoints": "xs sm md","style": {"minWidth": 100}}, diff --git a/data/web/js/site/quarantine.js b/data/web/js/site/quarantine.js index a4606645..e7817c8c 100644 --- a/data/web/js/site/quarantine.js +++ b/data/web/js/site/quarantine.js @@ -56,7 +56,7 @@ jQuery(function($){ {"name":"virus","title":lang.danger, "type": "text"}, {"name":"score","title": lang.spam_score, "type": "text"}, {"name":"notified","title":lang.notified, "type": "text"}, - {"name":"created","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleString();},"title":lang.received,"style":{"width":"170px"}}, + {"name":"created","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.received,"style":{"width":"170px"}}, {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right"},"style":{"min-width":"200px"},"type":"html","title":lang.action,"breakpoints":"xs sm md"} ], "rows": $.ajax({