@@ -133,9 +133,10 @@ const _render = ({entity, activationIds, container, noCrop=false, noPip=false, s
133133 return ( value - start - gaps [ idx ] ) / ( dur - tgap )
134134 }
135135
136- return fetch ( activationIds )
137- . then ( activations => entity ? [ entity , ...activations ] : activations ) // add entity to the top of the list
138- . then ( activations => {
136+ return Promise . all ( [ fetch ( activationIds )
137+ . then ( activations => entity ? [ entity , ...activations ] : activations ) , // add entity to the top of the list
138+ repl . qexec ( `wsk activation count ${ mapToOptions ( parsedOptions ) } ` ) ] )
139+ . then ( ( [ activations , count ] ) => {
139140 gaps = new Array ( activations . length ) . fill ( 0 )
140141 if ( ! entity ) {
141142 let residualDur = dur // after subtracing out gaps
@@ -384,6 +385,7 @@ const _render = ({entity, activationIds, container, noCrop=false, noPip=false, s
384385 if ( ! entity ) {
385386 const paginator = document . createElement ( 'div' ) ,
386387 leftButtons = document . createElement ( 'div' ) ,
388+ rightButtons = document . createElement ( 'div' ) ,
387389 description = document . createElement ( 'span' ) ,
388390 prev = document . createElement ( 'span' ) ,
389391 next = document . createElement ( 'span' )
@@ -396,27 +398,38 @@ const _render = ({entity, activationIds, container, noCrop=false, noPip=false, s
396398 leftButtons . classList . add ( 'list-paginator-left-buttons' )
397399
398400 // show summary buttons
399- const buttons = [ 'summary' ,
401+ paginator . appendChild ( rightButtons )
402+ rightButtons . classList . add ( 'list-paginator-right-buttons' )
403+ const buttons = [ { command : 'summary' , icon : 'fas fa-chart-bar' , balloon : 'Open a statistical summary view' } ,
400404 // 'timeline', // disabled for now shell issue #794
401- 'grid' ]
402- buttons . forEach ( buttonText => {
403- const command = buttonText , // it so happens...
404- button = document . createElement ( 'span' )
405- leftButtons . appendChild ( button )
405+ { command : 'grid' , icon : 'fas fa-th' , balloon : 'Open a grid view' } ]
406+ buttons . forEach ( ( { command, icon, balloon, balloonPos= 'up-left' } ) => {
407+ const buttonContainer = document . createElement ( 'span' ) ,
408+ button = document . createElement ( 'i' )
409+
410+ leftButtons . appendChild ( buttonContainer )
411+
412+ buttonContainer . className = 'graphical-icon'
413+ buttonContainer . appendChild ( button )
414+ buttonContainer . setAttribute ( 'data-balloon' , balloon )
415+ buttonContainer . setAttribute ( 'data-balloon-pos' , balloonPos )
416+
417+ button . className = icon
406418 button . classList . add ( 'clickable' )
407- button . setAttribute ( 'data-button-command' , command )
408- button . innerText = buttonText
409- button . onclick = ( ) => repl . pexec ( command )
419+
420+ buttonContainer . setAttribute ( 'data-button-command' , command )
421+ buttonContainer . onclick = ( ) => repl . pexec ( command )
410422 } )
411423
412424 // description of current page
413425 description . className = 'list-paginator-description'
414- paginator . appendChild ( description )
415- description . innerText = `Showing ${ skip + 1 } \u2013${ skip + activationIds . length } `
426+ rightButtons . appendChild ( description )
427+
428+ description . innerText = `${ skip + 1 } \u2013${ skip + activationIds . length } of ${ count . toLocaleString ( ) } items`
416429
417430 // forward and back buttons
418- paginator . appendChild ( prev )
419- paginator . appendChild ( next )
431+ rightButtons . appendChild ( prev )
432+ rightButtons . appendChild ( next )
420433 prev . innerText = '\uff1c'
421434 next . innerText = '\uff1e'
422435 prev . className = 'list-paginator-button list-paginator-button-prev'
0 commit comments