diff --git a/ui/packages/tidb-dashboard-for-clinic-cloud/public/ngm.html b/ui/packages/tidb-dashboard-for-clinic-cloud/public/ngm.html index 321e73b55b..86fc9b359d 100644 --- a/ui/packages/tidb-dashboard-for-clinic-cloud/public/ngm.html +++ b/ui/packages/tidb-dashboard-for-clinic-cloud/public/ngm.html @@ -167,14 +167,27 @@ slowQuery: { enableExport: false, showDBFilter: false, - listApiReturnDetail: false // so we can use the result returned by list api in the detail page, avoid reqeust detail api + listApiReturnDetail: false, // so we can use the result returned by list api in the detail page, avoid request detail api + + orgName, + clusterName, + timeRangeSelector: { + recentSeconds: [ + 5 * 60, + 15 * 60, + 30 * 60, + 60 * 60, + 2 * 60 * 60, + 3 * 60 * 60 + ], + customAbsoluteRangePicker: true + } }, topSQL: { checkNgm: false, showSetting: false, orgName, clusterName, - userName, timeRangeSelector: { recentSeconds: [ diff --git a/ui/packages/tidb-dashboard-lib/src/apps/SlowQuery/context/index.ts b/ui/packages/tidb-dashboard-lib/src/apps/SlowQuery/context/index.ts index 2758e206f0..5c5c359fe7 100644 --- a/ui/packages/tidb-dashboard-lib/src/apps/SlowQuery/context/index.ts +++ b/ui/packages/tidb-dashboard-lib/src/apps/SlowQuery/context/index.ts @@ -76,6 +76,10 @@ export interface ISlowQueryConfig extends IContextConfig { recentSeconds: number[] customAbsoluteRangePicker: boolean } + + // for clinic + orgName?: string + clusterName?: string } export interface ISlowQueryContext { diff --git a/ui/packages/tidb-dashboard-lib/src/apps/SlowQuery/pages/List/index.tsx b/ui/packages/tidb-dashboard-lib/src/apps/SlowQuery/pages/List/index.tsx index e78ce99e4b..72bdd17af5 100644 --- a/ui/packages/tidb-dashboard-lib/src/apps/SlowQuery/pages/List/index.tsx +++ b/ui/packages/tidb-dashboard-lib/src/apps/SlowQuery/pages/List/index.tsx @@ -1,4 +1,4 @@ -import React, { useContext, useState } from 'react' +import React, { useContext, useState, useMemo } from 'react' import { useTranslation } from 'react-i18next' import { Select, @@ -182,9 +182,27 @@ function List() { } }) + // only for clinic + const clusterInfo = useMemo(() => { + const infos: string[] = [] + if (ctx?.cfg.orgName) { + infos.push(`Org: ${ctx?.cfg.orgName}`) + } + if (ctx?.cfg.clusterName) { + infos.push(`Cluster: ${ctx?.cfg.clusterName}`) + } + return infos.join(' | ') + }, [ctx?.cfg.orgName, ctx?.cfg.clusterName]) + return (