Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use severity as as default sort #1121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sukhwinder33445
Copy link
Contributor

resolves #1096

@sukhwinder33445 sukhwinder33445 added the enhancement New feature or improvement label Jan 9, 2025
@sukhwinder33445 sukhwinder33445 added this to the 1.2.0 milestone Jan 9, 2025
@sukhwinder33445 sukhwinder33445 self-assigned this Jan 9, 2025
@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Jan 9, 2025
@sukhwinder33445 sukhwinder33445 force-pushed the sort-by-severity-as-default branch from 3793318 to 9b37857 Compare January 9, 2025 14:52
@@ -50,15 +50,19 @@ public function indexAction()

$limitControl = $this->createLimitControl();
$paginationControl = $this->createPaginationControl($hosts);

$defaultSort = 'host.state.severity desc,host.state.last_state_change desc';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$defaultSort = 'host.state.severity desc,host.state.last_state_change desc';
$defaultSort = ['host.state.severity DESC', 'host.state.last_state_change DESC'];

This looks more readable to me.

Comment on lines 58 to 59
'host.display_name' => t('Name'),
'host.state.severity desc,host.state.last_state_change desc' => t('Severity'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'host.display_name' => t('Name'),
'host.state.severity desc,host.state.last_state_change desc' => t('Severity'),
'host.state.severity desc,host.state.last_state_change desc' => t('Severity'),
'host.display_name' => t('Name'),

You need to also change the order of this array to reflect that the hosts were ordered by severity by default.

@@ -60,6 +60,8 @@ public function indexAction()

$limitControl = $this->createLimitControl();
$paginationControl = $this->createPaginationControl($services);

$defaultSort = 'service.state.severity desc,service.state.last_state_change desc';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$defaultSort = 'service.state.severity desc,service.state.last_state_change desc';
$defaultSort = ['service.state.severity DESC', 'service.state.last_state_change Desc'];

@@ -60,6 +60,8 @@ public function indexAction()

$limitControl = $this->createLimitControl();
$paginationControl = $this->createPaginationControl($services);

$defaultSort = 'service.state.severity desc,service.state.last_state_change desc';
$sortControl = $this->createSortControl(
$services,
[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, change the order of the array to reflect the default sort.

@sukhwinder33445 sukhwinder33445 force-pushed the sort-by-severity-as-default branch from 9b37857 to deea667 Compare January 9, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed CLA is signed by all contributors of a PR enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Icinga DB Hosts/Service view sort by Severity as default
2 participants