2016-11-26 22:46:16 +01:00
|
|
|
|
2016-12-04 19:32:23 +01:00
|
|
|
var conf_editor = null;
|
|
|
|
|
2016-11-26 22:46:16 +01:00
|
|
|
$(document).ready(function() {
|
2016-12-04 19:32:23 +01:00
|
|
|
performTranslation();
|
2016-11-26 22:46:16 +01:00
|
|
|
requestLoggingStart();
|
2016-12-04 19:32:23 +01:00
|
|
|
|
|
|
|
schema = parsedConfSchemaJSON.properties;
|
|
|
|
conf_editor = createJsonEditor('editor_container', {
|
|
|
|
logger : schema.logger
|
|
|
|
}, true);
|
|
|
|
|
|
|
|
$('#editor_container h3').remove();
|
|
|
|
|
|
|
|
$('#btn_submit').off().on('click',function() {
|
|
|
|
requestWriteConfig(conf_editor.getValue());
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#btn_autoscroll').off().on('click',function() {
|
|
|
|
toggleClass('#btn_autoscroll', "btn-success", "btn-danger");
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2016-11-26 22:46:16 +01:00
|
|
|
if (!loggingHandlerInstalled)
|
|
|
|
{
|
|
|
|
loggingHandlerInstalled = true;
|
|
|
|
$(hyperion).on("cmd-logging-update",function(event){
|
|
|
|
if ($("#logmessages").length == 0)
|
|
|
|
{
|
|
|
|
requestLoggingStop();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
messages = (event.response.result.messages);
|
|
|
|
for(var idx=0; idx<messages.length; idx++)
|
|
|
|
{
|
2016-12-17 22:14:30 +01:00
|
|
|
app_name = messages[idx].appName;
|
|
|
|
logger_name = messages[idx].loggerName;
|
|
|
|
function_ = messages[idx].function;
|
|
|
|
line = messages[idx].line;
|
|
|
|
file_name = messages[idx].fileName;
|
|
|
|
msg = messages[idx].message;
|
|
|
|
level_string = messages[idx].levelString;
|
2016-11-26 22:46:16 +01:00
|
|
|
|
2016-12-17 22:14:30 +01:00
|
|
|
var debug = "";
|
|
|
|
|
|
|
|
if(level_string == "DEBUG") {
|
|
|
|
debug = "<"+file_name+":"+line+":"+function_+"()> ";
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#logmessages").html($("#logmessages").html()+"\n <code>"+"["+app_name+" "+logger_name+"] <"+level_string+"> "+debug+msg+"</code>");
|
2016-11-26 22:46:16 +01:00
|
|
|
}
|
2016-12-04 19:32:23 +01:00
|
|
|
if($("#btn_autoscroll").hasClass('btn-success')){
|
|
|
|
$('#logmessages').stop().animate({
|
|
|
|
scrollTop: $('#logmessages')[0].scrollHeight
|
|
|
|
}, 800);
|
|
|
|
}
|
2016-11-26 22:46:16 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|