Merge branch 'tweak/pretzel-wss-error' into 'dev'

Add link to documentation to WSS error

See merge request crafty-controller/crafty-4!272
This commit is contained in:
Iain Powrie 2022-05-24 18:14:06 +00:00
commit db13b11f18
2 changed files with 26 additions and 16 deletions

View File

@ -52,12 +52,13 @@
</div>
<div class="navbar-menu-wrapper d-flex align-items-center">
<style>
body:not(.sidebar-icon-only) .navbar-toggler .mdi-chevron-double-right {
body:not(.sidebar-icon-only) .navbar-toggler .mdi-chevron-double-right {
display: none;
}
body.sidebar-icon-only .navbar-toggler .mdi-chevron-double-left {
}
body.sidebar-icon-only .navbar-toggler .mdi-chevron-double-left {
display: none;
}
}
</style>
<button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
<span class="mdi mdi-chevron-double-left"></span>
@ -157,7 +158,8 @@
<script src="/static/assets/js/shared/off-canvas.js"></script>
<script src="/static/assets/js/shared/hoverable-collapse.js"></script>
<script src="/static/assets/js/shared/misc.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.22/fh-3.1.7/r-2.2.6/sc-2.0.3/sp-1.2.2/datatables.min.js"></script>
<script type="text/javascript"
src="https://cdn.datatables.net/v/bs4/dt-1.10.22/fh-3.1.7/r-2.2.6/sc-2.0.3/sp-1.2.2/datatables.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/5.4.0/bootbox.min.js"></script>
<script type="text/javascript" src="/static/assets/js/motd.js"></script>
@ -214,14 +216,12 @@
};
wsInternal.onerror = function (errorEvent) {
console.error('WebSocket Error', errorEvent);
warn('WebSockets are required for Crafty to work. This websocket connection has been closed. Are you using a reverse proxy? See our'+
' documentation for details')
warn('WebSockets are required for Crafty to work. This websocket connection has been closed.', 'https://wiki.craftycontrol.com/en/4/docs/Reverse%20Proxy%20Examples')
};
wsInternal.onclose = function (closeEvent) {
console.log('Closed WebSocket', closeEvent);
warn('WebSockets are required for Crafty to work. This websocket connection has been closed. Are you using a reverse proxy? See our'+
' documentation for details')
warn('WebSockets are required for Crafty to work. This websocket connection has been closed. Are you using a reverse proxy?', 'https://wiki.craftycontrol.com/en/4/docs/Reverse%20Proxy%20Examples')
};
@ -269,11 +269,11 @@
}
if (webSocket) {
webSocket.on('support_status_update', function (logs) {
if(logs.percent >= 100){
if (logs.percent >= 100) {
document.getElementById('logs_progress_bar').innerHTML = '100%';
document.getElementById('logs_progress_bar').style.width = '100%';
}else{
document.getElementById('logs_progress_bar').innerHTML = logs.percent +'%';
} else {
document.getElementById('logs_progress_bar').innerHTML = logs.percent + '%';
document.getElementById('logs_progress_bar').style.width = logs.percent + '%';
}
});
@ -341,7 +341,7 @@
}
function eulaAgree(server_id, command) {
//< !--this getCookie function is in base.html-- >
//< !--this getCookie function is in base.html-- >
var token = getCookie("_xsrf");
$.ajax({
@ -357,7 +357,7 @@
}
function warn(message) {
function warn(message, link = null) {
var closeEl = document.createElement('span');
var strongEL = document.createElement('strong');
var msgEl = document.createElement('div');
@ -383,6 +383,16 @@
parentEl.appendChild(closeEl);
parentEl.appendChild(msgEl);
if (link) {
let linkEl = document.createElement('a')
linkEl.href = link;
linkEl.innerHTML = "See our documentation for details.";
linkEl.style.color = 'white';
linkEl.style.textDecoration = 'underline';
linkEl.target = "_blank";
parentEl.appendChild(linkEl);
}
document.querySelector('.warnings').appendChild(parentEl);
}

View File

@ -1,5 +1,5 @@
#Base config made by Justman10000 and Zedifus (https://gitlab.com/Zedifus)
#Adapted for WSS by Andrew McManus https://gitlab.com/amcmanu3
#Adapted for WSS by pretzelDewey https://gitlab.com/amcmanu3
#For this config you need to add the following mods
#mod_ssl
#mod_rewrite