File tree Expand file tree Collapse file tree 6 files changed +8
-102
lines changed
containers/AppWithClusters Expand file tree Collapse file tree 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';
33import type { Store } from '@reduxjs/toolkit' ;
44import type { History } from 'history' ;
55
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' ;
128import {
139 getMonitoringClusterLink as getMonitoringClusterLinkDefault ,
1410 getMonitoringLink as getMonitoringLinkDefault ,
@@ -32,7 +28,7 @@ export interface AppWithClustersProps {
3228export function AppWithClusters ( {
3329 store,
3430 history,
35- getLogsLink = getLogsLinkDefault ,
31+ getLogsLink,
3632 getMonitoringLink = getMonitoringLinkDefault ,
3733 getMonitoringClusterLink = getMonitoringClusterLinkDefault ,
3834 userSettings,
Original file line number Diff line number Diff line change @@ -8,11 +8,8 @@ import {cn} from '../../../utils/cn';
88import { USE_CLUSTER_BALANCER_AS_BACKEND_KEY } from '../../../utils/constants' ;
99import { useSetting } from '../../../utils/hooks' ;
1010import { 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' ;
1613import { getCleanBalancerValue , prepareBackendFromBalancer } from '../../../utils/parseBalancer' ;
1714import { getBackendFromBalancerAndNodeId } from '../../../utils/prepareBackend' ;
1815import type { Cluster } from '../../Cluster/Cluster' ;
Original file line number Diff line number Diff line change 11import { useClusterBaseInfo } from '../../../store/reducers/cluster/cluster' ;
22import type { ETenantType } from '../../../types/api/tenant' ;
33import { 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' ;
56import type { Tenant } from '../../Tenant/Tenant' ;
67
78export 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 {
22 dbName : string ;
33 logging : string ;
44}
55
66export 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 |
9999
100100 return undefined ;
101101}
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