@@ -7,7 +7,6 @@ import {TENANT_DIAGNOSTICS_TABS_IDS} from '../../../store/reducers/tenant/consta
77import type { TenantDiagnosticsTab } from '../../../store/reducers/tenant/types' ;
88import { EPathSubType , EPathType } from '../../../types/api/schema' ;
99import type { ETenantType } from '../../../types/api/tenant' ;
10- import type { AdditionalDiagnosticsTab } from '../../../uiFactory/types' ;
1110import { uiFactory } from '../../../uiFactory/uiFactory' ;
1211import type { TenantQuery } from '../TenantPages' ;
1312import { TenantTabsGroups } from '../TenantPages' ;
@@ -112,6 +111,11 @@ const operations = {
112111 title : 'Operations' ,
113112} ;
114113
114+ const monitoring = {
115+ id : TENANT_DIAGNOSTICS_TABS_IDS . monitoring ,
116+ title : 'Monitoring' ,
117+ } ;
118+
115119const ASYNC_REPLICATION_PAGES = [ overview , tablets , describe , access ] ;
116120
117121const TRANSFER_PAGES = [ overview , tablets , describe , access ] ;
@@ -235,33 +239,13 @@ export const getPagesByType = (
235239 const dbContext = isDatabaseEntityType ( type ) || options ?. isTopLevel ;
236240 const seeded = dbContext ? getDatabasePages ( options ?. databaseType ) : base ;
237241
238- const filtered = applyFilters ( seeded , type , options ) ;
242+ const result = applyFilters ( seeded , type , options ) ;
239243
240- // Add custom tabs from uiFactory if available
241- const customTabsToInsert =
242- uiFactory . additionalDiagnosticsTabs ?. filter (
243- ( tab : AdditionalDiagnosticsTab ) => ! tab . shouldShow || tab . shouldShow ( type , subType ) ,
244- ) || [ ] ;
245-
246- if ( customTabsToInsert . length === 0 ) {
247- return filtered ;
244+ // Add monitoring tab as second tab if renderMonitoring is available
245+ if ( uiFactory . renderMonitoring ) {
246+ result . splice ( 1 , 0 , monitoring ) ;
248247 }
249248
250- const result = [ ...filtered ] ;
251-
252- customTabsToInsert . forEach ( ( customTab : AdditionalDiagnosticsTab ) => {
253- const tabPage = { id : customTab . id , title : customTab . title } ;
254-
255- if ( customTab . insertAfter === undefined ) {
256- // Append at the end
257- result . push ( tabPage ) ;
258- } else {
259- // Insert at specific index
260- const index = Math . max ( 0 , Math . min ( customTab . insertAfter , result . length ) ) ;
261- result . splice ( index , 0 , tabPage ) ;
262- }
263- } ) ;
264-
265249 return result ;
266250} ;
267251
0 commit comments