@@ -12343,20 +12343,20 @@ var j, n, p, q, r, s = document.documentElement;
12343
12343
i.logViewerID = _.uniqueId("log-viewer"), i.empty = !0;
12344
12344
var t, u;
12345
12345
"ReplicationController" === i.object.kind ? (t = "deploymentconfigs/log", u = d("annotation")(i.object, "deploymentConfig")) :(t = f.kindToResource(i.object.kind) + "/log", u = i.object.metadata.name);
12346
- var v = function() {
12346
+ var v, w = function() {
12347
12347
q = window.innerWidth < l.screenSmMin && !i.fixedHeight ? null :n;
12348
- }, w = function() {
12348
+ }, x = function() {
12349
12349
i.$apply(function() {
12350
12350
var a = j.getBoundingClientRect();
12351
12351
i.fixedHeight ? i.showScrollLinks = a && a.height > i.fixedHeight :i.showScrollLinks = a && (a.top < 0 || a.bottom > s.clientHeight);
12352
12352
});
12353
- }, x = !1, y = function() {
12354
- x ? x = !1 :i.$evalAsync(function() {
12353
+ }, y = !1, z = function() {
12354
+ y ? y = !1 :i.$evalAsync(function() {
12355
12355
i.autoScrollActive = !1;
12356
12356
});
12357
- }, z = function() {
12358
- p.off("scroll", y), m.off("scroll", y), window.innerWidth <= l.screenSmMin && !i.fixedHeight ? m.on("scroll", y) :p.on("scroll", y);
12359
12357
}, A = function() {
12358
+ p.off("scroll", z), m.off("scroll", z), window.innerWidth <= l.screenSmMin && !i.fixedHeight ? m.on("scroll", z) :p.on("scroll", z);
12359
+ }, B = function() {
12360
12360
i.fixedHeight || (window.innerWidth < l.screenSmMin && !i.fixedHeight ? r.removeClass("target-logger-node").affix({
12361
12361
target:window,
12362
12362
offset:{
@@ -12368,30 +12368,46 @@ offset:{
12368
12368
top:i.followAffixTop || 0
12369
12369
}
12370
12370
}));
12371
- }, B = function(a) {
12372
- var b = $("#" + i.logViewerID + " .log-view-output"), c = b.offset().top;
12371
+ }, C = function() {
12372
+ return $("#" + i.logViewerID + " .log-view-output");
12373
+ }, D = function(a) {
12374
+ var b = C(), c = b.offset().top;
12373
12375
if (!(c < 0)) {
12374
12376
var d = $(".ellipsis-pulser").outerHeight(!0), e = i.fixedHeight ? i.fixedHeight :Math.floor($(window).height() - c - d);
12375
12377
i.chromeless || i.fixedHeight || (e -= 40), a ? b.animate({
12376
12378
"min-height":e + "px"
12377
12379
}, "fast") :b.css("min-height", e + "px"), i.fixedHeight && b.css("max-height", e);
12378
12380
}
12379
- }, C = _.debounce(function() {
12380
- B(!0), v(), z(), w(), A(), y();
12381
+ }, E = function() {
12382
+ if (!v) {
12383
+ var a = function() {
12384
+ clearInterval(v), v = null, i.$evalAsync(function() {
12385
+ i.sized = !0;
12386
+ });
12387
+ }, b = 0;
12388
+ v = setInterval(function() {
12389
+ if (b > 10) return void a();
12390
+ b++;
12391
+ var c = C();
12392
+ c.is(":visible") && (D(), a());
12393
+ }, 100);
12394
+ }
12395
+ }, F = _.debounce(function() {
12396
+ D(!0), w(), A(), x(), B(), z();
12381
12397
}, 100);
12382
- m.on("resize", C );
12383
- var D, E = function() {
12384
- x = !0, k.scrollBottom(q);
12385
- }, F = function() {
12386
- i.autoScrollActive = !i.autoScrollActive, i.autoScrollActive && E ();
12387
- }, G = document.createDocumentFragment(), H = _.debounce(function() {
12388
- j.appendChild(G ), G = document.createDocumentFragment(), i.autoScrollActive && E (), i.showScrollLinks || w ();
12398
+ m.on("resize", F );
12399
+ var G, H = function() {
12400
+ y = !0, k.scrollBottom(q);
12401
+ }, I = function() {
12402
+ i.autoScrollActive = !i.autoScrollActive, i.autoScrollActive && H ();
12403
+ }, J = document.createDocumentFragment(), K = _.debounce(function() {
12404
+ j.appendChild(J ), J = document.createDocumentFragment(), i.autoScrollActive && H (), i.showScrollLinks || x ();
12389
12405
}, 100, {
12390
12406
maxWait:300
12391
- }), I = function(a) {
12392
- D && (D .stop(), D = null), a || (H .cancel(), j && (j.innerHTML = ""), G = document.createDocumentFragment());
12393
- }, J = function() {
12394
- if (I (), i.run) {
12407
+ }), L = function(a) {
12408
+ G && (G .stop(), G = null), a || (K .cancel(), j && (j.innerHTML = ""), J = document.createDocumentFragment());
12409
+ }, M = function() {
12410
+ if (L (), i.run) {
12395
12411
angular.extend(i, {
12396
12412
loading:!0,
12397
12413
autoScrollActive:!0,
@@ -12403,32 +12419,32 @@ follow:!0,
12403
12419
tailLines:5e3,
12404
12420
limitBytes:10485760
12405
12421
}, i.options);
12406
- D = h.createStream(t, u, i.context, a);
12422
+ G = h.createStream(t, u, i.context, a);
12407
12423
var c = 0, d = function(a) {
12408
- c++, G .appendChild(o(c, a)), H ();
12424
+ c++, J .appendChild(o(c, a)), K ();
12409
12425
};
12410
- D .onMessage(function(b, e, f) {
12426
+ G .onMessage(function(b, e, f) {
12411
12427
i.$evalAsync(function() {
12412
- i.empty = !1, "logs" !== i.state && (i.state = "logs", setTimeout(B ));
12428
+ i.empty = !1, "logs" !== i.state && (i.state = "logs", E( ));
12413
12429
}), b && (a.limitBytes && f >= a.limitBytes && (i.$evalAsync(function() {
12414
12430
i.limitReached = !0, i.loading = !1;
12415
- }), I (!0)), d(b), !i.largeLog && c >= a.tailLines && i.$evalAsync(function() {
12431
+ }), L (!0)), d(b), !i.largeLog && c >= a.tailLines && i.$evalAsync(function() {
12416
12432
i.largeLog = !0;
12417
12433
}));
12418
- }), D .onClose(function() {
12419
- D = null, i.$evalAsync(function() {
12434
+ }), G .onClose(function() {
12435
+ G = null, i.$evalAsync(function() {
12420
12436
i.autoScrollActive = !1, 0 !== c || i.emptyStateMessage || (i.state = "empty", i.emptyStateMessage = "The logs are no longer available or could not be loaded.");
12421
12437
}), b(function() {
12422
12438
i.loading = !1;
12423
12439
}, 100);
12424
- }), D .onError(function() {
12425
- D = null, i.$evalAsync(function() {
12440
+ }), G .onError(function() {
12441
+ G = null, i.$evalAsync(function() {
12426
12442
angular.extend(i, {
12427
12443
loading:!1,
12428
12444
autoScrollActive:!1
12429
12445
}), 0 === c ? (i.state = "empty", i.emptyStateMessage = "The logs are no longer available or could not be loaded.") :i.errorWhileRunning = !0;
12430
12446
});
12431
- }), D .start();
12447
+ }), G .start();
12432
12448
}
12433
12449
};
12434
12450
return g.getLoggingURL().then(function(b) {
@@ -12454,7 +12470,7 @@ j = a;
12454
12470
}, this.cacheAffixable = function(a) {
12455
12471
r = $(a);
12456
12472
}, this.start = function() {
12457
- v (), z (), A ();
12473
+ w (), A (), B ();
12458
12474
}, angular.extend(i, {
12459
12475
ready:!0,
12460
12476
loading:!0,
@@ -12466,12 +12482,12 @@ k.scrollBottom(q);
12466
12482
onScrollTop:function() {
12467
12483
i.autoScrollActive = !1, k.scrollTop(q);
12468
12484
},
12469
- toggleAutoScroll:F ,
12485
+ toggleAutoScroll:I ,
12470
12486
goChromeless:k.chromelessLink,
12471
- restartLogs:J
12487
+ restartLogs:M
12472
12488
}), i.$on("$destroy", function() {
12473
- I (), m.off("resize", C ), m.off("scroll", y ), p.off("scroll", y );
12474
- }), "deploymentconfigs/logs" !== t || u ? void i.$watchGroup([ "name", "options.container", "run" ], J ) :(i.state = "empty", void (i.emptyStateMessage = "Logs are not available for this replication controller because it was not generated from a deployment configuration."));
12489
+ L (), m.off("resize", F ), m.off("scroll", z ), p.off("scroll", z );
12490
+ }), "deploymentconfigs/logs" !== t || u ? void i.$watchGroup([ "name", "options.container", "run" ], M ) :(i.state = "empty", void (i.emptyStateMessage = "Logs are not available for this replication controller because it was not generated from a deployment configuration."));
12475
12491
} ],
12476
12492
require:"logViewer",
12477
12493
link:function(a, c, d, e) {
0 commit comments