@@ -97,6 +97,14 @@ export class ECLWatchTree extends Tree {
97
97
wuNode . delete ( ) ;
98
98
} ) ;
99
99
100
+ vscode . commands . registerCommand ( "hpccPlatform.protectWU" , ( wuNode : ECLWUNode ) => {
101
+ wuNode . protect ( ) ;
102
+ } ) ;
103
+
104
+ vscode . commands . registerCommand ( "hpccPlatform.unprotectWU" , ( wuNode : ECLWUNode ) => {
105
+ wuNode . unprotect ( ) ;
106
+ } ) ;
107
+
100
108
vscode . commands . registerCommand ( "hpccPlatform.moveJobUp" , ( wuNode : ECLWUNode ) => {
101
109
wuNode . moveJobUp ( ) ;
102
110
} ) ;
@@ -391,12 +399,12 @@ export class ECLWUNode extends Item<ECLWatchTree> {
391
399
392
400
getDescription ( ) : string {
393
401
const extras : string [ ] = [ ] ;
394
- if ( this . _wu . Jobname ) {
395
- extras . push ( this . _wu . Wuid ) ;
396
- }
397
- if ( ! this . _tree . _myWorkunits && this . _wu . Owner ) extras . push ( this . _wu . Owner ) ;
402
+ if ( this . _wu . Jobname ) extras . push ( this . _wu . Wuid ) ;
403
+ if ( this . _wu . Protected ) extras . push ( "Protected" ) ;
398
404
if ( ! this . _wu . isComplete ( ) || this . _wu . isDeleted ( ) ) extras . push ( this . _wu . State ) ;
399
- return extras . join ( " " ) ;
405
+ if ( this . _wu . Owner ) extras . push ( this . _wu . Owner ) ;
406
+ if ( this . _wu . Cluster ) extras . push ( this . _wu . Cluster ) ;
407
+ return extras . join ( ", " ) ;
400
408
}
401
409
402
410
iconPath ( ) {
@@ -470,7 +478,15 @@ export class ECLWUNode extends Item<ECLWatchTree> {
470
478
resubmit ( ) {
471
479
this . _wu . resubmit ( ) . then ( ( ) => this . _tree . refresh ( this ) ) ;
472
480
}
473
-
481
+
482
+ protect ( ) {
483
+ this . _wu . protect ( ) . then ( ( ) => this . _tree . refresh ( ) ) ;
484
+ }
485
+
486
+ unprotect ( ) {
487
+ this . _wu . unprotect ( ) . then ( ( ) => this . _tree . refresh ( ) ) ;
488
+ }
489
+
474
490
moveJobUp ( ) {
475
491
const service = new SMCService ( { baseUrl : this . _wu . BaseUrl } ) ;
476
492
return service . MoveJobUp ( {
@@ -596,7 +612,8 @@ export class ECLWUNode extends Item<ECLWatchTree> {
596
612
}
597
613
598
614
contextValue ( ) : string {
599
- return this . _wu . isComplete ( ) ? "ECLWUNodeComplete" : "ECLWUNode" ;
615
+ const prot = this . _wu . Protected ? ",ECLWUNodeProtected" : ",ECLWUNodeUnprotected" ;
616
+ return this . _wu . isComplete ( ) ? `ECLWUNodeComplete${ prot } ` : `ECLWUNode${ prot } ` ;
600
617
}
601
618
}
602
619
0 commit comments