summaryrefslogtreecommitdiffstats
path: root/modules-available/webinterface/templates
diff options
context:
space:
mode:
authorChristian Hofmaier2017-04-12 14:30:18 +0200
committerChristian Hofmaier2017-04-12 14:30:18 +0200
commit9f27c7cdeb1df2f9c42373f419c6621d4faa71ca (patch)
treee55c6e1d95685df2117401e97f946b962f4e0f47 /modules-available/webinterface/templates
parent[permissionmanager] changed description to tooltips (diff)
parent[rebootcontrol] New module for shutting down and rebooting clients (diff)
downloadslx-admin-9f27c7cdeb1df2f9c42373f419c6621d4faa71ca.tar.gz
slx-admin-9f27c7cdeb1df2f9c42373f419c6621d4faa71ca.tar.xz
slx-admin-9f27c7cdeb1df2f9c42373f419c6621d4faa71ca.zip
Merge branches 'master' and 'permission-manager' of git.openslx.org:openslx-ng/slx-admin into permission-manager
Diffstat (limited to 'modules-available/webinterface/templates')
-rw-r--r--modules-available/webinterface/templates/httpd-restart.html38
-rw-r--r--modules-available/webinterface/templates/https.html34
-rw-r--r--modules-available/webinterface/templates/passwords.html1
3 files changed, 69 insertions, 4 deletions
diff --git a/modules-available/webinterface/templates/httpd-restart.html b/modules-available/webinterface/templates/httpd-restart.html
index cc84aafb..ac4e726b 100644
--- a/modules-available/webinterface/templates/httpd-restart.html
+++ b/modules-available/webinterface/templates/httpd-restart.html
@@ -1,6 +1,42 @@
<div class="panel panel-default">
<div class="panel-heading">{{lang_applyingSettings}}</div>
<div class="panel-body">
- <div data-tm-id="{{taskid}}" data-tm-log="error">{{lang_installAndRestart}}</div>
+ <div data-tm-id="{{taskid}}" data-tm-log="error" data-tm-callback="slxRestartCb">{{lang_installAndRestart}}</div>
</div>
</div>
+<script type="application/javascript"><!--
+
+var slxRedirTimeout = 0;
+var slxRedirTimer = false;
+
+function slxRestartCb(task) {
+ if (!task || !task.statusCode)
+ return;
+ if (task.statusCode === 'TASK_WAITING' || task.statusCode === 'TASK_PROCESSING') {
+ // Polling still works, reset counter
+ console.log('Resetting because ' + task.statusCode);
+ slxRedirTimeout = 0;
+ } else {
+ console.log('Disabling because ' + task.statusCode);
+ clearInterval(slxRedirTimer);
+ window.location.replace(window.location.href.replace('&show=httpsupdate', ''));
+ }
+}
+
+slxRedirTimer = setInterval(function() {
+ // Didn't get status update from TM for 6 seconds - try to switch protocols
+ if (++slxRedirTimeout > 6) {
+ console.log('TIMEOUT REACHED');
+ clearInterval(slxRedirTimer);
+ var url = window.location.href.split(':', 2)[1];
+ if (window.location.protocol === 'https:') {
+ url = 'http:' + url;
+ } else {
+ url = 'https:' + url;
+ }
+ console.log('REDIRECT TO ' + url);
+ window.location.replace(url);
+ }
+}, 1000);
+
+//--></script> \ No newline at end of file
diff --git a/modules-available/webinterface/templates/https.html b/modules-available/webinterface/templates/https.html
index dfd2a3fe..77585ddf 100644
--- a/modules-available/webinterface/templates/https.html
+++ b/modules-available/webinterface/templates/https.html
@@ -5,9 +5,26 @@
<div class="panel-heading">{{lang_httpsSettings}}</div>
<div class="panel-body">
<p>{{lang_httpsDescription}}</p>
- {{^httpsEnabled}}
- <p>{{lang_HttpsIsDisabled}}</p>
- {{/httpsEnabled}}
+ {{^httpsUsed}}
+ {{lang_youreNotUsingHttps}}
+ {{/httpsUsed}}
+ {{#httpsUsed}}
+ {{lang_youreUsingHttps}}
+ {{/httpsUsed}}
+ <div class="text-info slx-bold">
+ {{#offSelected}}
+ <p>{{lang_offSelected}}</p>
+ {{/offSelected}}
+ {{#unknownSelected}}
+ <p>{{lang_unknownSelected}}</p>
+ {{/unknownSelected}}
+ {{#generatedSelected}}
+ <p>{{lang_generatedSelected}}</p>
+ {{/generatedSelected}}
+ {{#suppliedSelected}}
+ <p>{{lang_suppliedSelected}}</p>
+ {{/suppliedSelected}}
+ </div>
{{#httpsEnabled}}
<div class="input-group" onclick="$('#moff').prop('checked', true);
$('#wcustom').hide()">
@@ -31,6 +48,7 @@
{{lang_customCert}}
</span>
</div>
+
<div class="well well-sm" style="display:none" id="wcustom">
{{lang_certificate}}
<pre class="small">
@@ -52,6 +70,16 @@ MIIFfTCCA...
<textarea name="cachain" class="form-control small" cols="101" rows="10"></textarea>
<hr>
</div>
+
+ <br>
+ <div class="input-group">
+ <span class="input-group-addon"><input id="httpsredirect" type="checkbox" name="httpsredirect" value="on" {{redirect_checked}}></span>
+ <span class="form-control" onclick="$('#httpsredirect').prop('checked', !$('#httpsredirect').prop('checked'))">
+ {{lang_httpsRedirect}}
+ </span>
+ </div>
+ <br>
+
<div class="pull-right">
<button type="submit" class="btn btn-primary">{{lang_save}}</button>
</div>
diff --git a/modules-available/webinterface/templates/passwords.html b/modules-available/webinterface/templates/passwords.html
index 1f23dfc4..8481d884 100644
--- a/modules-available/webinterface/templates/passwords.html
+++ b/modules-available/webinterface/templates/passwords.html
@@ -17,6 +17,7 @@
{{lang_hidePasswords}}
</span>
</div>
+ <br>
<div class="pull-right">
<button type="submit" class="btn btn-primary">{{lang_save}}</button>
</div>