From b12f1cce5b5190da21d1c4ab7a6cd02570f51b23 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 10 Dec 2020 14:32:17 -0500 Subject: [PATCH 1/2] add Function help text to monitor view --- web/skins/classic/views/js/monitor.js | 13 +++++++++++++ web/skins/classic/views/monitor.php | 21 ++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/web/skins/classic/views/js/monitor.js b/web/skins/classic/views/js/monitor.js index 75cb89707..77876e7c9 100644 --- a/web/skins/classic/views/js/monitor.js +++ b/web/skins/classic/views/js/monitor.js @@ -146,6 +146,19 @@ function initPage() { el.oninput = window['update_estimated_ram_use'].bind(el); }); + document.querySelectorAll('select[name="newMonitor[Function]"]').forEach(function(el) { + el.onchange = function() { + $j('#function_help div').hide(); + $j('#'+this.value+'Help').show(); + if ( this.value == 'Monitor' || this.value == 'None' ) { + $j('#FunctionEnabled').hide(); + } else { + $j('#FunctionEnabled').show(); + } + }; + el.onchange(); + }); + $j('.chosen').chosen(); // Don't enable the back button if there is no previous zm page to go back to diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index aae5bddf1..5bfc03ecc 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -470,7 +470,7 @@ if ( canEdit('Monitors') ) {
$value ) { - echo '
'; + echo '
'; ?> @@ -512,11 +512,26 @@ switch ( $name ) { } echo htmlSelect('newMonitor[Function]', $function_options, $monitor->Function()); ?> +
+ $translated ) { + if ( isset($OLANG['FUNCTION_'.strtoupper($fn)]) ) { + echo '
'.$OLANG['FUNCTION_'.strtoupper($fn)]['Help'].'
'; + } + } +?> +
- + - + Type() != 'WebSite' ) { From 2e9f991211c15a134efe0680dab51877bd748afe Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 10 Dec 2020 14:32:44 -0500 Subject: [PATCH 2/2] give the label column in monitor view a min-width of 300px so that it is always large enough --- web/skins/classic/css/base/views/monitor.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/skins/classic/css/base/views/monitor.css b/web/skins/classic/css/base/views/monitor.css index 2cdc0c400..29af3612a 100644 --- a/web/skins/classic/css/base/views/monitor.css +++ b/web/skins/classic/css/base/views/monitor.css @@ -42,3 +42,6 @@ input[name="newMonitor[Height]"] { select.chosen { width: 100%; } +tr td:first-child { + min-width: 300px; +}
Enabled() ? ' checked="checked"' : '' ?>/>Enabled() ? ' checked="checked"' : '' ?>/> +'.$OLANG['FUNCTION_ANALYSIS_ENABLED']['Help'].''; + } +?> +