1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-07-12 22:21:40 +02:00

Add queue details UI for admins (#1632)

# Changes
- Adds an admin view to see the whole work-queue of the server. 
- The admin can also pause / resume the queue. 
- The view is reloading data every 5 seconds automatically.
- The task model from queue got removed in favor of the one from models.
This commit is contained in:
Anbraten
2023-03-20 04:50:56 +01:00
committed by GitHub
parent 4d5c59556e
commit 2337f1854a
19 changed files with 432 additions and 265 deletions

View File

@ -23,16 +23,15 @@ import (
"github.com/woodpecker-ci/woodpecker/pipeline/rpc"
"github.com/woodpecker-ci/woodpecker/server"
"github.com/woodpecker-ci/woodpecker/server/model"
"github.com/woodpecker-ci/woodpecker/server/queue"
)
func queuePipeline(repo *model.Repo, pipelineItems []*pipeline.Item) error {
var tasks []*queue.Task
var tasks []*model.Task
for _, item := range pipelineItems {
if item.Step.State == model.StatusSkipped {
continue
}
task := new(queue.Task)
task := new(model.Task)
task.ID = fmt.Sprint(item.Step.ID)
task.Labels = map[string]string{}
for k, v := range item.Labels {
@ -42,7 +41,7 @@ func queuePipeline(repo *model.Repo, pipelineItems []*pipeline.Item) error {
task.Labels["repo"] = repo.FullName
task.Dependencies = taskIds(item.DependsOn, pipelineItems)
task.RunOn = item.RunsOn
task.DepStatus = make(map[string]string)
task.DepStatus = make(map[string]model.StatusValue)
task.Data, _ = json.Marshal(rpc.Pipeline{
ID: fmt.Sprint(item.Step.ID),