forked from baron/baron-sso
누락 키 수정 및 린트 적용
This commit is contained in:
@@ -139,13 +139,12 @@ function summarizeSeries(rows: RPUsageDailyMetric[]): SeriesSummary[] {
|
||||
);
|
||||
bySeries.set(key, current);
|
||||
}
|
||||
return Array.from(bySeries.values())
|
||||
.sort(
|
||||
(left, right) =>
|
||||
right.loginRequests +
|
||||
right.otherRequests -
|
||||
(left.loginRequests + left.otherRequests),
|
||||
);
|
||||
return Array.from(bySeries.values()).sort(
|
||||
(left, right) =>
|
||||
right.loginRequests +
|
||||
right.otherRequests -
|
||||
(left.loginRequests + left.otherRequests),
|
||||
);
|
||||
}
|
||||
|
||||
function buildMultiLineSeries(rows: RPUsageDailyMetric[]): MultiLineSeries[] {
|
||||
@@ -427,40 +426,39 @@ function RPUsageMixedChart({
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground">
|
||||
<span>
|
||||
{t("ui.dev.dashboard.chart.x_axis", "X축: 기간")}
|
||||
</span>
|
||||
<span>
|
||||
{t("ui.dev.dashboard.chart.y_axis", "Y축: 로그인 요청 수")}
|
||||
</span>
|
||||
<span>{t("ui.dev.dashboard.chart.x_axis", "X축: 기간")}</span>
|
||||
<span>{t("ui.dev.dashboard.chart.y_axis", "Y축: 로그인 요청 수")}</span>
|
||||
</div>
|
||||
|
||||
{multiLinePoints && multiLinePoints.length > 0 ? (
|
||||
<div className="grid gap-x-6 gap-y-2 border-t border-border/60 pt-2 text-xs md:grid-cols-2 xl:grid-cols-3">
|
||||
{multiLinePoints.map((item) => (
|
||||
<div
|
||||
key={item.key}
|
||||
className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1"
|
||||
>
|
||||
<span
|
||||
className="h-2.5 w-2.5 rounded-full"
|
||||
style={{ backgroundColor: item.color.line }}
|
||||
/>
|
||||
<span className="font-medium">{item.clientLabel}</span>
|
||||
{seriesByKey.get(item.key) ? (
|
||||
<span className="whitespace-nowrap tabular-nums text-muted-foreground">
|
||||
{t(
|
||||
"ui.dev.dashboard.chart.series",
|
||||
"로그인 {{login}} / 사용자 {{subjects}}",
|
||||
{
|
||||
login: seriesByKey.get(item.key)!.loginRequests.toLocaleString(),
|
||||
subjects: seriesByKey.get(item.key)!.uniqueSubjects.toLocaleString(),
|
||||
},
|
||||
)}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
))}
|
||||
{multiLinePoints.map((item) => {
|
||||
const seriesItem = seriesByKey.get(item.key);
|
||||
return (
|
||||
<div
|
||||
key={item.key}
|
||||
className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1"
|
||||
>
|
||||
<span
|
||||
className="h-2.5 w-2.5 rounded-full"
|
||||
style={{ backgroundColor: item.color.line }}
|
||||
/>
|
||||
<span className="font-medium">{item.clientLabel}</span>
|
||||
{seriesItem ? (
|
||||
<span className="whitespace-nowrap tabular-nums text-muted-foreground">
|
||||
{t(
|
||||
"ui.dev.dashboard.chart.series",
|
||||
"로그인 {{login}} / 사용자 {{subjects}}",
|
||||
{
|
||||
login: seriesItem.loginRequests.toLocaleString(),
|
||||
subjects: seriesItem.uniqueSubjects.toLocaleString(),
|
||||
},
|
||||
)}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
) : topSeries.length > 0 ? (
|
||||
<div className="grid gap-x-6 gap-y-2 border-t border-border/60 pt-2 text-xs md:grid-cols-2 xl:grid-cols-3">
|
||||
@@ -498,10 +496,7 @@ function DashboardPage() {
|
||||
const [period, setPeriod] = useState<RPUsagePeriod>("day");
|
||||
const [selectedClientIds, setSelectedClientIds] = useState<string[]>([]);
|
||||
const usageDays = period === "day" ? 14 : period === "week" ? 84 : 90;
|
||||
const {
|
||||
data: requestStatus,
|
||||
isLoading: isLoadingRequestStatus,
|
||||
} = useQuery({
|
||||
const { data: requestStatus, isLoading: isLoadingRequestStatus } = useQuery({
|
||||
queryKey: ["developer-request", tenantId],
|
||||
queryFn: () => fetchDeveloperRequestStatus(tenantId),
|
||||
enabled: hasAccessToken && role === "user",
|
||||
@@ -625,10 +620,7 @@ function DashboardPage() {
|
||||
setSelectedClientIds([]);
|
||||
};
|
||||
|
||||
if (
|
||||
(role === "user" || role === "tenant_member") &&
|
||||
isLoadingRequestStatus
|
||||
) {
|
||||
if ((role === "user" || role === "tenant_member") && isLoadingRequestStatus) {
|
||||
return (
|
||||
<div className="p-8 text-center">
|
||||
{t("ui.common.loading", "Loading...")}
|
||||
@@ -672,14 +664,8 @@ function DashboardPage() {
|
||||
onClick={() => navigate("/developer-requests")}
|
||||
>
|
||||
{isDeveloperRequestPending
|
||||
? t(
|
||||
"ui.dev.nav.developer_request",
|
||||
"개발자 권한 신청",
|
||||
)
|
||||
: t(
|
||||
"ui.dev.welcome.btn_request",
|
||||
"개발자 등록 신청하기",
|
||||
)}
|
||||
? t("ui.dev.nav.developer_request", "개발자 권한 신청")
|
||||
: t("ui.dev.welcome.btn_request", "개발자 등록 신청하기")}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user