Skip to content

Commit f0d9fed

Browse files
committed
feat: Add preferredECLWatch setting
fixes #438 Signed-off-by: Gordon Smith <[email protected]>
1 parent 352ad08 commit f0d9fed

15 files changed

+1515
-828
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ This extension adds rich language support for [HPCC Systems](https://hpccsystems
1111

1212
## Recent Highlights
1313

14+
### v2.30.x
15+
* Added `ecl.preferredECLWatch` setting, allows user to nominate preferred version of ECL Watch when opening "external" pages.
16+
1417
### v2.24.x
1518
* Added context menu to ECL bundles and ECL Client Tools
1619
* Added `ecl.WUShowResults` setting, allows user to control how results are displayed after submitting a workunit.
@@ -265,6 +268,9 @@ The following Visual Studio Code settings are available for the ECL extension.
265268

266269
// Ping interval (secs, -1 to disable)
267270
"ecl.pingInterval": 5
271+
272+
// Preferred version of ECL Watch (default v9).
273+
"ecl.preferredECLWatch": v9 | v5
268274
```
269275

270276
#### ECL Launch Settings

package-lock.json

Lines changed: 1337 additions & 731 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -56,66 +56,66 @@
5656
"html-to-text": "9.0.5"
5757
},
5858
"devDependencies": {
59-
"@eslint/js": "9.9.1",
60-
"@fluentui/react": "8.120.7",
61-
"@hpcc-js/common": "2.72.0",
62-
"@hpcc-js/comms": "2.95.0",
63-
"@hpcc-js/ddl-shim": "2.21.0",
64-
"@hpcc-js/dgrid2": "2.4.0",
65-
"@hpcc-js/esbuild-plugins": "1.1.2",
66-
"@hpcc-js/loader": "2.106.7",
67-
"@hpcc-js/marshaller": "2.26.4",
59+
"@eslint/js": "9.21.0",
60+
"@fluentui/react": "8.122.11",
61+
"@hpcc-js/common": "2.73.0",
62+
"@hpcc-js/comms": "2.99.0",
63+
"@hpcc-js/ddl-shim": "2.22.0",
64+
"@hpcc-js/dgrid2": "2.5.0",
65+
"@hpcc-js/esbuild-plugins": "1.4.0",
66+
"@hpcc-js/loader": "2.107.2",
67+
"@hpcc-js/marshaller": "2.27.2",
6868
"@hpcc-js/observable-shim": "2.6.0",
69-
"@hpcc-js/observablehq-compiler": "1.3.0",
70-
"@hpcc-js/util": "2.52.0",
71-
"@hpcc-js/wasm-expat": "1.3.0",
69+
"@hpcc-js/observablehq-compiler": "1.4.0",
70+
"@hpcc-js/util": "2.53.0",
71+
"@hpcc-js/wasm-expat": "1.3.2",
7272
"@hpcc-js/wasm-llama": "1.0.0",
73-
"@hpcc-js/wasm-zstd": "1.2.0",
73+
"@hpcc-js/wasm-zstd": "1.2.1",
7474
"@langchain/community": "0.3.10",
7575
"@langchain/core": "0.2.31",
7676
"@langchain/ollama": "0.0.4",
7777
"@observablehq/inspector": "5.0.1",
7878
"@observablehq/parser": "6.1.0",
7979
"@observablehq/runtime": "5.9.9",
8080
"@observablehq/stdlib": "5.8.8",
81-
"@octokit/rest": "21.0.2",
82-
"@types/mocha": "10.0.7",
83-
"@types/node": "20.16.5",
84-
"@types/react": "17.0.80",
85-
"@types/react-dom": "17.0.25",
81+
"@octokit/rest": "21.1.1",
82+
"@types/mocha": "10.0.10",
83+
"@types/node": "20.17.19",
84+
"@types/react": "17.0.83",
85+
"@types/react-dom": "17.0.26",
8686
"@types/tmp": "0.2.6",
8787
"@types/vscode": "1.92.0",
8888
"@types/vscode-notebook-renderer": "1.72.3",
89-
"@typescript-eslint/eslint-plugin": "8.4.0",
90-
"@typescript-eslint/parser": "8.4.0",
91-
"@vscode/debugadapter": "1.67.0",
92-
"@vscode/debugprotocol": "1.67.0",
93-
"@vscode/extension-telemetry": "0.9.7",
94-
"@vscode/vsce": "3.1.0",
89+
"@typescript-eslint/eslint-plugin": "8.25.0",
90+
"@typescript-eslint/parser": "8.25.0",
91+
"@vscode/debugadapter": "1.68.0",
92+
"@vscode/debugprotocol": "1.68.0",
93+
"@vscode/extension-telemetry": "0.9.8",
94+
"@vscode/vsce": "3.2.2",
9595
"adm-zip": "0.5.16",
9696
"antlr4": "4.13.2",
9797
"assert": "2.1.0",
9898
"copy-to-clipboard": "3.3.3",
9999
"copyfiles": "2.4.1",
100100
"csv-writer": "1.6.0",
101101
"diff": "5.2.0",
102-
"esbuild": "0.23.1",
102+
"esbuild": "0.25.0",
103103
"esbuild-copy-static-files": "0.1.0",
104104
"esbuild-plugin-text-replace": "1.3.0",
105105
"esbuild-plugin-umd-wrapper": "3.0.0",
106-
"eslint": "8.57.0",
106+
"eslint": "8.57.1",
107107
"eslint-plugin-react-hooks": "4.6.2",
108108
"langchain": "0.2.20",
109-
"mocha": "10.7.3",
109+
"mocha": "10.8.2",
110110
"npm-run-all": "4.1.5",
111111
"react": "17.0.2",
112112
"react-dom": "17.0.2",
113113
"rimraf": "6.0.1",
114114
"run-script-os": "^1.1.6",
115115
"standard-version": "9.5.0",
116-
"tslib": "2.7.0",
116+
"tslib": "2.8.1",
117117
"typescript": "5.5.4",
118-
"typescript-eslint": "8.4.0",
118+
"typescript-eslint": "8.25.0",
119119
"use-resize-observer": "9.1.0",
120120
"uuid": "10.0.0",
121121
"yargs": "^17.7.2"
@@ -1415,6 +1415,16 @@
14151415
"default": "internal",
14161416
"description": "%Show results after submitting a workunit%"
14171417
},
1418+
"ecl.preferredECLWatch": {
1419+
"type": "string",
1420+
"scope": "resource",
1421+
"enum": [
1422+
"v9",
1423+
"v5"
1424+
],
1425+
"default": "v9",
1426+
"description": "%Preferred version of ECL Watch%"
1427+
},
14181428
"ecl.forceProxySupport": {
14191429
"type": "boolean",
14201430
"scope": "resource",
@@ -1686,4 +1696,4 @@
16861696
}
16871697
]
16881698
}
1689-
}
1699+
}

package.nls.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"Back": "Back",
1717
"Blocked": "Blocked",
1818
"Browse Details": "Browse Details",
19-
"Browse Results": "Browse Results",
2019
"Browse Metrics": "Browse Metrics",
2120
"Browse Result": "Browse Result",
21+
"Browse Results": "Browse Results",
2222
"Build flags, to be passed to the eclcc compiler": "Build flags, to be passed to the eclcc compiler",
2323
"Bundles": "Bundles",
2424
"Bundles Homepage": "Bundles Homepage",
@@ -89,6 +89,7 @@
8989
"Pin launch configuration to current document": "Pin launch configuration to current document",
9090
"Ping interval (secs, -1 to disable)": "Ping interval (secs, -1 to disable)",
9191
"Pinned launch configurations": "Pinned launch configurations",
92+
"Preferred version of ECL Watch": "Preferred version of ECL Watch",
9293
"Private": "Private",
9394
"Protect Workunit": "Protect Workunit",
9495
"Public": "Public",
@@ -105,10 +106,10 @@
105106
"Running": "Running",
106107
"Save + check syntax of current file": "Save + check syntax of current file",
107108
"Save All + check syntax of all files": "Save All + check syntax of all files",
108-
"Save Results": "Save Results",
109109
"Save file prior to submission": "Save file prior to submission",
110110
"Save file prior to syntax check": "Save file prior to syntax check",
111111
"Save Result": "Save Result",
112+
"Save Results": "Save Results",
112113
"Scheduled": "Scheduled",
113114
"Select Client Tools Version": "Select Client Tools Version",
114115
"Select Client Tools Version from available options": "Select Client Tools Version from available options",

src/ecl/command.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ export class ECLCommands {
112112
}
113113
}
114114

115-
showWUDetails(launchRequestArgs: LaunchRequestArguments, wuid: string, result?: number) {
116-
eclWatchPanelView.navigateTo(launchRequestArgs, wuid, result);
115+
showWUDetails(launchRequestArgs: LaunchRequestArguments, wuid: string, resultName?: string) {
116+
eclWatchPanelView.navigateTo(launchRequestArgs, wuid, resultName);
117117
}
118118

119119
openECLWatchExternal(source: ECLWUNode | ECLResultNode) {
@@ -126,7 +126,7 @@ export class ECLCommands {
126126
}
127127

128128
openResult(source: ECLResultNode) {
129-
eclWatchPanelView.navigateTo(sessionManager.session.launchRequestArgs, source.getWU().Wuid, source.getResult().Sequence);
129+
eclWatchPanelView.navigateTo(sessionManager.session.launchRequestArgs, source.getWU().Wuid, source.getResult().Name);
130130
}
131131

132132
browseResult(source: ECLResultNode) {

src/ecl/documentSymbolProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class ECLDocumentSymbolProvider implements vscode.DocumentSymbolProvider
9595
metaWorkspace = attachWorkspace(wsFolder.uri.fsPath);
9696
} else if (vscode.workspace.workspaceFolders) {
9797
for (const wuf of vscode.workspace.workspaceFolders) {
98-
if (wuf.uri !== wsFolder.uri) {
98+
if (wuf.uri !== wsFolder?.uri) {
9999
metaWorkspace = attachWorkspace(wuf.uri.fsPath);
100100
break;
101101
}

src/ecl/eclWatchPanelView.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { Messages } from "../eclwatch/messages";
88

99
interface NavigateParams extends LaunchRequestArguments {
1010
wuid: string;
11-
result?: number;
11+
resultName?: string;
1212
show: boolean;
1313
}
1414

@@ -33,15 +33,15 @@ export class ECLWatchPanelView implements vscode.WebviewViewProvider {
3333
}));
3434

3535
sessionManager.onDidChangeSession(launchRequestArgs => {
36-
this.navigateTo(launchRequestArgs, "", 0, false);
36+
this.navigateTo(launchRequestArgs, undefined, undefined, false);
3737
});
3838

3939
vscode.commands.registerCommand("ecl.watch.lite.openECLWatchExternal", async () => {
4040
if (this._currParams) {
41-
if (this._currParams.result === undefined) {
41+
if (this._currParams.resultName === undefined) {
4242
vscode.env.openExternal(vscode.Uri.parse(wuDetailsUrl(this._currParams, this._currParams.wuid)));
4343
} else {
44-
vscode.env.openExternal(vscode.Uri.parse(wuResultUrl(this._currParams, this._currParams.wuid, this._currParams.result)));
44+
vscode.env.openExternal(vscode.Uri.parse(wuResultUrl(this._currParams, this._currParams.wuid, this._currParams.resultName)));
4545
}
4646
}
4747
});
@@ -78,7 +78,7 @@ export class ECLWatchPanelView implements vscode.WebviewViewProvider {
7878
switch (message.command) {
7979
case "loaded":
8080
if (this._initialParams) {
81-
this.navigateTo(this._initialParams, this._initialParams.wuid, this._initialParams.result, this._initialParams.show);
81+
this.navigateTo(this._initialParams, this._initialParams.wuid, this._initialParams.resultName, this._initialParams.show);
8282
delete this._initialParams;
8383
} else {
8484
this._webviewView.title = this._currParams?.wuid;
@@ -114,9 +114,9 @@ export class ECLWatchPanelView implements vscode.WebviewViewProvider {
114114
}
115115

116116
private _prevHash: string;
117-
navigateTo(launchRequestArgs: LaunchRequestArguments, wuid: string, result?: number, show = true) {
117+
navigateTo(launchRequestArgs: LaunchRequestArguments, wuid: string, resultName?: string, show = true) {
118118
const { protocol, serverAddress, port, path, user, password, rejectUnauthorized, name, type, targetCluster } = launchRequestArgs;
119-
this._currParams = { protocol, serverAddress, port, path, user, password, rejectUnauthorized, name, type, targetCluster, wuid, result, show };
119+
this._currParams = { protocol, serverAddress, port, path, user, password, rejectUnauthorized, name, type, targetCluster, wuid, resultName, show };
120120
if (!this._webviewView) {
121121
this._initialParams = this._currParams;
122122
if (show) {
@@ -136,7 +136,7 @@ export class ECLWatchPanelView implements vscode.WebviewViewProvider {
136136
rejectUnauthorized: this._currParams.rejectUnauthorized,
137137
timeoutSecs: this._currParams.timeoutSecs,
138138
wuid: this._currParams.wuid,
139-
result: this._currParams.result
139+
result: this._currParams.resultName
140140
}
141141
} as Messages);
142142
if (show) {

src/ecl/eclWatchTree.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import localize from "../util/localize";
55
import { Item, Tree } from "./tree";
66
import { eclWatchPanelView } from "./eclWatchPanelView";
77
import { SaveData } from "./saveData";
8+
import { formatWorkunitURL, formatResultURL, formatResultsURL, formatMetricsURL } from "./util";
89

910
const PrevWeeks: string[] = [localize("Last Week"), localize("Two Weeks Ago"), localize("Three Weeks Ago"), localize("Four Weeks Ago"), localize("Five Weeks Ago"), localize("Six Weeks Ago"), localize("Seven Weeks Ago")];
1011

@@ -35,8 +36,7 @@ export class ECLWatchTree extends Tree {
3536
case "disabled":
3637
break;
3738
case "external":
38-
// vscode.env.openExternal(vscode.Uri.parse(`${evt.workunit.BaseUrl}/esp/files/stub.htm?Widget=WUDetailsWidget&Wuid=${evt.workunit.Wuid}`));
39-
vscode.env.openExternal(vscode.Uri.parse(`${evt.workunit.BaseUrl}/esp/files/index.html#/workunits/${evt.workunit.Wuid}`));
39+
vscode.env.openExternal(vscode.Uri.parse(formatWorkunitURL(evt.workunit.BaseUrl, evt.workunit.Wuid)));
4040
break;
4141
case "internal":
4242
default:
@@ -326,7 +326,7 @@ export class ECLResultNode extends Item<ECLWatchTree> {
326326

327327
constructor(wu: Workunit, tree: ECLWatchTree, private _result: Result) {
328328
super(tree);
329-
this.url = `${this._result.BaseUrl}esp/files/index.html#/workunits/${this._result.Wuid}/outputs/${this._result.Name}`;
329+
this.url = formatResultURL(this._result.BaseUrl, this._result.Wuid, this._result.Name);
330330
this.wu = wu;
331331
}
332332

@@ -390,11 +390,15 @@ export class ECLWUNode extends Item<ECLWatchTree> {
390390
private _wu: Workunit;
391391

392392
readonly url: string;
393+
readonly resultsUrl: string;
394+
readonly metricsUrl: string;
393395

394396
constructor(tree: ECLWatchTree, wu: Workunit) {
395397
super(tree);
396398
this._wu = wu;
397-
this.url = `${wu.BaseUrl}esp/files/index.html#/workunits/${wu.Wuid}`;
399+
this.url = formatWorkunitURL(wu.BaseUrl, wu.Wuid);
400+
this.resultsUrl = formatResultsURL(wu.BaseUrl, wu.Wuid);
401+
this.metricsUrl = formatMetricsURL(wu.BaseUrl, wu.Wuid);
398402
if (!this._wu.isComplete()) {
399403
this._wu.watchUntilComplete(changes => {
400404
tree.refresh(this);
@@ -455,11 +459,11 @@ export class ECLWUNode extends Item<ECLWatchTree> {
455459
}
456460

457461
browseResults() {
458-
vscode.env.openExternal(vscode.Uri.parse(this.url + "/outputs"));
462+
vscode.env.openExternal(vscode.Uri.parse(this.resultsUrl));
459463
}
460464

461465
browseMetrics() {
462-
vscode.env.openExternal(vscode.Uri.parse(this.url + "/metrics"));
466+
vscode.env.openExternal(vscode.Uri.parse(this.metricsUrl));
463467
}
464468

465469
browseWUDetails() {

src/ecl/util.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,48 @@ export function initLogger(level: Level) {
2525
logger.writer(new VSCodeWriter());
2626
logger.level(level);
2727
}
28+
29+
export function formatECLWatchURL(baseUrl: string): string {
30+
const eclConfig = vscode.workspace.getConfiguration("ecl");
31+
if (eclConfig.get("preferredECLWatch") === "v5") {
32+
return `${baseUrl}esp/files/stub.htm`;
33+
} else {
34+
return `${baseUrl}esp/files/index.html`;
35+
}
36+
}
37+
38+
export function formatWorkunitURL(baseUrl: string, wuid: string): string {
39+
const eclConfig = vscode.workspace.getConfiguration("ecl");
40+
if (eclConfig.get("preferredECLWatch") === "v5") {
41+
return `${baseUrl}esp/files/stub.htm?Wuid=${wuid}&Widget=WUDetailsWidget#/stub/Summary`;
42+
} else {
43+
return `${baseUrl}esp/files/index.html#/workunits/${wuid}`;
44+
}
45+
}
46+
47+
export function formatResultsURL(baseUrl: string, wuid: string): string {
48+
const eclConfig = vscode.workspace.getConfiguration("ecl");
49+
if (eclConfig.get("preferredECLWatch") === "v5") {
50+
return `${baseUrl}esp/files/stub.htm?Wuid=${wuid}&Widget=ResultsWidget#/stub/Grid`;
51+
} else {
52+
return `${baseUrl}esp/files/index.html#/workunits/${wuid}/outputs`;
53+
}
54+
}
55+
56+
export function formatMetricsURL(baseUrl: string, wuid: string): string {
57+
const eclConfig = vscode.workspace.getConfiguration("ecl");
58+
if (eclConfig.get("preferredECLWatch") === "v5") {
59+
return `${baseUrl}esp/files/stub.htm?Wuid=${wuid}&Widget=GraphsWUWidget#/stub/Grid`;
60+
} else {
61+
return `${baseUrl}esp/files/index.html#/workunits/${wuid}/metrics`;
62+
}
63+
}
64+
65+
export function formatResultURL(baseUrl: string, wuid: string, name: string): string {
66+
const eclConfig = vscode.workspace.getConfiguration("ecl");
67+
if (eclConfig.get("preferredECLWatch") === "v5") {
68+
return `${baseUrl}esp/files/stub.htm?Wuid=${wuid}&Name=${name}&Widget=ResultWidget`;
69+
} else {
70+
return `${baseUrl}esp/files/index.html#/workunits/${wuid}/outputs/${name}`;
71+
}
72+
}

src/eclwatch/Frame.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const Frame: React.FunctionComponent<FrameProps> = () => {
1818
return <ThemeProvider style={{ height: "100%" }}>
1919
{
2020
state ?
21-
<WUDetails opts={state} wuid={state.wuid} sequence={state.result}></WUDetails> :
21+
<WUDetails opts={state} wuid={state.wuid} name={state.resultName}></WUDetails> :
2222
<div>...loading...</div>
2323
}
2424
</ThemeProvider >;

0 commit comments

Comments
 (0)