| 1 | {@ include(common/header) @} |
| 2 | {@ include(admin/nav) @} |
| 3 | <h1 class="paragraph">ログ</h1> |
| 4 | {@ if (!$logging) @} |
| 5 | <p class="admin-warn">LOGGING_ENABLEDが無効なので、新しいログは残りません。</p> |
| 6 | {@ endif @} |
| 7 | {@ if (!$dirExists) @} |
| 8 | <p class="paragraph">log/が有りません。</p> |
| 9 | {@ elif (empty($list)) @} |
| 10 | <p class="paragraph">ログは有りません。</p> |
| 11 | {@ else @} |
| 12 | <table class="admin-table"> |
| 13 | <thead><tr><th>ファイル</th><th>大きさ</th><th>更新</th></tr></thead> |
| 14 | <tbody> |
| 15 | {@ foreach ($list as $l) @} |
| 16 | <tr{{{ $l['name'] === $file ? ' class="admin-current"' : '' }}}><td><a href="/admin/logs?file={{ rawurlencode($l['name']) }}">{{ $l['name'] }}</a></td><td>{{ $l['sizeText'] }}</td><td>{{ $l['time'] }}</td></tr> |
| 17 | {@ endforeach @} |
| 18 | </tbody> |
| 19 | </table> |
| 20 | {@ endif @} |
| 21 | {@ if ($file !== '') @} |
| 22 | <h2 class="paragraph">{{ $file }}</h2> |
| 23 | <form method="get" action="/admin/logs" class="admin-row"> |
| 24 | <input type="hidden" name="file" value="{{ $file }}" /> |
| 25 | <select name="lines"> |
| 26 | {@ foreach ([50, 200, 1000, 5000] as $n) @} |
| 27 | <option value="{{ $n }}"{{{ $n === $lines ? ' selected="selected"' : '' }}}>最後の{{ $n }}行</option> |
| 28 | {@ endforeach @} |
| 29 | </select> |
| 30 | <input type="text" name="q" value="{{ $q }}" placeholder="検索" /> |
| 31 | <button>表示</button> |
| 32 | <a href="/admin/logs?file={{ rawurlencode($file) }}&download=1">ダウンロード</a> |
| 33 | </form> |
| 34 | {@ if ($tail['more']) @} |
| 35 | <p class="paragraph"><small>前にもっと有ります(全部はダウンロードで)。</small></p> |
| 36 | {@ endif @} |
| 37 | {@ if (empty($tail['lines'])) @} |
| 38 | <p class="paragraph">{{ $q !== '' ? '一致する行は有りません。' : '空です。' }}</p> |
| 39 | {@ else @} |
| 40 | <pre class="admin-pre admin-log">{{ implode("\n", $tail['lines']) }}</pre> |
| 41 | {@ endif @} |
| 42 | <form method="post" action="/admin/logs?file={{ rawurlencode($file) }}" class="admin-row"> |
| 43 | <input type="hidden" name="csrf_token" value="{{ $csrf }}" /> |
| 44 | <input type="hidden" name="file" value="{{ $file }}" /> |
| 45 | <button name="do" value="clear">空にする</button> |
| 46 | <button name="do" value="delete" class="danger">削除</button> |
| 47 | </form> |
| 48 | {@ endif @} |
| 49 | {@ include(common/footer) @} |