summaryrefslogblamecommitdiffstats
path: root/modules-available/rebootcontrol/templates/header.html
blob: f539be9accddc7f14bccde71a32372b4f8a67c18 (plain) (tree)
1
2
3
4
5
6
                         




                                                                                                                                      










                                                                                                         
                                                                           
                                                                 
                                                                     



                                                                                                                  

                                                                                                                           


                                                                                         
                                                                      














                                                                                                                                                                 
                                                             




                                                                    





                                      









                                                                             
                               

                                            





                                                                             



                                                             

                         


           
 
        
<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_moduleHeading}}</h1>
</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">
				<label for="pubkey">{{lang_pubKey}}</label>
				<pre id="pubkey">{{pubkey}}</pre>
				<p>{{lang_newKeypairExplanation}}</p>
				<div class="checkbox">
					<input {{perms.newkeypair.disabled}} type="checkbox" id="keypair-confirm">
					<label for="keypair-confirm">{{lang_keypairConfirmCheck}}</label>
				</div>
				<button {{perms.newkeypair.disabled}} class="btn btn-danger pull-right" id="keypair-button"
						  onclick="generateNewKeypair()" type="button">
					<span class="glyphicon glyphicon-refresh"></span>
					{{lang_genNew}}
				</button>
				<div class="clearfix slx-space"></div>
			</div>
			<div class="modal-body">
				<label>{{lang_wolDiscoverHeading}}</label>
				<form method="post" action="?do=rebootcontrol">
					<input type="hidden" name="token" value="{{token}}">
					<input type="hidden" name="action" value="toggle-wol">
					<div class="checkbox">
						<input {{perms.woldiscover.disabled}} id="wol-auto-discover" type="checkbox" name="enabled" {{wol_auto_checked}}>
						<label for="wol-auto-discover">{{lang_wolAutoDiscoverCheck}}</label>
					</div>
					<div class="slx-space"></div>
					<p>{{lang_wolDiscoverDescription}}</p>
					<button {{perms.woldiscover.disabled}} class="btn btn-primary pull-right"
							  onclick="generateNewKeypair()" type="submit">
						<span class="glyphicon glyphicon-floppy-disk"></span>
						{{lang_save}}
					</button>
					<div class="clearfix"></div>
				</form>
			</div>
			<div class="modal-body">
			</div>
		</div>
	</div>
</div>

<script type="application/javascript">
document.addEventListener('DOMContentLoaded', function() {
	var $btn = $('#keypair-button');
	var $chk = $('#keypair-confirm');
	$chk.prop('checked', false); // Firefox helpfully keeping state on F5
	$btn.click(function() {
		if (!$chk.is(':checked')) {
			var $p = $chk.parent();
			$p.fadeOut(100, function () {
				$p.fadeIn(75);
			});
			return;
		}
		$btn.prop('disabled', true);
		$.ajax({
			url: '?do=rebootcontrol',
			type: 'POST',
			data: { action: "generateNewKeypair", token: TOKEN },
			success: function(value) {
				$('#pubkey').text(value);
			},
			fail: function() {
				$('#pubkey').text('Error');
				$btn.prop('disabled', false);
			}
		});
	});
});


</script>