summaryrefslogtreecommitdiffstats
path: root/modules-available/syslog/templates/page-syslog.html
blob: d4709456a1b15b902c0dcd84d463289a5bf83623 (plain) (blame)
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
<h1>{{lang_clientLog}}</h1>
<style type="text/css">
	.selectize-dropdown {
		max-width: 500px;
	}
</style>
<form method="post" action="?do=SysLog{{#machineuuid}}&machineuuid={{machineuuid}}{{/machineuuid}}">
	<input type="hidden" name="token" value="{{token}}">
	<div class="pull-left">
		<label for="filterstring">{{lang_filter}}</label>
	</div>
	<div class="clearfix"></div>


	<div class="row">
		<div class="col-sm-1">
			<div class="checkbox">
				<input id="notbox" type="checkbox" name="not" {{#not}}checked="checked"{{/not}}>
				<label for="notbox">{{lang_not}}</label>
			</div>
		</div>
		<div class="col-sm-11">
			<div class="input-group">
				<input id="filterstring" placeholder="id" value="{{filter}}" name="filter">
				<span style="padding-bottom: 5px;" class="input-group-btn">
					<button class="btn btn-primary" type="submit">{{lang_applyFilter}}</button>
				</span>
			</div>
		</div>
	</div>
</form>
{{{pagenav}}}


<table class="table table-striped table-condensed">
	<thead>
	<th width="1"></th>
	<th class="text-center">{{lang_when}}</th>
	<th class="text-center">{{lang_client}}</th>
	<th class="text-center">{{lang_event}}</th>
	<th width="1">{{lang_details}}</th>
	</thead>
	<tbody>
	{{#list}}
		<tr>
			<td><span class="type-button glyphicon {{icon}}" title="{{logtypeid}}"></span></td>
			<td class="text-center" nowrap="nowrap">{{date}}</td>
			<td class="text-left"><a href="?do=statistics&uuid={{machineuuid}}">{{clientip}}</a></td>
			<td>{{description}}</td>
			<td class="text-center">{{#extra}}
				<a class="btn btn-default btn-xs" onclick="$('#details-body').html($('#extra-{{logid}}').html())"
					data-toggle="modal" data-target="#myModal">&raquo;</a>
				<div class="hidden" id="extra-{{logid}}">{{extra}}</div>
			{{/extra}}</td>
		</tr>
	{{/list}}
	</tbody>
</table>

{{{pagenav}}}

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
						class="sr-only">Close</span></button>
				<h4 class="modal-title" id="myModalLabel">{{lang_details}}</h4>
			</div>
			<div class="modal-body">
				<pre id="details-body"></pre>
			</div>
		</div>
	</div>
</div>

<script type="application/javascript"><!--
document.addEventListener('DOMContentLoaded', function () {

	function renderOption(item, escape) {
		return '<div><div class="pull-right badge">' + escape(item.counter) + '</div>' + escape(item.logtypeid) + '</div>';
	}

	function renderSelected(item, escape) {
		return '<div>' + escape(item.logtypeid) + '</div>';
	}

	var opts = {{{types}}} || [];
	var $box = $('#filterstring').selectize({
		options: opts,
		plugins: ["remove_button"],
		valueField: 'logtypeid',
		searchField: "logtypeid",
		openOnFocus: true,
		create: true,
		render: {option: renderOption, item: renderSelected},
		maxItems: null,
		highlight: false
	});
	var inst = $box[0].selectize;

	$('.type-button').click(function() {
		inst.addOption({logtypeid: this.title, counter: ''});
		inst.addItem(this.title, true);
	});
});
//--></script>