@@ -24,20 +24,24 @@ export default class Bars extends PIXI.Graphics {
2424 const cpuHeight = barHeight / bars . resources . cpu . capacity
2525 bars . interactive = true
2626 bars . lineStyle ( 0 , 0xaaffaa , 1 )
27- bars . beginFill ( getBarColor ( bars . resources . cpu . requested , bars . resources . cpu . capacity ) , 1 )
28- bars . drawRect ( 5 , 110 - bars . resources . cpu . requested * cpuHeight , 2.5 , bars . resources . cpu . requested * cpuHeight )
27+ bars . beginFill ( getBarColor ( bars . resources . cpu . requested , bars . resources . cpu . capacity - bars . resources . cpu . reserved ) , 1 )
28+ bars . drawRect ( 5 , 110 - ( bars . resources . cpu . requested + bars . resources . cpu . reserved ) * cpuHeight , 2.5 , ( bars . resources . cpu . requested + bars . resources . cpu . reserved ) * cpuHeight )
2929 bars . beginFill ( getBarColor ( bars . resources . cpu . used , bars . resources . cpu . capacity ) , 1 )
3030 bars . drawRect ( 7.5 , 110 - bars . resources . cpu . used * cpuHeight , 2.5 , bars . resources . cpu . used * cpuHeight )
3131 bars . endFill ( )
32+ bars . lineStyle ( 1 , App . current . theme . primaryColor , 1 )
33+ bars . drawRect ( 5 , 110 - bars . resources . cpu . reserved * cpuHeight , 5 , bars . resources . cpu . reserved * cpuHeight )
3234
3335 // Memory
3436 const scale = bars . resources . memory . capacity / barHeight
3537 bars . lineStyle ( 0 , 0xaaffaa , 1 )
36- bars . beginFill ( getBarColor ( bars . resources . memory . requested , bars . resources . memory . capacity ) , 1 )
37- bars . drawRect ( 14 , 110 - bars . resources . memory . requested / scale , 2.5 , bars . resources . memory . requested / scale )
38+ bars . beginFill ( getBarColor ( bars . resources . memory . requested , bars . resources . memory . capacity - bars . resources . memory . reserved ) , 1 )
39+ bars . drawRect ( 14 , 110 - ( bars . resources . memory . requested + bars . resources . memory . reserved ) / scale , 2.5 , ( bars . resources . memory . requested + bars . resources . memory . reserved ) / scale )
3840 bars . beginFill ( getBarColor ( bars . resources . memory . used , bars . resources . memory . capacity ) , 1 )
3941 bars . drawRect ( 16.5 , 110 - bars . resources . memory . used / scale , 2.5 , bars . resources . memory . used / scale )
4042 bars . endFill ( )
43+ bars . lineStyle ( 1 , App . current . theme . primaryColor , 1 )
44+ bars . drawRect ( 14 , 110 - bars . resources . memory . reserved / scale , 5 , bars . resources . memory . reserved / scale )
4145
4246 bars . lineStyle ( 1 , App . current . theme . primaryColor , 1 )
4347 for ( var i = 0 ; i < bars . resources . cpu . capacity ; i ++ ) {
@@ -48,14 +52,16 @@ export default class Bars extends PIXI.Graphics {
4852
4953 bars . on ( 'mouseover' , function ( ) {
5054 let s = 'CPU: \n'
51- const { capacity : cpuCap , requested : cpuReq , used : cpuUsed } = bars . resources . cpu
55+ const { capacity : cpuCap , reserved : cpuRes , requested : cpuReq , used : cpuUsed } = bars . resources . cpu
5256 s += '\t\t Capacity : ' + cpuCap + '\n'
57+ s += '\t\t Reserved : ' + cpuRes . toFixed ( 2 ) + '\n'
5358 s += '\t\t Requested : ' + cpuReq . toFixed ( 2 ) + '\n'
5459 s += '\t\t Used : ' + cpuUsed . toFixed ( 2 ) + '\n'
5560 s += '\nMemory: \n'
5661
57- const { capacity : memCap , requested : memReq , used : memUsed } = bars . resources . memory
62+ const { capacity : memCap , reserved : memRes , requested : memReq , used : memUsed } = bars . resources . memory
5863 s += '\t\t Capacity : ' + ( memCap / FACTORS . Gi ) . toFixed ( 2 ) + ' GiB\n'
64+ s += '\t\t Reserved : ' + ( memRes / FACTORS . Gi ) . toFixed ( 2 ) + ' GiB\n'
5965 s += '\t\t Requested : ' + ( memReq / FACTORS . Gi ) . toFixed ( 2 ) + ' GiB\n'
6066 s += '\t\t Used : ' + ( memUsed / FACTORS . Gi ) . toFixed ( 2 ) + ' GiB\n'
6167
0 commit comments