forked from baron/baron-sso
adminfront 정적 서빙 경로 수정 & devfront 빌드 오류 수정
This commit is contained in:
@@ -120,6 +120,7 @@ ensure_frontend_dependencies
|
|||||||
|
|
||||||
if [ "$mode" = "production" ]; then
|
if [ "$mode" = "production" ]; then
|
||||||
echo "Running in production mode with custom static server..."
|
echo "Running in production mode with custom static server..."
|
||||||
|
export ADMINFRONT_BUILD_OUT_DIR="${ADMINFRONT_BUILD_OUT_DIR:-/tmp/baron-sso-adminfront-dist}"
|
||||||
exec sh -c "npm run build && node ./scripts/serve-prod.mjs"
|
exec sh -c "npm run build && node ./scripts/serve-prod.mjs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import react from "@vitejs/plugin-react";
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
|
|
||||||
const buildOutDir = process.env.ADMINFRONT_BUILD_OUT_DIR ?? "dist";
|
const buildOutDir =
|
||||||
|
process.env.ADMINFRONT_BUILD_OUT_DIR ?? "/tmp/baron-sso-adminfront-dist";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
@@ -11,6 +12,9 @@ export default defineConfig({
|
|||||||
"lucide-react": path.resolve(process.cwd(), "node_modules/lucide-react"),
|
"lucide-react": path.resolve(process.cwd(), "node_modules/lucide-react"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
cacheDir:
|
||||||
|
process.env.ADMINFRONT_VITE_CACHE_DIR ??
|
||||||
|
"/tmp/baron-sso-adminfront-vite-cache",
|
||||||
envPrefix: ["VITE_", "USERFRONT_", "ORGFRONT_"],
|
envPrefix: ["VITE_", "USERFRONT_", "ORGFRONT_"],
|
||||||
build: {
|
build: {
|
||||||
outDir: buildOutDir,
|
outDir: buildOutDir,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
import type { AxiosError } from "axios";
|
import type { AxiosError } from "axios";
|
||||||
import {
|
import {
|
||||||
BookOpenText,
|
|
||||||
Filter,
|
Filter,
|
||||||
|
Info,
|
||||||
Plus,
|
Plus,
|
||||||
Search,
|
Search,
|
||||||
ShieldHalf,
|
ShieldHalf,
|
||||||
@@ -54,6 +54,7 @@ import {
|
|||||||
type DevAuditLog,
|
type DevAuditLog,
|
||||||
fetchDevUser,
|
fetchDevUser,
|
||||||
fetchClients,
|
fetchClients,
|
||||||
|
fetchDevAuditLogs,
|
||||||
fetchDeveloperRequestStatus,
|
fetchDeveloperRequestStatus,
|
||||||
fetchDevStats,
|
fetchDevStats,
|
||||||
fetchMyTenants,
|
fetchMyTenants,
|
||||||
@@ -296,7 +297,9 @@ function ClientsPage() {
|
|||||||
} = useQuery({
|
} = useQuery({
|
||||||
queryKey: ["developer-request", tenantId],
|
queryKey: ["developer-request", tenantId],
|
||||||
queryFn: () => fetchDeveloperRequestStatus(tenantId),
|
queryFn: () => fetchDeveloperRequestStatus(tenantId),
|
||||||
enabled: hasAccessToken && (profileRole === "user" || profileRole === "tenant_member"),
|
enabled:
|
||||||
|
hasAccessToken &&
|
||||||
|
(profileRole === "user" || profileRole === "tenant_member"),
|
||||||
});
|
});
|
||||||
const { data: tenants } = useQuery({
|
const { data: tenants } = useQuery({
|
||||||
queryKey: ["myTenants"],
|
queryKey: ["myTenants"],
|
||||||
@@ -363,8 +366,9 @@ function ClientsPage() {
|
|||||||
.flat()
|
.flat()
|
||||||
.filter(
|
.filter(
|
||||||
(item, index, self) =>
|
(item, index, self) =>
|
||||||
self.findIndex((candidate) => candidate.event_id === item.event_id) ===
|
self.findIndex(
|
||||||
index,
|
(candidate) => candidate.event_id === item.event_id,
|
||||||
|
) === index,
|
||||||
)
|
)
|
||||||
.sort(
|
.sort(
|
||||||
(left, right) =>
|
(left, right) =>
|
||||||
@@ -508,7 +512,8 @@ function ClientsPage() {
|
|||||||
.filter((item): item is RecentClientChange => Boolean(item))
|
.filter((item): item is RecentClientChange => Boolean(item))
|
||||||
.sort(
|
.sort(
|
||||||
(left, right) =>
|
(left, right) =>
|
||||||
new Date(right.timestamp).getTime() - new Date(left.timestamp).getTime(),
|
new Date(right.timestamp).getTime() -
|
||||||
|
new Date(left.timestamp).getTime(),
|
||||||
);
|
);
|
||||||
}, [clients, recentAuditData?.items]);
|
}, [clients, recentAuditData?.items]);
|
||||||
|
|
||||||
@@ -548,7 +553,8 @@ function ClientsPage() {
|
|||||||
}, [recentClientActors, recentClientChanges]);
|
}, [recentClientActors, recentClientChanges]);
|
||||||
|
|
||||||
const recentChangedClientCount = useMemo(() => {
|
const recentChangedClientCount = useMemo(() => {
|
||||||
return new Set(recentClientChangesWithActors.map((item) => item.clientId)).size;
|
return new Set(recentClientChangesWithActors.map((item) => item.clientId))
|
||||||
|
.size;
|
||||||
}, [recentClientChangesWithActors]);
|
}, [recentClientChangesWithActors]);
|
||||||
|
|
||||||
const visibleRecentClientChanges = useMemo(() => {
|
const visibleRecentClientChanges = useMemo(() => {
|
||||||
@@ -572,10 +578,7 @@ function ClientsPage() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [
|
}, [recentClientChangesWithActors.length, visibleRecentClientChangesCount]);
|
||||||
recentClientChangesWithActors.length,
|
|
||||||
visibleRecentClientChangesCount,
|
|
||||||
]);
|
|
||||||
|
|
||||||
const isLoading =
|
const isLoading =
|
||||||
isLoadingClients ||
|
isLoadingClients ||
|
||||||
@@ -1145,9 +1148,7 @@ function ClientsPage() {
|
|||||||
<code className="rounded-md bg-secondary/60 px-2 py-1 font-mono text-xs text-muted-foreground">
|
<code className="rounded-md bg-secondary/60 px-2 py-1 font-mono text-xs text-muted-foreground">
|
||||||
{item.clientId}
|
{item.clientId}
|
||||||
</code>
|
</code>
|
||||||
<span className="font-semibold">
|
<span className="font-semibold">{item.actorName}</span>
|
||||||
{item.actorName}
|
|
||||||
</span>
|
|
||||||
<code className="rounded-md bg-secondary/60 px-2 py-1 font-mono text-xs text-muted-foreground">
|
<code className="rounded-md bg-secondary/60 px-2 py-1 font-mono text-xs text-muted-foreground">
|
||||||
{item.actorId}
|
{item.actorId}
|
||||||
</code>
|
</code>
|
||||||
@@ -1155,8 +1156,11 @@ function ClientsPage() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap gap-2">
|
<div className="flex flex-wrap gap-2">
|
||||||
{item.detailLabels.length > 0 ? (
|
{item.detailLabels.length > 0 ? (
|
||||||
item.detailLabels.map((detail, index) => (
|
item.detailLabels.map((detail) => (
|
||||||
<Badge key={`${item.eventId}-${index}`} variant="outline">
|
<Badge
|
||||||
|
key={`${item.eventId}-${detail.label}`}
|
||||||
|
variant="outline"
|
||||||
|
>
|
||||||
{detail.label}: {detail.value}
|
{detail.label}: {detail.value}
|
||||||
</Badge>
|
</Badge>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import { useDeveloperAccessGate } from "../developer-access/developerAccessGate"
|
|||||||
import {
|
import {
|
||||||
type ClientSummary,
|
type ClientSummary,
|
||||||
fetchClients,
|
fetchClients,
|
||||||
fetchDeveloperRequestStatus,
|
|
||||||
fetchDevRPUsageDaily,
|
fetchDevRPUsageDaily,
|
||||||
fetchDevStats,
|
fetchDevStats,
|
||||||
type RPUsageDailyMetric,
|
type RPUsageDailyMetric,
|
||||||
@@ -611,9 +610,7 @@ function GlobalOverviewPage() {
|
|||||||
setSelectedClientIds([]);
|
setSelectedClientIds([]);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (
|
if (isLoadingDeveloperAccessGate) {
|
||||||
isLoadingDeveloperAccessGate
|
|
||||||
) {
|
|
||||||
return (
|
return (
|
||||||
<div className="p-8 text-center">
|
<div className="p-8 text-center">
|
||||||
{t("ui.common.loading", "Loading...")}
|
{t("ui.common.loading", "Loading...")}
|
||||||
|
|||||||
Reference in New Issue
Block a user