Improvements to log viewer

This commit is contained in:
Andy Miller
2019-02-04 16:29:52 -07:00
parent 8471095b6b
commit b5f8eb8b25
9 changed files with 55 additions and 39 deletions

View File

@@ -6,6 +6,7 @@ logo_text: ''
body_classes: ''
content_padding: true
twofa_enabled: true
log_viewer_files: ['grav', 'email']
sidebar:
activate: tab
hover_delay: 100

View File

@@ -253,6 +253,15 @@ form:
label: Hide modular page types in Admin
value_only: true
log_viewer_files:
type: selectize
size: medium
label: PLUGIN_ADMIN.LOG_VIEWER_FILES
help: PLUGIN_ADMIN.LOG_VIEWER_FILES_HELP
classes: fancy
validate:
type: commalist
MediaResize:
type: section
title: Page Media Image Resizer

View File

@@ -782,5 +782,7 @@ PLUGIN_ADMIN:
UPLOADS_DANGEROUS_EXTENSIONS_HELP: "Block these extensions from being uploaded no matter the accepted MIME types"
REPORTS: "Reports"
LOGS: "Logs"
LOG_VIEWER_FILES: "Log Viewer Files"
LOG_VIEWER_FILES_HELP: "Files in /logs/ that will be available to view in Tools - Logs. e.g. 'grav' = /logs/grav.log"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1243,11 +1243,20 @@ body.sidebar-quickopen #admin-main {
.logs-output {
form {
float: right;
.form-select {
display: inline-block;
width: auto;
.form-data {
display: flex;
margin: 0 -0.5rem;
@include breakpoint(small-mobile-range) {
display: block;
}
}
.forms-select-wrapper {
display: block;
flex: 1;
margin: 0.5rem 0.5rem;
}
}
@@ -1258,6 +1267,10 @@ body.sidebar-quickopen #admin-main {
h3 {
padding: 0.5rem 1.5rem;
font-size: 1.1rem;
@include breakpoint(mobile-only) {
padding: 0.5rem 1rem;
}
}
table.noflex {
@@ -1287,6 +1300,7 @@ body.sidebar-quickopen #admin-main {
td.message {
width: 100%;
word-break: break-all;
}
.trace {
@@ -1297,10 +1311,11 @@ body.sidebar-quickopen #admin-main {
code {
font-size: 0.7rem;
display: block;
white-space: pre-wrap
}
}
}
}
}

View File

@@ -382,8 +382,6 @@ form {
}
.switch-toggle {
// margin-left: 30%;
label {
cursor: pointer;
}

View File

@@ -70,18 +70,6 @@ i.fa {
}
}
// Blockquote
blockquote {
p {
font-size: 1.1rem;
}
cite {
display: block;
text-align: right;
font-size: 1.2rem;
}
}
pre {
padding: 2rem;
border-radius: 3px;

View File

@@ -1,5 +1,20 @@
<div class="logs-content">
{% macro render_select(name, options, selected, autokey=false) %}
<div class="forms-select-wrapper">
<select class="form-select" name="{{ name }}" data-grav-selectize>
{% for key,option in options %}
{% if autokey %}
{% set key = key|of_type('int') ? option|lower : key %}
{% endif %}
<option value="{{ key }}" {{ key == selected ? ' selected' : '' }}>{{ option|titleize }}</option>
{% endfor %}
</select>
</div>
{% endmacro %}
{% import _self as macro %}
{% if authorize(['admin.super']) %}
{% set file = grav.uri.query('log') ?: 'grav' %}
{% set verbose = grav.uri.query('verbose') == 'true' ? true : false %}
@@ -9,28 +24,16 @@
<div class="logs-output">
<form>
<form id="logs-form">
<div class="block block-select">
<div class="form-field">
<div class="form-data">
<select class="form-select selectized" name="log">
<option value="grav">Grav</option>
<option value="email">Email</option>
</select>
{% set log_files = config.plugins.admin.log_viewer_files|default(['grav','email']) %}
{% set lines_list = {10:'10 entries', 25:'25 entries', 50:'50 entries', 100:'100 entries', 200:'200 entries', 500:'500 entries'} %}
<select class="form-select selectized" name="verbose">
<option value="false">Essential Details</option>
<option value="true">Verbose Output</option>
</select>
<select class="form-select selectized" name="lines">
<option value="10">10 entries</option>
<option value="25">25 entries</option>
<option value="50">50 entries</option>
<option value="100">100 entries</option>
<option value="200">200 entries</option>
<option value="500">500 entries</option>
</select>
{{ macro.render_select('log', log_files, file, true) }}
{{ macro.render_select('verbose', {'false':'Essential Output', 'true':'Verbose Output'}, verbose) }}
{{ macro.render_select('lines', lines_list, lines) }}
</div>
</div>
</div>