Skip to content

Commit

Permalink
feature: Add years to get_daysfromtime function
Browse files Browse the repository at this point in the history
* Added this part and then corrected some soft-tab issues
* Make the support page on timeout more readable
  • Loading branch information
TheWitness committed Nov 15, 2024
1 parent 0290ab3 commit f9bc09b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Cacti CHANGELOG
-feature: Upgrade d3.js to version 7.8.2
-feature: Upgrade ua-parser.js to version 1.0.35
-feature: Add parsedown to vendor library for plugin CHANGELOG and README viewing support
-feature: Add year display to get_daysfromtime function

1.2.29
-issue#5843: Issue with temporary tables with use of microtime
Expand Down
10 changes: 8 additions & 2 deletions include/global_arrays.php
Original file line number Diff line number Diff line change
Expand Up @@ -2965,21 +2965,24 @@

$days_from_time_settings = array(
'mods' => array(
'y' => 31536000,
'd' => 86400,
'h' => 3600,
'm' => '60',
's' => 0,
),
'text' => array(
DAYS_FORMAT_SHORT => array(
'y' => 'y',
'd' => 'd',
'h' => 'h',
'm' => 'm',
'h' => 'h',
'm' => 'm',
's' => 's',
'suffix' => ':',
'prefix' => '',
),
DAYS_FORMAT_MEDIUM => array(
'y' => __('years'),
'd' => __('days'),
'h' => __('hrs'),
'm' => __('mins'),
Expand All @@ -2988,6 +2991,7 @@
'prefix' => ' ',
),
DAYS_FORMAT_MEDIUM_LOG => array(
'y' => 'years',
'd' => 'days',
'h' => 'hrs',
'm' => 'mins',
Expand All @@ -2996,6 +3000,7 @@
'prefix' => ' ',
),
DAYS_FORMAT_LONG => array(
'y' => __('years'),
'd' => __('days'),
'h' => __('hours'),
'm' => __('minutes'),
Expand All @@ -3004,6 +3009,7 @@
'prefix' => ' ',
),
DAYS_FORMAT_LONG_LOG => array(
'y' => 'years',
'd' => 'days',
'h' => 'hours',
'm' => 'minutes',
Expand Down
14 changes: 13 additions & 1 deletion support.php
Original file line number Diff line number Diff line change
Expand Up @@ -778,12 +778,24 @@ function applyFilter() {
foreach ($processes as $p) {
form_alternate_row('line' . $p['pid'], false);

if ($p['timeout'] != 'N/A') {
$timeout_time = $p['timeout'];
$timeout_date = get_daysfromtime($timeout_time, true);

if (strpos($timeout_date, 'y:') !== false) {
$timeout_date = __('> 1 Year');
}
} else {
$timeout_date = $p['timeout'];
}

form_selectable_cell($p['tasktype'], $p['pid']);
form_selectable_cell(filter_value(strtoupper($p['taskname']), ''), $p['pid']);
form_selectable_cell($p['taskid'], $p['pid'], '', 'right');
form_selectable_cell($p['runtime'], $p['pid'], '', 'right');
form_selectable_cell($p['pid'], $p['pid'], '', 'right');
form_selectable_cell($p['timeout'], $p['pid'], '', 'right');
//form_selectable_cell($p['timeout'], $p['pid'], '', 'right');
form_selectable_cell($timeout_date, $p['pid'], '', 'right');
form_selectable_cell($p['started'], $p['pid'], '', 'right');
form_selectable_cell($p['last_update'], $p['pid'], '', 'right');

Expand Down

0 comments on commit f9bc09b

Please sign in to comment.