migrate std::string to qstring + add sysinfo via json (#412)

* std::string -> qstring part 1

* more string migration

* more string migration ...

* ...

* more qstring mogrations
add sysinfo via json

* remove unneccessary includes

* integrate sysinfo into webui
This commit is contained in:
redPanther
2017-03-04 22:17:42 +01:00
committed by GitHub
parent 19f8928869
commit bfb9a08c80
90 changed files with 539 additions and 529 deletions

View File

@@ -105,4 +105,4 @@ $(document).ready( function() {
createHintH("intro", $.i18n('dashboard_label_intro'), "dash_intro");
removeOverlay();
});
});

View File

@@ -6,11 +6,14 @@ $(document).ready( function() {
initWebSocket();
$(hyperion).on("cmd-serverinfo",function(event){
// get sysinfo only once
if ( typeof(sysInfo.info) == "undefined" )
requestSysInfo();
serverInfo = event.response;
currentVersion = serverInfo.info.hyperion[0].version;
$(hyperion).trigger("ready");
if (serverInfo.info.hyperion[0].config_modified)
if (serverInfo.info.hyperion.config_modified)
$("#hyperion_reload_notify").fadeIn("fast");
else
$("#hyperion_reload_notify").fadeOut("fast");
@@ -22,7 +25,7 @@ $(document).ready( function() {
loggingStreamActive = false;
}
if (!serverInfo.info.hyperion[0].config_writeable)
if (!serverInfo.info.hyperion.config_writeable)
{
showInfoDialog('uilock',$.i18n('InfoDialog_nowrite_title'),$.i18n('InfoDialog_nowrite_text'));
$('#wrapper').toggle(false);
@@ -37,6 +40,11 @@ $(document).ready( function() {
}); // end cmd-serverinfo
$(hyperion).one("cmd-sysinfo", function(event) {
sysInfo = event.response;
currentVersion = sysInfo.info.hyperion.version;
});
$(hyperion).one("cmd-config-getschema", function(event) {
serverSchema = event.response.result;
requestServerConfig();

View File

@@ -3,12 +3,13 @@
var webPrio = 1;
var webOrigin = "Web Configuration";
var showOptHelp;
var currentVersion;
var currentVersion = "";
var latestVersion;
var serverInfo = {};
var parsedUpdateJSON = {};
var serverSchema = {};
var serverConfig = {};
var sysInfo = {};
var schema;
var jsonPort = 19444;
var websocket = null;
@@ -76,7 +77,6 @@ function initWebSocket()
websocket.onopen = function (event) {
$(hyperion).trigger({type:"open"});
$(hyperion).on("cmd-serverinfo", function(event) {
watchdog = 0;
});
@@ -171,6 +171,11 @@ function requestServerInfo()
sendToHyperion("serverinfo");
}
function requestSysInfo()
{
sendToHyperion("sysinfo");
}
function requestServerConfigSchema()
{
sendToHyperion("config","getschema");