summaryrefslogtreecommitdiffstats
path: root/modules-available/rebootcontrol/templates/header.html
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/rebootcontrol/templates/header.html')
-rw-r--r--modules-available/rebootcontrol/templates/header.html79
1 files changed, 79 insertions, 0 deletions
diff --git a/modules-available/rebootcontrol/templates/header.html b/modules-available/rebootcontrol/templates/header.html
new file mode 100644
index 00000000..e171ccd6
--- /dev/null
+++ b/modules-available/rebootcontrol/templates/header.html
@@ -0,0 +1,79 @@
+<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> \ No newline at end of file