Implemented READLOGFILE client-side
This commit is contained in:
parent
8ebac6a33d
commit
b7e1478991
@ -230,6 +230,10 @@
|
|||||||
<input type="checkbox" class="custom-control-input" id="showDateSettingsSwitch">
|
<input type="checkbox" class="custom-control-input" id="showDateSettingsSwitch">
|
||||||
<label class="custom-control-label" for="showDateSettingsSwitch" id="showDateSettingsSwitchLabel">Show date and time on each console line</label>
|
<label class="custom-control-label" for="showDateSettingsSwitch" id="showDateSettingsSwitchLabel">Show date and time on each console line</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="custom-control custom-switch">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="readLogFileSwitch">
|
||||||
|
<label class="custom-control-label" for="readLogFileSwitch" id="readLogFileSwitchLabel">Retrieve full log file from server after login</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="settingsModalCloseButton">Done</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="settingsModalCloseButton">Done</button>
|
||||||
@ -241,7 +245,7 @@
|
|||||||
<!-- Webpage footer -->
|
<!-- Webpage footer -->
|
||||||
<footer class="footer mt-auto py-3">
|
<footer class="footer mt-auto py-3">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<span class="text-muted">WebConsole v1.4 (rev. 6) - <a href="https://github.com/mesacarlos/WebConsole">GitHub</a></span>
|
<span class="text-muted">WebConsole v1.5 - <a href="https://github.com/mesacarlos/WebConsole">GitHub</a></span>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
@ -251,11 +255,11 @@
|
|||||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
<!-- WebConsole JS Scripts -->
|
<!-- WebConsole JS Scripts -->
|
||||||
<script src="scripts/WebConsoleLanguage.js?v=1.4.6"></script>
|
<script src="scripts/WebConsoleLanguage.js?v=1.5.0"></script>
|
||||||
<script src="scripts/WebConsoleConnector.js?v=1.4.6"></script>
|
<script src="scripts/WebConsoleConnector.js?v=1.5.0"></script>
|
||||||
<script src="scripts/WebConsoleManager.js?v=1.4.6"></script>
|
<script src="scripts/WebConsoleManager.js?v=1.5.0"></script>
|
||||||
<script src="scripts/WebConsolePersistenceManager.js?v=1.4.6"></script>
|
<script src="scripts/WebConsolePersistenceManager.js?v=1.5.0"></script>
|
||||||
<script src="scripts/WebConsole.js?v=1.4.6"></script>
|
<script src="scripts/WebConsole.js?v=1.5.0"></script>
|
||||||
<script src="scripts/WebConsoleJqueryHandler.js?v=1.4.6"></script>
|
<script src="scripts/WebConsoleJqueryHandler.js?v=1.5.0"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -57,6 +57,10 @@ function onWebSocketsMessage(message){
|
|||||||
case 200:
|
case 200:
|
||||||
//Processed
|
//Processed
|
||||||
writeToWebConsole(message.message);
|
writeToWebConsole(message.message);
|
||||||
|
if(connectionManager.activeConnection.isLogged === false){
|
||||||
|
connectionManager.activeConnection.isLogged = true;
|
||||||
|
connectionManager.askForLogs();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 400:
|
case 400:
|
||||||
//Unknown Command
|
//Unknown Command
|
||||||
|
@ -13,6 +13,7 @@ class WebConsoleConnector {
|
|||||||
this.messages = []; //All messages retrieved since connection start
|
this.messages = []; //All messages retrieved since connection start
|
||||||
this.commands = []; //EXEC Commands sent by user to this server
|
this.commands = []; //EXEC Commands sent by user to this server
|
||||||
this.players = []; //Connected users.
|
this.players = []; //Connected users.
|
||||||
|
this.isLogged = false; //Is logged in with valid pasword or not
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -195,6 +195,7 @@ $("#disconnectionModalWelcomeScreenButton").click(function() {
|
|||||||
$("#settingsLink").click(function() {
|
$("#settingsLink").click(function() {
|
||||||
//Update modal switches and boxes with saved settings
|
//Update modal switches and boxes with saved settings
|
||||||
$("#showDateSettingsSwitch").prop("checked", persistenceManager.getSetting("dateTimePrefix"));
|
$("#showDateSettingsSwitch").prop("checked", persistenceManager.getSetting("dateTimePrefix"));
|
||||||
|
$("#readLogFileSwitch").prop("checked", persistenceManager.getSetting("retrieveLogFile"));
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -204,3 +205,11 @@ $("#showDateSettingsSwitch").click(function() {
|
|||||||
//Update modal switches and boxes with saved settings
|
//Update modal switches and boxes with saved settings
|
||||||
persistenceManager.setSetting("dateTimePrefix", $("#showDateSettingsSwitch").is(":checked"));
|
persistenceManager.setSetting("dateTimePrefix", $("#showDateSettingsSwitch").is(":checked"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On readLogFileSwitch switched
|
||||||
|
*/
|
||||||
|
$("#readLogFileSwitch").click(function() {
|
||||||
|
//Update modal switches and boxes with saved settings
|
||||||
|
persistenceManager.setSetting("retrieveLogFile", $("#readLogFileSwitch").is(":checked"));
|
||||||
|
});
|
@ -38,6 +38,7 @@ function setLanguage(locale){
|
|||||||
"settingsLink": "Settings",
|
"settingsLink": "Settings",
|
||||||
"settingsModalLongTitle": "WebConsole Settings",
|
"settingsModalLongTitle": "WebConsole Settings",
|
||||||
"showDateSettingsSwitchLabel": "Show date and time on each console line",
|
"showDateSettingsSwitchLabel": "Show date and time on each console line",
|
||||||
|
"readLogFileSwitchLabel": "Retrieve full log file from server after login",
|
||||||
"settingsModalCloseButton": "Done",
|
"settingsModalCloseButton": "Done",
|
||||||
"players_online": "Players Online",
|
"players_online": "Players Online",
|
||||||
"cpu_title": "CPU",
|
"cpu_title": "CPU",
|
||||||
@ -75,6 +76,7 @@ function setLanguage(locale){
|
|||||||
"settingsLink": "Configuración",
|
"settingsLink": "Configuración",
|
||||||
"settingsModalLongTitle": "Configuración de WebConsole",
|
"settingsModalLongTitle": "Configuración de WebConsole",
|
||||||
"showDateSettingsSwitchLabel": "Mostrar fecha y hora en cada linea de consola",
|
"showDateSettingsSwitchLabel": "Mostrar fecha y hora en cada linea de consola",
|
||||||
|
"readLogFileSwitchLabel": "Leer log completo al iniciar sesión",
|
||||||
"settingsModalCloseButton": "Hecho",
|
"settingsModalCloseButton": "Hecho",
|
||||||
"players_online": "Jugadores en línea",
|
"players_online": "Jugadores en línea",
|
||||||
"cpu_title": "CPU",
|
"cpu_title": "CPU",
|
||||||
@ -112,6 +114,7 @@ function setLanguage(locale){
|
|||||||
"settingsLink": "настройки",
|
"settingsLink": "настройки",
|
||||||
"settingsModalLongTitle": "настройки WebConsole",
|
"settingsModalLongTitle": "настройки WebConsole",
|
||||||
"showDateSettingsSwitchLabel": "Показать дату и время в каждой строке консоли",
|
"showDateSettingsSwitchLabel": "Показать дату и время в каждой строке консоли",
|
||||||
|
"readLogFileSwitchLabel": "Получить полный файл журнала с сервера после входа в систему",
|
||||||
"settingsModalCloseButton": "Выполнено",
|
"settingsModalCloseButton": "Выполнено",
|
||||||
"players_online": "Игроки",
|
"players_online": "Игроки",
|
||||||
"cpu_title": "CPU",
|
"cpu_title": "CPU",
|
||||||
@ -149,6 +152,7 @@ function setLanguage(locale){
|
|||||||
"settingsLink": "Configurações",
|
"settingsLink": "Configurações",
|
||||||
"settingsModalLongTitle": "Configurações do WebConsole",
|
"settingsModalLongTitle": "Configurações do WebConsole",
|
||||||
"showDateSettingsSwitchLabel": "Mostrar data e hora em cada linha do console",
|
"showDateSettingsSwitchLabel": "Mostrar data e hora em cada linha do console",
|
||||||
|
"readLogFileSwitchLabel": "Recuperar arquivo de log completo do servidor após o login",
|
||||||
"settingsModalCloseButton": "Feito",
|
"settingsModalCloseButton": "Feito",
|
||||||
"players_online": "Jogadores online",
|
"players_online": "Jogadores online",
|
||||||
"cpu_title": "Consumo de CPU",
|
"cpu_title": "Consumo de CPU",
|
||||||
@ -186,6 +190,7 @@ function setLanguage(locale){
|
|||||||
"settingsLink": "设定值",
|
"settingsLink": "设定值",
|
||||||
"settingsModalLongTitle": "WebConsole 设定值",
|
"settingsModalLongTitle": "WebConsole 设定值",
|
||||||
"showDateSettingsSwitchLabel": "在每个控制台行上显示日期和时间",
|
"showDateSettingsSwitchLabel": "在每个控制台行上显示日期和时间",
|
||||||
|
"readLogFileSwitchLabel": "登录后从服务器检索完整的日志文件",
|
||||||
"settingsModalCloseButton": "完成",
|
"settingsModalCloseButton": "完成",
|
||||||
"players_online": "在线人数",
|
"players_online": "在线人数",
|
||||||
"cpu_title": "CPU",
|
"cpu_title": "CPU",
|
||||||
@ -223,6 +228,7 @@ function setLanguage(locale){
|
|||||||
"settingsLink": "Réglages",
|
"settingsLink": "Réglages",
|
||||||
"settingsModalLongTitle": "Réglages de WebConsole",
|
"settingsModalLongTitle": "Réglages de WebConsole",
|
||||||
"showDateSettingsSwitchLabel": "Afficher la date et l'heure sur chaque ligne de console",
|
"showDateSettingsSwitchLabel": "Afficher la date et l'heure sur chaque ligne de console",
|
||||||
|
"readLogFileSwitchLabel": "Récupérer le fichier journal complet du serveur après la connexion",
|
||||||
"settingsModalCloseButton": "Terminé",
|
"settingsModalCloseButton": "Terminé",
|
||||||
"players_online": "Joueurs en ligne",
|
"players_online": "Joueurs en ligne",
|
||||||
"cpu_title": "Utilisation de la CPU",
|
"cpu_title": "Utilisation de la CPU",
|
||||||
@ -260,6 +266,7 @@ function setLanguage(locale){
|
|||||||
"settingsLink": "Nastavení",
|
"settingsLink": "Nastavení",
|
||||||
"settingsModalLongTitle": "Nastavení WebConsole",
|
"settingsModalLongTitle": "Nastavení WebConsole",
|
||||||
"showDateSettingsSwitchLabel": "Zobrazit datum a čas na každé řádce konzoly",
|
"showDateSettingsSwitchLabel": "Zobrazit datum a čas na každé řádce konzoly",
|
||||||
|
"readLogFileSwitchLabel": "Po přihlášení načtěte úplný soubor protokolu ze serveru",
|
||||||
"settingsModalCloseButton": "Hotovo",
|
"settingsModalCloseButton": "Hotovo",
|
||||||
"players_online": "Počet hráčů online",
|
"players_online": "Počet hráčů online",
|
||||||
"cpu_title": "CPU",
|
"cpu_title": "CPU",
|
||||||
@ -281,31 +288,4 @@ function setLanguage(locale){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// document.getElementById("navbarHomeLink").textContent = lang.navbarHomeLink;
|
|
||||||
// document.getElementById("home_header").textContent = lang.home_header;
|
|
||||||
// document.getElementById("home_description").textContent = lang.home_description;
|
|
||||||
// document.getElementById("serversDropdown").textContent = lang.serversDropdown;
|
|
||||||
// document.getElementById("add_server").textContent = lang.add_server;
|
|
||||||
// document.getElementById("lang_dropdown").textContent = lang.lang_dropdown;
|
|
||||||
// document.getElementById("addServerModalLongTitle").textContent = lang.addServerModalLongTitle;
|
|
||||||
// document.getElementById("addServerModalSvName").textContent = lang.addServerModalSvName;
|
|
||||||
// document.getElementById("addServerModalSvIp").textContent = lang.addServerModalSvIp;
|
|
||||||
// document.getElementById("addServerModalSvPort").textContent = lang.addServerModalSvPort;
|
|
||||||
// document.getElementById("addServerModalSvSsl").textContent = lang.addServerModalSvSsl;
|
|
||||||
// document.getElementById("addServerModalSslAdvice").textContent = lang.addServerModalSslAdvice;
|
|
||||||
// document.getElementById("addServerModalClose").textContent = lang.addServerModalClose;
|
|
||||||
// document.getElementById("saveAndConnectServerButton").textContent = lang.saveAndConnectServerButton;
|
|
||||||
// document.getElementById("passwordModalLongTitle").textContent = lang.passwordModalLongTitle;
|
|
||||||
// document.getElementById("passwordModalLabel").textContent = lang.passwordModalLabel;
|
|
||||||
// document.getElementById("passwordModalRememberLabel").textContent = lang.passwordModalRememberLabel;
|
|
||||||
// document.getElementById("passwordModalCloseButton").textContent = lang.passwordModalCloseButton;
|
|
||||||
// document.getElementById("passwordSendButton").textContent = lang.passwordSendButton;
|
|
||||||
// document.getElementById("disconnectionModalLongTitle").textContent = lang.disconnectionModalLongTitle;
|
|
||||||
// document.getElementById("disconnectionModalDescription").textContent = lang.disconnectionModalDescription;
|
|
||||||
// document.getElementById("disconnectionModalCloseButton").textContent = lang.disconnectionModalCloseButton;
|
|
||||||
// document.getElementById("players_online").textContent = lang.players_online;
|
|
||||||
// document.getElementById("cpu_title").textContent = lang.cpu_title;
|
|
||||||
// document.getElementById("ram_title").textContent = lang.ram_title;
|
|
||||||
// document.getElementById("deleteServerButton").textContent = lang.deleteServerButton;
|
|
||||||
// document.getElementById("sendCommandButton").textContent = lang.sendCommandButton;
|
|
||||||
}
|
}
|
@ -80,4 +80,11 @@ class WebConsoleManager {
|
|||||||
this.activeConnection.sendToServer("RAMUSAGE");
|
this.activeConnection.sendToServer("RAMUSAGE");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asks server for full latest.log
|
||||||
|
*/
|
||||||
|
askForLogs(){
|
||||||
|
this.activeConnection.sendToServer("READLOGFILE");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -135,8 +135,10 @@ class WebConsolePersistenceManager{
|
|||||||
currentSettings = new Object();
|
currentSettings = new Object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Setting array initialization. If you need to add more settings, add them here. Any object is valid as a value (not only bool)
|
||||||
var settings = {
|
var settings = {
|
||||||
dateTimePrefix : new Setting("dateTimePrefix", true)
|
dateTimePrefix : new Setting("dateTimePrefix", true),
|
||||||
|
retrieveLogFile : new Setting("retrieveLogFile", true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set settings
|
//Set settings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user