
META-INF.spring-boot-admin-server-ui.applications-logfile.module.js Maven / Gradle / Ivy
webpackJsonp([5],{0:function(t,e,n){(function(t){"use strict";var e=n(1),i=e.module("sba-applications-logfile",["sba-applications"]);t.sbaModules.push(i.name),n(35),i.component("sbaLogfileViewer",n(108)),i.service("Logtail",n(110)),i.controller("logfileCtrl",n(109)),i.config(["$stateProvider",function(t){t.state("applications.logfile",{url:"/logfile",templateUrl:"applications-logfile/views/logfile.html",controller:"logfileCtrl"})}]),i.run(["ApplicationViews","$sce","$http",function(t,e,n){t.register({order:1,title:e.trustAsHtml('Log'),state:"applications.logfile",show:function(t){return n.head("api/applications/"+t.id+"/logfile").then(function(){return!0}).catch(function(){return!1})}})}])}).call(e,function(){return this}())},34:function(t,e){},35:function(t,e){},108:function(t,e,n){"use strict";n(34),t.exports={bindings:{url:"@logfileUrl",interval:"@?refreshInterval",initialSize:"@?initialSize",onAppend:"&onAppend"},controller:["$timeout","Logtail","$element","$document","$filter",function(t,e,n,i,o){"ngInject";var l=this;l.$onInit=function(){l.interval=l.interval||1e3,l.initialSize=l.initialSize||307200,l.logtail=new e(l.url,l.initialSize),l.totalSize=0,l.currentSize=0;var r=n.children(".logview"),a=function(){l.logtail.refresh().then(function(e){if(l.totalSize=e.totalSize,e.first){r.empty();var n=Math.max(e.totalSize-l.initialSize,0);n>0&&r.append(i[0].createTextNode("... first "+o("humanBytes")(n)+" skipped ...\n\n"))}null!==e.addendum&&(r.append(i[0].createTextNode(e.addendum)),l.onAppend&&l.onAppend()),l.promise=t(a,l.interval)}).catch(function(t){l.error=t})};a()},l.$onDestroy=function(){l.promise&&t.cancel(l.promise)}}],template:n(155)}},109:function(t,e,n){"use strict";var i=n(1);t.exports=["$scope","$window","$document",function(t,e,n){"ngInject";t.follow=!1,t.toggleFollow=function(){t.follow=!t.follow,t.updateview()},t.scrollToTop=function(){e.scrollTo(e.scrollX,0)},t.updateview=function(){t.follow&&e.scrollTo(e.scrollX,n[0].body.scrollHeight)},i.element(e).bind("scroll",function(){var i=e.innerHeight+e.scrollY>=n[0].body.offsetHeight;!i&&t.follow&&(t.follow=!1,t.$apply())})}]},110:function(t,e){"use strict";t.exports=["$http",function(t){"ngInject";var e=function(t,e){this.url=t,this.initialSize=e||307200,this.logSize=0};return e.prototype.refresh=function(){var e,n=this,i=0===n.logSize;return e=i?"-"+n.initialSize.toString():(n.logSize-1).toString()+"-",t.get(n.url,{headers:{Range:"bytes="+e}}).then(function(t){var e=parseInt(t.headers("Content-Length"));if(206===t.status)n.logSize=parseInt(t.headers("Content-Range").split("/")[1]);else{if(200!==t.status)throw"Unexpected resopnse status: "+t.status;if(!i)throw"Expected 206 - Partial Content on subsequent requests.";n.logSize=e}var o={totalSize:n.logSize,first:!1,addendum:null};return i?(o.first=!0,e1&&(o.addendum=t.data.substring(1)),o})},e}]},155:function(t,e){t.exports='\n\n Error while reading logfile: - \n\n'}});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy