Skip to content

Commit

Permalink
fix: Fix log search in single cluster mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliu committed Jul 3, 2020
1 parent 3296f92 commit 61296e7
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 50 deletions.
20 changes: 11 additions & 9 deletions src/components/Modals/AuditingSearch/Auditing/Detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,17 @@ export default class Detail extends React.PureComponent {
const { searchInputState, clustersOpts } = this.props
return (
<div className={styles.searchBar}>
<span className={styles.clusterSelect}>
<Select
value={searchInputState.cluster}
onChange={this.changeClusterChange}
className={styles.queryModeOptions}
valueRenderer={this.clusterRenderer}
options={clustersOpts}
/>
</span>
{globals.app.isMultiCluster && (
<span className={styles.clusterSelect}>
<Select
value={searchInputState.cluster}
onChange={this.changeClusterChange}
className={styles.queryModeOptions}
valueRenderer={this.clusterRenderer}
options={clustersOpts}
/>
</span>
)}
<SearchInput
className={styles.searchInput}
placeholder={t('search condition')}
Expand Down
20 changes: 12 additions & 8 deletions src/components/Modals/AuditingSearch/Auditing/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,15 @@ export default class Home extends React.Component {
const { searchInputState, clustersOpts } = this.props
return (
<div className={styles.searchBarContainer}>
<Select
className={styles.clusterSelector}
value={searchInputState.cluster}
options={clustersOpts}
valueRenderer={this.clusterRenderer}
onChange={this.onClusterChange}
/>
{globals.app.isMultiCluster && (
<Select
className={styles.clusterSelector}
value={searchInputState.cluster}
options={clustersOpts}
valueRenderer={this.clusterRenderer}
onChange={this.onClusterChange}
/>
)}
<SearchInput
className={styles.searchBar}
onChange={this.onSearchParamsChange}
Expand All @@ -162,7 +164,9 @@ export default class Home extends React.Component {
<div className={styles.recentSummary}>
<h2 className={styles.count}>{total || 0}</h2>
<p>
{t('Trends in the total number of auditing logs in the last 12 hours')}
{t(
'Trends in the total number of auditing logs in the last 12 hours'
)}
</p>
</div>
<div className={styles.chart}>
Expand Down
20 changes: 11 additions & 9 deletions src/components/Modals/EventSearch/Event/Detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,17 @@ export default class Detail extends React.PureComponent {
const { searchInputState, clustersOpts } = this.props
return (
<div className={styles.searchBar}>
<span className={styles.clusterSelect}>
<Select
value={searchInputState.cluster}
onChange={this.changeClusterChange}
className={styles.queryModeOptions}
valueRenderer={this.clusterRenderer}
options={clustersOpts}
/>
</span>
{globals.app.isMultiCluster && (
<span className={styles.clusterSelect}>
<Select
value={searchInputState.cluster}
onChange={this.changeClusterChange}
className={styles.queryModeOptions}
valueRenderer={this.clusterRenderer}
options={clustersOpts}
/>
</span>
)}
<SearchInput
className={styles.searchInput}
placeholder={t('search condition')}
Expand Down
16 changes: 9 additions & 7 deletions src/components/Modals/EventSearch/Event/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,15 @@ export default class HomeModal extends React.Component {
const { searchInputState, clustersOpts } = this.props
return (
<div className={styles.searchBarContainer}>
<Select
className={styles.clusterSelector}
value={searchInputState.cluster}
options={clustersOpts}
valueRenderer={this.clusterRenderer}
onChange={this.onClusterChange}
/>
{globals.app.isMultiCluster && (
<Select
className={styles.clusterSelector}
value={searchInputState.cluster}
options={clustersOpts}
valueRenderer={this.clusterRenderer}
onChange={this.onClusterChange}
/>
)}
<SearchInput
className={styles.searchBar}
onChange={this.onSearchParamsChange}
Expand Down
16 changes: 9 additions & 7 deletions src/components/Modals/LogSearch/Logging/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ export default class HomeModal extends React.Component {
const { searchInputState, clustersOpts } = this.props
return (
<div className={styles.searchBarContainer}>
<Select
className={styles.clusterSelector}
value={searchInputState.cluster}
options={clustersOpts}
valueRenderer={this.clusterRenderer}
onChange={this.onClusterChange}
/>
{globals.app.isMultiCluster && (
<Select
className={styles.clusterSelector}
value={searchInputState.cluster}
options={clustersOpts}
valueRenderer={this.clusterRenderer}
onChange={this.onClusterChange}
/>
)}
<SearchInput
className={styles.searchBar}
onChange={this.onSearchParamsChange}
Expand Down
21 changes: 11 additions & 10 deletions src/components/Modals/LogSearch/Logging/Search/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,17 @@ export default class LogSearchModal extends React.Component {
renderSearchBar() {
return (
<div className={styles.searchBar}>
<span className={styles.clusterSelect}>
<Select
value={this.props.searchInputState.cluster}
onChange={this.changeClusterChange}
className={styles.queryModeOptions}
valueRenderer={this.clusterRenderer}
options={this.props.clustersOpts}
/>
</span>

{globals.app.isMultiCluster && (
<span className={styles.clusterSelect}>
<Select
value={this.props.searchInputState.cluster}
onChange={this.changeClusterChange}
className={styles.queryModeOptions}
valueRenderer={this.clusterRenderer}
options={this.props.clustersOpts}
/>
</span>
)}
<SearchInput
className={styles.searchInput}
onChange={this.onSearchParamsChange}
Expand Down

0 comments on commit 61296e7

Please sign in to comment.