mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 17:25:26 +02:00
Killing some unicorns and magic numbers.
This commit is contained in:
parent
2fd82b6ee5
commit
3498e9e1e7
@ -255,9 +255,9 @@ if ($template['time_from'] == $template['time_to']) {
|
||||
}
|
||||
else {
|
||||
$from_array = explode(':', $template['time_from']);
|
||||
$from = $from_array[0] * 3600 + $from_array[1] * 60 + $from_array[2];
|
||||
$from = $from_array[0] * SECONDS_1HOUR + $from_array[1] * SECONDS_1MINUTE + $from_array[2];
|
||||
$to_array = explode(':', $template['time_to']);
|
||||
$to = $to_array[0] * 3600 + $to_array[1] * 60 + $to_array[2];
|
||||
$to = $to_array[0] * SECONDS_1HOUR + $to_array[1] * SECONDS_1MINUTE + $to_array[2];
|
||||
if ($to > $from) {
|
||||
if ($template['time_from'] != '00:00:00') {
|
||||
$table_time->head[0] = '00:00:00<br>-<br>' . $template['time_from'];
|
||||
@ -296,7 +296,11 @@ unset($table_time);
|
||||
$table_conditions->data[] = $data;
|
||||
|
||||
$data[0] = __('Use special days list');
|
||||
$data[1] = (isset($alert['special_day']) && $alert['special_day'] == 1) ? __('Yes') : __('No');
|
||||
$data[1] = (isset($alert['special_day']) && $alert['special_day'] == 1)
|
||||
?
|
||||
__('Yes')
|
||||
:
|
||||
__('No');
|
||||
$table_conditions->data[] = $data;
|
||||
|
||||
$data[0] = __('Time threshold');
|
||||
|
@ -8062,7 +8062,12 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4) {
|
||||
return;
|
||||
}
|
||||
|
||||
$graph_seconds =(!empty($other) && isset($other['data'])) ? $other['data'] : 3600; // 1 hour by default
|
||||
$graph_seconds =
|
||||
(!empty($other) && isset($other['data']))
|
||||
?
|
||||
$other['data']
|
||||
:
|
||||
SECONDS_1HOUR; // 1 hour by default
|
||||
|
||||
if (is_nan($graph_seconds) || $graph_seconds <= 0) {
|
||||
// returnError('error_module_graph', __(''));
|
||||
@ -8070,9 +8075,10 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4) {
|
||||
}
|
||||
|
||||
// Get the html item
|
||||
$graph_html = grafico_modulo_sparse($id_module, $graph_seconds, false, 600, 300, '',
|
||||
'', false, false, true, time(), '', 0, 0, true, true,
|
||||
ui_get_full_url(false) . '/', 1, false, '', false, true);
|
||||
$graph_html = grafico_modulo_sparse(
|
||||
$id_module, $graph_seconds, false, 600, 300, '',
|
||||
'', false, false, true, time(), '', 0, 0, true, true,
|
||||
ui_get_full_url(false) . '/', 1, false, '', false, true);
|
||||
|
||||
$graph_image_file_encoded = false;
|
||||
|
||||
|
@ -6,10 +6,16 @@
|
||||
<h1>Action Threshold</h1>
|
||||
|
||||
<p>
|
||||
An alert action will not be executed more than once every action_threshold seconds, regardless of the number of times the alert is fired.
|
||||
|
||||
For example, if you have configured an action that sends you an email when the alert fires and you don't want to receive more than one email per hour, you can set the action_threshold to 3600.
|
||||
|
||||
Bear in mind that the individual action_threshold of an action overrides the global action_threshold of the alert.
|
||||
|
||||
An alert action will not be executed more than once every
|
||||
action_threshold seconds, regardless of the number of times the alert is
|
||||
fired.
|
||||
</p>
|
||||
<p>
|
||||
For example, if you have configured an action that sends you an email
|
||||
when the alert fires and you don't want to receive more than one email
|
||||
per hour, you can set the action_threshold to 3600.
|
||||
</p>
|
||||
<p>
|
||||
Bear in mind that the individual action_threshold of an action overrides
|
||||
the global action_threshold of the alert.
|
||||
</p>
|
||||
|
@ -6,10 +6,16 @@
|
||||
<h1>Umbral de acción</h1>
|
||||
|
||||
<p>
|
||||
Una acción de una alerta no se ejecutará más de una vez cada action_threshold segundos, independientemenete del número de veces que se dispare la alerta.
|
||||
|
||||
Por ejemplo, si ha configurado una acción que le envía un email cuando la alerta se dispara y no quiere recibir más de un email por hora, puede configurar un action_threshold de 3600.
|
||||
|
||||
Tenga en cuenta que el action_threshold individual de una acción tiene precedencia sobre el action_threshold global de una alerta.
|
||||
|
||||
Una acción de una alerta no se ejecutará más de una vez cada
|
||||
action_threshold segundos, independientemenete del número de veces que
|
||||
se dispare la alerta.
|
||||
</p>
|
||||
<p>
|
||||
Por ejemplo, si ha configurado una acción que le envía un email cuando
|
||||
la alerta se dispara y no quiere recibir más de un email por hora, puede
|
||||
configurar un action_threshold de 3600.
|
||||
</p>
|
||||
<p>
|
||||
Tenga en cuenta que el action_threshold individual de una acción tiene
|
||||
precedencia sobre el action_threshold global de una alerta.
|
||||
</p>
|
||||
|
Loading…
x
Reference in New Issue
Block a user