summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/templates/page-replace.html
blob: a83774f670ff236ddf6b5f818ee384265c09daea (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
<h1>{{lang_replaceMachinesHeading}}</h1>

<style>
	.reptable {
		border-collapse: separate;
		border-spacing: 2px;
	}
	.reptable td.a {
		padding: 2px;
		border:1px solid #ccc;
		border-radius: 3px;
		background: #eee;
		vertical-align: top;
	}
	.reptable td.b {
		font-size: 300%;
	}
</style>

<p>
	{{lang_replaceInstructions}}
</p>

<form method="post" action="?do=statistics&amp;show=replace">
	<input type="hidden" name="token" value="{{token}}">
	<table class="reptable">
		<thead>
		<tr>
			<th>{{lang_replaceOld}}</th>
			<th></th>
			<th>{{lang_replaceNew}}</th>
			<th></th>
		</tr>
		</thead>
		<tbody>
		{{#pairs}}
			<tr>
				<td class="a">
					<div><b>{{oldhost}}</b> {{oldip}}</div>
					<div class="slx-bold">{{oldmodel}}</div>
					<div class="small">{{oldmac}} – {{olduuid}}</div>
					<div>{{lang_lastSeen}}: {{oldlastseen_s}}</div>
				</td>
				<td class="b">&rightarrow;</td>
				<td class="a">
					<div><b>{{newhost}}</b> {{newip}}</div>
					<div class="slx-bold">{{newmodel}}</div>
					<div class="small">{{newmac}} – {{newuuid}}</div>
					<div>{{lang_firstSeen}}: {{newfirstseen_s}}</div>
				</td>
				<td>
					<div class="checkbox checkbox-inline">
						<input type="checkbox" name="replace[]" value="{{olduuid}}x{{newuuid}}">
						<label></label>
					</div>
				</td>
			</tr>
		{{/pairs}}
		</tbody>
	</table>

	<div class="text-right">
		<button type="submit" class="btn btn-danger" name="action" value="replace" data-confirm="#confirm-replace" data-title="{{lang_replace}}">
			<span class="glyphicon glyphicon-floppy-disk"></span>
			{{lang_replace}}
			(<span id="rep-count">0</span>)
		</button>
	</div>
</form>
<div class="hidden" id="confirm-replace">{{lang_sureReplaceNoUndo}}</div>

<script type="application/javascript"><!--
	document.addEventListener('DOMContentLoaded', function () {
		$('td.a').click(function () {
			var $cb = $(this).parent().find('input:checkbox');
			$cb.prop('checked', !$cb.is(':checked'));
			cbChanged();
		});
		$('input:checkbox').change(function () {
			cbChanged();
		});
		function cbChanged() {
			var cnt = $('input:checkbox:checked').length;
			$('#rep-count').text(cnt).parent().prop('disabled', cnt === 0);
		}
		cbChanged();
	});
//--></script>