Skip to content

Commit eac38af

Browse files
[yugabyte#8324] Platform: Disabled the query monitoring under Quries tab. (yugabyte#8576)
Description: When the Universe is in a paused state the users will not perform any actions for that respective universe. But for now, when the users go under the Queries tab they can perform the actions like query monitoring and reset stats. This is not supposed to happen. Test Plan: 1. Go to the universe page. 2. Hit the Action button next to connect and hit Pause universe. 3. Once the universe is paused then hit the Queries tab for that universe. 4. Click on Show queries. 5. Check whether Reset stats and Query Monitoring is present or not. If the above-mentioned buttons are not present then it's working fine. Check for both the Universes: 1. For Pasued Universe - Buttons are not supposed to be there on the UI. 2. For Normal Universe(Ready State) - Buttons are supposed to be there. Reviewers: @sshev @jaydeepkumara @gaurav061 @yb-andrew Reviewed by: @yb-andrew
1 parent 3255b7e commit eac38af

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

managed/ui/src/components/queries/SlowQueries.js

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ const SlowQueriesComponent = () => {
9898
const [columns, setColumns] = useState(initialColumns);
9999
const currentUniverse = useSelector((state) => state.universe.currentUniverse);
100100
const universeUUID = currentUniverse?.data?.universeUUID;
101+
const universePaused = currentUniverse?.data?.universeDetails?.universePaused;
101102
const { ysqlQueries, loading, errors, getSlowQueries } = useSlowQueriesApi({
102103
universeUUID,
103104
enabled: queryMonitoring
@@ -262,21 +263,23 @@ const SlowQueriesComponent = () => {
262263
</Alert>
263264
)
264265
)}
265-
<div className="slow-queries__actions">
266-
<YBButtonLink
267-
btnIcon="fa fa-undo"
268-
btnClass="btn btn-default"
269-
btnText="Reset Stats"
270-
onClick={handleResetQueries}
271-
/>
272-
<YBToggle
273-
label="Query Monitoring"
274-
input={{
275-
value: queryMonitoring,
276-
onChange: handleToggleMonitoring
277-
}}
278-
/>
279-
</div>
266+
{!universePaused && (
267+
<div className="slow-queries__actions">
268+
<YBButtonLink
269+
btnIcon="fa fa-undo"
270+
btnClass="btn btn-default"
271+
btnText="Reset Stats"
272+
onClick={handleResetQueries}
273+
/>
274+
<YBToggle
275+
label="Query Monitoring"
276+
input={{
277+
value: queryMonitoring,
278+
onChange: handleToggleMonitoring
279+
}}
280+
/>
281+
</div>
282+
)}
280283
</div>
281284
}
282285
leftPanel={
@@ -288,7 +291,10 @@ const SlowQueriesComponent = () => {
288291
panelState === PANEL_STATE.MAXIMIZED && 'maximized'
289292
)}
290293
>
291-
<span className="panel-close-icon" onClick={() => setPanelState(PANEL_STATE.MINIMIZED)}>
294+
<span
295+
className="panel-close-icon"
296+
onClick={() => setPanelState(PANEL_STATE.MINIMIZED)}
297+
>
292298
<i className="fa fa-window-minimize" />
293299
</span>
294300
<div className="slow-queries__column-selector">
@@ -313,7 +319,8 @@ const SlowQueriesComponent = () => {
313319
</ul>
314320
</div>
315321
</div>
316-
)}
322+
)
323+
}
317324
bodyClassName={clsx(
318325
panelState === PANEL_STATE.MINIMIZED && 'expand',
319326
panelState === PANEL_STATE.MAXIMIZED && 'shrink',
@@ -343,9 +350,7 @@ const SlowQueriesComponent = () => {
343350
{tableColHeaders}
344351
</BootstrapTable>
345352
) : (
346-
<>
347-
Enable query monitoring to see slow queries.
348-
</>
353+
<>Enable query monitoring to see slow queries.</>
349354
)}
350355
</div>
351356
}

0 commit comments

Comments
 (0)