-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#10776] Field and tag can be selected as 1:N
- Loading branch information
1 parent
475503b
commit 34527c4
Showing
22 changed files
with
507 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
web-frontend/src/main/v3/packages/constants/src/types/OtlpMetricData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
web-frontend/src/main/v3/packages/hooks/src/api/usePostOtlpMetricData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { END_POINTS, OtlpMetricData, OtlpMetricDefUserDefined } from '@pinpoint-fe/constants'; | ||
import { UseMutationOptions, useMutation } from '@tanstack/react-query'; | ||
import { useOpenTelemetrySearchParameters } from '../searchParameters'; | ||
|
||
export const usePostOtlpMetricData = ( | ||
options?: UseMutationOptions<OtlpMetricData.Response, unknown, OtlpMetricData.Body, unknown>, | ||
) => { | ||
const { application, dateRange } = useOpenTelemetrySearchParameters(); | ||
|
||
const postData = async (bodyData: OtlpMetricData.Body) => { | ||
try { | ||
// Fetch를 사용하여 POST 요청을 보냅니다. | ||
const response = await fetch(`${END_POINTS.OTLP_METRIC_DATA}`, { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify({ | ||
...bodyData, | ||
from: dateRange.from.getTime(), | ||
to: dateRange.to.getTime(), | ||
}), | ||
}); | ||
const data = await response.json(); | ||
|
||
return data; | ||
} catch (error) { | ||
throw error; | ||
} | ||
}; | ||
|
||
return useMutation({ | ||
mutationFn: postData, | ||
...options, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
web-frontend/src/main/v3/packages/ui/src/components/HelpPopover/HelpPopover.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import { Popover, PopoverContent, PopoverTrigger } from '../../components/ui/popover'; | ||
import { MdHelp } from 'react-icons/md'; | ||
import * as PopoverPrimitive from '@radix-ui/react-popover'; | ||
|
||
export const HelpPopover = ({ | ||
title, | ||
content, | ||
}: { | ||
title?: React.ReactNode; | ||
content?: React.ReactNode; | ||
}) => { | ||
return ( | ||
<Popover> | ||
<PopoverTrigger> | ||
<MdHelp /> | ||
</PopoverTrigger> | ||
<PopoverPrimitive.Portal> | ||
<PopoverContent className="z-[9999]"> | ||
{title && <h4 className="mb-4 font-medium leading-none">{title}</h4>} | ||
{content} | ||
</PopoverContent> | ||
</PopoverPrimitive.Portal> | ||
</Popover> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
web-frontend/src/main/v3/packages/ui/src/components/HelpPopover/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './HelpPopover'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.