aboutsummaryrefslogtreecommitdiff
path: root/app/views/index/logs.phtml
blob: 5e4812a3ae587192c20fa2bcc1e3a3de1f304a1f (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
<?php
	declare(strict_types=1);
	/** @var FreshRSS_View $this */
	$this->partial('aside_configure');
?>
<main class="post">
	<h1><?= _t('index.log') ?></h1>

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

	<?php if (!empty($items)) { ?>
		<form method="post" action="<?= _url('index', 'logs') ?>">
			<?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?>

			<div id="loglist-wrapper" class="table-wrapper scrollbar-thin">
				<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()) ?: 0) ?>">
							<?= date('Y-m-d H:i:s', @strtotime($log->date()) ?: 0) ?>
						</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'); ?>

			<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>