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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
<?php
use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
use Fisharebest\Webtrees\Http\RequestHandlers\SiteLogsData;
use Fisharebest\Webtrees\Http\RequestHandlers\SiteLogsDelete;
use Fisharebest\Webtrees\Http\RequestHandlers\SiteLogsDownload;
use Fisharebest\Webtrees\Http\RequestHandlers\SiteLogsPage;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\View;
?>
<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
<h1><?= $title ?></h1>
<form method="post" class="form" name="logs">
<?= csrf_field() ?>
<div class="row">
<div class="form-group col-xs-6 col-sm-3">
<label for="from">
<?= I18N::translateContext('Start of date range', 'From') ?>
</label>
<input type="date" class="form-control" id="from" max="<?= e($latest) ?>" min="<?= e($earliest) ?>" name="from" value="<?= e($from) ?>" required>
</div>
<div class="form-group col-xs-6 col-sm-3">
<label for="to">
<?= I18N::translateContext('End of date range', 'To') ?>
</label>
<input type="date" class="form-control" id="to" max="<?= e($latest) ?>" min="<?= e($earliest) ?>" name="to" value="<?= e($to) ?>" required>
</div>
<div class="form-group col-xs-6 col-sm-2">
<label for="type">
<?= I18N::translate('Type') ?>
</label>
<?= view('components/select', ['name' => 'type', 'selected' => $type, 'options' => ['' => '', 'auth' => 'auth', 'config' => 'config', 'debug' => 'debug', 'edit' => 'edit', 'error' => 'error', 'media' => 'media', 'search' => 'search']]) ?>
</div>
<div class="form-group col-xs-6 col-sm-4">
<label for="ip">
<?= I18N::translate('IP address') ?>
</label>
<input class="form-control" type="text" id="ip" name="ip" value="<?= e($ip) ?>">
</div>
</div>
<div class="row">
<div class="form-group col-sm-4">
<label for="text">
<?= I18N::translate('Message') ?>
</label>
<input class="form-control" type="text" id="text" name="text" value="<?= e($text) ?>">
</div>
<div class="form-group col-sm-4">
<label for="username">
<?= I18N::translate('User') ?>
</label>
<?= view('components/select', ['name' => 'username', 'selected' => $username, 'options' => $user_options]) ?>
</div>
<div class="form-group col-sm-4">
<label for="tree">
<?= I18N::translate('Family tree') ?>
</label>
<?= view('components/select', ['name' => 'tree', 'selected' => $tree, 'options' => $tree_options]) ?>
</div>
</div>
<div class="text-center">
<button type="submit" class="btn btn-primary">
<?= view('icons/search') ?>
<?= /* I18N: A button label. */ I18N::translate('search') ?>
</button>
<a href="<?= e(route(SiteLogsPage::class)) ?>" type="submit" class="btn btn-secondary">
<?= view('icons/cancel') ?>
<?= /* I18N: A button label. */ I18N::translate('reset') ?>
</a>
<a href="<?= e(route(SiteLogsDownload::class, ['from' => $from, 'to' => $to, 'type' => $type, 'text' => $text, 'ip' => $ip, 'username' => $username, 'tree' => $tree])) ?>" class="btn btn-secondary">
<?= view('icons/download') ?>
<?= /* I18N: A button label. */ I18N::translate('download') ?>
</a>
<a href="#" class="btn btn-danger" data-confirm="<?= I18N::translate('Permanently delete these records?') ?>" data-post-url="<?= e(route(SiteLogsDelete::class, ['from' => $from, 'to' => $to, 'type' => $type, 'text' => $text, 'ip' => $ip, 'username' => $username, 'tree' => $tree])) ?>">
<?= view('icons/delete') ?>
<?= /* I18N: A button label. */ I18N::translate('delete') ?>
</a>
</div>
</form>
<table
class="table table-bordered table-sm table-hover table-site-logs"
<?= view('lists/datatables-attributes') ?>
data-ajax="<?= e(route(SiteLogsData::class, ['from' => $from, 'to' => $to, 'type' => $type, 'text' => $text, 'ip' => $ip, 'username' => $username, 'tree' => $tree])) ?>"
data-server-side="true"
>
<thead>
<tr>
<th></th>
<th><?= I18N::translate('Timestamp') ?></th>
<th><?= I18N::translate('Type') ?></th>
<th><?= I18N::translate('Message') ?></th>
<th><?= I18N::translate('IP address') ?></th>
<th><?= I18N::translate('User') ?></th>
<th><?= I18N::translate('Family tree') ?></th>
</tr>
</thead>
</table>
<?php View::push('javascript') ?>
<script>
$(".table-site-logs").dataTable( {
processing: true,
sorting: [[ 0, "desc" ]],
columns: [
/* log_id */ { visible: false },
/* Timestamp */ { sort: 0 },
/* Type */ { },
/* message */ { },
/* IP address */ { },
/* User */ { },
/* Family tree */ { }
]
});
</script>
<?php View::endpush() ?>
|