diff --git a/src/classes/localConnection.ts b/src/classes/localConnection.ts index ae6469fc..0dfc46dd 100644 --- a/src/classes/localConnection.ts +++ b/src/classes/localConnection.ts @@ -76,12 +76,31 @@ export class LocalConnection { if (err || !conn) { ext.serverProvider.reload(); - window.showErrorMessage( - `Connection to server ${this.options.host}:${this.options.port} failed! Details: ${err?.message}`, - ); + if (this.connLabel.endsWith("[local]")) { + window + .showErrorMessage( + `Connection to server ${this.options.host}:${this.options.port} failed.`, + "Start q process", + ) + .then((res) => { + if (res) { + commands.executeCommand( + "kdb.startLocalProcess", + ext.connectionsList.find( + (conn) => conn.label === this.connLabel, + ), + ); + } + }); + } else { + window.showErrorMessage( + `Connection to server ${this.options.host}:${this.options.port} failed.`, + ); + } + kdbOutputLog( `Connection to server ${this.options.host}:${this.options.port} failed! Details: ${err?.message}`, - "ERROR", + "CONNECTION", ); return; } diff --git a/src/webview/components/kdbNewConnectionView.ts b/src/webview/components/kdbNewConnectionView.ts index b1e278f1..f2df287c 100644 --- a/src/webview/components/kdbNewConnectionView.ts +++ b/src/webview/components/kdbNewConnectionView.ts @@ -143,6 +143,7 @@ export class KdbNewConnectionView extends LitElement { handleMessage(event: { data: any }) { const message = event.data; + console.log(message); if (message.command === "editConnection") { this.connectionData = message.data; this.labels = message.labels; @@ -366,7 +367,7 @@ export class KdbNewConnectionView extends LitElement { @@ -389,16 +390,17 @@ export class KdbNewConnectionView extends LitElement { } renderLblDropdownOptions(pos: number) { + console.log(this.labels); return html` - - No Label Selected - ${repeat( - this.lblNamesList, - (lbl) => lbl.name, - (lbl) => html` - + No Label Selected + ${repeat( + this.lblNamesList, + (lbl) => lbl, + (lbl) => { + console.log(lbl.name); + console.log(lbl.name === this.labels[pos]); + return html` +