This commit is contained in:
@@ -92,7 +92,6 @@ export function LauncherBuildPage() {
|
|||||||
const clientSource = source?.client;
|
const clientSource = source?.client;
|
||||||
const artifactName = `autonomy-studio-launcher-${version || activeVersion?.version || '0.0.0'}.deb`;
|
const artifactName = `autonomy-studio-launcher-${version || activeVersion?.version || '0.0.0'}.deb`;
|
||||||
const backendImageName = backendSource?.image || 'localhost:5000/studio-launcher-be';
|
const backendImageName = backendSource?.image || 'localhost:5000/studio-launcher-be';
|
||||||
const backendImageTag = `${backendImageName.replace(/\/$/, '')}:${version || '0.1.0'}`;
|
|
||||||
const backendDockerfile = backendSource?.dockerfile || 'Dockerfile';
|
const backendDockerfile = backendSource?.dockerfile || 'Dockerfile';
|
||||||
const uploadPath = launcherArtifactKey(version || activeVersion?.version || '0.0.0', branch, commitSha, artifactName);
|
const uploadPath = launcherArtifactKey(version || activeVersion?.version || '0.0.0', branch, commitSha, artifactName);
|
||||||
const downloadUrl = r2PublicBaseUrl ? `${r2PublicBaseUrl.replace(/\/$/, '')}/${encodeObjectKey(uploadPath)}` : '백엔드 R2 설정 기준으로 생성됩니다.';
|
const downloadUrl = r2PublicBaseUrl ? `${r2PublicBaseUrl.replace(/\/$/, '')}/${encodeObjectKey(uploadPath)}` : '백엔드 R2 설정 기준으로 생성됩니다.';
|
||||||
@@ -165,10 +164,10 @@ export function LauncherBuildPage() {
|
|||||||
repository: isBackend ? backendSource?.repository ?? undefined : clientSource?.repository ?? activeVersion?.repository ?? undefined,
|
repository: isBackend ? backendSource?.repository ?? undefined : clientSource?.repository ?? activeVersion?.repository ?? undefined,
|
||||||
branch,
|
branch,
|
||||||
commitSha: commitSha.trim() || undefined,
|
commitSha: commitSha.trim() || undefined,
|
||||||
version: isBackend ? version.trim() : undefined,
|
version: undefined,
|
||||||
uploadPath: isBackend ? backendDockerfile : uploadPath,
|
uploadPath: isBackend ? backendDockerfile : uploadPath,
|
||||||
artifact: isBackend ? backendImageName.replace(/^localhost:5000\//, '') : undefined,
|
artifact: isBackend ? backendImageName.replace(/^localhost:5000\//, '') : undefined,
|
||||||
downloadUrl: isBackend ? backendImageTag : r2PublicBaseUrl ? downloadUrl : undefined
|
downloadUrl: isBackend ? undefined : r2PublicBaseUrl ? downloadUrl : undefined
|
||||||
})
|
})
|
||||||
.then(({ job }) => {
|
.then(({ job }) => {
|
||||||
setJobs((prev) => [job, ...prev]);
|
setJobs((prev) => [job, ...prev]);
|
||||||
@@ -189,7 +188,7 @@ export function LauncherBuildPage() {
|
|||||||
title="빌드 관리"
|
title="빌드 관리"
|
||||||
description="런처 클라이언트 설치 파일과 백엔드 컨테이너 이미지를 구성요소별로 빌드합니다."
|
description="런처 클라이언트 설치 파일과 백엔드 컨테이너 이미지를 구성요소별로 빌드합니다."
|
||||||
actions={
|
actions={
|
||||||
<Button className="h-8 px-3 text-[13px]" onClick={() => setConfirmOpen(true)} disabled={isBackend && !version.trim()}>
|
<Button className="h-8 px-3 text-[13px]" onClick={() => setConfirmOpen(true)}>
|
||||||
<Play className="size-4" />
|
<Play className="size-4" />
|
||||||
실행
|
실행
|
||||||
</Button>
|
</Button>
|
||||||
@@ -209,17 +208,10 @@ export function LauncherBuildPage() {
|
|||||||
<Card className="min-w-0 overflow-hidden">
|
<Card className="min-w-0 overflow-hidden">
|
||||||
<CardHeader title="빌드 요청" description={isBackend ? '브랜치와 커밋 기준으로 런처 백엔드 이미지를 빌드하고 레지스트리에 푸시합니다.' : '브랜치와 커밋 기준으로 런처 설치 파일을 생성합니다.'} />
|
<CardHeader title="빌드 요청" description={isBackend ? '브랜치와 커밋 기준으로 런처 백엔드 이미지를 빌드하고 레지스트리에 푸시합니다.' : '브랜치와 커밋 기준으로 런처 설치 파일을 생성합니다.'} />
|
||||||
<div className="space-y-4 p-5">
|
<div className="space-y-4 p-5">
|
||||||
{isBackend ? (
|
<div className="rounded-md border border-border bg-muted/20 px-3 py-2">
|
||||||
<label className="block">
|
<p className="text-xs font-medium text-muted-foreground">버전</p>
|
||||||
<span className="text-xs font-medium text-muted-foreground">이미지 태그 버전</span>
|
<p className="mt-1 text-sm font-medium text-foreground">빌드 후 package.json 기준으로 자동 확정</p>
|
||||||
<input className="mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring" value={version} onChange={(event) => setVersion(event.target.value)} />
|
</div>
|
||||||
</label>
|
|
||||||
) : (
|
|
||||||
<div className="rounded-md border border-border bg-muted/20 px-3 py-2">
|
|
||||||
<p className="text-xs font-medium text-muted-foreground">버전</p>
|
|
||||||
<p className="mt-1 text-sm font-medium text-foreground">빌드 후 package.json 기준으로 자동 확정</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<label className="block">
|
<label className="block">
|
||||||
<span className="text-xs font-medium text-muted-foreground">브랜치</span>
|
<span className="text-xs font-medium text-muted-foreground">브랜치</span>
|
||||||
<select className="mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring" value={branch} onChange={(event) => setBranch(event.target.value)}>
|
<select className="mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring" value={branch} onChange={(event) => setBranch(event.target.value)}>
|
||||||
@@ -234,8 +226,9 @@ export function LauncherBuildPage() {
|
|||||||
</label>
|
</label>
|
||||||
{isBackend ? (
|
{isBackend ? (
|
||||||
<div className="rounded-md border border-border bg-background p-3">
|
<div className="rounded-md border border-border bg-background p-3">
|
||||||
<p className="text-xs text-muted-foreground">이미지</p>
|
<p className="text-xs text-muted-foreground">이미지 이름</p>
|
||||||
<p className="mt-2 break-all font-mono text-xs text-foreground">{backendImageTag}</p>
|
<p className="mt-2 break-all font-mono text-xs text-foreground">{backendImageName}</p>
|
||||||
|
<p className="mt-1 text-xs leading-5 text-muted-foreground">태그는 빌드 후 package.json 버전으로 자동 확정됩니다.</p>
|
||||||
<p className="mt-2 text-xs text-muted-foreground">Repository</p>
|
<p className="mt-2 text-xs text-muted-foreground">Repository</p>
|
||||||
<p className="mt-1 break-all font-mono text-xs text-foreground">{backendSource?.repository || '-'}</p>
|
<p className="mt-1 break-all font-mono text-xs text-foreground">{backendSource?.repository || '-'}</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -339,7 +332,7 @@ export function LauncherBuildPage() {
|
|||||||
footer={
|
footer={
|
||||||
<>
|
<>
|
||||||
<Button variant="outline" onClick={() => setConfirmOpen(false)}>취소</Button>
|
<Button variant="outline" onClick={() => setConfirmOpen(false)}>취소</Button>
|
||||||
<Button onClick={createJob} disabled={loading || (isBackend && !version.trim())}>
|
<Button onClick={createJob} disabled={loading}>
|
||||||
<Play className="size-4" />
|
<Play className="size-4" />
|
||||||
실행
|
실행
|
||||||
</Button>
|
</Button>
|
||||||
@@ -374,8 +367,8 @@ export function LauncherBuildPage() {
|
|||||||
</div>
|
</div>
|
||||||
{isBackend ? (
|
{isBackend ? (
|
||||||
<div className="flex items-center justify-between gap-4">
|
<div className="flex items-center justify-between gap-4">
|
||||||
<span className="text-muted-foreground">이미지</span>
|
<span className="text-muted-foreground">이미지 이름</span>
|
||||||
<span className="truncate font-mono text-xs font-medium">{backendImageTag}</span>
|
<span className="truncate font-mono text-xs font-medium">{backendImageName}</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import {
|
|||||||
listGiteaCommits,
|
listGiteaCommits,
|
||||||
listLauncherVersions,
|
listLauncherVersions,
|
||||||
listPlatformRepos,
|
listPlatformRepos,
|
||||||
listStudioRepos,
|
|
||||||
updateLauncherSource,
|
updateLauncherSource,
|
||||||
type GiteaCommit,
|
type GiteaCommit,
|
||||||
type LauncherVersion
|
type LauncherVersion
|
||||||
@@ -37,7 +36,7 @@ const targetLabels: Record<SourceTarget, { title: string; description: string; d
|
|||||||
'launcher-backend': {
|
'launcher-backend': {
|
||||||
title: '백엔드',
|
title: '백엔드',
|
||||||
description: 'portal-api 런처 백엔드 컨테이너 이미지 빌드 소스입니다.',
|
description: 'portal-api 런처 백엔드 컨테이너 이미지 빌드 소스입니다.',
|
||||||
defaultOrg: 'studio'
|
defaultOrg: 'platform'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -119,7 +118,6 @@ export function LauncherSourcePage() {
|
|||||||
const [activeTarget, setActiveTarget] = useState<SourceTarget>('launcher-client');
|
const [activeTarget, setActiveTarget] = useState<SourceTarget>('launcher-client');
|
||||||
const [versions, setVersions] = useState<LauncherVersion[]>([]);
|
const [versions, setVersions] = useState<LauncherVersion[]>([]);
|
||||||
const [platformRepos, setPlatformRepos] = useState<GiteaRepo[]>([]);
|
const [platformRepos, setPlatformRepos] = useState<GiteaRepo[]>([]);
|
||||||
const [studioRepos, setStudioRepos] = useState<GiteaRepo[]>([]);
|
|
||||||
const [repos, setRepos] = useState<GiteaRepo[]>([]);
|
const [repos, setRepos] = useState<GiteaRepo[]>([]);
|
||||||
const [forms, setForms] = useState<Record<SourceTarget, SourceForm>>({
|
const [forms, setForms] = useState<Record<SourceTarget, SourceForm>>({
|
||||||
'launcher-client': emptyForm(),
|
'launcher-client': emptyForm(),
|
||||||
@@ -149,16 +147,15 @@ export function LauncherSourcePage() {
|
|||||||
|
|
||||||
const refresh = () => {
|
const refresh = () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
Promise.all([listLauncherVersions(), listPlatformRepos(), listStudioRepos(), getLauncherSource()])
|
Promise.all([listLauncherVersions(), listPlatformRepos(), getLauncherSource()])
|
||||||
.then(([nextVersions, platformRepos, studioRepos, sourceResult]) => {
|
.then(([nextVersions, platformRepos, sourceResult]) => {
|
||||||
const nextVersion = nextVersions.find((version) => version.isActive) ?? nextVersions[0];
|
const nextVersion = nextVersions.find((version) => version.isActive) ?? nextVersions[0];
|
||||||
const clientRepository = sourceResult.source.client?.repository ?? sourceResult.source.repository ?? nextVersion?.repository ?? (platformRepos[0] ? repoFullName(platformRepos[0]) : '');
|
const clientRepository = sourceResult.source.client?.repository ?? sourceResult.source.repository ?? nextVersion?.repository ?? (platformRepos[0] ? repoFullName(platformRepos[0]) : '');
|
||||||
const backendRepository = sourceResult.source.backend?.repository ?? (studioRepos[0] ? repoFullName(studioRepos[0]) : '');
|
const backendRepository = sourceResult.source.backend?.repository ?? (platformRepos[0] ? repoFullName(platformRepos[0]) : '');
|
||||||
|
|
||||||
setVersions(nextVersions);
|
setVersions(nextVersions);
|
||||||
setPlatformRepos(platformRepos);
|
setPlatformRepos(platformRepos);
|
||||||
setStudioRepos(studioRepos);
|
setRepos(platformRepos);
|
||||||
setRepos(activeTarget === 'launcher-client' ? platformRepos : studioRepos);
|
|
||||||
setForms({
|
setForms({
|
||||||
'launcher-client': {
|
'launcher-client': {
|
||||||
repository: clientRepository,
|
repository: clientRepository,
|
||||||
@@ -181,8 +178,8 @@ export function LauncherSourcePage() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setRepos(activeTarget === 'launcher-client' ? platformRepos : studioRepos);
|
setRepos(platformRepos);
|
||||||
}, [activeTarget, platformRepos, studioRepos]);
|
}, [platformRepos]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const repository = splitRepository(activeForm.repository, activeTargetMeta.defaultOrg);
|
const repository = splitRepository(activeForm.repository, activeTargetMeta.defaultOrg);
|
||||||
|
|||||||
@@ -52,7 +52,17 @@ export function UserSessionsPage() {
|
|||||||
const columns = useMemo<Array<DataTableColumn<UserSession>>>(
|
const columns = useMemo<Array<DataTableColumn<UserSession>>>(
|
||||||
() => [
|
() => [
|
||||||
{ key: 'no', header: 'No.', className: 'w-20 px-5 py-3 font-medium', cell: (row) => <span className="font-semibold">{row.no}</span> },
|
{ key: 'no', header: 'No.', className: 'w-20 px-5 py-3 font-medium', cell: (row) => <span className="font-semibold">{row.no}</span> },
|
||||||
{ key: 'user', header: '사용자', className: 'w-[220px] px-5 py-3 font-medium', cell: (row) => <span className="font-semibold">{row.user}</span> },
|
{
|
||||||
|
key: 'user',
|
||||||
|
header: '사용자',
|
||||||
|
className: 'w-[240px] px-5 py-3 font-medium',
|
||||||
|
cell: (row) => (
|
||||||
|
<div className="min-w-0">
|
||||||
|
<p className="truncate font-semibold">{row.user}</p>
|
||||||
|
{row.email ? <p className="mt-1 truncate text-xs font-medium text-muted-foreground">{row.email}</p> : null}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
},
|
||||||
{ key: 'role', header: '권한', cell: (row) => <span className="text-muted-foreground">{row.role}</span> },
|
{ key: 'role', header: '권한', cell: (row) => <span className="text-muted-foreground">{row.role}</span> },
|
||||||
{ key: 'session', header: '세션', cell: (row) => <span className="font-mono text-xs text-muted-foreground">{row.session}</span> },
|
{ key: 'session', header: '세션', cell: (row) => <span className="font-mono text-xs text-muted-foreground">{row.session}</span> },
|
||||||
{ key: 'expiresAt', header: '만료', cell: (row) => <span className="text-muted-foreground">{formatDateTime(row.expiresAt)}</span> },
|
{ key: 'expiresAt', header: '만료', cell: (row) => <span className="text-muted-foreground">{formatDateTime(row.expiresAt)}</span> },
|
||||||
|
|||||||
Reference in New Issue
Block a user