diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index ba15534d5e..1bf908e1da 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -84,6 +84,20 @@ blockquote { overflow: hidden !important; } +/** + * details tag + */ +details { + padding: .5em .5em 0; +} +details details { + padding-left: .5em; +} +details summary { + font-weight: bold; + display: list-item; +} + /** * mobile aside */ diff --git a/view/theme/frio/js/module/admin/logs/view.js b/view/theme/frio/js/module/admin/logs/view.js new file mode 100644 index 0000000000..fc19af28a2 --- /dev/null +++ b/view/theme/frio/js/module/admin/logs/view.js @@ -0,0 +1,41 @@ +$(function(){ + $(".log-event").on("click", function(ev) { + var $modal = $("#logdetail"); + var tr = $modal.find(".main-data tbody tr")[0]; + tr.innerHTML = ev.currentTarget.innerHTML; + + var data = JSON.parse(ev.currentTarget.dataset.source); + $modal.find(".source-data td").each(function(i,elm){ + var k = elm.dataset.value; + elm.innerText = data[k]; + }); + + var elm = $modal.find(".event-data")[0]; + elm.innerHTML = ""; + var data = ev.currentTarget.dataset.data; + if (data !== "") { + elm.innerHTML = "

Data

"; + data = JSON.parse(data); + elm.innerHTML += recursive_details("", data); + } + + $modal.modal({}) + }) + + function recursive_details(s, data, lev=0) { + for(var k in data) { + if (data.hasOwnProperty(k)) { + var v = data[k]; + var open = lev > 1 ? "" : "open"; + s += "
" + k + ""; + if (typeof v === 'object' && v !== null) { + s = recursive_details(s, v, lev+1); + } else { + s += $("
").text(v)[0].outerHTML;
+				}
+				s += "
"; + } + } + return s; + } +}); diff --git a/view/theme/frio/templates/admin/logs/view.tpl b/view/theme/frio/templates/admin/logs/view.tpl new file mode 100755 index 0000000000..99a96befd5 --- /dev/null +++ b/view/theme/frio/templates/admin/logs/view.tpl @@ -0,0 +1,93 @@ +
+

{{$title}} - {{$page}}

+ +

{{$logname}}

+ {{if $error }} +
+

{{$error nofilter}}

+
+ {{else}} + + + + + + + + + + + {{foreach $data as $row}} + + + + + + + {{/foreach}} + +
DateLevelContextMessage
{{$row->date}}level == "ERROR"}}bg-danger + {{elseif $row->level == "WARNING"}}bg-warinig + {{elseif $row->level == "NOTICE"}}bg-info + {{elseif $row->level == "DEBUG"}}text-muted + {{/if}} + ">{{$row->level}}{{$row->context}}{{$row->message}}
+ {{/if}} +
+ +