mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add BDC create controller action (#11019)
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
{
|
{
|
||||||
"command": "arc.connectToController",
|
"command": "arc.connectToController",
|
||||||
"title": "%command.connectToController.title%",
|
"title": "%command.connectToController.title%",
|
||||||
"icon": "$(debug-disconnect)"
|
"icon": "$(disconnect)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "arc.removeController",
|
"command": "arc.removeController",
|
||||||
|
|||||||
@@ -20,21 +20,6 @@ class SslAuth implements Authentication {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class KerberosAuth extends SslAuth implements Authentication {
|
|
||||||
|
|
||||||
constructor(public kerberosToken: string) {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
applyToRequest(requestOptions: request.Options): void {
|
|
||||||
super.applyToRequest(requestOptions);
|
|
||||||
if (requestOptions && requestOptions.headers) {
|
|
||||||
requestOptions.headers['Authorization'] = `Negotiate ${this.kerberosToken}`;
|
|
||||||
}
|
|
||||||
requestOptions.auth = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class BasicAuth extends SslAuth implements Authentication {
|
export class BasicAuth extends SslAuth implements Authentication {
|
||||||
constructor(public username: string, public password: string) {
|
constructor(public username: string, public password: string) {
|
||||||
super();
|
super();
|
||||||
@@ -48,20 +33,6 @@ export class BasicAuth extends SslAuth implements Authentication {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class OAuthWithSsl extends SslAuth implements Authentication {
|
|
||||||
constructor(public accessToken: string) {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
applyToRequest(requestOptions: request.Options): void {
|
|
||||||
super.applyToRequest(requestOptions);
|
|
||||||
if (requestOptions && requestOptions.headers) {
|
|
||||||
requestOptions.headers['Authorization'] = `Bearer ${this.accessToken}`;
|
|
||||||
}
|
|
||||||
requestOptions.auth = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Retrieves the current setting for whether to ignore SSL verification errors */
|
/* Retrieves the current setting for whether to ignore SSL verification errors */
|
||||||
export function getIgnoreSslVerificationConfigSetting(): boolean {
|
export function getIgnoreSslVerificationConfigSetting(): boolean {
|
||||||
const arcConfigSectionName = 'arc';
|
const arcConfigSectionName = 'arc';
|
||||||
|
|||||||
@@ -12,14 +12,15 @@
|
|||||||
"azdata": "*"
|
"azdata": "*"
|
||||||
},
|
},
|
||||||
"activationEvents": [
|
"activationEvents": [
|
||||||
"onCommand:bigDataClusters.command.mount",
|
"onCommand:bigDataClusters.command.mount",
|
||||||
"onCommand:bigDataClusters.command.refreshmount",
|
"onCommand:bigDataClusters.command.refreshmount",
|
||||||
"onCommand:bigDataClusters.command.deletemount",
|
"onCommand:bigDataClusters.command.deletemount",
|
||||||
"onCommand:bigDataClusters.command.addController",
|
"onCommand:bigDataClusters.command.createController",
|
||||||
"onCommand:bigDataClusters.command.deleteController",
|
"onCommand:bigDataClusters.command.connectController",
|
||||||
"onCommand:bigDataClusters.command.manageController",
|
"onCommand:bigDataClusters.command.deleteController",
|
||||||
"onCommand:bigDataClusters.command.refreshController",
|
"onCommand:bigDataClusters.command.manageController",
|
||||||
"onView:sqlBigDataCluster"
|
"onCommand:bigDataClusters.command.refreshController",
|
||||||
|
"onView:sqlBigDataCluster"
|
||||||
],
|
],
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -38,7 +39,11 @@
|
|||||||
"menus": {
|
"menus": {
|
||||||
"commandPalette": [
|
"commandPalette": [
|
||||||
{
|
{
|
||||||
"command": "bigDataClusters.command.addController",
|
"command": "bigDataClusters.command.createController",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "bigDataClusters.command.connectController",
|
||||||
"when": "false"
|
"when": "false"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -68,9 +73,14 @@
|
|||||||
],
|
],
|
||||||
"view/title": [
|
"view/title": [
|
||||||
{
|
{
|
||||||
"command": "bigDataClusters.command.addController",
|
"command": "bigDataClusters.command.createController",
|
||||||
"when": "view == sqlBigDataCluster",
|
"when": "view == sqlBigDataCluster",
|
||||||
"group": "navigation"
|
"group": "navigation@1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "bigDataClusters.command.connectController",
|
||||||
|
"when": "view == sqlBigDataCluster",
|
||||||
|
"group": "navigation@2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"view/item/context": [
|
"view/item/context": [
|
||||||
@@ -110,10 +120,15 @@
|
|||||||
},
|
},
|
||||||
"commands": [
|
"commands": [
|
||||||
{
|
{
|
||||||
"command": "bigDataClusters.command.addController",
|
"command": "bigDataClusters.command.createController",
|
||||||
"title": "%command.addController.title%",
|
"title": "%command.createController.title%",
|
||||||
"icon": "$(add)"
|
"icon": "$(add)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "bigDataClusters.command.connectController",
|
||||||
|
"title": "%command.connectController.title%",
|
||||||
|
"icon": "$(disconnect)"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "bigDataClusters.command.deleteController",
|
"command": "bigDataClusters.command.deleteController",
|
||||||
"title": "%command.deleteController.title%",
|
"title": "%command.deleteController.title%",
|
||||||
@@ -154,7 +169,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ads-kerberos": "^1.1.3",
|
"ads-kerberos": "^1.1.3",
|
||||||
"request": "^2.88.0",
|
"request": "^2.88.0",
|
||||||
"vscode-nls": "^4.0.0"
|
"vscode-nls": "^4.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"description": "Support for managing SQL Server Big Data Clusters",
|
"description": "Support for managing SQL Server Big Data Clusters",
|
||||||
"text.sqlServerBigDataClusters": "SQL Server Big Data Clusters",
|
"text.sqlServerBigDataClusters": "SQL Server Big Data Clusters",
|
||||||
"command.addController.title": "Connect to Controller",
|
"command.connectController.title": "Connect to Existing Controller",
|
||||||
|
"command.createController.title": "Create New Controller",
|
||||||
"command.deleteController.title" : "Delete",
|
"command.deleteController.title" : "Delete",
|
||||||
"command.refreshController.title" : "Refresh",
|
"command.refreshController.title" : "Refresh",
|
||||||
"command.manageController.title" : "Manage",
|
"command.manageController.title" : "Manage",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import * as vscode from 'vscode';
|
|||||||
export enum BdcItemType {
|
export enum BdcItemType {
|
||||||
controllerRoot = 'bigDataClusters.itemType.controllerRootNode',
|
controllerRoot = 'bigDataClusters.itemType.controllerRootNode',
|
||||||
controller = 'bigDataClusters.itemType.controllerNode',
|
controller = 'bigDataClusters.itemType.controllerNode',
|
||||||
addController = 'bigDataClusters.itemType.addControllerNode',
|
connectController = 'bigDataClusters.itemType.connectControllerNode',
|
||||||
loadingController = 'bigDataClusters.itemType.loadingControllerNode'
|
loadingController = 'bigDataClusters.itemType.loadingControllerNode'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ import { BdcItemType } from '../constants';
|
|||||||
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
export class AddControllerNode extends TreeNode {
|
export class ConnectControllerNode extends TreeNode {
|
||||||
private readonly nodeType: string;
|
private readonly nodeType: string;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(localize('textBigDataClusterControllerWithDots', "Add SQL Server Big Data Cluster controller..."));
|
super(localize('textBigDataClusterControllerWithDots', "Connect to SQL Server Big Data Cluster controller..."));
|
||||||
this.nodeType = BdcItemType.addController;
|
this.nodeType = BdcItemType.connectController;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getChildren(): Promise<TreeNode[]> {
|
public async getChildren(): Promise<TreeNode[]> {
|
||||||
@@ -27,7 +27,7 @@ export class AddControllerNode extends TreeNode {
|
|||||||
let item = new vscode.TreeItem(this.label, vscode.TreeItemCollapsibleState.None);
|
let item = new vscode.TreeItem(this.label, vscode.TreeItemCollapsibleState.None);
|
||||||
item.command = {
|
item.command = {
|
||||||
title: localize('textConnectToController', "Connect to Controller"),
|
title: localize('textConnectToController', "Connect to Controller"),
|
||||||
command: 'bigDataClusters.command.addController',
|
command: 'bigDataClusters.command.connectController',
|
||||||
arguments: [this]
|
arguments: [this]
|
||||||
};
|
};
|
||||||
item.contextValue = this.nodeType;
|
item.contextValue = this.nodeType;
|
||||||
@@ -8,7 +8,7 @@ import * as azdata from 'azdata';
|
|||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
import { TreeNode } from './treeNode';
|
import { TreeNode } from './treeNode';
|
||||||
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
|
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
|
||||||
import { AddControllerNode } from './addControllerNode';
|
import { ConnectControllerNode } from './connectControllerNode';
|
||||||
import { ControllerRootNode, ControllerNode } from './controllerTreeNode';
|
import { ControllerRootNode, ControllerNode } from './controllerTreeNode';
|
||||||
import { showErrorMessage } from '../utils';
|
import { showErrorMessage } from '../utils';
|
||||||
import { LoadingControllerNode } from './loadingControllerNode';
|
import { LoadingControllerNode } from './loadingControllerNode';
|
||||||
@@ -95,7 +95,7 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
|||||||
private removePlaceholderNodes(nodes: TreeNode[]): void {
|
private removePlaceholderNodes(nodes: TreeNode[]): void {
|
||||||
if (nodes.length > 0) {
|
if (nodes.length > 0) {
|
||||||
for (let i = 0; i < nodes.length; ++i) {
|
for (let i = 0; i < nodes.length; ++i) {
|
||||||
if (nodes[i] instanceof AddControllerNode ||
|
if (nodes[i] instanceof ConnectControllerNode ||
|
||||||
nodes[i] instanceof LoadingControllerNode
|
nodes[i] instanceof LoadingControllerNode
|
||||||
) {
|
) {
|
||||||
nodes.splice(i--, 1);
|
nodes.splice(i--, 1);
|
||||||
@@ -143,7 +143,7 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
|||||||
|
|
||||||
this.root.clearChildren();
|
this.root.clearChildren();
|
||||||
if (treeNodes.length === 0) {
|
if (treeNodes.length === 0) {
|
||||||
this.root.addChild(new AddControllerNode());
|
this.root.addChild(new ConnectControllerNode());
|
||||||
} else {
|
} else {
|
||||||
treeNodes.forEach(node => this.root.addChild(node));
|
treeNodes.forEach(node => this.root.addChild(node));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ export class ControllerNode extends ControllerTreeNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this._password) {
|
if (!this._password) {
|
||||||
vscode.commands.executeCommand('bigDataClusters.command.addController', this);
|
vscode.commands.executeCommand('bigDataClusters.command.connectController', this);
|
||||||
return this.children as ControllerTreeNode[];
|
return this.children as ControllerTreeNode[];
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
export const ManageControllerCommand = 'bigDataClusters.command.manageController';
|
export const ManageControllerCommand = 'bigDataClusters.command.manageController';
|
||||||
export const AddControllerCommand = 'bigDataClusters.command.addController';
|
export const CreateControllerCommand = 'bigDataClusters.command.createController';
|
||||||
|
export const ConnectControllerCommand = 'bigDataClusters.command.connectController';
|
||||||
export const DeleteControllerCommand = 'bigDataClusters.command.deleteController';
|
export const DeleteControllerCommand = 'bigDataClusters.command.deleteController';
|
||||||
export const RefreshControllerCommand = 'bigDataClusters.command.refreshController';
|
export const RefreshControllerCommand = 'bigDataClusters.command.refreshController';
|
||||||
export const MountHdfsCommand = 'bigDataClusters.command.mount';
|
export const MountHdfsCommand = 'bigDataClusters.command.mount';
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ let throttleTimers: { [key: string]: any } = {};
|
|||||||
|
|
||||||
export function activate(extensionContext: vscode.ExtensionContext): IExtension {
|
export function activate(extensionContext: vscode.ExtensionContext): IExtension {
|
||||||
IconPathHelper.setExtensionContext(extensionContext);
|
IconPathHelper.setExtensionContext(extensionContext);
|
||||||
let treeDataProvider = new ControllerTreeDataProvider(extensionContext.globalState);
|
const treeDataProvider = new ControllerTreeDataProvider(extensionContext.globalState);
|
||||||
registerTreeDataProvider(treeDataProvider);
|
vscode.window.registerTreeDataProvider('sqlBigDataCluster', treeDataProvider);
|
||||||
registerCommands(extensionContext, treeDataProvider);
|
registerCommands(extensionContext, treeDataProvider);
|
||||||
return {
|
return {
|
||||||
getClusterController(url: string, authType: AuthType, username?: string, password?: string): IClusterController {
|
getClusterController(url: string, authType: AuthType, username?: string, password?: string): IClusterController {
|
||||||
@@ -41,13 +41,13 @@ export function activate(extensionContext: vscode.ExtensionContext): IExtension
|
|||||||
export function deactivate() {
|
export function deactivate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerTreeDataProvider(treeDataProvider: ControllerTreeDataProvider): void {
|
|
||||||
vscode.window.registerTreeDataProvider('sqlBigDataCluster', treeDataProvider);
|
|
||||||
}
|
|
||||||
|
|
||||||
function registerCommands(context: vscode.ExtensionContext, treeDataProvider: ControllerTreeDataProvider): void {
|
function registerCommands(context: vscode.ExtensionContext, treeDataProvider: ControllerTreeDataProvider): void {
|
||||||
vscode.commands.registerCommand(commands.AddControllerCommand, (node?: TreeNode) => {
|
vscode.commands.registerCommand(commands.ConnectControllerCommand, (node?: TreeNode) => {
|
||||||
runThrottledAction(commands.AddControllerCommand, () => addBdcController(treeDataProvider, node));
|
runThrottledAction(commands.ConnectControllerCommand, () => addBdcController(treeDataProvider, node));
|
||||||
|
});
|
||||||
|
|
||||||
|
vscode.commands.registerCommand(commands.CreateControllerCommand, () => {
|
||||||
|
runThrottledAction(commands.CreateControllerCommand, () => vscode.commands.executeCommand('azdata.resource.deploy'));
|
||||||
});
|
});
|
||||||
|
|
||||||
vscode.commands.registerCommand(commands.DeleteControllerCommand, async (node: TreeNode) => {
|
vscode.commands.registerCommand(commands.DeleteControllerCommand, async (node: TreeNode) => {
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ export namespace Codicon {
|
|||||||
export const database = new Codicon('database', { character: '\\eace' });
|
export const database = new Codicon('database', { character: '\\eace' });
|
||||||
export const debugContinue = new Codicon('debug-continue', { character: '\\eacf' });
|
export const debugContinue = new Codicon('debug-continue', { character: '\\eacf' });
|
||||||
export const debugDisconnect = new Codicon('debug-disconnect', { character: '\\ead0' });
|
export const debugDisconnect = new Codicon('debug-disconnect', { character: '\\ead0' });
|
||||||
|
export const disconnect = new Codicon('disconnect', { character: '\\ead0' }); // {{SQL CARBON EDIT}} Uncolored version of debug-disconnect
|
||||||
export const debugPause = new Codicon('debug-pause', { character: '\\ead1' });
|
export const debugPause = new Codicon('debug-pause', { character: '\\ead1' });
|
||||||
export const debugRestart = new Codicon('debug-restart', { character: '\\ead2' });
|
export const debugRestart = new Codicon('debug-restart', { character: '\\ead2' });
|
||||||
export const debugStart = new Codicon('debug-start', { character: '\\ead3' });
|
export const debugStart = new Codicon('debug-start', { character: '\\ead3' });
|
||||||
|
|||||||
Reference in New Issue
Block a user