mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add BDC create controller action (#11019)
This commit is contained in:
@@ -8,7 +8,7 @@ import * as vscode from 'vscode';
|
||||
export enum BdcItemType {
|
||||
controllerRoot = 'bigDataClusters.itemType.controllerRootNode',
|
||||
controller = 'bigDataClusters.itemType.controllerNode',
|
||||
addController = 'bigDataClusters.itemType.addControllerNode',
|
||||
connectController = 'bigDataClusters.itemType.connectControllerNode',
|
||||
loadingController = 'bigDataClusters.itemType.loadingControllerNode'
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ import { BdcItemType } from '../constants';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class AddControllerNode extends TreeNode {
|
||||
export class ConnectControllerNode extends TreeNode {
|
||||
private readonly nodeType: string;
|
||||
|
||||
constructor() {
|
||||
super(localize('textBigDataClusterControllerWithDots', "Add SQL Server Big Data Cluster controller..."));
|
||||
this.nodeType = BdcItemType.addController;
|
||||
super(localize('textBigDataClusterControllerWithDots', "Connect to SQL Server Big Data Cluster controller..."));
|
||||
this.nodeType = BdcItemType.connectController;
|
||||
}
|
||||
|
||||
public async getChildren(): Promise<TreeNode[]> {
|
||||
@@ -27,7 +27,7 @@ export class AddControllerNode extends TreeNode {
|
||||
let item = new vscode.TreeItem(this.label, vscode.TreeItemCollapsibleState.None);
|
||||
item.command = {
|
||||
title: localize('textConnectToController', "Connect to Controller"),
|
||||
command: 'bigDataClusters.command.addController',
|
||||
command: 'bigDataClusters.command.connectController',
|
||||
arguments: [this]
|
||||
};
|
||||
item.contextValue = this.nodeType;
|
||||
@@ -8,7 +8,7 @@ import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { TreeNode } from './treeNode';
|
||||
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
|
||||
import { AddControllerNode } from './addControllerNode';
|
||||
import { ConnectControllerNode } from './connectControllerNode';
|
||||
import { ControllerRootNode, ControllerNode } from './controllerTreeNode';
|
||||
import { showErrorMessage } from '../utils';
|
||||
import { LoadingControllerNode } from './loadingControllerNode';
|
||||
@@ -95,7 +95,7 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
private removePlaceholderNodes(nodes: TreeNode[]): void {
|
||||
if (nodes.length > 0) {
|
||||
for (let i = 0; i < nodes.length; ++i) {
|
||||
if (nodes[i] instanceof AddControllerNode ||
|
||||
if (nodes[i] instanceof ConnectControllerNode ||
|
||||
nodes[i] instanceof LoadingControllerNode
|
||||
) {
|
||||
nodes.splice(i--, 1);
|
||||
@@ -143,7 +143,7 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
|
||||
this.root.clearChildren();
|
||||
if (treeNodes.length === 0) {
|
||||
this.root.addChild(new AddControllerNode());
|
||||
this.root.addChild(new ConnectControllerNode());
|
||||
} else {
|
||||
treeNodes.forEach(node => this.root.addChild(node));
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ export class ControllerNode extends ControllerTreeNode {
|
||||
}
|
||||
|
||||
if (!this._password) {
|
||||
vscode.commands.executeCommand('bigDataClusters.command.addController', this);
|
||||
vscode.commands.executeCommand('bigDataClusters.command.connectController', this);
|
||||
return this.children as ControllerTreeNode[];
|
||||
}
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user