diff --git a/package-lock.json b/package-lock.json index 35b3327..9899868 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "devDependencies": { "@fluentui/react": "8.111.2", "@hpcc-js/common": "2.71.11", - "@hpcc-js/comms": "2.86.0", + "@hpcc-js/comms": "2.87.0", "@hpcc-js/ddl-shim": "2.20.5", "@hpcc-js/dgrid2": "2.3.11", "@hpcc-js/loader": "2.104.28", @@ -971,9 +971,9 @@ } }, "node_modules/@hpcc-js/comms": { - "version": "2.86.0", - "resolved": "https://registry.npmjs.org/@hpcc-js/comms/-/comms-2.86.0.tgz", - "integrity": "sha512-+oNr7s/YFr4+quKK4ZBpWT/KjLO/0ZLXqg+aIY2leqL6Euog7z/VbA/6ClRdWNFblyxtgi47hH2rWR2Hd+vs4g==", + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/@hpcc-js/comms/-/comms-2.87.0.tgz", + "integrity": "sha512-ZEAu/i96kces6nKZOBMbtkgZalRIMYH9gxvRdOg+URK1vTQ6g/RnO6MKxc0BG73ttCMbWVP6Un1XxRAa/sb2Vw==", "dev": true, "dependencies": { "@hpcc-js/ddl-shim": "^2.20.6", @@ -983,7 +983,7 @@ "node-fetch": "2.7.0", "safe-buffer": "5.2.1", "tmp": "0.2.1", - "undici": "5.26.3" + "undici": "5.28.2" } }, "node_modules/@hpcc-js/comms/node_modules/@hpcc-js/ddl-shim": { @@ -13817,9 +13817,9 @@ "dev": true }, "node_modules/undici": { - "version": "5.26.3", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.26.3.tgz", - "integrity": "sha512-H7n2zmKEWgOllKkIUkLvFmsJQj062lSm3uA4EYApG8gLuiOM0/go9bIoC3HVaSnfg4xunowDE2i9p8drkXuvDw==", + "version": "5.28.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.2.tgz", + "integrity": "sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==", "dev": true, "dependencies": { "@fastify/busboy": "^2.0.0" diff --git a/package.json b/package.json index 9cdb94e..8ad4631 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "devDependencies": { "@fluentui/react": "8.111.2", "@hpcc-js/common": "2.71.11", - "@hpcc-js/comms": "2.86.0", + "@hpcc-js/comms": "2.87.0", "@hpcc-js/ddl-shim": "2.20.5", "@hpcc-js/dgrid2": "2.3.11", "@hpcc-js/loader": "2.104.28", @@ -461,6 +461,26 @@ "category": "ECL", "title": "%Waiting%" }, + { + "command": "hpccPlatform.moveJobUp", + "category": "ECL", + "title": "%Up%" + }, + { + "command": "hpccPlatform.moveJobDown", + "category": "ECL", + "title": "%Down%" + }, + { + "command": "hpccPlatform.moveJobBack", + "category": "ECL", + "title": "%Back%" + }, + { + "command": "hpccPlatform.moveJobFront", + "category": "ECL", + "title": "%Front%" + }, { "command": "hpccPlatform.refresh", "category": "ECL", @@ -716,9 +736,31 @@ { "id": "setState", "label": "%Set State%" + }, + { + "id": "setPriority", + "label": "%Set Priority%" } ], "menus": { + "setPriority": [ + { + "command": "hpccPlatform.moveJobUp", + "group": "set@01" + }, + { + "command": "hpccPlatform.moveJobDown", + "group": "set@02" + }, + { + "command": "hpccPlatform.moveJobBack", + "group": "set@03" + }, + { + "command": "hpccPlatform.moveJobFront", + "group": "set@04" + } + ], "setState": [ { "command": "hpccPlatform.setStateCompiled", @@ -970,6 +1012,10 @@ "when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/", "group": "3action@920" }, + { + "submenu": "setPriority", + "group": "3action@940" + }, { "submenu": "setState", "group": "3action@950" diff --git a/package.nls.json b/package.nls.json index 23cf907..ebf6e65 100644 --- a/package.nls.json +++ b/package.nls.json @@ -13,6 +13,7 @@ "Auto Detect": "Auto Detect", "Auto Detect Client Tools": "Auto Detect Client Tools", "Automatically open Workunits on creation": "Automatically open Workunits on creation", + "Back": "Back", "Blocked": "Blocked", "Browse ECL Watch": "Browse ECL Watch", "Browse Metrics": "Browse Metrics", @@ -38,6 +39,7 @@ "Default timeout (secs)": "Default timeout (secs)", "Delete Workunit": "Delete Workunit", "Digitally sign ECL file": "Digitally sign ECL file", + "Down": "Down", "ECL Client Tools Terminal": "ECL Client Tools Terminal", "ECL Watch": "ECL Watch", "Edit Dashboard": "Edit Dashboard", @@ -45,6 +47,7 @@ "Failed": "Failed", "For the currently selected text, search the online ECL language reference": "For the currently selected text, search the online ECL language reference", "Force global 'proxySupport' to 'fallback'": "Force global 'proxySupport' to 'fallback'", + "Front": "Front", "Generate": "Generate", "Generate ECL on save": "Generate ECL on save", "Generate source from KEL file": "Generate source from KEL file", @@ -101,7 +104,7 @@ "Server path": "Server path", "Server port": "Server port", "Server protocol (http or https)": "Server protocol (http or https)", - "Set State": "Set State", + "Set Priority": "Set Priority", "Show results after submitting a workunit": "Show results after submitting a workunit", "Showing \"my\" workunits": "Showing \"my\" workunits", "Showing all workunits": "Showing all workunits", @@ -124,6 +127,7 @@ "Terminal": "Terminal", "Uninstall": "Uninstall", "Uninstall Bundle": "Uninstall Bundle", + "Up": "Up", "User ID": "User ID", "User password": "User password", "Verify ECL Digital Signature": "Verify ECL Digital Signature", diff --git a/src/ecl/eclWatchTree.ts b/src/ecl/eclWatchTree.ts index 96e1ad5..6e29cd3 100644 --- a/src/ecl/eclWatchTree.ts +++ b/src/ecl/eclWatchTree.ts @@ -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"; @@ -93,6 +93,21 @@ export class ECLWatchTree extends Tree { 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(); }); @@ -448,6 +463,46 @@ export class ECLWUNode extends Item { this._wu.abort().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({