1- /* global add_flash getChartColumnDataValues getChartFormatedValue miqBrowserDetect miqExpressionPrefill miqFlashLater miqFlashSaved miqGridCheckAll miqGridGetCheckedRows miqMenu miqTreeObject miqValueStylePrefill recalculateChartYAxisLabels */
1+ /* global add_flash getChartColumnDataValues getChartFormatedValue miqBrowserDetect miqExpressionPrefill miqFlashLater miqFlashSaved miqMenu miqTreeObject miqValueStylePrefill recalculateChartYAxisLabels */
22
33// MIQ specific JS functions
44
@@ -351,40 +351,6 @@ window.miqValidateButtons = function(h_or_s, prefix) {
351351 }
352352} ;
353353
354- // update all checkboxes on a form when the masterToggle checkbox is changed
355- // parms: button_div=<id of div with buttons to update>
356- window . miqUpdateAllCheckboxes = function ( button_div ) {
357- if ( ! miqDomElementExists ( 'masterToggle' ) ) {
358- return ;
359- }
360-
361- const state = $ ( '#masterToggle' ) . prop ( 'checked' ) ;
362-
363- if ( ManageIQ . grids . gtl_list_grid ) {
364- miqGridCheckAll ( state ) ;
365- const crows = miqGridGetCheckedRows ( ) ;
366-
367- ManageIQ . gridChecks = crows ;
368- miqSetButtons ( crows . length , button_div ) ;
369- } else if ( $ ( 'input.listcheckbox' ) . length ) {
370- // No list_grid on the screen
371- const cbs = $ ( 'input.listcheckbox' )
372- . prop ( 'checked' , state )
373- . trigger ( 'change' ) ;
374-
375- miqUpdateButtons ( cbs [ 0 ] , button_div ) ;
376- } else if ( $ ( "input[id^='storage_cb']" ) . length ) {
377- // to handle check/uncheck all for C&U collection
378- $ ( "input[id^='storage_cb']" )
379- . prop ( 'checked' , state )
380- . trigger ( 'change' ) ;
381- miqJqueryRequest ( miqPassFields (
382- '/configuration/form_field_changed' ,
383- { storage_cb_all : state }
384- ) ) ;
385- }
386- } ;
387-
388354// Update buttons based on number of checkboxes that are checked
389355// parms: obj=<checkbox element>, button_div=<id of div with buttons to update>
390356window . miqUpdateButtons = function ( obj , button_div ) {
@@ -419,7 +385,7 @@ window.miqSetToolbarCount = function(count) {
419385window . miqSetButtons = function ( count , button_div ) {
420386 if ( button_div . match ( '_tb$' ) && count === 0 ) {
421387 // FIXME: this should be happening regardless of `count === 0`
422- // ..but that needs more refactoring around miqUpdateAllCheckboxes, miqUpdateButtons, etc.
388+ // ..but that needs more refactoring around miqUpdateButtons, etc.
423389 miqSetToolbarCount ( count ) ;
424390 return ;
425391 }
@@ -438,24 +404,6 @@ window.DoNav = function(theUrl) {
438404 document . location . href = theUrl ;
439405} ;
440406
441- // Routines to get the size of the window
442- window . miqResetSizeTimer = function ( ) {
443- const height = window . innerHeight ;
444- const offset = 427 ;
445- let h = height - offset ;
446-
447- if ( h < 200 ) {
448- h = 200 ;
449- }
450-
451- // Adjust certain elements, if present
452- if ( miqDomElementExists ( 'list_grid' ) ) {
453- $ ( '#list_grid' ) . css ( { height : `${ h } px` } ) ;
454- } else if ( miqDomElementExists ( 'logview' ) ) {
455- $ ( '#logview' ) . css ( { height : `${ h } px` } ) ;
456- }
457- } ;
458-
459407// Pass fields to server given a URL and fields in name/value pairs
460408window . miqPassFields = function ( url , args ) {
461409 return `${ url } ?${ $ . param ( args ) } ` ;
@@ -1460,7 +1408,6 @@ $(() => {
14601408
14611409 $ ( window ) . on ( 'resize' , miqInitAccordions ) ;
14621410 $ ( window ) . on ( 'resize' , miqInitMainContent ) ;
1463- $ ( window ) . on ( 'resize' , _ . debounce ( miqResetSizeTimer , 1000 ) ) ;
14641411
14651412 check_for_ellipsis ( ) ;
14661413} ) ;
@@ -1493,3 +1440,16 @@ window.redirectLogin = function(msg) {
14931440 add_flash ( msg , 'warning' ) ;
14941441 window . document . location . href = '/dashboard/login?timeout=true' ;
14951442} ;
1443+
1444+ // Needed for optimization page queue report button
1445+ window . miqQueueReport = function ( id ) {
1446+ const url = `/optimization/queue_report/${ id } ` ;
1447+ window . miqSparkleOn ( ) ;
1448+ http
1449+ . post ( url , { } )
1450+ . then ( ( data ) => {
1451+ window . add_flash ( data . flash , 'success' ) ;
1452+ window . miqSparkleOff ( ) ;
1453+ } )
1454+ . catch ( ( ) => window . miqSparkleOff ( ) ) ;
1455+ } ;
0 commit comments