This commit is contained in:
@@ -10,7 +10,6 @@ import {
|
|||||||
getLauncherSource,
|
getLauncherSource,
|
||||||
listGiteaCommits,
|
listGiteaCommits,
|
||||||
listLauncherVersions,
|
listLauncherVersions,
|
||||||
listPlatformRepos,
|
|
||||||
listStudioRepos,
|
listStudioRepos,
|
||||||
updateLauncherSource,
|
updateLauncherSource,
|
||||||
type GiteaCommit,
|
type GiteaCommit,
|
||||||
@@ -32,7 +31,7 @@ const targetLabels: Record<SourceTarget, { title: string; description: string; d
|
|||||||
'launcher-client': {
|
'launcher-client': {
|
||||||
title: '클라이언트',
|
title: '클라이언트',
|
||||||
description: '사용자 PC에 설치되는 Electron .deb 빌드 소스입니다.',
|
description: '사용자 PC에 설치되는 Electron .deb 빌드 소스입니다.',
|
||||||
defaultOrg: 'platform'
|
defaultOrg: 'studio'
|
||||||
},
|
},
|
||||||
'launcher-backend': {
|
'launcher-backend': {
|
||||||
title: '백엔드',
|
title: '백엔드',
|
||||||
@@ -147,15 +146,14 @@ export function LauncherSourcePage() {
|
|||||||
|
|
||||||
const refresh = () => {
|
const refresh = () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
Promise.all([listLauncherVersions(), listPlatformRepos(), listStudioRepos(), getLauncherSource()])
|
Promise.all([listLauncherVersions(), listStudioRepos(), getLauncherSource()])
|
||||||
.then(([nextVersions, platformRepos, studioRepos, sourceResult]) => {
|
.then(([nextVersions, studioRepos, sourceResult]) => {
|
||||||
const mergedRepos = [...platformRepos, ...studioRepos];
|
|
||||||
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 ?? (studioRepos[0] ? repoFullName(studioRepos[0]) : '');
|
||||||
const backendRepository = sourceResult.source.backend?.repository ?? (studioRepos[0] ? repoFullName(studioRepos[0]) : '');
|
const backendRepository = sourceResult.source.backend?.repository ?? (studioRepos[0] ? repoFullName(studioRepos[0]) : '');
|
||||||
|
|
||||||
setVersions(nextVersions);
|
setVersions(nextVersions);
|
||||||
setRepos(mergedRepos);
|
setRepos(studioRepos);
|
||||||
setForms({
|
setForms({
|
||||||
'launcher-client': {
|
'launcher-client': {
|
||||||
repository: clientRepository,
|
repository: clientRepository,
|
||||||
@@ -263,23 +261,17 @@ export function LauncherSourcePage() {
|
|||||||
<Card className="min-w-0 overflow-hidden">
|
<Card className="min-w-0 overflow-hidden">
|
||||||
<CardHeader title={`${activeTargetMeta.title} 소스 연결`} description={activeTargetMeta.description} />
|
<CardHeader title={`${activeTargetMeta.title} 소스 연결`} description={activeTargetMeta.description} />
|
||||||
<div className="grid gap-4 p-5 md:grid-cols-3">
|
<div className="grid gap-4 p-5 md:grid-cols-3">
|
||||||
<label className="block md:col-span-2">
|
<label className="block md:col-span-3">
|
||||||
<span className="text-xs font-medium text-muted-foreground">저장소</span>
|
<span className="text-xs font-medium text-muted-foreground">저장소</span>
|
||||||
<input
|
<select
|
||||||
className="mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-ring"
|
className="mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-ring"
|
||||||
value={activeForm.repository}
|
value={activeForm.repository}
|
||||||
onChange={(event) => updateForm({ repository: event.target.value })}
|
onChange={(event) => updateForm({ repository: event.target.value })}
|
||||||
list="launcher-source-repositories"
|
>
|
||||||
placeholder={`${activeTargetMeta.defaultOrg}/repository`}
|
<option value="">저장소 선택</option>
|
||||||
/>
|
{repos.map((repo) => <option key={repoFullName(repo)} value={repoFullName(repo)}>{repoFullName(repo)}</option>)}
|
||||||
<datalist id="launcher-source-repositories">
|
</select>
|
||||||
{repos.map((repo) => <option key={repoFullName(repo)} value={repoFullName(repo)} />)}
|
|
||||||
</datalist>
|
|
||||||
</label>
|
</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">develop 최신 성공 빌드</p>
|
|
||||||
</div>
|
|
||||||
{activeTarget === 'launcher-backend' ? (
|
{activeTarget === 'launcher-backend' ? (
|
||||||
<>
|
<>
|
||||||
<label className="block md:col-span-3">
|
<label className="block md:col-span-3">
|
||||||
@@ -296,7 +288,7 @@ export function LauncherSourcePage() {
|
|||||||
<div className="flex justify-end md:col-span-3">
|
<div className="flex justify-end md:col-span-3">
|
||||||
<Button onClick={save} disabled={!activeForm.repository.trim() || saving}>
|
<Button onClick={save} disabled={!activeForm.repository.trim() || saving}>
|
||||||
<Link2 className="size-4" />
|
<Link2 className="size-4" />
|
||||||
저장소 연결 저장
|
저장소 연결
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user