Skip to content

Commit 2268ecf

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix-194
2 parents a647190 + b32e271 commit 2268ecf

File tree

9 files changed

+63
-17
lines changed

9 files changed

+63
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# InterSystems Server Manager
22

3-
> **Note:** The best way to install and use this extension is by installing the [InterSystems ObjectScript Extension Pack](https://marketplace.visualstudio.com/items?itemName=intersystems-community.objectscript-pack) and following the [documentation here](https://intersystems-community.github.io/vscode-objectscript/).
3+
> **Note:** The best way to install and use this extension is by installing the [InterSystems ObjectScript Extension Pack](https://marketplace.visualstudio.com/items?itemName=intersystems-community.objectscript-pack) and following the [documentation here](https://docs.intersystems.com/components/csp/docbook/DocBook.UI.Page.cls?KEY=GVSCO).
44
55
InterSystems Server Manager is a Visual Studio Code extension for defining connections to [InterSystems](https://www.intersystems.com/) servers. These definitions can used by other VS Code extensions when they make connections. One example is the [ObjectScript extension](https://github.com/intersystems-community/vscode-objectscript) for code editing. The [Launch WebTerminals](https://marketplace.visualstudio.com/items?itemName=georgejames.webterminal-vscode) extension is another.
66

package-lock.json

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

package.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"tough-cookie": "^4.1.3"
5151
},
5252
"devDependencies": {
53-
"@intersystems-community/intersystems-servermanager": "latest",
53+
"@intersystems-community/intersystems-servermanager": "^3.4.1",
5454
"@types/vscode": "^1.75.0",
5555
"@types/glob": "^7.1.1",
5656
"@types/mocha": "^9.0.0",
@@ -181,6 +181,38 @@
181181
],
182182
"additionalProperties": false
183183
},
184+
"superServer": {
185+
"type": "object",
186+
"description": "InterSystems server's superserver.",
187+
"properties": {
188+
"host": {
189+
"type": "string",
190+
"description": "Hostname or IP address of the InterSystems server. If omitted, uses the value of 'webServer.host'.",
191+
"anyOf": [
192+
{
193+
"format": "hostname"
194+
},
195+
{
196+
"format": "ipv4"
197+
},
198+
{
199+
"format": "ipv6"
200+
}
201+
]
202+
},
203+
"port": {
204+
"type": "integer",
205+
"description": "TCP port number the superserver listens on.",
206+
"minimum": 1,
207+
"maximum": 65535,
208+
"default": 1972
209+
}
210+
},
211+
"required": [
212+
"port"
213+
],
214+
"additionalProperties": false
215+
},
184216
"username": {
185217
"type": "string",
186218
"description": "Username to connect as. If not set here it must be provided when connecting."

src/api/addServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export async function addServer(
110110
return name;
111111
} catch (error) {
112112
vscode.window.showErrorMessage(
113-
"Failed to store server '${name}' definition.",
113+
`Failed to store server '${name}' definition. Does your settings.json file contain a JSON syntax error?`,
114114
);
115115
return undefined;
116116
}

src/api/getServerSpec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export async function getServerSpec(
3838
server.webServer.scheme = server.webServer.scheme || "http";
3939
server.webServer.port = server.webServer.port || (server.webServer.scheme === "https" ? 443 : 80);
4040
server.webServer.pathPrefix = server.webServer.pathPrefix || "";
41+
if (server.superServer) {
42+
// Fall back to default if appropriate
43+
server.superServer.host = server.superServer.host || server.webServer.host;
44+
}
4145

4246

4347
// When authentication provider is being used we should only have a password if it came from the deprecated

src/ui/serverManagerView.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ async function serverFeatures(element: ServerTreeItem, params?: any): Promise<Fe
379379

380380
const response = await makeRESTRequest("HEAD", serverSpec);
381381
if (!response || response.status !== 200) {
382-
children.push(new OfflineTreeItem({ parent: element, label: name, id: name }, element.name));
382+
children.push(new OfflineTreeItem({ parent: element, label: name, id: name }, serverSpec.username || 'UnknownUser'));
383383
credentialCache[name] = undefined;
384384
} else {
385385
children.push(new NamespacesTreeItem({ parent: element, label: name, id: name }, element.name, serverSpec.username || 'UnknownUser'));
@@ -397,14 +397,14 @@ export class OfflineTreeItem extends FeatureTreeItem {
397397
public readonly name: string;
398398
constructor(
399399
element: ISMItem,
400-
serverName: string,
400+
username: string,
401401
) {
402402
const parentFolderId = element.parent?.id || "";
403403
super({
404404
id: parentFolderId + ":offline",
405405
label: `Unavailable at ${new Date().toLocaleTimeString()}`,
406406
parent: element.parent,
407-
tooltip: `Server could not be reached`,
407+
tooltip: `Server could not be accessed by '${username}'`,
408408
});
409409
this.name = "offline";
410410
this.contextValue = "offline";
@@ -454,7 +454,7 @@ async function serverNamespaces(element: ServerTreeItem, params?: any): Promise<
454454

455455
const response = await makeRESTRequest("GET", serverSpec);
456456
if (!response || response.status !== 200) {
457-
children.push(new OfflineTreeItem({ parent: element, label: name, id: name }, element.name));
457+
children.push(new OfflineTreeItem({ parent: element, label: name, id: name }, serverSpec.username || 'UnknownUser'));
458458
credentialCache[params.serverName] = undefined;
459459
} else {
460460
response.data.result.content.namespaces.map((namespace) => {

types/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Package defining the interfaces used in the API that is published by the `inters
66

77
# Changelog
88

9+
### v3.4.1
10+
11+
- Add optional `superServer` object.
12+
913
### v3.0.4
1014

1115
- Export constants correctly.

types/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ export interface IWebServerSpec {
1414
pathPrefix?: string;
1515
}
1616

17+
export interface ISuperServerSpec {
18+
host?: string;
19+
port: number;
20+
}
21+
1722
export interface IJSONServerSpec {
1823
webServer: IWebServerSpec;
24+
superServer?: ISuperServerSpec;
1925
username?: string;
2026
password?: string;
2127
description?: string;

types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@intersystems-community/intersystems-servermanager",
3-
"version": "3.0.4",
3+
"version": "3.4.1",
44
"description": "InterSystems Server Manager VS Code extension API interfaces and constants",
55
"types": "index.d.ts",
66
"main": "index.js",

0 commit comments

Comments
 (0)