-
Notifications
You must be signed in to change notification settings - Fork 0
/
varys.min.js
1 lines (1 loc) · 1.02 KB
/
varys.min.js
1
function init_components(){kibs_create_button();var e=document.createElement("div");e.setAttribute("id","kibs_snackbar"),e.innerHTML="Logs parsed successfully to Console.",document.getElementsByClassName("app-wrapper")[0].appendChild(e)}function kibs_create_button(){$(".filter-bar").html($(".filter-bar").html()+'<button id="parse_download" class="kuiButton kuiButton--small kuiButton--primary pull-right">Parse logs!</button>')}function kibs_toast(e){var t=document.getElementById(e);t.className="show",setTimeout(function(){t.className=t.className.replace("show","")},3e3)}$(function(){init_components(),$("#parse_download").click(function(){if(document.msearch_responses.length>0){var e=JSON.parse(document.msearch_responses),t=[],s=0,n=e.responses[0].hits.hits.length;do{var o=e.responses[0].hits.hits[s]._source.message,i=e.responses[0].hits.hits[s]._source.timestamp;t[s]={line:o,time:i},s++}while(s<n);for(lr in s=0,t.sort(function(e,t){return e.time>t.time?1:e.time<t.time?-1:0}),t)console.log(t[lr].line);kibs_toast("kibs_snackbar")}})});