Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V.1.9.0 dev to main #461

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions src/classes/localConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
30 changes: 16 additions & 14 deletions src/webview/components/kdbNewConnectionView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -366,7 +367,7 @@ export class KdbNewConnectionView extends LitElement {
<sl-select
id="selectLabel"
class="dropdown larger"
.value="${live(this.labels[pos])}"
value="${live(this.labels[pos])}"
@sl-change="${(event: Event) => {
this.updateLabelValue(pos, event);
}}">
Expand All @@ -389,26 +390,27 @@ export class KdbNewConnectionView extends LitElement {
}

renderLblDropdownOptions(pos: number) {
console.log(this.labels);
return html`
<sl-select placeholder="No Label Selected">
<sl-option> No Label Selected </sl-option>
${repeat(
this.lblNamesList,
(lbl) => lbl.name,
(lbl) => html`
<sl-option
.value="${live(lbl.name)}"
?selected="${lbl.name === this.labels[pos]}">
<sl-option> No Label Selected </sl-option>
${repeat(
this.lblNamesList,
(lbl) => lbl,
(lbl) => {
console.log(lbl.name);
console.log(lbl.name === this.labels[pos]);
return html`
<sl-option .value="${lbl.name}">
<span>
<div
style="width: 10px; height: 10px; background: ${lbl.color
.colorHex}; border-radius: 50%; float: left; margin-right: 10px; margin-top: 3px;"></div>
${lbl.name}
</span>
</sl-option>
`,
)}
</sl-select>
`;
},
)}
`;
}

Expand Down Expand Up @@ -998,7 +1000,7 @@ export class KdbNewConnectionView extends LitElement {
},
});
setTimeout(() => {
this.labels.unshift(this.newLblName);
this.labels.push(this.newLblName);
this.closeModal();
}, 500);
}
Expand Down
Loading