-
Notifications
You must be signed in to change notification settings - Fork 0
feat: API 상세페이지 기초 퍼블리싱 #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7212b88
feat(api-detail): UI 기초 퍼블리싱
wlrnjs 67b72a8
feat(api-detail): 수정 아이콘 추가
wlrnjs fd54c63
refactor(api-detail): 각 책임 별 컴포넌트 분리
wlrnjs e6db7a9
refactor(api-detail): DetailHeader 컴포넌트 리팩토링 및 접근성, 시맨틱 태그 개선
wlrnjs ce5feef
refactor(api-detail): DetailSummaryCards 컴포넌트 리팩토링 및 접근성, 시맨틱 태그 개선
wlrnjs 7f78da1
refactor(api-detail): DetailCheckLogs 컴포넌트 리팩토링 및 접근성, 시맨틱 태그 개선
wlrnjs 6e770b7
refactor(api-detail): DetailImpactedFeatures 컴포넌트 리팩토링 및 접근성, 시맨틱 태그 개선
wlrnjs a649f62
refactor(api-detail): DetailSettings 컴포넌트 리팩토링 및 접근성, 시맨틱 태그 개선
wlrnjs c5afa7b
refactor(api-detail): mock 폴더 생성 및 목업 관련 데이터 분리
wlrnjs 3004fb1
rename(api-detail): mock 폴더 네이밍 수정
wlrnjs 4b15e7a
Merge branch 'develop' into feat/api-detail-publish
wlrnjs a154db1
Merge branch 'develop' into feat/api-detail-publish
wlrnjs 338b028
refactor(apiStatus): ApiStatus 타입 분리 및 import 수정
wlrnjs 3463bd5
Merge branch 'develop' into feat/api-detail-publish
wlrnjs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
13 changes: 1 addition & 12 deletions
13
apps/monitor-web/src/components/common/display/_internal/badge.constants.ts
This file contains hidden or 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 hidden or 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,71 @@ | ||
| import type { | ||
| ApiCheckLog, | ||
| ApiDetailData, | ||
| ApiSummaryData, | ||
| DetailSettingsData, | ||
| ImpactedFeature, | ||
| } from "../pages/ApiDetail/_types"; | ||
|
|
||
| export const MOCK_HEADER_DATA: ApiDetailData = { | ||
| name: "Kakao Map API", | ||
| statusCode: "404", | ||
| status: "healthy" as const, | ||
| category: "map", | ||
| responseTime: "428ms", | ||
| lastChecked: "2026-04-24 15:30", | ||
| successRate: "99%", | ||
| }; | ||
|
|
||
| export const MOCK_SUMMARY_DATA: ApiSummaryData = { | ||
| avgResponseTime: 443, | ||
| maxResponseTime: 1230, | ||
| minResponseTime: 210, | ||
| successRate: 99, | ||
| errorCount: 1, | ||
| lastErrorAt: "2026-04-24 13:20", | ||
| }; | ||
|
|
||
| export const MOCK_LOGS: ApiCheckLog[] = [ | ||
| { | ||
| id: "1", | ||
| status: "healthy", | ||
| time: "15:30", | ||
| fullDate: "2024-05-13", | ||
| message: "정상 작동 중", | ||
| statusCode: "HTTP 200", | ||
| latency: "428ms", | ||
| }, | ||
| { | ||
| id: "2", | ||
| status: "outage", | ||
| time: "15:20", | ||
| fullDate: "2024-05-13", | ||
| message: "Connection Timeout", | ||
| statusCode: "HTTP 504", | ||
| latency: "5000ms", | ||
| }, | ||
| { | ||
| id: "3", | ||
| status: "healthy", | ||
| time: "15:10", | ||
| fullDate: "2024-05-13", | ||
| message: "정상 작동 중", | ||
| statusCode: "HTTP 200", | ||
| latency: "312ms", | ||
| }, | ||
| ]; | ||
|
|
||
| export const MOCK_FEATURES: ImpactedFeature[] = [ | ||
| { id: "1", name: "지도 표시" }, | ||
| { id: "2", name: "위치 선택" }, | ||
| { id: "3", name: "게시글 작성 시 주소 검색" }, | ||
| { id: "4", name: "내 주변 분실물 조회" }, | ||
| ]; | ||
|
|
||
| export const MOCK_SETTINGS: DetailSettingsData = { | ||
| requestUrl: "https://dapi.kakao.com/...", | ||
| httpMethod: "GET", | ||
| checkInterval: "10분", | ||
| isActive: true, | ||
| isNotificationEnabled: true, | ||
| }; |
This file contains hidden or 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 "./apiDetail"; |
This file contains hidden or 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
61 changes: 61 additions & 0 deletions
61
apps/monitor-web/src/pages/ApiDetail/_components/DetailCheckLogs.tsx
This file contains hidden or 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,61 @@ | ||
| import { cn } from "@/utils"; | ||
| import { MOCK_LOGS } from "@/mock"; | ||
| import type { ApiStatus } from "@/types"; | ||
|
|
||
| const STATUS_CONFIG: Record<ApiStatus, { label: string; color: string }> = { | ||
| healthy: { label: "정상", color: "bg-fg-primary-normal-default" }, | ||
| outage: { label: "장애", color: "bg-[#FF4D4F]" }, | ||
| degraded: { label: "지연", color: "bg-[#FAAD14]" }, | ||
| } as const; | ||
|
|
||
| const DetailCheckLogs = () => { | ||
|
wlrnjs marked this conversation as resolved.
|
||
| return ( | ||
| <section | ||
| aria-labelledby="logs-title" | ||
| className="flex min-h-0 min-w-0 flex-col gap-10 rounded-xl border border-[#DFDFDF] bg-white px-12 py-8" | ||
| > | ||
| <div className="flex items-center justify-between"> | ||
| <h2 id="logs-title" className="text-header1-semibold"> | ||
| 최근 체크 로그 | ||
| </h2> | ||
| <span className="text-body1-medium block text-[#1D1D1D]/40">10분 주기</span> | ||
| </div> | ||
|
|
||
| <div | ||
| aria-label="로그 목록" | ||
| role="region" | ||
| tabIndex={0} | ||
| className="flex flex-col gap-4 overflow-y-auto" | ||
| > | ||
| <ul className="flex flex-col gap-4"> | ||
| {MOCK_LOGS.map((log) => ( | ||
| <li | ||
| key={log.id} | ||
| className="flex w-full items-center justify-between border-b border-[#F5F5F5] pb-4 last:border-0" | ||
| > | ||
| <div className="flex min-w-[100px] items-center gap-[6px]"> | ||
| <div | ||
| aria-label={STATUS_CONFIG[log.status].label} | ||
| role="img" | ||
| className={cn("size-3 rounded-full", STATUS_CONFIG[log.status].color)} | ||
| /> | ||
| <time dateTime={`${log.fullDate}T${log.time}`}>{log.time}</time> | ||
| </div> | ||
|
|
||
| <span className="flex-1 truncate px-4 text-left text-[#1D1D1D]" title={log.message}> | ||
| {log.message} | ||
| </span> | ||
|
|
||
| <div className="text-body1-regular flex items-center gap-8 text-[#1D1D1D]/60"> | ||
| <span aria-label="상태 코드">{log.statusCode}</span> | ||
| <span aria-label="응답 시간">{log.latency}</span> | ||
| </div> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| </div> | ||
| </section> | ||
| ); | ||
| }; | ||
|
|
||
| export default DetailCheckLogs; | ||
105 changes: 105 additions & 0 deletions
105
apps/monitor-web/src/pages/ApiDetail/_components/DetailHeader.tsx
This file contains hidden or 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,105 @@ | ||
| import { Badge, BasicButton, Icon } from "@/components"; | ||
| import { cn } from "@/utils"; | ||
| import type { ApiStatus } from "@/types"; | ||
| import type { ApiDetailData } from "../_types"; | ||
|
|
||
| interface DetailHeaderProps { | ||
| apiData: ApiDetailData; | ||
| } | ||
|
|
||
| const DetailHeader = ({ apiData }: DetailHeaderProps) => { | ||
| const headerInfoList = [ | ||
| { label: "카테고리", value: apiData.category }, | ||
| { label: "응답", value: apiData.responseTime }, | ||
| { | ||
| label: "마지막 체크", | ||
| value: apiData.lastChecked, | ||
| dateTime: apiData.lastChecked, | ||
| }, | ||
| { label: "최근 24시간 성공률", value: apiData.successRate }, | ||
| ]; | ||
|
|
||
| return ( | ||
| <section | ||
| aria-labelledby="api-detail-title" | ||
| className="-mx-8 -mt-8 flex items-center justify-between border border-[#E2E8F0] bg-white p-10" | ||
| > | ||
| <div className="flex flex-col gap-6"> | ||
| <div className="flex items-center gap-2"> | ||
| <h1 id="api-detail-title" className="text-header1-bold"> | ||
| {apiData.name} | ||
| </h1> | ||
| <Badge aria-label={`HTTP 상태 코드: ${apiData.statusCode}`} label={apiData.statusCode} /> | ||
| </div> | ||
| <dl className="flex gap-6"> | ||
| <StatusItem status={apiData.status} /> | ||
| {headerInfoList.map((info) => ( | ||
| <InfoItem key={info.label} {...info} /> | ||
| ))} | ||
| </dl> | ||
| </div> | ||
|
|
||
| <BasicButton className="h-[80px] min-w-[121px] rounded-xl border border-[#DFDFDF] bg-white px-7 py-8 text-[#1D1D1D]"> | ||
| <span className="flex items-center gap-1"> | ||
| <Icon name="editPencil" size={24} /> | ||
| <span className="text-body1-medium">수정</span> | ||
| </span> | ||
| </BasicButton> | ||
| </section> | ||
| ); | ||
| }; | ||
|
|
||
| export default DetailHeader; | ||
|
|
||
| const STATUS_CONFIG = { | ||
|
wlrnjs marked this conversation as resolved.
|
||
| healthy: { | ||
| label: "정상", | ||
| color: "bg-fg-primary-normal-default", | ||
| textColor: "text-fg-primary-normal-default", | ||
| }, | ||
| outage: { | ||
| label: "장애", | ||
| color: "bg-[#FF4D4F]", | ||
| textColor: "text-[#FF4D4F]", | ||
| }, | ||
| degraded: { | ||
| label: "지연", | ||
| color: "bg-[#FAAD14]", | ||
| textColor: "text-[#FAAD14]", | ||
| }, | ||
| } as const; | ||
|
|
||
| const StatusItem = ({ status }: { status: ApiStatus }) => { | ||
| const { label, color, textColor } = STATUS_CONFIG[status]; | ||
|
|
||
| return ( | ||
| <div className="flex flex-col gap-2"> | ||
| <dt className="text-body1-regular text-[#1D1D1D]/40">상태</dt> | ||
| <dd className="flex items-center gap-2"> | ||
| <div aria-hidden="true" className={cn("size-3 rounded-full", color)} /> | ||
| <span className={cn("text-body1-regular", textColor)}>{label}</span> | ||
| </dd> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| interface InfoItemProps { | ||
| label: string; | ||
| value: string; | ||
| dateTime?: string; | ||
| } | ||
|
|
||
| const InfoItem = ({ label, value, dateTime }: InfoItemProps) => { | ||
| const Tag = dateTime ? "time" : "span"; | ||
|
|
||
| return ( | ||
| <div className="flex flex-col gap-2"> | ||
| <dt className="text-body1-regular text-[#1D1D1D]/40">{label}</dt> | ||
| <dd> | ||
| <Tag className="text-body1-regular text-[#1D1D1D]" {...(dateTime && { dateTime })}> | ||
| {value} | ||
| </Tag> | ||
| </dd> | ||
| </div> | ||
| ); | ||
| }; | ||
33 changes: 33 additions & 0 deletions
33
apps/monitor-web/src/pages/ApiDetail/_components/DetailImpactedFeatures.tsx
This file contains hidden or 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,33 @@ | ||
| import { Badge } from "@/components"; | ||
| import { MOCK_FEATURES } from "@/mock"; | ||
|
|
||
| const DetailImpactedFeatures = () => { | ||
| return ( | ||
| <section | ||
| aria-describedby="features-description" | ||
| aria-labelledby="features-title" | ||
| className="flex min-h-0 min-w-0 flex-col justify-between rounded-xl border border-[#DFDFDF] bg-white px-12 py-8" | ||
| > | ||
| <div className="flex flex-col gap-[13px]"> | ||
| <h2 id="features-title" className="text-header1-semibold"> | ||
| 영향 받는 기능 | ||
| </h2> | ||
| <span id="features-description" className="text-[#1D1D1D]/40"> | ||
| 이 API에 장애 시 영향을 받는 사용자 기능 | ||
| </span> | ||
| </div> | ||
|
|
||
| <div aria-label="영향 받는 기능 목록" role="region" tabIndex={0} className="overflow-x-auto"> | ||
| <ul className="flex items-center gap-3"> | ||
| {MOCK_FEATURES.map((feature) => ( | ||
| <li key={feature.id} className="shrink-0"> | ||
| <Badge className="min-h-[40px] px-4" label={feature.name} /> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| </div> | ||
| </section> | ||
| ); | ||
| }; | ||
|
|
||
| export default DetailImpactedFeatures; |
14 changes: 14 additions & 0 deletions
14
apps/monitor-web/src/pages/ApiDetail/_components/DetailIncidentHistory.tsx
This file contains hidden or 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,14 @@ | ||
| const DetailIncidentHistory = () => { | ||
| return ( | ||
| <section | ||
| aria-labelledby="incident-title" | ||
| className="rounded-xl border border-[#DFDFDF] bg-white px-12 py-8" | ||
| > | ||
| <h2 id="incident-title" className="text-header1-bold"> | ||
| 최근 장애 / 에러 상세 목록 | ||
| </h2> | ||
| </section> | ||
| ); | ||
| }; | ||
|
|
||
| export default DetailIncidentHistory; |
5 changes: 5 additions & 0 deletions
5
apps/monitor-web/src/pages/ApiDetail/_components/DetailResponseChart.tsx
This file contains hidden or 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,5 @@ | ||
| const DetailResponseChart = () => { | ||
| return <div className="min-w-0 bg-gray-300" title="표 들어갈 자리" />; | ||
| }; | ||
|
|
||
| export default DetailResponseChart; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.