mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-21 16:06:29 +00:00
Some UI fixes (#2698)
- fix first log line being dropped if channel was opened - link org and repo on repo logs view - fix decline pipeline status does not update
This commit is contained in:
parent
fe489287fc
commit
b949c190de
5 changed files with 28 additions and 19 deletions
|
@ -79,9 +79,15 @@ func (l *log) Write(ctx context.Context, stepID int64, logEntry *model.LogEntry)
|
|||
l.Lock()
|
||||
s, ok := l.streams[stepID]
|
||||
l.Unlock()
|
||||
|
||||
// auto open the stream if it does not exist
|
||||
if !ok {
|
||||
return l.Open(ctx, stepID)
|
||||
err := l.Open(ctx, stepID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
s.Lock()
|
||||
s.list = append(s.list, logEntry)
|
||||
for sub := range s.subs {
|
||||
|
|
|
@ -82,7 +82,7 @@ func Create(ctx context.Context, _store store.Store, repo *model.Repo, pipeline
|
|||
err = _store.CreatePipeline(pipeline)
|
||||
if err != nil {
|
||||
msg := fmt.Errorf("failed to save pipeline for %s", repo.FullName)
|
||||
log.Error().Err(err).Msg(msg.Error())
|
||||
log.Error().Str("repo", repo.FullName).Err(err).Msg(msg.Error())
|
||||
return nil, msg
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ func Decline(ctx context.Context, store store.Store, pipeline *model.Pipeline, u
|
|||
return nil, fmt.Errorf("cannot decline a pipeline with status %s", pipeline.Status)
|
||||
}
|
||||
|
||||
_, err := UpdateToStatusDeclined(store, *pipeline, user.Login)
|
||||
pipeline, err := UpdateToStatusDeclined(store, *pipeline, user.Login)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error updating pipeline. %w", err)
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ import (
|
|||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/woodpecker-ci/woodpecker/pipeline"
|
||||
"github.com/woodpecker-ci/woodpecker/server"
|
||||
"github.com/woodpecker-ci/woodpecker/server/model"
|
||||
"github.com/woodpecker-ci/woodpecker/server/store"
|
||||
)
|
||||
|
@ -45,18 +44,6 @@ func start(ctx context.Context, store store.Store, activePipeline *model.Pipelin
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// open logs streamer for each step
|
||||
for _, wf := range activePipeline.Workflows {
|
||||
for _, step := range wf.Children {
|
||||
stepID := step.ID
|
||||
go func() {
|
||||
if err := server.Config.Services.Logs.Open(context.Background(), stepID); err != nil {
|
||||
log.Error().Err(err).Msgf("could not open log stream for step %d", stepID)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
return activePipeline, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,17 @@
|
|||
:fluid-content="activeTab === 'tasks'"
|
||||
full-width-header
|
||||
>
|
||||
<template #title>{{ repo.full_name }}</template>
|
||||
<template #title>
|
||||
<span>
|
||||
<router-link :to="{ name: 'org', params: { orgId: repo.org_id } }" class="hover:underline">
|
||||
{{ repo.owner }}
|
||||
</router-link>
|
||||
/
|
||||
<router-link :to="{ name: 'repo' }" class="hover:underline">
|
||||
{{ repo.name }}
|
||||
</router-link>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #titleActions>
|
||||
<div class="flex md:items-center flex-col gap-2 md:flex-row md:justify-between min-w-0">
|
||||
|
@ -139,6 +149,14 @@ const pipeline = pipelineStore.getPipeline(repositoryId, pipelineId);
|
|||
const { since, duration, created, message, title } = usePipeline(pipeline);
|
||||
provide('pipeline', pipeline);
|
||||
|
||||
watch(
|
||||
pipeline,
|
||||
() => {
|
||||
favicon.updateStatus(pipeline.value?.status);
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
const showDeployPipelinePopup = ref(false);
|
||||
|
||||
async function loadPipeline(): Promise<void> {
|
||||
|
@ -147,8 +165,6 @@ async function loadPipeline(): Promise<void> {
|
|||
}
|
||||
|
||||
await pipelineStore.loadPipeline(repo.value.id, parseInt(pipelineId.value, 10));
|
||||
|
||||
favicon.updateStatus(pipeline.value?.status);
|
||||
}
|
||||
|
||||
const { doSubmit: cancelPipeline, isLoading: isCancelingPipeline } = useAsyncAction(async () => {
|
||||
|
|
Loading…
Reference in a new issue