Skip to content

Commit

Permalink
Merge pull request #446 from KxSystems/KXI-55598
Browse files Browse the repository at this point in the history
migrate from vscode ui to sl
  • Loading branch information
Philip-Carneiro-KX authored Oct 29, 2024
2 parents 95932b6 + 4ad7c32 commit 9dd4f8a
Show file tree
Hide file tree
Showing 6 changed files with 327 additions and 260 deletions.
6 changes: 5 additions & 1 deletion src/models/connectionsModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
* specific language governing permissions and limitations under the License.
*/

//TODO: start to migrate all connections models to here
export const enum ConnectionType {
BundledQ,
Kdb,
Insights,
}

export enum ServerType {
INSIGHTS,
Expand Down
7 changes: 1 addition & 6 deletions src/models/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* specific language governing permissions and limitations under the License.
*/

import { ConnectionType } from "./connectionsModels";
import { DataSourceFiles } from "./dataSource";
import { MetaObjectPayload } from "./meta";

Expand Down Expand Up @@ -44,12 +45,6 @@ export interface DataSourceMessage2 {
dataSourceFile: DataSourceFiles;
}

export const enum ConnectionType {
BundledQ,
Kdb,
Insights,
}

export interface EditConnectionMessage {
connType: ConnectionType;
serverName: string;
Expand Down
19 changes: 14 additions & 5 deletions src/panels/newConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import { getUri } from "../utils/getUri";
import { getNonce } from "../utils/getNonce";
import { ext } from "../extensionVariables";
import { InsightsNode, KdbNode } from "../services/kdbTreeProvider";
import { ConnectionType, EditConnectionMessage } from "../models/messages";
import { EditConnectionMessage } from "../models/messages";
import { retrieveConnLabelsNames } from "../utils/connLabel";
import { ConnectionType } from "../models/connectionsModels";

export class NewConnectionPannel {
public static currentPanel: NewConnectionPannel | undefined;
Expand Down Expand Up @@ -176,17 +177,25 @@ export class NewConnectionPannel {
webview: vscode.Webview,
extensionUri: vscode.Uri,
) {
const webviewUri = getUri(webview, extensionUri, ["out", "webview.js"]);
const nonce = getNonce();
const getResource = (resource: string) =>
getUri(webview, extensionUri, ["out", resource]);

return /* html */ `
<!DOCTYPE html>
<html lang="en">
<html lang="en" class="${
vscode.window.activeColorTheme.kind === vscode.ColorThemeKind.Light ||
vscode.window.activeColorTheme.kind ===
vscode.ColorThemeKind.HighContrastLight
? "sl-theme-light"
: "sl-theme-dark"
}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Connection</title>
<script type="module" nonce="${nonce}" src="${webviewUri}"></script>
<link rel="stylesheet" href="${getResource("light.css")}" />
<link rel="stylesheet" href="${getResource("style.css")}" />
<script type="module" nonce="${getNonce()}" src="${getResource("webview.js")}"></script>
</head>
<body>
<kdb-new-connection-view/>
Expand Down
Loading

0 comments on commit 9dd4f8a

Please sign in to comment.