Skip to content

Commit

Permalink
feat: add a resubmit item in the WU menu
Browse files Browse the repository at this point in the history
Signed-off-by: David de Hilster <[email protected]>
  • Loading branch information
dehilsterlexis committed Feb 6, 2024
1 parent 4ee1e25 commit c2fe15d
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@
},
"enablement": "ecl.connected"
},
{
"command": "hpccPlatform.resubmitWU",
"category": "ECL",
"title": "%Resubmit%",
"description": "%Resubmit ECL to HPCC Platform%",
"icon": {
"light": "resources/light/play.svg",
"dark": "resources/dark/play.svg"
},
"enablement": "ecl.connected"
},
{
"command": "ecl.submitNoArchive",
"category": "ECL",
Expand Down Expand Up @@ -965,6 +976,11 @@
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "3action@910"
},
{
"command": "hpccPlatform.resubmitWU",
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "3action@915"
},
{
"command": "hpccPlatform.deleteWU",
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
Expand Down
2 changes: 2 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
"Refresh": "Refresh",
"Refresh Tree": "Refresh Tree",
"Reject unauthorized calls e.g. SSL certificate errors": "Reject unauthorized calls e.g. SSL certificate errors",
"Resubmit": "Resubmit",
"Resubmit ECL to HPCC Platform": "Resubmit ECL to HPCC Platform",
"Reveal Generated ECL in File Explorer": "Reveal Generated ECL in File Explorer",
"Reveals Generated ECL in File Explorer": "Reveals Generated ECL in File Explorer",
"Run 'eclcc -syntax' on load": "Run 'eclcc -syntax' on load",
Expand Down
65 changes: 64 additions & 1 deletion src/ecl/eclWatchTree.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Workunit, WUStateID, Result, WUInfo, WorkunitsService } from "@hpcc-js/comms";
import { Workunit, WUStateID, Result, WUInfo, WorkunitsService, SMCService } from "@hpcc-js/comms";
import * as vscode from "vscode";
import { sessionManager } from "../hpccplatform/session";
import localize from "../util/localize";
Expand Down Expand Up @@ -89,10 +89,29 @@ export class ECLWatchTree extends Tree {
wuNode.abort();
});

vscode.commands.registerCommand("hpccPlatform.resubmitWU", (wuNode: ECLWUNode) => {
wuNode.resubmit();
});

vscode.commands.registerCommand("hpccPlatform.deleteWU", (wuNode: ECLWUNode) => {
wuNode.delete();
});

vscode.commands.registerCommand("hpccPlatform.moveJobUp", (wuNode: ECLWUNode) => {
wuNode.moveJobUp();
});

vscode.commands.registerCommand("hpccPlatform.moveJobDown", (wuNode: ECLWUNode) => {
wuNode.moveJobDown();
});

vscode.commands.registerCommand("hpccPlatform.moveJobBack", (wuNode: ECLWUNode) => {
wuNode.moveJobBack();
});

vscode.commands.registerCommand("hpccPlatform.moveJobFront", (wuNode: ECLWUNode) => {
wuNode.moveJobFront();
});
vscode.commands.registerCommand("hpccPlatform.setStateCompiled", (wuNode: ECLWUNode) => {
wuNode.setStateCompiled();
});
Expand Down Expand Up @@ -448,6 +467,50 @@ export class ECLWUNode extends Item<ECLWatchTree> {
this._wu.abort().then(() => this._tree.refresh(this));
}

resubmit() {
this._wu.resubmit().then(() => this._tree.refresh(this));
}

moveJobUp() {
const service = new SMCService({ baseUrl: this._wu.BaseUrl });
return service.MoveJobUp({
ClusterType: this._wu.ClusterFlag,
Cluster: this._wu.Cluster,
QueueName: this._wu.Queue,
Wuid: this._wu.Wuid
}).then(() => this._tree.refresh());
}

moveJobDown() {
const service = new SMCService({ baseUrl: this._wu.BaseUrl });
return service.MoveJobDown({
ClusterType: this._wu.ClusterFlag,
Cluster: this._wu.Cluster,
QueueName: this._wu.Queue,
Wuid: this._wu.Wuid
}).then(() => this._tree.refresh());
}

moveJobBack() {
const service = new SMCService({ baseUrl: this._wu.BaseUrl });
return service.MoveJobBack({
ClusterType: this._wu.ClusterFlag,
Cluster: this._wu.Cluster,
QueueName: this._wu.Queue,
Wuid: this._wu.Wuid
}).then(() => this._tree.refresh());
}

moveJobFront() {
const service = new SMCService({ baseUrl: this._wu.BaseUrl });
return service.MoveJobFront({
ClusterType: this._wu.ClusterFlag,
Cluster: this._wu.Cluster,
QueueName: this._wu.Queue,
Wuid: this._wu.Wuid
}).then(() => this._tree.refresh());
}

setState(stateID: WUStateID) {
const service = new WorkunitsService({ baseUrl: this._wu.BaseUrl });
return service.WUUpdate({
Expand Down

0 comments on commit c2fe15d

Please sign in to comment.