var conf_editor = null; var createdCont = false; performTranslation(); requestLoggingStart(); $(document).ready(function() { var messages; $('#conf_cont').append(createOptPanel('fa-reorder', $.i18n("edt_conf_log_heading_title"), 'editor_container', 'btn_submit')); if(showOptHelp) { $('#conf_cont').append(createHelpTable(schema.logger.properties, $.i18n("edt_conf_log_heading_title"))); createHintH("intro", $.i18n('conf_logging_label_intro'), "log_head"); } conf_editor = createJsonEditor('editor_container', { logger : schema.logger }, true, true); conf_editor.on('change',function() { conf_editor.validate().length ? $('#btn_submit').attr('disabled', true) : $('#btn_submit').attr('disabled', false); }); $('#btn_submit').off().on('click',function() { requestWriteConfig(conf_editor.getValue()); }); function uploadLog() { var reportUrl = 'https://glot.io/snippets/'; var log = ""; var config = JSON.stringify(serverConfig, null, "\t").replace(/"/g, '\\"'); var prios = serverInfo.info.priorities; var comps = serverInfo.info.components; //create log for(var i = 0; i "; } log += "["+app_name+" "+logger_name+"] <"+level_string+"> "+debug+msg+"\n"; } //create prios var info = "######## PRIORITIES ######## \n"; for(var i = 0; i'+reportUrl+''); $("html, body").animate({ scrollTop: 9999 }, "fast"); } else { $('#btn_logupload').attr("disabled", false); $('#upl_link').html(''+$.i18n('conf_logging_uplfailed')+''); } }) .fail( function( jqXHR, textStatus ) { //console.log(jqXHR, textStatus) }); } if (!loggingHandlerInstalled) { loggingHandlerInstalled = true; $(hyperion).on("cmd-logging-update",function(event){ messages = (event.response.result.messages); if(messages.length != 0 && !createdCont) { $('#log_content').html('
'); createdCont = true; $('#btn_autoscroll').off().on('click',function() { toggleClass('#btn_autoscroll', "btn-success", "btn-danger"); }); $('#btn_logupload').off().on('click',function() { uploadLog(); $(this).attr("disabled", true); $('#upl_link').html($.i18n('conf_logging_uploading')) }); } for(var idx=0; idx"+"["+app_name+" "+logger_name+"] <"+level_string+"> "+debug+msg+""); } if($("#btn_autoscroll").hasClass('btn-success')){ $('#logmessages').stop().animate({ scrollTop: $('#logmessages')[0].scrollHeight }, 800); } }); } removeOverlay(); });