77 * wheels jobs status --format=json
88 * {code}
99 */
10- component extends = " ../../base" {
10+ component extends = " ../base" {
11+
12+ property name = " detailOutput" inject = " DetailOutputService@wheels-cli" ;
1113
1214 /**
1315 * @queue Filter by queue name (default: all queues)
@@ -24,9 +26,7 @@ component extends="../../base" {
2426 return ;
2527 }
2628
27- print .line ();
28- print .boldBlueLine (" Job Queue Status" );
29- print .line ();
29+ detailOutput .header (" Job Queue Status" );
3030
3131 // Build URL parameters
3232 local .urlParams = " &command=jobsStatus" ;
@@ -40,7 +40,7 @@ component extends="../../base" {
4040 }
4141
4242 if (arguments .format == " json" ) {
43- print . line (SerializeJSON (local .result .stats ));
43+ detailOutput . output (SerializeJSON (local .result .stats ));
4444 return ;
4545 }
4646
@@ -49,8 +49,8 @@ component extends="../../base" {
4949 local .queues = local .result .stats .queues ;
5050
5151 if (StructCount (local .queues ) == 0 ) {
52- print . line (" No jobs found." );
53- print .line ();
52+ detailOutput . output (" No jobs found." );
53+ detailOutput .line ();
5454 return ;
5555 }
5656
@@ -63,47 +63,47 @@ component extends="../../base" {
6363 PadRight (" Total" , 10 ) & " |" ;
6464 local .separator = RepeatString (" -" , Len (local .header ));
6565
66- print .line (local .separator );
67- print .line (local .header );
68- print .line (local .separator );
66+ detailOutput . getPrint () .line (local .separator );
67+ detailOutput . getPrint () .line (local .header );
68+ detailOutput . getPrint () .line (local .separator );
6969
7070 for (local .queueName in local .queues ) {
7171 local .q = local .queues [local .queueName ];
72- print .text (" | " & PadRight (local .queueName , 20 ) & " | " );
73- print .yellowText (PadRight (local .q .pending , 10 ));
74- print .text (" | " );
75- print .cyanText (PadRight (local .q .processing , 12 ));
76- print .text (" | " );
77- print .greenText (PadRight (local .q .completed , 12 ));
78- print .text (" | " );
72+ detailOutput . getPrint () .text (" | " & PadRight (local .queueName , 20 ) & " | " );
73+ detailOutput . getPrint () .yellowText (PadRight (local .q .pending , 10 ));
74+ detailOutput . getPrint () .text (" | " );
75+ detailOutput . getPrint () .cyanText (PadRight (local .q .processing , 12 ));
76+ detailOutput . getPrint () .text (" | " );
77+ detailOutput . getPrint () .greenText (PadRight (local .q .completed , 12 ));
78+ detailOutput . getPrint () .text (" | " );
7979 if (local .q .failed > 0 ) {
80- print .redText (PadRight (local .q .failed , 10 ));
80+ detailOutput . getPrint () .redText (PadRight (local .q .failed , 10 ));
8181 } else {
82- print .text (PadRight (local .q .failed , 10 ));
82+ detailOutput . getPrint () .text (PadRight (local .q .failed , 10 ));
8383 }
84- print .line (" | " & PadRight (local .q .total , 10 ) & " |" );
84+ detailOutput . getPrint () .line (" | " & PadRight (local .q .total , 10 ) & " |" );
8585 }
8686
8787 // Totals row
8888 local .totals = local .result .stats .totals ;
89- print .line (local .separator );
90- print .text (" | " & PadRight (" TOTAL" , 20 ) & " | " );
91- print .boldYellowText (PadRight (local .totals .pending , 10 ));
92- print .text (" | " );
93- print .boldCyanText (PadRight (local .totals .processing , 12 ));
94- print .text (" | " );
95- print .boldGreenText (PadRight (local .totals .completed , 12 ));
96- print .text (" | " );
89+ detailOutput . getPrint () .line (local .separator );
90+ detailOutput . getPrint () .text (" | " & PadRight (" TOTAL" , 20 ) & " | " );
91+ detailOutput . getPrint () .boldYellowText (PadRight (local .totals .pending , 10 ));
92+ detailOutput . getPrint () .text (" | " );
93+ detailOutput . getPrint () .boldCyanText (PadRight (local .totals .processing , 12 ));
94+ detailOutput . getPrint () .text (" | " );
95+ detailOutput . getPrint () .boldGreenText (PadRight (local .totals .completed , 12 ));
96+ detailOutput . getPrint () .text (" | " );
9797 if (local .totals .failed > 0 ) {
98- print .boldRedText (PadRight (local .totals .failed , 10 ));
98+ detailOutput . getPrint () .boldRedText (PadRight (local .totals .failed , 10 ));
9999 } else {
100- print .boldText (PadRight (local .totals .failed , 10 ));
100+ detailOutput . getPrint () .boldText (PadRight (local .totals .failed , 10 ));
101101 }
102- print .line (" | " & PadRight (local .totals .total , 10 ) & " |" );
103- print .line (local .separator );
102+ detailOutput . getPrint () .line (" | " & PadRight (local .totals .total , 10 ) & " |" );
103+ detailOutput . getPrint () .line (local .separator );
104104 }
105105
106- print .line ();
106+ detailOutput .line ();
107107 }
108108
109109 private string function PadRight (required string text , required numeric length ) {
0 commit comments