mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-06-07 18:08:48 +00:00
Redirect to new pipeline (#1761)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
parent
435f5ae207
commit
cfb53cb995
2 changed files with 9 additions and 5 deletions
|
@ -124,9 +124,9 @@ export default class WoodpeckerClient extends ApiClient {
|
||||||
repo: string,
|
repo: string,
|
||||||
pipeline: string,
|
pipeline: string,
|
||||||
opts?: Record<string, string | number | boolean>,
|
opts?: Record<string, string | number | boolean>,
|
||||||
): Promise<unknown> {
|
): Promise<Pipeline> {
|
||||||
const query = encodeQueryString(opts);
|
const query = encodeQueryString(opts);
|
||||||
return this._post(`/api/repos/${owner}/${repo}/pipelines/${pipeline}?${query}`);
|
return this._post(`/api/repos/${owner}/${repo}/pipelines/${pipeline}?${query}`) as Promise<Pipeline>;
|
||||||
}
|
}
|
||||||
|
|
||||||
getLogs(owner: string, repo: string, pipeline: number, step: number): Promise<PipelineLog[]> {
|
getLogs(owner: string, repo: string, pipeline: number, step: number): Promise<PipelineLog[]> {
|
||||||
|
|
|
@ -161,10 +161,14 @@ const { doSubmit: restartPipeline, isLoading: isRestartingPipeline } = useAsyncA
|
||||||
throw new Error('Unexpected: Repo is undefined');
|
throw new Error('Unexpected: Repo is undefined');
|
||||||
}
|
}
|
||||||
|
|
||||||
await apiClient.restartPipeline(repo.value.owner, repo.value.name, pipelineId.value, { fork: true });
|
const newPipeline = await apiClient.restartPipeline(repo.value.owner, repo.value.name, pipelineId.value, {
|
||||||
|
fork: true,
|
||||||
|
});
|
||||||
notifications.notify({ title: i18n.t('repo.pipeline.actions.restart_success'), type: 'success' });
|
notifications.notify({ title: i18n.t('repo.pipeline.actions.restart_success'), type: 'success' });
|
||||||
// TODO: directly send to newest pipeline?
|
await router.push({
|
||||||
await router.push({ name: 'repo', params: { repoName: repo.value.name, repoOwner: repo.value.owner } });
|
name: 'repo-pipeline',
|
||||||
|
params: { pipelineId: newPipeline.number },
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(loadPipeline);
|
onMounted(loadPipeline);
|
||||||
|
|
Loading…
Reference in a new issue