diff --git a/web-console/src/views/datasource-view/datasource-view.tsx b/web-console/src/views/datasource-view/datasource-view.tsx index 35d46f95a3f..964b4e1d922 100644 --- a/web-console/src/views/datasource-view/datasource-view.tsx +++ b/web-console/src/views/datasource-view/datasource-view.tsx @@ -151,8 +151,11 @@ export class DatasourcesView extends React.Component x.datasource); - const disabledResp = await axios.get('/druid/coordinator/v1/metadata/datasources?includeDisabled'); - const disabled: string[] = disabledResp.data.filter((d: string) => !seen[d]); + let disabled: string [] = []; + if (this.state.showDisabled) { + const disabledResp = await axios.get('/druid/coordinator/v1/metadata/datasources?includeDisabled' ); + disabled = disabledResp.data.filter((d: string) => !seen[d]); + } const rulesResp = await axios.get('/druid/coordinator/v1/rules'); const rules = rulesResp.data; @@ -395,6 +398,13 @@ GROUP BY 1`); }); } + private toggleDisabled(showDisabled: boolean) { + if (!showDisabled) { + this.datasourceQueryManager.rerunLastQuery(); + } + this.setState({showDisabled: !showDisabled}); + } + getDatasourceActions(datasource: string, disabled: boolean): BasicAction[] { const { goToSql } = this.props; @@ -657,7 +667,7 @@ GROUP BY 1`); this.setState({ showDisabled: !showDisabled })} + onChange={() => this.toggleDisabled(showDisabled)} />