From 2de479f565cf1c5666a537c90bec1d156b09f4ed Mon Sep 17 00:00:00 2001 From: guodan1 Date: Thu, 27 Dec 2018 17:08:51 +0800 Subject: [PATCH] mgr/dashboard: Add a 'clear filter' button to configuration page Fixes:http://tracker.ceph.com/issues/36173 Signed-off-by: familyuu --- .../cluster/configuration/configuration.component.html | 6 ++++++ .../cluster/configuration/configuration.component.ts | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.html index c6fce9f31325f..36d280aebb0ec 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.html @@ -18,6 +18,12 @@ + + + + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts index 3f33a43b4e664..9c056bcb602f4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts @@ -25,6 +25,7 @@ export class ConfigurationComponent implements OnInit { { label: this.i18n('Level'), prop: 'level', + initValue: 'basic', value: 'basic', options: ['basic', 'advanced', 'dev'], applyFilter: (row, value) => { @@ -42,6 +43,7 @@ export class ConfigurationComponent implements OnInit { { label: this.i18n('Service'), prop: 'services', + initValue: 'any', value: 'any', options: ['any', 'mon', 'mgr', 'osd', 'mds', 'common', 'mds_client', 'rgw'], applyFilter: (row, value) => { @@ -55,6 +57,7 @@ export class ConfigurationComponent implements OnInit { { label: this.i18n('Source'), prop: 'source', + initValue: 'any', value: 'any', options: ['any', 'mon'], applyFilter: (row, value) => { @@ -125,4 +128,11 @@ export class ConfigurationComponent implements OnInit { updateFilter() { this.data = [...this.data]; } + + resetFilter() { + this.filters.forEach((item) => { + item.value = item.initValue; + }); + this.data = [...this.data]; + } } -- 2.39.5