Skip to content

Commit 4d7954d

Browse files
add alwaysShowGroupFilters option
1 parent 5ae7e41 commit 4d7954d

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/atoms/settingsState.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export const clientSettingsInitial: ClientSettings = {
126126

127127
hostgroupFilter: '',
128128
servicegroupFilter: '',
129+
alwaysShowGroupFilters: false,
129130

130131
versionCheckDays: 7,
131132

src/components/Dashboard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const Dashboard = () => {
4141
hideHostSection,
4242
hideServiceSection,
4343
hostsAndServicesSideBySide,
44+
alwaysShowGroupFilters,
4445
} = clientSettings;
4546

4647
//console.log('Dashboard render()');
@@ -54,13 +55,13 @@ const Dashboard = () => {
5455

5556
<DashboardFetch />
5657

57-
<div className="flex">
58+
{(alwaysShowGroupFilters || !hideFilters) && <div className="flex">
5859
{/* Hostgroup Filter Section */}
5960
<HostGroupFilter />
6061

6162
{/* Servicegroup Filter Section */}
6263
<ServiceGroupFilter />
63-
</div>
64+
</div>}
6465

6566

6667
{/* Summary Section */}

src/components/Settings.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,17 @@ const Settings = () => {
578578
Side-by-side (Column) layout reverts to stacked on smaller screens
579579
</td>
580580
</tr>
581+
<tr>
582+
<th>Service and HostGroup filters:</th>
583+
<td>
584+
<select value={clientSettingsTemp.alwaysShowGroupFilters.toString()} onChange={handleChange('alwaysShowGroupFilters', 'boolean')}>
585+
<option value={'true'}>Show Always</option>
586+
<option value={'false'}>Show with Filters</option>
587+
</select>
588+
&nbsp;
589+
Show Always keeps HostGroup and ServiceGroup filters visible. Show with Filters only shows them when filters are toggled on.
590+
</td>
591+
</tr>
581592
<tr>
582593
<th>Hosts:</th>
583594
<td>

src/types/settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export interface ClientSettings {
7474

7575
hostgroupFilter: string;
7676
servicegroupFilter: string;
77+
alwaysShowGroupFilters: boolean;
7778

7879
versionCheckDays: number;
7980

0 commit comments

Comments
 (0)