replace launcher common settings with internal launcher settings
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -83,9 +83,6 @@ export function CommonAppBuildPage() {
|
|||||||
<div className="flex min-w-0 items-center gap-2">
|
<div className="flex min-w-0 items-center gap-2">
|
||||||
<span className={cn('size-2.5 shrink-0 rounded-full', pipelineStatusDotClass(pipeline.status))} />
|
<span className={cn('size-2.5 shrink-0 rounded-full', pipelineStatusDotClass(pipeline.status))} />
|
||||||
<p className="truncate text-sm font-semibold">{formatRepositoryName(pipeline.repository)}</p>
|
<p className="truncate text-sm font-semibold">{formatRepositoryName(pipeline.repository)}</p>
|
||||||
{isActivePipelineStatus(pipeline.status) ? (
|
|
||||||
<Loader2 className="size-3.5 shrink-0 animate-spin text-sky-300" />
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
<p className="mt-1 truncate text-sm text-muted-foreground">{pipeline.message || '-'}</p>
|
<p className="mt-1 truncate text-sm text-muted-foreground">{pipeline.message || '-'}</p>
|
||||||
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
|
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
|
||||||
|
|||||||
@@ -25,10 +25,13 @@ const commitRangeLabels: Record<CommitRange, string> = {
|
|||||||
|
|
||||||
const commitPageSize = 5;
|
const commitPageSize = 5;
|
||||||
const branchOptions = ['develop', 'release', 'main'];
|
const branchOptions = ['develop', 'release', 'main'];
|
||||||
const defaultCicdBaseUrl = 'http://192.168.0.20:8010';
|
|
||||||
|
|
||||||
function repoFullName(repo: GiteaRepo) {
|
function repoFullName(repo: GiteaRepo) {
|
||||||
return (repo as GiteaRepo & { fullName?: string }).fullName ?? repo.full_name ?? repo.name;
|
return repo.fullName ?? repo.full_name ?? repo.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
function repoHtmlUrl(repo?: GiteaRepo) {
|
||||||
|
return repo?.htmlUrl ?? repo?.html_url ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function splitRepository(repository: string) {
|
function splitRepository(repository: string) {
|
||||||
@@ -39,13 +42,7 @@ function splitRepository(repository: string) {
|
|||||||
|
|
||||||
function cicdLabel(pipeline?: CommonAppPipeline) {
|
function cicdLabel(pipeline?: CommonAppPipeline) {
|
||||||
if (!pipeline) return '-';
|
if (!pipeline) return '-';
|
||||||
try {
|
return pipeline.ciUrl ? `Woodpecker / ${pipeline.ciUrl}` : 'Woodpecker';
|
||||||
const origin = pipeline.url ? new URL(pipeline.url).origin : '';
|
|
||||||
const baseUrl = origin && !origin.includes(':3000') ? origin : defaultCicdBaseUrl;
|
|
||||||
return `Woodpecker / ${baseUrl}`;
|
|
||||||
} catch {
|
|
||||||
return `Woodpecker / ${defaultCicdBaseUrl}`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function commitAuthor(commit: GiteaCommit) {
|
function commitAuthor(commit: GiteaCommit) {
|
||||||
@@ -258,7 +255,10 @@ export function CommonAppSourcePage() {
|
|||||||
<button
|
<button
|
||||||
key={fullName}
|
key={fullName}
|
||||||
type="button"
|
type="button"
|
||||||
className={cn('block w-full px-5 py-4 text-left transition-colors hover:bg-muted/20', selected && 'bg-muted/30')}
|
className={cn(
|
||||||
|
'block w-full px-5 py-4 text-left transition-colors hover:bg-muted/20',
|
||||||
|
selected && 'bg-primary/20 shadow-[inset_4px_0_0_var(--color-primary)] hover:bg-primary/25'
|
||||||
|
)}
|
||||||
onClick={() => setSelectedRepository(fullName)}
|
onClick={() => setSelectedRepository(fullName)}
|
||||||
>
|
>
|
||||||
<div className="flex items-start justify-between gap-3">
|
<div className="flex items-start justify-between gap-3">
|
||||||
@@ -300,7 +300,7 @@ export function CommonAppSourcePage() {
|
|||||||
<div>
|
<div>
|
||||||
<p className="text-xs text-muted-foreground">Gitea URL</p>
|
<p className="text-xs text-muted-foreground">Gitea URL</p>
|
||||||
<div className="mt-2 flex h-9 items-center gap-2 rounded-md border border-border bg-background px-3">
|
<div className="mt-2 flex h-9 items-center gap-2 rounded-md border border-border bg-background px-3">
|
||||||
<p className="min-w-0 flex-1 truncate text-xs text-muted-foreground">{selectedRepo?.html_url ?? '-'}</p>
|
<p className="min-w-0 flex-1 truncate text-xs text-muted-foreground">{repoHtmlUrl(selectedRepo) || '-'}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ export type CommonAppPipeline = {
|
|||||||
branch: string;
|
branch: string;
|
||||||
status: string;
|
status: string;
|
||||||
createdAt: number;
|
createdAt: number;
|
||||||
|
ciUrl?: string | null;
|
||||||
url?: string | null;
|
url?: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function listCommonAppPipelines() {
|
export function listCommonAppPipelines() {
|
||||||
return apiRequest<{ repos?: CommonAppPipeline[] }>('/woodpecker/repos')
|
return apiRequest<{ repos?: CommonAppPipeline[]; baseUrl?: string | null }>('/woodpecker/repos')
|
||||||
.then((result) => result.repos ?? []);
|
.then((result) => (result.repos ?? []).map((repo) => ({ ...repo, ciUrl: repo.ciUrl ?? result.baseUrl ?? null })));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,9 +81,13 @@ export type GiteaRepo = {
|
|||||||
id?: number;
|
id?: number;
|
||||||
name: string;
|
name: string;
|
||||||
full_name: string;
|
full_name: string;
|
||||||
|
fullName?: string;
|
||||||
html_url?: string;
|
html_url?: string;
|
||||||
|
htmlUrl?: string;
|
||||||
clone_url?: string;
|
clone_url?: string;
|
||||||
|
cloneUrl?: string;
|
||||||
ssh_url?: string;
|
ssh_url?: string;
|
||||||
|
sshUrl?: string;
|
||||||
private?: boolean;
|
private?: boolean;
|
||||||
owner?: { login: string };
|
owner?: { login: string };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user