Open cluster dashboard from SQL Dashboard (#7783)

* Open cluster dashboard

* Remove old translated strings and update var name

* Add exported auth type

* Add newline

* PR feedback
This commit is contained in:
Charles Gagnon
2019-10-18 17:35:47 -07:00
committed by GitHub
parent 203ff3872f
commit ab31a7b964
18 changed files with 39 additions and 80 deletions

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { ClusterController } from '../controller/clusterControllerApi';
@@ -12,6 +10,8 @@ import { EndpointModel, BdcStatusModel } from '../controller/apiGenerated';
import { showErrorMessage, Endpoint } from '../utils';
import { AuthType } from '../constants';
export type BdcDashboardOptions = { url: string, auth: AuthType, username: string, password: string };
export class BdcDashboardModel {
private _clusterController: ClusterController;
@@ -24,8 +24,8 @@ export class BdcDashboardModel {
public onDidUpdateEndpoints = this._onDidUpdateEndpoints.event;
public onDidUpdateBdcStatus = this._onDidUpdateBdcStatus.event;
constructor(url: string, auth: AuthType, username: string, private password: string, ignoreSslVerification = true) {
this._clusterController = new ClusterController(url, auth, username, password, ignoreSslVerification);
constructor(private options: BdcDashboardOptions, ignoreSslVerification = true) {
this._clusterController = new ClusterController(options.url, options.auth, options.username, options.password, ignoreSslVerification);
this.refresh();
}
@@ -81,7 +81,7 @@ export class BdcDashboardModel {
serverName: sqlServerMasterEndpoint.endpoint,
databaseName: undefined,
userName: 'sa',
password: this.password,
password: this.options.password,
authenticationType: '',
savePassword: true,
groupFullName: undefined,

View File

@@ -14,7 +14,7 @@ import { TreeNode } from './bigDataCluster/tree/treeNode';
import { AddControllerDialogModel, AddControllerDialog } from './bigDataCluster/dialog/addControllerDialog';
import { ControllerNode } from './bigDataCluster/tree/controllerTreeNode';
import { BdcDashboard } from './bigDataCluster/dialog/bdcDashboard';
import { BdcDashboardModel } from './bigDataCluster/dialog/bdcDashboardModel';
import { BdcDashboardModel, BdcDashboardOptions } from './bigDataCluster/dialog/bdcDashboardModel';
import { MountHdfsDialogModel as MountHdfsModel, MountHdfsProperties, MountHdfsDialog, DeleteMountDialog, DeleteMountModel, RefreshMountDialog, RefreshMountModel } from './bigDataCluster/dialog/mountHdfsDialog';
import { getControllerEndpoint } from './bigDataCluster/utils';
@@ -62,9 +62,9 @@ function registerCommands(context: vscode.ExtensionContext, treeDataProvider: Co
treeDataProvider.notifyNodeChanged(node);
});
vscode.commands.registerCommand(ManageControllerCommand, async (node: ControllerNode) => {
const title: string = `${localize('bdc.dashboard.title', "Big Data Cluster Dashboard -")} ${ControllerNode.toIpAndPort(node.url)}`;
const dashboard: BdcDashboard = new BdcDashboard(title, new BdcDashboardModel(node.url, node.auth, node.username, node.password));
vscode.commands.registerCommand(ManageControllerCommand, async (info: ControllerNode | BdcDashboardOptions) => {
const title: string = `${localize('bdc.dashboard.title', "Big Data Cluster Dashboard -")} ${ControllerNode.toIpAndPort(info.url)}`;
const dashboard: BdcDashboard = new BdcDashboard(title, new BdcDashboardModel(info));
dashboard.showDashboard();
});