File tree Expand file tree Collapse file tree 5 files changed +22
-2
lines changed Expand file tree Collapse file tree 5 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -646,6 +646,8 @@ components:
646646 type : array
647647 items :
648648 $ref : ' #/components/schemas/AnvilJob'
649+ logs :
650+ type : string
649651 SuccessResponse :
650652 type : object
651653 properties :
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export enum AnvilWorkerStatus {
1313export class AnvilWorker {
1414 public readonly id : string ;
1515 public readonly name : string ;
16+ public logs : string ;
1617 public status : AnvilWorkerStatus ;
1718 private timer : NodeJS . Timeout ;
1819 private commands : AnvilCommand [ ] ;
@@ -25,6 +26,7 @@ export class AnvilWorker {
2526 this . status = AnvilWorkerStatus . IDLE ;
2627 this . commands = [ ] ;
2728 this . jobs = [ ] ;
29+ this . logs = "" ;
2830 this . keepAlive ( ) ;
2931 }
3032
@@ -49,7 +51,8 @@ export class AnvilWorker {
4951 id : this . id ,
5052 name : this . name ,
5153 status : this . status . toString ( ) ,
52- jobs : this . jobs . map ( j => j . apiObject ( ) )
54+ jobs : this . jobs . map ( j => j . apiObject ( ) ) ,
55+ logs : this . logs
5356 }
5457 }
5558
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ export namespace WorkerEndpoint {
3737 return next ( new BadRequest ( "id not valid" ) ) ;
3838 }
3939 worker . keepAlive ( ) ;
40+ if ( req . body . logs && req . body . logs . trim ( ) . length > 0 ) {
41+ worker . logs += req . body . logs ;
42+ }
4043 res . json ( worker . fetchCommand ( status ) ) ;
4144 }
4245
Original file line number Diff line number Diff line change @@ -103,7 +103,8 @@ export interface IAnvilWorker {
103103 name : string ,
104104 id : string ,
105105 status : string ,
106- jobs : IAnvilJob [ ]
106+ jobs : IAnvilJob [ ] ,
107+ logs : string
107108}
108109
109110export interface IAnvilJob {
Original file line number Diff line number Diff line change 5858 <span v-else >
5959 No Jobs running.
6060 </span >
61+ <br >
62+ <code v-if =" worker.logs" >
63+ {{ worker.logs }}
64+ </code >
6165 </main >
6266 <footer class =" buttons" >
6367 <span v-if =" worker.status == 'WORKING'" :aria-busy =" true" ></span >
@@ -160,4 +164,11 @@ article {
160164 --table-row-stripped-background-color : rgb (227 , 227 , 227 );
161165 background-color : rgb (227 , 227 , 227 );
162166}
167+
168+ code {
169+ white-space : pre-line ;
170+ max-height : 10rem ;
171+ width : 100% ;
172+ overflow-x : scroll ;
173+ }
163174 </style >
You can’t perform that action at this time.
0 commit comments