mirror of
https://github.com/supabase/supabase.git
synced 2026-06-01 10:21:10 +08:00
Chore/add export functionality to advisors (#33030)
* Add export functionality to security and performance advisors * Add download results button to query performance advisor * Add refresh buttons to security and performance advisors * Add LoadingLine to Query performance to make UI consistent with the other advisors * Minor change
This commit is contained in:
@@ -13,6 +13,7 @@ import { LOCAL_STORAGE_KEYS } from 'lib/constants'
|
||||
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
|
||||
import {
|
||||
Button,
|
||||
LoadingLine,
|
||||
TabsList_Shadcn_,
|
||||
TabsTrigger_Shadcn_,
|
||||
Tabs_Shadcn_,
|
||||
@@ -44,6 +45,8 @@ export const QueryPerformance = ({
|
||||
const { project } = useProjectContext()
|
||||
const state = useDatabaseSelectorStateSnapshot()
|
||||
|
||||
const { isLoading, isRefetching } = queryPerformanceQuery
|
||||
|
||||
const [page, setPage] = useState<QUERY_PERFORMANCE_REPORT_TYPES>(
|
||||
(preset as QUERY_PERFORMANCE_REPORT_TYPES) ?? QUERY_PERFORMANCE_REPORT_TYPES.MOST_TIME_CONSUMING
|
||||
)
|
||||
@@ -190,14 +193,11 @@ export const QueryPerformance = ({
|
||||
</TabsList_Shadcn_>
|
||||
</Tabs_Shadcn_>
|
||||
|
||||
<div className="px-6 py-3 bg-surface-200 border-t -mt-px">
|
||||
<QueryPerformanceFilterBar
|
||||
queryPerformanceQuery={queryPerformanceQuery}
|
||||
onResetReportClick={() => {
|
||||
setShowResetgPgStatStatements(true)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<QueryPerformanceFilterBar
|
||||
queryPerformanceQuery={queryPerformanceQuery}
|
||||
onResetReportClick={() => setShowResetgPgStatStatements(true)}
|
||||
/>
|
||||
<LoadingLine loading={isLoading || isRefetching} />
|
||||
|
||||
<QueryPerformanceGrid queryPerformanceQuery={queryPerformanceQuery} />
|
||||
|
||||
@@ -210,9 +210,7 @@ export const QueryPerformance = ({
|
||||
className="absolute top-1.5 right-3 px-1.5"
|
||||
type="text"
|
||||
size="tiny"
|
||||
onClick={() => {
|
||||
setShowBottomSection(false)
|
||||
}}
|
||||
onClick={() => setShowBottomSection(false)}
|
||||
>
|
||||
<X size="14" />
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user