1<script type="text/x-jquery-tmpl" id="filter-inventory-row"> 2 <?= (new CRow([ 3 new CComboBox('filter_inventory[#{rowNum}][field]', null, null, $data['filter']['inventories']), 4 (new CTextBox('filter_inventory[#{rowNum}][value]'))->setWidth(ZBX_TEXTAREA_FILTER_SMALL_WIDTH), 5 (new CCol( 6 (new CButton('filter_inventory[#{rowNum}][remove]', _('Remove'))) 7 ->addClass(ZBX_STYLE_BTN_LINK) 8 ->addClass('element-table-remove') 9 ))->addClass(ZBX_STYLE_NOWRAP) 10 ])) 11 ->addClass('form_row') 12 ->toString() 13 ?> 14</script> 15<script type="text/x-jquery-tmpl" id="filter-tag-row"> 16 <?= (new CRow([ 17 (new CTextBox('filter_tags[#{rowNum}][tag]')) 18 ->setAttribute('placeholder', _('tag')) 19 ->setWidth(ZBX_TEXTAREA_FILTER_SMALL_WIDTH), 20 (new CRadioButtonList('filter_tags[#{rowNum}][operator]', TAG_OPERATOR_LIKE)) 21 ->addValue(_('Contains'), TAG_OPERATOR_LIKE) 22 ->addValue(_('Equals'), TAG_OPERATOR_EQUAL) 23 ->setModern(true), 24 (new CTextBox('filter_tags[#{rowNum}][value]')) 25 ->setAttribute('placeholder', _('value')) 26 ->setWidth(ZBX_TEXTAREA_FILTER_SMALL_WIDTH), 27 (new CCol( 28 (new CButton('filter_tags[#{rowNum}][remove]', _('Remove'))) 29 ->addClass(ZBX_STYLE_BTN_LINK) 30 ->addClass('element-table-remove') 31 ))->addClass(ZBX_STYLE_NOWRAP) 32 ])) 33 ->addClass('form_row') 34 ->toString() 35 ?> 36</script> 37<script type="text/javascript"> 38 jQuery(function($) { 39 $(function() { 40 $('#filter-inventory').dynamicRows({ template: '#filter-inventory-row' }); 41 $('#filter-tags').dynamicRows({ template: '#filter-tag-row' }); 42 }); 43 44 $('#filter_show').change(function() { 45 var filter_show = jQuery('input[name=filter_show]:checked').val(); 46 47 $('#filter_age').closest('li').toggle(filter_show == <?= TRIGGERS_OPTION_RECENT_PROBLEM ?> 48 || filter_show == <?= TRIGGERS_OPTION_IN_PROBLEM ?>); 49 }); 50 51 $('#filter_show').trigger('change'); 52 53 $('#filter_compact_view').change(function() { 54 if ($(this).is(':checked')) { 55 $('#filter_show_timeline, #filter_details, #filter_show_latest_values').prop('disabled', true); 56 $('#filter_highlight_row').prop('disabled', false); 57 } 58 else { 59 $('#filter_show_timeline, #filter_details, #filter_show_latest_values').prop('disabled', false); 60 $('#filter_highlight_row').prop('disabled', true); 61 } 62 }); 63 64 $('#filter_show_tags').change(function() { 65 var disabled = $(this).find('[value = "<?= PROBLEMS_SHOW_TAGS_NONE ?>"]').is(':checked'); 66 $('#filter_tag_priority').prop('disabled', disabled); 67 $('#filter_tag_name_format input').prop('disabled', disabled); 68 }); 69 70 $(document).on({ 71 mouseenter: function() { 72 if ($(this).width() > $(this).parent('td').width()) { 73 $(this).attr({title: $(this).text()}); 74 } 75 }, 76 mouseleave: function() { 77 if ($(this).is('[title]')) { 78 $(this).removeAttr('title'); 79 } 80 } 81 }, 'table.<?= ZBX_STYLE_COMPACT_VIEW ?> a.<?= ZBX_STYLE_LINK_ACTION ?>'); 82 }); 83</script> 84