Skip to content

Commit

Permalink
Merge pull request #374 from dehilsterlexis/ADD_SET_PRIORITY
Browse files Browse the repository at this point in the history
feat: add set priority to workunit context menu
  • Loading branch information
GordonSmith authored Feb 6, 2024
2 parents a34688c + d1ad237 commit 0b4ffd2
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 11 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 47 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -970,6 +1012,10 @@
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "3action@920"
},
{
"submenu": "setPriority",
"group": "3action@940"
},
{
"submenu": "setState",
"group": "3action@950"
Expand Down
6 changes: 5 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -38,13 +39,15 @@
"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",
"Export ECL Markdown to HTML": "Export ECL Markdown to HTML",
"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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
57 changes: 56 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 @@ -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();
});
Expand Down Expand Up @@ -448,6 +463,46 @@ export class ECLWUNode extends Item<ECLWatchTree> {
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({
Expand Down

0 comments on commit 0b4ffd2

Please sign in to comment.