File tree 6 files changed +8
-102
lines changed
containers/AppWithClusters
6 files changed +8
-102
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,8 @@ import React from 'react';
3
3
import type { Store } from '@reduxjs/toolkit' ;
4
4
import type { History } from 'history' ;
5
5
6
- import { getLogsLink as getLogsLinkDefault } from '../../utils/logs' ;
7
- import type {
8
- GetLogsLink ,
9
- GetMonitoringClusterLink ,
10
- GetMonitoringLink ,
11
- } from '../../utils/monitoring' ;
6
+ import type { GetLogsLink } from '../../utils/logs' ;
7
+ import type { GetMonitoringClusterLink , GetMonitoringLink } from '../../utils/monitoring' ;
12
8
import {
13
9
getMonitoringClusterLink as getMonitoringClusterLinkDefault ,
14
10
getMonitoringLink as getMonitoringLinkDefault ,
@@ -32,7 +28,7 @@ export interface AppWithClustersProps {
32
28
export function AppWithClusters ( {
33
29
store,
34
30
history,
35
- getLogsLink = getLogsLinkDefault ,
31
+ getLogsLink,
36
32
getMonitoringLink = getMonitoringLinkDefault ,
37
33
getMonitoringClusterLink = getMonitoringClusterLinkDefault ,
38
34
userSettings,
Original file line number Diff line number Diff line change @@ -8,11 +8,8 @@ import {cn} from '../../../utils/cn';
8
8
import { USE_CLUSTER_BALANCER_AS_BACKEND_KEY } from '../../../utils/constants' ;
9
9
import { useSetting } from '../../../utils/hooks' ;
10
10
import { useAdditionalNodesProps } from '../../../utils/hooks/useAdditionalNodesProps' ;
11
- import type {
12
- GetLogsLink ,
13
- GetMonitoringClusterLink ,
14
- GetMonitoringLink ,
15
- } from '../../../utils/monitoring' ;
11
+ import type { GetLogsLink } from '../../../utils/logs' ;
12
+ import type { GetMonitoringClusterLink , GetMonitoringLink } from '../../../utils/monitoring' ;
16
13
import { getCleanBalancerValue , prepareBackendFromBalancer } from '../../../utils/parseBalancer' ;
17
14
import { getBackendFromBalancerAndNodeId } from '../../../utils/prepareBackend' ;
18
15
import type { Cluster } from '../../Cluster/Cluster' ;
Original file line number Diff line number Diff line change 1
1
import { useClusterBaseInfo } from '../../../store/reducers/cluster/cluster' ;
2
2
import type { ETenantType } from '../../../types/api/tenant' ;
3
3
import { useAdditionalNodesProps } from '../../../utils/hooks/useAdditionalNodesProps' ;
4
- import type { GetLogsLink , GetMonitoringLink } from '../../../utils/monitoring' ;
4
+ import type { GetLogsLink } from '../../../utils/logs' ;
5
+ import type { GetMonitoringLink } from '../../../utils/monitoring' ;
5
6
import type { Tenant } from '../../Tenant/Tenant' ;
6
7
7
8
export interface ExtendedTenantProps {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- interface GetLogsLinkProps {
1
+ export interface GetLogsLinkProps {
2
2
dbName : string ;
3
3
logging : string ;
4
4
}
5
5
6
6
export type GetLogsLink = ( props : GetLogsLinkProps ) => string ;
7
-
8
- export function getLogsLink ( { dbName, logging} : GetLogsLinkProps ) : string {
9
- try {
10
- const data = JSON . parse ( logging ) ;
11
-
12
- if ( typeof data === 'object' && 'url' in data ) {
13
- const logUrl = data . url ;
14
- if ( ! logUrl ) {
15
- return '' ;
16
- }
17
-
18
- const url = new URL ( logUrl ) ;
19
-
20
- const queryParam = url . searchParams . get ( 'query' ) ;
21
- if ( queryParam ) {
22
- const decodedQuery = decodeURIComponent ( queryParam ) ;
23
-
24
- const queryBetweenBraces = decodedQuery . slice ( 1 , - 1 ) ;
25
- const witComma = queryBetweenBraces . length > 0 ;
26
- const updatedQuery = `{${ queryBetweenBraces } ${ witComma ? ', ' : '' } database = "${ dbName } "}` ;
27
-
28
- url . searchParams . set ( 'query' , updatedQuery ) ;
29
- }
30
-
31
- return url . toString ( ) ;
32
- }
33
- } catch { }
34
-
35
- return '' ;
36
- }
Original file line number Diff line number Diff line change @@ -99,10 +99,3 @@ export function parseMonitoringData(monitoring: string): ParsedMonitoringData |
99
99
100
100
return undefined ;
101
101
}
102
-
103
- interface GetLogsLinkProps {
104
- dbName : string ;
105
- logging : string ;
106
- }
107
-
108
- export type GetLogsLink = ( props : GetLogsLinkProps ) => string ;
You can’t perform that action at this time.
0 commit comments