-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui,api,cdsctl): Add filter to queue/workflows on status #3293
feat(ui,api,cdsctl): Add filter to queue/workflows on status #3293
Conversation
…ters in status and queue pages
@@ -29,16 +29,20 @@ export class QueueComponent implements OnDestroy { | |||
requirementsList: Array<string> = []; | |||
loading = true; | |||
|
|||
statusOptions: Array<string> = ['Waiting', 'Building', 'All']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an enum in pipeline model I think something like PipelineStatus
@@ -47,6 +51,21 @@ export class QueueComponent implements OnDestroy { | |||
} | |||
} | |||
|
|||
getQueueWorkerParams() { | |||
console.log(this.status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to delete
|
||
<table class="ui definition table" *ngIf="status && !loading"> | ||
<tbody> | ||
<tr *ngFor="let line of status.lines" [ngClass]="{'error': line.status=='AL', 'warning': line.status=='WARN', 'positive': line.status=='WARN'}"> | ||
<td> | ||
<tr *ngFor="let line of getStatusLines()" [ngClass]="{'error': line.status=='AL', 'warning': line.status=='WARN', 'positive': line.status=='WARN'}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strict equals ===
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid using function in ngIf/ngFor etc..
ui/src/assets/worker/web/queue.js
Outdated
onmessage = function (e) { | ||
loadWorkflowRuns(e.data.user, e.data.session, e.data.api); | ||
status = e.data.status; | ||
if (!started) { loadWorkflowRuns(e.data.user, e.data.session, e.data.api); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiline could be more readable
ui/src/assets/worker/web/queue.js
Outdated
loop(5, function () { | ||
var url = '/queue/workflows'; | ||
|
||
if (status && status.length > 0) { | ||
url = url.concat('?', status.map(function (s) { return "status=" + s; }).join('&')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single quote 'status='
@@ -17,12 +24,15 @@ <h3>{{'admin_queue_title' | translate }} <span *ngIf="!loading && nodeJobRuns && | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<tr *ngFor="let wNodeJobRun of nodeJobRuns; let index = index"> | |||
<tr *ngFor="let wNodeJobRun of getNodeJobRuns(); let index = index"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's possible please avoid use function in template (to avoid performance issues)
@@ -3,10 +3,17 @@ <h3>{{'admin_queue_title' | translate }} <span *ngIf="!loading && nodeJobRuns && | |||
|
|||
<div *ngIf="loading" class="ui active text loader">{{ 'common_loading' | translate }}</div> | |||
|
|||
<sm-select class="search fluid" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use sm-select but sui-select
|
||
<table class="ui definition table" *ngIf="status && !loading"> | ||
<tbody> | ||
<tr *ngFor="let line of status.lines" [ngClass]="{'error': line.status=='AL', 'warning': line.status=='WARN', 'positive': line.status=='WARN'}"> | ||
<td> | ||
<tr *ngFor="let line of getStatusLines()" [ngClass]="{'error': line.status=='AL', 'warning': line.status=='WARN', 'positive': line.status=='WARN'}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid using function in ngIf/ngFor etc..
engine/api/workflow_queue.go
Outdated
|
||
status, err := QueryStrings(r, "status") | ||
if err != nil { | ||
return sdk.WrapError(err, "getWorkflowJobQueueHandler> Cannot parse request") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case the error is not a sdk.Error and will be returned as a 500
you should do sdk.NewError(sdk.ErrWrongRequest, err)
@ovh/cds