diff --git a/web/includes/Group.php b/web/includes/Group.php index ca3557076..1a2b7606f 100644 --- a/web/includes/Group.php +++ b/web/includes/Group.php @@ -141,6 +141,7 @@ public $defaults = array( $depth = 0; $groups = array(); $parent_group_ids = null; + session_start(); while(1) { $Groups = Group::find_all( array('ParentId'=>$parent_group_ids) ); if ( ! count( $Groups ) ) @@ -148,10 +149,10 @@ public $defaults = array( $parent_group_ids = array(); $selected_group_id = 0; - if ( isset($_REQUEST['group'.$depth]) and $_REQUEST['group'.$depth] > 0 ) { - $selected_group_id = $group_id = $_REQUEST['group'.$depth]; - } else if ( isset($_COOKIE['zmGroup'.$depth] ) and $_COOKIE['zmGroup'.$depth] > 0 ) { - $selected_group_id = $group_id = $_COOKIE['zmGroup'.$depth]; + if ( isset($_REQUEST['group'.$depth]) ) { + $selected_group_id = $group_id = $_SESSION['group'.$depth] = $_REQUEST['group'.$depth]; + } else if ( isset($_REQUEST['filtering']) ) { + unset($_SESSION['group'.$depth]); } foreach ( $Groups as $Group ) { @@ -163,10 +164,11 @@ public $defaults = array( $parent_group_ids[] = $Group->Id(); } - echo htmlSelect( 'group'.$depth, $groups[$depth], $selected_group_id, "changeGroup(this,$depth);" ); + echo htmlSelect( 'group'.$depth, $groups[$depth], $selected_group_id, "this.form.submit();" ); if ( ! count($parent_group_ids) ) break; $depth += 1; } + session_write_close(); return $group_id; } # end public static function get_group_dropdowns() diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index 2338bbeab..021d710ae 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -96,6 +96,8 @@ if ( file_exists( "skins/$skin/css/$css/graphics/favicon.ico" ) ) { + + + + + + +
+ +
+ + diff --git a/web/skins/classic/js/chosen/index.proto.html b/web/skins/classic/js/chosen/index.proto.html new file mode 100644 index 000000000..11c9346d6 --- /dev/null +++ b/web/skins/classic/js/chosen/index.proto.html @@ -0,0 +1,1472 @@ + + + + + Chosen: A Prototype Plugin by Harvest to Tame Unwieldy Select Boxes + + + + + + + + +
+
+
+

Chosen - Prototype Version (v1.8.2)

+
+

Chosen is a Prototype plugin that makes long, unwieldy select boxes much more user-friendly.

+ +

+ Downloads + Project Source + Contribute +

+ +

Looking for the jQuery version?

+ +

Standard Select

+
+
+ Turns This + +
+
+ Into This + +
+
+ +

Multiple Select

+
+
+ Turns This + +
+
+ Into This + +
+
+ +

<optgroup> Support

+
+
+ Single Select with Groups + +
+
+ Multiple Select with Groups + +
+
+ +

Selected and Disabled Support

+
+

Chosen automatically highlights selected options and removes disabled options.

+
+ Single Select + +
+
+ Multiple Select + +
+
+ +

Hide Search on Single Select

+
+

The disable_search_threshold option can be specified to hide the search input on single selects if there are n or fewer options.

+
 new Chosen($("chosen_select_field"),{disable_search_threshold: 10}); 
+

+
+ +
+
+ +

Default Text Support

+
+

Chosen automatically sets the default field text ("Choose a country...") by reading the select element's data-placeholder value. If no data-placeholder value is present, it will default to "Select an Option" or "Select Some Options" depending on whether the select is single or multiple. You can change these elements in the plugin js file as you see fit.

+
<select data-placeholder="Choose a country..." multiple class="chosen-select">
+

Note: on single selects, the first element is assumed to be selected by the browser. To take advantage of the default text support, you will need to include a blank option as the first element of your select list.

+
+ +

No Results Text Support

+
+

Setting the "No results" search text is as easy as passing an option when you create Chosen:

+
new Chosen($("chosen_select_field"),{no_results_text: "Oops, nothing found!"}); 
+ +
+ Single Select + +
+
+ Multiple Select + +
+
+ +

Limit Selected Options in Multiselect

+
+

You can easily limit how many options the user can select:

+
new Chosen($("chosen_select_field"),{max_selected_options: 5}); 
+

If you try to select another option with limit reached chosen:maxselected event is triggered:

+
$("chosen_select_field").observe("chosen:maxselected", function(evt) { ... }); 
+
+ +

Allow Deselect on Single Selects

+
+

When a single select box isn't a required field, you can set allow_single_deselect: true and Chosen will add a UI element for option deselection. This will only work if the first option has blank text.

+
+ +
+
+ +

Right-to-Left Support

+
+

You can set right-to-left text by setting rtl: true

+
 $(".chosen-select").chosen({rtl: true}); 
+
+ Single Right-to-Left Select + +
+
+ Multiple Right-to-Left Select + +
+
+ +

Observing, Updating, and Destroying Chosen

+
+
    +
  • +

    Observing Form Field Changes

    +

    When working with form fields, you often want to perform some behavior after a value has been selected or deselected. Whenever a user selects a field in Chosen, it triggers a "change" event on the original form field. That lets you do something like this:

    +
    $("#form_field").chosen().change( … );
    +

    Note: Prototype doesn't offer support for triggering standard browser events. Event.simulate is required to trigger the change event when using the Prototype version.

    +
  • +
  • +

    Updating Chosen Dynamically

    +

    If you need to update the options in your select field and want Chosen to pick up the changes, you'll need to trigger the "chosen:updated" event on the field. Chosen will re-build itself based on the updated content.

    +
    Event.fire($("form_field"), "chosen:updated");
    +
  • +
  • +

    Destroying Chosen

    +

    To destroy Chosen and revert back to the native select, call destroy on the Chosen instance:

    +
    chosen = new Chosen($("form_field"));
    +
    +// ...later
    +chosen.destroy();
    +
  • +
+
+ +

Custom Width Support

+
+

Using a custom width with Chosen is as easy as passing an option when you create Chosen:

+
new Chosen($("chosen_select_field"),{width: "95%"}); 
+
+ Single Select + +
+
+ Multiple Select + +
+
+ +

Labels work, too

+
+

Use labels just like you would a standard select

+

+
+ + +
+
+ + +
+
+ +

Setup

+

Using Chosen is easy as can be.

+
    +
  1. Download the plugin and copy the chosen files to your app.
  2. +
  3. Activate the plugin by creating a new instance of Chosen: New Chosen(some_form_field,some_options);
  4. +
  5. Disco.
  6. +
+ +

FAQs

+ + +

Credits

+ + + + + +
+
+ + + + +
+ +
+ + diff --git a/web/skins/classic/js/chosen/options.html b/web/skins/classic/js/chosen/options.html new file mode 100644 index 000000000..3e2a6a87e --- /dev/null +++ b/web/skins/classic/js/chosen/options.html @@ -0,0 +1,306 @@ + + + + + Chosen: A jQuery Plugin by Harvest to Tame Unwieldy Select Boxes + + + + + + +
+
+
+

Chosen (v1.8.2)

+
+

Chosen has a number of options and attributes that allow you to have full control of your select boxes.

+ +

Options

+

The following options are available to pass into Chosen on instantiation.

+ +

Example:

+
+  $(".my_select_box").chosen({
+    disable_search_threshold: 10,
+    no_results_text: "Oops, nothing found!",
+    width: "95%"
+  });
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefaultDescription
allow_single_deselectfalseWhen set to true on a single select, Chosen adds a UI element which selects the first element (if it is blank).
disable_searchfalseWhen set to true, Chosen will not display the search field (single selects only).
disable_search_threshold0Hide the search input on single selects if there are n or fewer options.
enable_split_word_searchtrueBy default, searching will match on any word within an option tag. Set this option to false if you want to only match on the entire text of an option tag.
inherit_select_classesfalseWhen set to true, Chosen will grab any classes on the original select field and add them to Chosen’s container div.
max_selected_optionsInfinityLimits how many options the user can select. When the limit is reached, the chosen:maxselected event is triggered.
no_results_text"No results match"The text to be displayed when no matching results are found. The current search is shown at the end of the text (e.g., + No results match "Bad Search").
placeholder_text_multiple"Select Some Options"The text to be displayed as a placeholder when no options are selected for a multiple select.
placeholder_text_single"Select an Option"The text to be displayed as a placeholder when no options are selected for a single select.
search_containsfalseBy default, Chosen’s search matches starting at the beginning of a word. Setting this option to true allows matches starting from anywhere within a word. This is especially useful for options that include a lot of special characters or phrases in ()s and []s.
single_backstroke_deletetrueBy default, pressing delete/backspace on multiple selects will remove a selected choice. When false, pressing delete/backspace will highlight the last choice, and a second press deselects it.
widthOriginal select width.The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0.
display_disabled_optionstrueBy default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches.
display_selected_optionstrue +

By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches.

+

Note: this is for multiple selects only. In single selects, the selected result will always be displayed.

+
include_group_label_in_selectedfalse +

By default, Chosen only shows the text of a selected option. Setting this option to true will show the text and group (if any) of the selected option.

+
max_shown_resultsInfinity +

Only show the first (n) matching options in the results. This can be used to increase performance for selects with very many options.

+
case_sensitive_searchfalse +

By default Chosen's search is case-insensitive. Setting this option to true makes the search case-sensitive.

+
hide_results_on_selecttrue +

By default Chosen's results are hidden after a option is selected. Setting this option to false will keep the results open after selection. This only applies to multiple selects.

+
rtlfalse +

Chosen supports right-to-left text in select boxes. Set this option to true to support right-to-left text options.

+

Note: the chosen-rtl class on the select has precedence over this option. However, the classname approach is deprecated and will be removed in future versions of Chosen.

+
+ +

Attributes

+

Certain attributes placed on the select tag or its options can be used to configure Chosen.

+ +

Example:

+ +
+  <select class="my_select_box" data-placeholder="Select Your Options">
+    <option value="1">Option 1</option>
+    <option value="2" selected>Option 2</option>
+    <option value="3" disabled>Option 3</option>
+  </select>
+
+ + + + + + + + + + + + + + + + + +
AttributeDescription
data-placeholder +

The text to be displayed as a placeholder when no options are selected for a select. Defaults to "Select an Option" for single selects or "Select Some Options" for multiple selects.

+

Note:This attribute overrides anything set in the placeholder_text_multiple or placeholder_text_single options.

+
multipleThe attribute multiple on your select box dictates whether Chosen will render a multiple or single select.
selected, disabledChosen automatically highlights selected options and disables disabled options.
+ +

Classes

+

Classes placed on the select tag can be used to configure Chosen.

+ +

Example:

+ +
+  <select class="my_select_box chosen-rtl">
+    <option value="1">Option 1</option>
+    <option value="2">Option 2</option>
+    <option value="3">Option 3</option>
+  </select>
+
+ + + + + + + + + + +
ClassnameDescription
chosen-rtl +

Chosen supports right-to-left text in select boxes. Add the class chosen-rtl to your select tag to support right-to-left text options.

+

Note: The chosen-rtl class will pass through to the Chosen select even when the inherit_select_classes option is set to false.

+

Note: This is deprecated in favor of using the rtl: true option (see the Options section).

+
+ +

Triggered Events

+

Chosen triggers a number of standard and custom events on the original select field.

+ +

Example:

+ +
+  $('.my_select_box').on('change', function(evt, params) {
+    do_something(evt, params);
+  });
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EventDescription
change +

Chosen triggers the standard DOM event whenever a selection is made (it also sends a selected or deselected parameter that tells you which option was changed).

+

Note: The selected and deselected parameters are not available for Prototype.

+
chosen:readyTriggered after Chosen has been fully instantiated.
chosen:maxselectedTriggered if max_selected_options is set and that total is broken.
chosen:showing_dropdownTriggered when Chosen’s dropdown is opened.
chosen:hiding_dropdownTriggered when Chosen’s dropdown is closed.
chosen:no_resultsTriggered when a search returns no matching results.
+ +

+ Note: all custom Chosen events (those that begin with chosen:) also include the chosen object as a parameter. +

+ +

Triggerable Events

+

You can trigger several events on the original select field to invoke a behavior in Chosen.

+ +

Example:

+ +
+  // tell Chosen that a select has changed
+  $('.my_select_box').trigger('chosen:updated');
+
+ + + + + + + + + + + + + + + + + + + + + +
EventDescription
chosen:updatedThis event should be triggered whenever Chosen’s underlying select element changes (such as a change in selected options).
chosen:activateThis is the equivalant of focusing a standard HTML select field. When activated, Chosen will capure keypress events as if you had clicked the field directly.
chosen:openThis event activates Chosen and also displays the search results.
chosen:closeThis event deactivates Chosen and hides the search results.
+ + + +
+
+
+ +
+ + + diff --git a/web/skins/classic/js/chosen/package.json b/web/skins/classic/js/chosen/package.json new file mode 100644 index 000000000..20c4480a3 --- /dev/null +++ b/web/skins/classic/js/chosen/package.json @@ -0,0 +1,50 @@ +{ + "name": "chosen-js", + "version": "1.8.1", + "description": "Chosen is a JavaScript plugin that makes select boxes user-friendly. It is currently available in both jQuery and Prototype flavors.", + "keywords": [ + "select", + "multiselect", + "dropdown", + "form", + "input", + "ui" + ], + "homepage": "https://harvesthq.github.io/chosen/", + "bugs": "https://github.com/harvesthq/chosen/issues", + "license": "MIT", + "contributors": [ + { + "name": "Patrick Filler", + "url": "https://github.com/pfiller" + }, + { + "name": "Christophe Coevoet", + "url": "https://github.com/stof" + }, + { + "name": "Ken Earley", + "url": "https://github.com/kenearley" + }, + { + "name": "Koen Punt", + "url": "https://github.com/koenpunt" + } + ], + "dependencies": {}, + "files": [ + "chosen.jquery.js", + "chosen.jquery.min.js", + "chosen.proto.js", + "chosen.proto.min.js", + "chosen.css", + "chosen.min.css", + "chosen-sprite@2x.png", + "chosen-sprite.png" + ], + "main": "chosen.jquery.js", + "repository": { + "type": "git", + "url": "https://github.com/harvesthq/chosen.git" + } +} diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js index e9d03481b..57f67fd07 100644 --- a/web/skins/classic/js/skin.js +++ b/web/skins/classic/js/skin.js @@ -335,21 +335,6 @@ function addVideoTimingTrack(video, LabelFormat, monitorName, duration, startTim } */ -function changeGroup( e, depth ) { - var group_id = $('group'+depth).get('value'); - Cookie.write( 'zmGroup'+depth, group_id, { duration: 10*365 } ); - window.location = window.location; -} -function changeMonitor( e ) { - var monitor_id = e.value; - Cookie.write( 'MonitorId', monitor_id, { duration: 10*365 } ); - window.location = window.location; -} -function changeFilter( e ) { - Cookie.write( e.name, e.value, { duration: 10*365 } ); - window.location = window.location; -} - var resizeTimer; function endOfResize(e) { diff --git a/web/skins/classic/views/_monitor_filters.php b/web/skins/classic/views/_monitor_filters.php index 89ff4e3eb..c5520b835 100644 --- a/web/skins/classic/views/_monitor_filters.php +++ b/web/skins/classic/views/_monitor_filters.php @@ -24,19 +24,15 @@ foreach ( $servers as $S ) { $ServersById[$S->Id()] = $S; } session_start(); -foreach ( array('ServerFilter','StorageFilter','StatusFilter','MonitorId') as $var ) { +foreach ( array('ServerId','StorageId','Status','MonitorId') as $var ) { if ( isset( $_REQUEST[$var] ) ) { if ( $_REQUEST[$var] != '' ) { $_SESSION[$var] = $_REQUEST[$var]; } else { unset( $_SESSION[$var] ); } - } else if ( isset( $_COOKIE[$var] ) ) { - if ( $_COOKIE[$var] != '' ) { - $_SESSION[$var] = $_COOKIE[$var]; - } else { - unset($_SESSION[$var]); - } + } else if ( isset( $_REQUEST['filtering'] ) ) { + unset( $_SESSION[$var] ); } } session_write_close(); @@ -49,6 +45,7 @@ foreach ( $storage_areas as $S ) { ?>
+ 'All'); + $monitors_dropdown = array(); # Check to see if the selected monitor_id is in the results. - if ( $monitor_id ) { + if ( count($selected_monitor_ids) ) { $found_selected_monitor = false; for ( $i = 0; $i < count($monitors); $i++ ) { if ( !visibleMonitor( $monitors[$i]['Id'] ) ) { continue; } - if ( $monitors[$i]['Id'] == $monitor_id ) { + if ( in_array( $monitors[$i]['Id'], $selected_monitor_ids ) ) { $found_selected_monitor = true; } } // end foreach monitor if ( ! $found_selected_monitor ) { - $monitor_id = ''; + $selected_monitor_ids = array(); } } // end if a monitor was specified @@ -111,7 +111,7 @@ $groupSql = Group::get_group_sql( $group_id ); } $monitors_dropdown[$monitors[$i]['Id']] = $monitors[$i]['Name']; - if ( $monitor_id and ( $monitors[$i]['Id'] != $monitor_id ) ) { + if ( count($selected_monitor_ids) and ! in_array( $monitors[$i]['Id'], $selected_monitor_ids ) ) { continue; } if ( isset($_SESSION['StatusFilter']) ) { @@ -121,7 +121,13 @@ $groupSql = Group::get_group_sql( $group_id ); } $displayMonitors[] = $monitors[$i]; } - echo htmlSelect( 'MonitorId', $monitors_dropdown, $monitor_id, array('onchange'=>'changeFilter(this);') ); + echo htmlSelect( 'MonitorId[]', $monitors_dropdown, $selected_monitor_ids, + array( + 'onchange'=>'this.form.submit();', + 'class'=>'chosen', + 'multiple'=>'multiple', + 'data-placeholder'=>'All', + ) ); ?> 1 ) { ?> 'All')+$ServersById, (isset($_SESSION['ServerFilter'])?$_SESSION['ServerFilter']:''), array('onchange'=>'changeFilter(this);') ); + echo htmlSelect( 'ServerId[]', $ServersById, + (isset($_SESSION['ServerId'])?$_SESSION['ServerId']:''), + array( + 'onchange'=>'this.form.submit();', + 'class'=>'chosen', + 'multiple'=>'multiple', + 'data-placeholder'=>'All', + ) + ); ?> 'All')+$ServersById, (isset($_SESSION if ( count($StorageById) > 1 ) { ?> 'All')+$StorageById, (isset($_SESSION['StorageFilter'])?$_SESSION['StorageFilter']:''), array('onchange'=>'changeFilter(this);') ); + echo htmlSelect( 'StorageId[]',$StorageById, + (isset($_SESSION['StorageId'])?$_SESSION['StorageId']:''), + array( + 'onchange'=>'this.form.submit();', + 'class'=>'chosen', + 'multiple'=>'multiple', + 'data-placeholder'=>'All', + ) ); ?> 'All')+$StorageById, (isset($_SESSIO 'All', 'Unknown' => translate('Unknown'), 'NotRunning' => translate('NotRunning'), 'Running' => translate('Running'), ); -echo htmlSelect( 'StatusFilter', $status_options, ( isset($_SESSION['StatusFilter']) ? $_SESSION['StatusFilter'] : '' ), array('onchange'=>'changeFilter(this);') ); +echo htmlSelect( 'Status[]', $status_options, + ( isset($_SESSION['Status']) ? $_SESSION['Status'] : '' ), + array( + 'onchange'=>'this.form.submit();', + 'class'=>'chosen', + 'multiple'=>'multiple', + 'data-placeholder'=>'All' + ) ); ?>
diff --git a/web/skins/classic/views/js/montagereview.js.php b/web/skins/classic/views/js/montagereview.js.php index 69d9c3d22..766d43502 100644 --- a/web/skins/classic/views/js/montagereview.js.php +++ b/web/skins/classic/views/js/montagereview.js.php @@ -42,60 +42,62 @@ $index = 0; $anyAlarms = false; if ( ! $initialModeIsLive ) { +Warning($eventsSql); + $result = dbQuery( $eventsSql ); + if ( ! $result ) { + Fatal('SQL-ERR'); + return; + } -$result = dbQuery( $eventsSql ); -if ( ! $result ) { - Fatal('SQL-ERR'); - return; -} + while( $event = $result->fetch( PDO::FETCH_ASSOC ) ) { -while( $event = $result->fetch( PDO::FETCH_ASSOC ) ) { - - if ( $minTimeSecs > $event['StartTimeSecs'] ) $minTimeSecs = $event['StartTimeSecs']; - if ( $maxTimeSecs < $event['CalcEndTimeSecs'] ) $maxTimeSecs = $event['CalcEndTimeSecs']; - echo " + if ( $minTimeSecs > $event['StartTimeSecs'] ) $minTimeSecs = $event['StartTimeSecs']; + if ( $maxTimeSecs < $event['CalcEndTimeSecs'] ) $maxTimeSecs = $event['CalcEndTimeSecs']; + echo " eMonId[$index]=" . $event['MonitorId'] . "; eId[$index]=" . $event['Id'] . "; eStartSecs[$index]=" . $event['StartTimeSecs'] . "; eEndSecs[$index]=" . $event['CalcEndTimeSecs'] . "; eventFrames[$index]=" . $event['Frames'] . "; -"; + "; - $index = $index + 1; - if ( $event['MaxScore'] > 0 ) - $anyAlarms = true; -} - -// if there is no data set the min/max to the passed in values -if ( $index == 0 ) { - if ( isset($minTime) && isset($maxTime) ) { - $minTimeSecs = strtotime($minTime); - $maxTimeSecs = strtotime($maxTime); - } else { - // this is the case of no passed in times AND no data -- just set something arbitrary - $minTimeSecs = strtotime('1950-06-01 01:01:01'); // random time so there's something to display - $maxTimeSecs = time() + 86400; + $index = $index + 1; + if ( $event['MaxScore'] > 0 ) + $anyAlarms = true; } -} -// We only reset the calling time if there was no calling time -if ( !isset($minTime) || !isset($maxTime) ) { - $maxTime = strftime($maxTimeSecs); - $minTime = strftime($minTimeSecs); -} else { - $minTimeSecs = strtotime($minTime); + // if there is no data set the min/max to the passed in values + if ( $index == 0 ) { + if ( isset($minTime) && isset($maxTime) ) { + $minTimeSecs = strtotime($minTime); + $maxTimeSecs = strtotime($maxTime); + } else { + // this is the case of no passed in times AND no data -- just set something arbitrary + $minTimeSecs = strtotime('1950-06-01 01:01:01'); // random time so there's something to display + $maxTimeSecs = time() + 86400; + } + } - $maxTimeSecs = strtotime($maxTime); -} + // We only reset the calling time if there was no calling time + if ( !isset($minTime) || !isset($maxTime) ) { + $maxTime = strftime($maxTimeSecs); + $minTime = strftime($minTimeSecs); + } else { + $minTimeSecs = strtotime($minTime); -// If we had any alarms in those events, this builds the list of all alarm frames, but consolidated down to (nearly) contiguous segments -// comparison in else governs how aggressively it consolidates + $maxTimeSecs = strtotime($maxTime); + } -echo "var fMonId = [];\n"; -echo "var fTimeFromSecs = [];\n"; -echo "var fTimeToSecs = [];\n"; -echo "var fScore = [];\n"; + // If we had any alarms in those events, this builds the list of all alarm frames, but consolidated down to (nearly) contiguous segments + // comparison in else governs how aggressively it consolidates + + echo " +var fMonId = []; +var fTimeFromSecs = []; +var fTimeToSecs = []; +var fScore = []; +"; $maxScore=0; $index=0; $mId=-1; @@ -115,10 +117,11 @@ if ( $anyAlarms && $result = dbQuery( $frameSql ) ) { // dump this one start a new $index++; echo " - fMonId[$index]= $mId; - fTimeFromSecs[$index]= $fromSecs; - fTimeToSecs[$index]= $toSecs; - fScore[$index]= $maxScore; + +fMonId[$index]= $mId; +fTimeFromSecs[$index]= $fromSecs; +fTimeToSecs[$index]= $toSecs; +fScore[$index]= $maxScore; "; $mId = $frame['MonitorId']; $fromSecs = $frame['TimeStampSecs']; @@ -140,7 +143,7 @@ if ( $mId > 0 ) { "; } -echo "var maxScore=$maxScore;\n"; // used to skip frame load if we find no alarms. + echo "var maxScore=$maxScore;\n"; // used to skip frame load if we find no alarms. } // end if initialmodeislive echo "var monitorName = [];\n"; echo "var monitorLoading = [];\n"; diff --git a/web/skins/classic/views/montage.php b/web/skins/classic/views/montage.php index 30f7d0420..65e1ec329 100644 --- a/web/skins/classic/views/montage.php +++ b/web/skins/classic/views/montage.php @@ -153,7 +153,10 @@ if ( $showZones ) { } ?> +
+ +
diff --git a/web/skins/classic/views/montagereview.php b/web/skins/classic/views/montagereview.php index 2774cb5fd..cbb1e59b7 100644 --- a/web/skins/classic/views/montagereview.php +++ b/web/skins/classic/views/montagereview.php @@ -68,10 +68,9 @@ if (isset($_REQUEST['minTime']) && isset($_REQUEST['maxTime']) && count($display ) ), ); - if (isset($_SESSION['MonitorId'])) { - $filter['Query']['terms'][] = (array('attr' => 'MonitorId', 'op' => '=', 'val' => $_SESSION['MonitorId'], 'cnj' => 'and')); - } - if (( $group_id != 0 || isset($_SESSION['ServerFilter']) || isset($_SESSION['StorageFilter']) || isset($_SESSION['StatusFilter']) ) && !isset($_SESSION['MonitorId'])) { + if (count($selected_monitor_ids ) ) { + $filter['Query']['terms'][] = (array('attr' => 'MonitorId', 'op' => 'IN', 'val' => $selected_monitor_ids, 'cnj' => 'and')); + } else if ( ( $group_id != 0 || isset($_SESSION['ServerFilter']) || isset($_SESSION['StorageFilter']) || isset($_SESSION['StatusFilter']) ) ) { for ($i=0; $i < count($displayMonitors); $i++) { if ($i == '0') { $filter['Query']['terms'][] = array('attr' => 'MonitorId', 'op' => '=', 'val' => $displayMonitors[$i]['Id'], 'cnj' => 'and', 'obr' => '1'); @@ -122,9 +121,10 @@ if ( ! empty( $user['MonitorIds'] ) ) { $eventsSql .= ' AND M.Id IN ('.$user['MonitorIds'].')'; $frameSql .= ' AND E.MonitorId IN ('.$user['MonitorIds'].')'; } -if ( $monitor_id ) { - $eventsSql .= ' AND M.Id='.$monitor_id; - $frameSql .= ' AND E.MonitorId='.$monitor_id; +if ( count($selected_monitor_ids) ) { + $monitor_ids_sql = ' IN (' . implode(',',$selected_monitor_ids).')'; + $eventsSql .= ' AND M.Id '.$monitor_ids_sql; + $frameSql .= ' AND E.MonitorId '.$monitor_ids_sql; } // Parse input parameters -- note for future, validate/clean up better in case we don't get called from self. @@ -199,7 +199,7 @@ if ( isset($minTime) && isset($maxTime) ) { $frameSql .= ' GROUP BY E.Id, E.MonitorId, F.TimeStamp, F.Delta ORDER BY E.MonitorId, F.TimeStamp ASC'; $monitors = array(); -foreach( $displayMonitors as &$row ) { +foreach( $displayMonitors as $row ) { if ( $row['Function'] == 'None' ) continue; $Monitor = new Monitor( $row );