Some cleanup and fixes for Arc/BDC dashboards (#11075)

This commit is contained in:
Charles Gagnon
2020-06-24 12:41:33 -07:00
committed by GitHub
parent 6f6bf3f3b3
commit c62394262a
19 changed files with 1021 additions and 1063 deletions

View File

@@ -1,186 +1,192 @@
{
"name": "big-data-cluster",
"displayName": "%text.sqlServerBigDataClusters%",
"description": "%description%",
"version": "1.0.0",
"publisher": "Microsoft",
"preview": true,
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
"icon": "images/extension.png",
"engines": {
"vscode": "*",
"azdata": "*"
},
"activationEvents": [
"onCommand:bigDataClusters.command.mount",
"onCommand:bigDataClusters.command.refreshmount",
"onCommand:bigDataClusters.command.deletemount",
"onCommand:bigDataClusters.command.createController",
"onCommand:bigDataClusters.command.connectController",
"onCommand:bigDataClusters.command.removeController",
"onCommand:bigDataClusters.command.manageController",
"onCommand:bigDataClusters.command.refreshController",
"onView:sqlBigDataCluster"
],
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/azuredatastudio.git"
},
"main": "./out/extension",
"contributes": {
"dataExplorer": {
"sqlBigDataCluster": [
{
"id": "sqlBigDataCluster",
"name": "%text.sqlServerBigDataClusters%"
}
]
},
"menus": {
"commandPalette": [
{
"command": "bigDataClusters.command.createController",
"when": "false"
},
{
"command": "bigDataClusters.command.connectController",
"when": "false"
},
{
"command": "bigDataClusters.command.removeController",
"when": "false"
},
{
"command": "bigDataClusters.command.refreshController",
"when": "false"
},
{
"command": "bigDataClusters.command.manageController",
"when": "false"
},
{
"command": "bigDataClusters.command.mount",
"when": "false"
},
{
"command": "bigDataClusters.command.refreshmount",
"when": "false"
},
{
"command": "bigDataClusters.command.deletemount",
"when": "false"
}
],
"view/title": [
{
"command": "bigDataClusters.command.createController",
"when": "view == sqlBigDataCluster",
"group": "navigation@1"
},
{
"command": "bigDataClusters.command.connectController",
"when": "view == sqlBigDataCluster",
"group": "navigation@2"
}
],
"view/item/context": [
{
"command": "bigDataClusters.command.manageController",
"when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
"group": "navigation@1"
},
{
"command": "bigDataClusters.command.refreshController",
"when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
"group": "navigation@2"
},
{
"command": "bigDataClusters.command.removeController",
"when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
"group": "navigation@3"
}
],
"objectExplorer/item/context": [
{
"command": "bigDataClusters.command.mount",
"when": "nodeType=~/^mssqlCluster/ && nodeType!=mssqlCluster:message && nodeSubType=~/^(?!:mount).*$/",
"group": "1mssqlCluster@10"
},
{
"command": "bigDataClusters.command.refreshmount",
"when": "nodeType == mssqlCluster:folder && nodeSubType==:mount:",
"group": "1mssqlCluster@11"
},
{
"command": "bigDataClusters.command.deletemount",
"when": "nodeType == mssqlCluster:folder && nodeSubType==:mount:",
"group": "1mssqlCluster@12"
}
]
},
"commands": [
{
"command": "bigDataClusters.command.createController",
"title": "%command.createController.title%",
"icon": "$(add)"
},
{
"command": "bigDataClusters.command.connectController",
"title": "%command.connectController.title%",
"icon": "$(disconnect)"
},
{
"command": "bigDataClusters.command.removeController",
"title": "%command.removeController.title%",
"when": "viewItem == bigDataClusters.itemType.controllerNode"
},
{
"command": "bigDataClusters.command.refreshController",
"title": "%command.refreshController.title%",
"icon": "$(refresh)"
},
{
"command": "bigDataClusters.command.manageController",
"title": "%command.manageController.title%"
},
{
"command": "bigDataClusters.command.mount",
"title": "%command.mount.title%"
},
{
"command": "bigDataClusters.command.refreshmount",
"title": "%command.refreshmount.title%"
},
{
"command": "bigDataClusters.command.deletemount",
"title": "%command.deletemount.title%"
}
],
"configuration": {
"type": "object",
"title": "%bdc.configuration.title%",
"properties": {
"bigDataCluster.ignoreSslVerification": {
"type": "boolean",
"default": true,
"description": "%bdc.ignoreSslVerification.desc%"
}
}
},
"viewsWelcome": [
{
"view": "sqlBigDataCluster",
"contents": "%bdc.view.welcome%"
}
]
},
"dependencies": {
"ads-kerberos": "^1.1.3",
"request": "^2.88.0",
"vscode-nls": "^4.0.0"
},
"devDependencies": {
"@types/request": "^2.48.3",
"vscode": "^1.1.36"
}
"name": "big-data-cluster",
"displayName": "%text.sqlServerBigDataClusters%",
"description": "%description%",
"version": "1.0.0",
"publisher": "Microsoft",
"preview": true,
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
"icon": "images/extension.png",
"engines": {
"vscode": "*",
"azdata": "*"
},
"activationEvents": [
"onCommand:bigDataClusters.command.mount",
"onCommand:bigDataClusters.command.refreshmount",
"onCommand:bigDataClusters.command.deletemount",
"onCommand:bigDataClusters.command.createController",
"onCommand:bigDataClusters.command.connectController",
"onCommand:bigDataClusters.command.removeController",
"onCommand:bigDataClusters.command.manageController",
"onCommand:bigDataClusters.command.refreshController",
"onView:sqlBigDataCluster"
],
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/azuredatastudio.git"
},
"main": "./out/extension",
"contributes": {
"dataExplorer": {
"sqlBigDataCluster": [
{
"id": "sqlBigDataCluster",
"name": "%text.sqlServerBigDataClusters%"
}
]
},
"menus": {
"commandPalette": [
{
"command": "bigDataClusters.command.createController",
"when": "false"
},
{
"command": "bigDataClusters.command.connectController",
"when": "false"
},
{
"command": "bigDataClusters.command.removeController",
"when": "false"
},
{
"command": "bigDataClusters.command.refreshController",
"when": "false"
},
{
"command": "bigDataClusters.command.manageController",
"when": "false"
},
{
"command": "bigDataClusters.command.mount",
"when": "false"
},
{
"command": "bigDataClusters.command.refreshmount",
"when": "false"
},
{
"command": "bigDataClusters.command.deletemount",
"when": "false"
}
],
"view/title": [
{
"command": "bigDataClusters.command.createController",
"when": "view == sqlBigDataCluster",
"group": "navigation@1"
},
{
"command": "bigDataClusters.command.connectController",
"when": "view == sqlBigDataCluster",
"group": "navigation@2"
}
],
"view/item/context": [
{
"command": "bigDataClusters.command.manageController",
"when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
"group": "navigation@1"
},
{
"command": "bigDataClusters.command.refreshController",
"when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
"group": "navigation@2"
},
{
"command": "bigDataClusters.command.removeController",
"when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
"group": "navigation@3"
}
],
"objectExplorer/item/context": [
{
"command": "bigDataClusters.command.mount",
"when": "nodeType=~/^mssqlCluster/ && nodeType!=mssqlCluster:message && nodeSubType=~/^(?!:mount).*$/",
"group": "1mssqlCluster@10"
},
{
"command": "bigDataClusters.command.refreshmount",
"when": "nodeType == mssqlCluster:folder && nodeSubType==:mount:",
"group": "1mssqlCluster@11"
},
{
"command": "bigDataClusters.command.deletemount",
"when": "nodeType == mssqlCluster:folder && nodeSubType==:mount:",
"group": "1mssqlCluster@12"
}
]
},
"commands": [
{
"command": "bigDataClusters.command.createController",
"title": "%command.createController.title%",
"icon": "$(add)"
},
{
"command": "bigDataClusters.command.connectController",
"title": "%command.connectController.title%",
"icon": "$(disconnect)"
},
{
"command": "bigDataClusters.command.removeController",
"title": "%command.removeController.title%",
"when": "viewItem == bigDataClusters.itemType.controllerNode"
},
{
"command": "bigDataClusters.command.refreshController",
"title": "%command.refreshController.title%",
"icon": "$(refresh)"
},
{
"command": "bigDataClusters.command.manageController",
"title": "%command.manageController.title%"
},
{
"command": "bigDataClusters.command.mount",
"title": "%command.mount.title%"
},
{
"command": "bigDataClusters.command.refreshmount",
"title": "%command.refreshmount.title%"
},
{
"command": "bigDataClusters.command.deletemount",
"title": "%command.deletemount.title%"
}
],
"configuration": {
"type": "object",
"title": "%bdc.configuration.title%",
"properties": {
"bigDataCluster.ignoreSslVerification": {
"type": "boolean",
"default": true,
"description": "%bdc.ignoreSslVerification.desc%"
}
}
},
"viewsWelcome": [
{
"view": "sqlBigDataCluster",
"contents": "%bdc.view.welcome.connect%",
"when": "bdc.loaded"
},
{
"view": "sqlBigDataCluster",
"contents": "%bdc.view.welcome.loading%",
"when": "!bdc.loaded"
}
]
},
"dependencies": {
"ads-kerberos": "^1.1.3",
"request": "^2.88.0",
"vscode-nls": "^4.0.0"
},
"devDependencies": {
"@types/request": "^2.48.3",
"vscode": "^1.1.36"
}
}

View File

@@ -3,13 +3,14 @@
"text.sqlServerBigDataClusters": "SQL Server Big Data Clusters",
"command.connectController.title": "Connect to Existing Controller",
"command.createController.title": "Create New Controller",
"command.removeController.title" : "Remove Controller",
"command.refreshController.title" : "Refresh",
"command.manageController.title" : "Manage",
"command.mount.title" : "Mount HDFS",
"command.refreshmount.title" : "Refresh Mount",
"command.deletemount.title" : "Delete Mount",
"bdc.configuration.title" : "Big Data Cluster",
"bdc.view.welcome" : "No SQL Big Data Cluster controllers registered. [Learn More](https://docs.microsoft.com/sql/big-data-cluster/big-data-cluster-overview)\n[Connect Controller](command:bigDataClusters.command.connectController)",
"bdc.ignoreSslVerification.desc" : "Ignore SSL verification errors against SQL Server Big Data Cluster endpoints such as HDFS, Spark, and Controller if true"
"command.removeController.title": "Remove Controller",
"command.refreshController.title": "Refresh",
"command.manageController.title": "Manage",
"command.mount.title": "Mount HDFS",
"command.refreshmount.title": "Refresh Mount",
"command.deletemount.title": "Delete Mount",
"bdc.configuration.title": "Big Data Cluster",
"bdc.view.welcome.connect": "No SQL Big Data Cluster controllers registered. [Learn More](https://docs.microsoft.com/sql/big-data-cluster/big-data-cluster-overview)\n[Connect Controller](command:bigDataClusters.command.connectController)",
"bdc.view.welcome.loading": "Loading controllers...",
"bdc.ignoreSslVerification.desc": "Ignore SSL verification errors against SQL Server Big Data Cluster endpoints such as HDFS, Spark, and Controller if true"
}

View File

@@ -10,7 +10,6 @@ import { TreeNode } from './treeNode';
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
import { ControllerRootNode, ControllerNode } from './controllerTreeNode';
import { showErrorMessage } from '../utils';
import { LoadingControllerNode } from './loadingControllerNode';
import { AuthType } from 'bdc';
const localize = nls.loadMessageBundle();
@@ -35,7 +34,6 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
constructor(private memento: vscode.Memento) {
this.root = new ControllerRootNode(this);
this.root.addChild(new LoadingControllerNode());
}
public async getChildren(element?: TreeNode): Promise<TreeNode[]> {
@@ -45,6 +43,11 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
if (!this.initialized) {
this.loadSavedControllers().catch(err => { vscode.window.showErrorMessage(localize('bdc.controllerTreeDataProvider.error', "Unexpected error loading saved controllers: {0}", err)); });
} else {
// We set the context here since VS Code takes a bit of time to process the _onDidChangeTreeData
// and so if we set it as soon as we finished loading the controllers it would briefly flash
// the "connect to controller" welcome view
await vscode.commands.executeCommand('setContext', 'bdc.loaded', true);
}
return this.root.getChildren();
@@ -87,21 +90,9 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
}
private removeNonControllerNodes(): void {
this.removePlaceholderNodes(this.root.children);
this.removeDefectiveControllerNodes(this.root.children);
}
private removePlaceholderNodes(nodes: TreeNode[]): void {
if (nodes.length > 0) {
for (let i = 0; i < nodes.length; ++i) {
if (nodes[i] instanceof LoadingControllerNode
) {
nodes.splice(i--, 1);
}
}
}
}
private removeDefectiveControllerNodes(nodes: TreeNode[]): void {
if (nodes.length > 0) {
for (let i = 0; i < nodes.length; ++i) {

View File

@@ -1,45 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { TreeNode } from './treeNode';
import { BdcItemType } from '../constants';
const localize = nls.loadMessageBundle();
export class LoadingControllerNode extends TreeNode {
private readonly nodeType: string;
constructor() {
super(localize('textLoadingWithDots', "Loading..."));
this.nodeType = BdcItemType.loadingController;
}
public async getChildren(): Promise<TreeNode[]> {
return [];
}
public getTreeItem(): vscode.TreeItem {
let item = new vscode.TreeItem(this.label, vscode.TreeItemCollapsibleState.None);
item.contextValue = this.nodeType;
return item;
}
public getNodeInfo(): azdata.NodeInfo {
return {
label: this.label,
isLeaf: this.isLeaf,
errorMessage: undefined,
metadata: undefined,
nodePath: this.nodePath,
nodeStatus: undefined,
nodeType: this.nodeType,
iconType: this.nodeType,
nodeSubType: undefined
};
}
}

View File

@@ -26,8 +26,9 @@ const endpointNotFoundError = localize('mount.error.endpointNotFound', "Controll
let throttleTimers: { [key: string]: any } = {};
export function activate(extensionContext: vscode.ExtensionContext): IExtension {
export async function activate(extensionContext: vscode.ExtensionContext): Promise<IExtension> {
IconPathHelper.setExtensionContext(extensionContext);
await vscode.commands.executeCommand('setContext', 'bdc.loaded', false);
const treeDataProvider = new ControllerTreeDataProvider(extensionContext.globalState);
vscode.window.registerTreeDataProvider('sqlBigDataCluster', treeDataProvider);
registerCommands(extensionContext, treeDataProvider);