Skip to content

Commit

Permalink
add ds icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip-Carneiro-KX committed May 2, 2024
1 parent 8f8b8ab commit d75bb75
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 16 deletions.
6 changes: 6 additions & 0 deletions resources/datasource-active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions resources/datasource-connected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions resources/datasource.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/extensionVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { WorkspaceTreeProvider } from "./services/workspaceTreeProvider";
import { ScratchpadFile } from "./models/scratchpad";
import { LocalConnection } from "./classes/localConnection";
import { InsightsConnection } from "./classes/insightsConnection";
import { DataSourceFiles } from "./models/dataSource";

// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace ext {
Expand All @@ -53,6 +54,8 @@ export namespace ext {
export let runScratchpadItem: StatusBarItem;
export const activeScratchPadList: Array<ScratchpadFile> = [];
export const connectedScratchPadList: Array<ScratchpadFile> = [];
export const activeDatasourceList: Array<DataSourceFiles> = [];
export const connectedDatasourceList: Array<DataSourceFiles> = [];
export let serverObjects: ServerObject;
export let openSslVersion: string | null;
export let resultPanelCSV: string;
Expand Down
10 changes: 10 additions & 0 deletions src/utils/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,16 @@ export function getScratchpadStatusIcon(label: string) {
}
}

export function getDatasourceStatusIcon(label: string) {
if (ext.activeDatasourceList?.some((ds) => ds.name === label)) {
return "-active";
} else if (ext.connectedDatasourceList?.some((ds) => ds.name === label)) {
return "-connected";
} else {
return "";
}
}

export async function checkLocalInstall(): Promise<void> {
const QHOME = workspace.getConfiguration().get<string>("kdb.qHomeDirectory");
if (QHOME || env.QHOME) {
Expand Down
Loading

0 comments on commit d75bb75

Please sign in to comment.