Skip to content

Commit

Permalink
Further UI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwexler committed Jan 5, 2025
1 parent 08f1a6c commit 5eae852
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions admin/tabs/cluster/objects/ClusterObjectsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ClusterObjectsModel extends HoistModel {
@observable.ref startTimestamp: Date = null;
@observable runDurationMs: number = 0;

@bindable showInactive: boolean = true;
@bindable hideUnchecked: boolean = false;
@bindable.ref textFilter: FilterTestFn = null;

clearHibernateCachesAction: RecordActionSpec = {
Expand Down Expand Up @@ -103,7 +103,7 @@ export class ClusterObjectsModel extends HoistModel {

@computed
get counts() {
const ret = {passed: 0, failed: 0, inactive: 0};
const ret = {passed: 0, failed: 0, unchecked: 0};
this.gridModel.store.allRecords.forEach(record => {
ret[record.data.compareState]++;
});
Expand All @@ -114,7 +114,7 @@ export class ClusterObjectsModel extends HoistModel {
super();
makeObservable(this);
this.addReaction({
track: () => [this.textFilter, this.showInactive],
track: () => [this.textFilter, this.hideUnchecked],
run: this.applyFilters,
fireImmediately: true
});
Expand Down Expand Up @@ -220,14 +220,14 @@ export class ClusterObjectsModel extends HoistModel {
// Implementation
//----------------------
private applyFilters() {
const {showInactive, textFilter, isSingleInstance} = this,
const {hideUnchecked, textFilter, isSingleInstance} = this,
filters: FilterLike[] = [textFilter];

if (!showInactive && !isSingleInstance) {
if (hideUnchecked && !isSingleInstance) {
filters.push({
field: 'compareState',
op: '!=',
value: 'inactive'
value: 'unchecked'
});
}

Expand All @@ -253,7 +253,7 @@ export class ClusterObjectsModel extends HoistModel {
type,
parentName: this.deriveParent(name, type),
compareState: (isEmpty(comparableAdminStats) || objs.length < 2
? 'inactive'
? 'unchecked'
: !isEmpty(breaks[name])
? 'failed'
: 'passed') as CompareState,
Expand Down Expand Up @@ -321,7 +321,7 @@ export class ClusterObjectsModel extends HoistModel {
? 'failed'
: state === 'passed' || parentState === 'passed'
? 'passed'
: 'inactive';
: 'unchecked';
}
}

Expand All @@ -336,7 +336,7 @@ export class ClusterObjectsModel extends HoistModel {
}): ClusterObjectRecord {
return {
...args,
compareState: 'inactive',
compareState: 'unchecked',
comparableAdminStats: [],
adminStatsByInstance: {},
children: []
Expand Down Expand Up @@ -413,7 +413,7 @@ export class ClusterObjectsModel extends HoistModel {
}
}

type CompareState = 'failed' | 'passed' | 'inactive';
type CompareState = 'failed' | 'passed' | 'unchecked';

interface ClusterObjectRecord {
name: string;
Expand Down
8 changes: 4 additions & 4 deletions admin/tabs/cluster/objects/ClusterObjectsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const diffBar = hoistCmp.factory<ClusterObjectsModel>(({model}) => {
const {counts} = model;
return [
switchInput({
label: 'Show unchecked',
bind: 'showInactive'
label: 'Hide unchecked',
bind: 'hideUnchecked'
}),
div({
className: 'xh-cluster-objects-result-count',
Expand All @@ -84,11 +84,11 @@ const diffBar = hoistCmp.factory<ClusterObjectsModel>(({model}) => {
}),
div({
className: 'xh-cluster-objects-result-count',
omit: !counts.inactive || !model.showInactive,
omit: !counts.unchecked || model.hideUnchecked,
items: [
toolbarSep(),
Icon.disabled({prefix: 'fas', className: 'xh-gray'}),
label(`${counts.inactive} Unchecked`)
label(`${counts.unchecked} Unchecked`)
]
})
];
Expand Down

0 comments on commit 5eae852

Please sign in to comment.