#50 indicate pod restarts as red "ticks" and show number in tooltip
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ __pycache__
|
||||
**/node_modules/
|
||||
static/build/
|
||||
*-secret
|
||||
npm-debug.log*
|
||||
|
||||
@@ -84,6 +84,7 @@ export class Pod extends PIXI.Graphics {
|
||||
const containerStatuses = this.pod.status.containerStatuses || []
|
||||
var ready = 0
|
||||
var running = 0
|
||||
var restarts = 0
|
||||
for (const containerStatus of containerStatuses) {
|
||||
if (containerStatus.ready) {
|
||||
ready++
|
||||
@@ -91,6 +92,7 @@ export class Pod extends PIXI.Graphics {
|
||||
if (containerStatus.state.running) {
|
||||
running++
|
||||
}
|
||||
restarts += containerStatus.restartCount || 0
|
||||
}
|
||||
const allReady = ready >= containerStatuses.length
|
||||
const allRunning = running >= containerStatuses.length
|
||||
@@ -120,6 +122,9 @@ export class Pod extends PIXI.Graphics {
|
||||
// "CrashLoopBackOff"
|
||||
s += ': ' + containerStatus.state[key].reason
|
||||
}
|
||||
if (containerStatus.restartCount) {
|
||||
s += ' (' + containerStatus.restartCount + ' restarts)'
|
||||
}
|
||||
}
|
||||
s += '\nCPU:'
|
||||
s += '\n Requested: ' + (resources.cpu.requested / FACTORS.m).toFixed(0) + ' m'
|
||||
@@ -181,6 +186,16 @@ export class Pod extends PIXI.Graphics {
|
||||
}
|
||||
newTick = this.terminating
|
||||
}
|
||||
|
||||
|
||||
if (restarts) {
|
||||
this.lineStyle(2, 0xff9999, 1)
|
||||
for (let i=0; i<Math.min(restarts, 4); i++) {
|
||||
this.moveTo(10, i*3 - 1)
|
||||
this.lineTo(10, i*3 + 1)
|
||||
}
|
||||
}
|
||||
|
||||
if (newTick) {
|
||||
this.tick = newTick
|
||||
PIXI.ticker.shared.add(this.tick, this)
|
||||
|
||||
Reference in New Issue
Block a user