summaryrefslogblamecommitdiffstats
path: root/modules-available/rebootcontrol/templates/header.html
blob: e171ccd63206cd59a4430d75b141a00250d3a5fd (plain) (tree)










































                                                                                                                                                                                                              
                                                                 


                                                                     



                                                                                                                                                     













                                                                                












                                                                             
        
<div class="page-header">
	<button type="button" id="settingsButton" class="btn btn-default pull-right" data-toggle="modal" data-target="#settingsModal"><span class="glyphicon glyphicon-cog"></span> {{lang_settings}}</button>
	<h1>{{lang_rebootControl}}</h1>
</div>

<div>
	<label>{{lang_location}}:
		<select id="locationDropdown" class="form-control" onchange="selectLocation()">
			{{#locations}}
				<option value="{{locationid}}" {{disabled}} {{#selected}}selected{{/selected}}>{{locationpad}} {{locationname}}</option>
			{{/locations}}
		</select>
	</label>
	<div class="pull-right">
		<button type="button" id="shutdownButton" class="btn btn-danger action-button" data-toggle="modal" data-target="#shutdownModal" disabled>
			<span class="glyphicon glyphicon-off"></span>
			{{lang_shutdownButton}}
		</button>
		<button type="button" id="rebootButton" class="btn btn-warning action-button" data-toggle="modal" data-target="#rebootModal" disabled>
			<span class="glyphicon glyphicon-repeat"></span>
			{{lang_rebootButton}}
		</button>
		<button type="button" id="selectAllButton" class="btn btn-primary select-button" disabled>
			<span class="glyphicon glyphicon-check"></span>
			{{lang_selectall}}
		</button>
		<button type="button" id="unselectAllButton" class="btn btn-default select-button collapse" disabled>
			<span class="glyphicon glyphicon-unchecked"></span>
			{{lang_unselectall}}
		</button>
	</div>
</div>

<div id="settingsModal" class="modal fade" role="dialog">
	<div class="modal-dialog">

		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">&times;</button>
				<h4 class="modal-title"><b>{{lang_settings}}</b></h4>
			</div>
			<div class="modal-body">
				<p>{{lang_pubKey}}</p>
				<pre id="pubkey">{{pubKey}}</pre>
				<p>{{lang_newKeypairExplanation}}</p>
			</div>
			<div class="modal-footer">
				<button {{perms.newkeypair.disabled}} class="btn btn-danger pull-right" onclick="generateNewKeypair()" type="button">
					<span class="glyphicon glyphicon-refresh"></span>
					{{lang_genNew}}
				</button>
			</div>
		</div>
	</div>
</div>

<script type="application/javascript">

	// Change Location when selected in Dropdown Menu
	function selectLocation() {
		var dropdown = $("#locationDropdown");
		var location = dropdown.val();
		window.location.replace("?do=rebootcontrol&location="+location);
	}

	function generateNewKeypair() {
		if (!confirm('{{lang_confirmNewKeypair}}'))
			return;
		$.ajax({
			url: '?do=rebootcontrol',
			type: 'POST',
			data: { action: "generateNewKeypair", token: TOKEN },
			success: function(value) {
				$('#pubkey').text(value);
			}
		});
	}

</script>