aboutsummaryrefslogtreecommitdiff
path: root/app/views/index/logs.phtml
blob: f6a76b9221a272f3c88420b732c595c391d54864 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php /** @var FreshRSS_View $this */ ?>
<?php $this->partial('aside_configure'); ?>
<main class="post">
	<div class="link-back-wrapper">
		<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
	</div>

	<h1><?= _t('index.log') ?></h1>
	

	<?php
		/** @var array<FreshRSS_Log> $items */
		$items = $this->logsPaginator->items();
	?>

	<?php if (!empty($items)) { ?>
	<?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?>
	<div id="loglist-wrapper" class="table-wrapper">
		<table id="loglist">
			<thead>
				<th><?= _t('conf.logs.loglist.level') ?></th>
				<th><?= _t('conf.logs.loglist.timestamp') ?></th>
				<th><?= _t('conf.logs.loglist.message') ?></th>
			</thead>
			<tbody>
		<?php foreach ($items as $log) { ?>
		<tr class="log-item log-<?= $log->level() ?>">
			<td class="log-level">
				<?= _i($log->level()) ?>
			</td>
			<td class="log-date">
				<time datetime="<?= @date('Y-m-d H:i:s', @strtotime($log->date())) ?>">
					<?= @date('Y-m-d H:i:s', @strtotime($log->date())) ?>
				</time>
			</td>
			<td class="log-message">
				<?= htmlspecialchars($log->info(), ENT_NOQUOTES, 'UTF-8') ?>
			</td>
			</tr>
		<?php } ?>
		</tbody>
		</table>
	</div>
	<?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?>
	


	<form method="post" action="<?= _url('index', 'logs') ?>">
	<div class="form-group form-actions">
	<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
		<input type="hidden" name="clearLogs" />
		<div class="group-controls">
		<button type="submit" class="btn btn-attention"><?= _t('index.log.clear') ?></button>
		</div>
	</div>
	</form>

	<?php } else { ?>
	<p class="alert alert-warn"><?= _t('index.log.empty') ?></p>
	<?php } ?>
	
</main>