Skip to content

Commit

Permalink
chore(topsql): hide limit select for op (#1689)
Browse files Browse the repository at this point in the history
  • Loading branch information
baurine authored Jun 12, 2024
1 parent 3318058 commit 91f6c28
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
3 changes: 2 additions & 1 deletion ui/packages/tidb-dashboard-for-op/src/apps/TopSQL/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const ctx: ITopSQLContext = {
ds,
cfg: {
checkNgm: true,
showSetting: true
showSetting: true,
showLimit: true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface ITopSQLConfig {
userName?: string

showSearchInStatements?: boolean
showLimit?: boolean
}

export interface ITopSQLContext {
Expand Down
26 changes: 14 additions & 12 deletions ui/packages/tidb-dashboard-lib/src/apps/TopSQL/pages/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,20 @@ export function TopSQLList() {
}
disabled={isLoading}
/>
<Select
style={{ width: 150 }}
value={limit}
onChange={setLimit}
data-e2e="limit_select"
>
{LIMITS.map((item) => (
<Option value={item} key={item} data-e2e="limit_option">
Limit {item}
</Option>
))}
</Select>
{ctx?.cfg.showLimit && (
<Select
style={{ width: 150 }}
value={limit}
onChange={setLimit}
data-e2e="limit_select"
>
{LIMITS.map((item) => (
<Option value={item} key={item} data-e2e="limit_option">
Limit {item}
</Option>
))}
</Select>
)}

<AutoRefreshButton
defaultValue={ctx?.cfg.autoRefresh === false ? 0 : undefined}
Expand Down

0 comments on commit 91f6c28

Please sign in to comment.