update target environment type page based on latest design (#4311)

This commit is contained in:
Alan Ren
2019-03-06 21:21:47 -08:00
committed by GitHub
parent 428dd17d54
commit 68418f2c8f
5 changed files with 49 additions and 20 deletions

View File

@@ -52,6 +52,8 @@ export interface ContainerRegistryInfo {
export interface TargetClusterTypeInfo {
type: TargetClusterType;
name: string;
fullName: string;
description: string;
iconPath: {
dark: string,
light: string
@@ -61,6 +63,7 @@ export interface TargetClusterTypeInfo {
export interface ToolInfo {
name: string;
description: string;
version: string;
status: ToolInstallationStatus;
}
@@ -72,9 +75,9 @@ export enum ToolInstallationStatus {
}
export enum ClusterType {
Unknown = 0,
AKS,
Unknown = 0,
AKS,
Minikube,
Kubernetes,
Other
Other
}

View File

@@ -4,11 +4,10 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TargetClusterType, ClusterPorts, ContainerRegistryInfo, TargetClusterTypeInfo, ToolInfo, ToolInstallationStatus } from '../../interfaces';
import { getContexts, KubectlContext, setContext, inferCurrentClusterType } from '../../kubectl/kubectlUtils';
import { TargetClusterType, ClusterPorts, ClusterType, ContainerRegistryInfo, TargetClusterTypeInfo, ToolInfo, ToolInstallationStatus } from '../../interfaces';
import { getContexts, KubectlContext, setContext, inferCurrentClusterType } from '../../kubectl/kubectlUtils';
import { Kubectl } from '../../kubectl/kubectl';
import { Scriptable, ScriptingDictionary } from '../../scripting/scripting';
import { ClusterType} from '../../interfaces';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
@@ -16,8 +15,8 @@ const localize = nls.loadMessageBundle();
export class CreateClusterModel implements Scriptable {
private _tmp_tools_installed: boolean = false;
private scriptingProperties : ScriptingDictionary<string> = {};
constructor(private _kubectl : Kubectl) {
private scriptingProperties: ScriptingDictionary<string> = {};
constructor(private _kubectl: Kubectl) {
}
public async loadClusters(): Promise<KubectlContext[]> {
@@ -58,6 +57,9 @@ export class CreateClusterModel implements Scriptable {
let aksCluster: TargetClusterTypeInfo = {
type: TargetClusterType.NewAksCluster,
name: localize('bdc-create.AKSClusterCardText', 'New AKS Cluster'),
fullName: localize('bdc-create.AKSClusterFullName', 'New Azure Kubernetes Service cluster'),
description: localize('bdc-create.AKSClusterDescription', 'This option configures new Azure Kubernetes Service (AKS) for SQL Server big data cluster deployments. '
+ 'AKS makes it simple to create, configure and manage a cluster of virutal machines that are preconfigured with a Kubernetes cluster to run containerized applications.'),
iconPath: {
dark: 'images/cluster_inverse.svg',
light: 'images/cluster.svg'
@@ -66,7 +68,9 @@ export class CreateClusterModel implements Scriptable {
let existingCluster: TargetClusterTypeInfo = {
type: TargetClusterType.ExistingKubernetesCluster,
name: localize('bdc-create.ExistingCardText', 'Existing Cluster'),
name: localize('bdc-create.ExistingClusterCardText', 'Existing Cluster'),
fullName: localize('bdc-create.ExistingClusterFullName', 'Existing Kubernetes Cluster'),
description: localize('bdc-create.ExistingClusterDescription', 'This option assumes you already have a Kubernetes cluster installed, Once a prerequisite check is done, ensure the correct cluster context is selected.'),
iconPath: {
dark: 'images/cluster_inverse.svg',
light: 'images/cluster.svg'
@@ -81,16 +85,19 @@ export class CreateClusterModel implements Scriptable {
let kubeCtl = {
name: 'kubectl',
description: 'Tool used for managing the Kubernetes cluster',
version: '',
status: ToolInstallationStatus.Installed
};
let mssqlCtl = {
name: 'mssqlctl',
description: 'Command-line tool for installing and managing the SQL Server big data cluster',
version: '',
status: ToolInstallationStatus.Installed
};
let azureCli = {
name: 'Azure CLI',
description: 'Tool used for managing Azure services',
version: '',
status: this._tmp_tools_installed ? ToolInstallationStatus.Installed : ToolInstallationStatus.NotInstalled
};
let promise = new Promise<ToolInfo[]>(resolve => {
@@ -143,7 +150,7 @@ export class CreateClusterModel implements Scriptable {
public containerRegistryPassword: string;
public async getTargetClusterPlatform(targetContextName : string) : Promise<string> {
public async getTargetClusterPlatform(targetContextName: string): Promise<string> {
await setContext(this._kubectl, targetContextName);
let clusterType = await inferCurrentClusterType(this._kubectl);
@@ -158,7 +165,7 @@ export class CreateClusterModel implements Scriptable {
}
}
public async getScriptProperties() : Promise<ScriptingDictionary<string>> {
public async getScriptProperties(): Promise<ScriptingDictionary<string>> {
// Cluster settings
this.scriptingProperties['CLUSTER_NAME'] = this.selectedCluster.clusterName;
@@ -171,13 +178,13 @@ export class CreateClusterModel implements Scriptable {
// SQL Server settings
this.scriptingProperties['CONTROLLER_USERNAME'] = this.adminUserName;
this.scriptingProperties['CONTROLLER_PASSWORD'] = this.adminPassword;
this.scriptingProperties['CONTROLLER_PASSWORD'] = this.adminPassword;
this.scriptingProperties['KNOX_PASSWORD'] = this.adminPassword;
this.scriptingProperties['MSSQL_SA_PASSWORD'] = this.adminPassword;
// docker settings
this.scriptingProperties['DOCKER_REPOSITORY'] = this.containerRepository;
this.scriptingProperties['DOCKER_REGISTRY' ] = this.containerRegistry;
this.scriptingProperties['DOCKER_REGISTRY'] = this.containerRegistry;
this.scriptingProperties['DOCKER_PASSWORD'] = this.containerRegistryPassword;
this.scriptingProperties['DOCKER_USERNAME'] = this.containerRegistryUserName;
this.scriptingProperties['DOCKER_IMAGE_TAG'] = this.containerImageTag;
@@ -191,7 +198,7 @@ export class CreateClusterModel implements Scriptable {
return this.scriptingProperties;
}
public getTargetKubectlContext() : KubectlContext {
public getTargetKubectlContext(): KubectlContext {
return this.selectedCluster;
}
}

View File

@@ -38,7 +38,7 @@ export class SelectExistingClusterPage extends WizardPageBase<CreateClusterWizar
}
],
{
horizontal: true
horizontal: false
}
).withLayout({ width: '100%', height: '100%' });

View File

@@ -23,6 +23,8 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
private installToolsButton: azdata.window.Button;
private toolsLoadingWrapper: azdata.LoadingComponent;
private refreshToolsButton: azdata.window.Button;
private targetDescriptionText: azdata.TextComponent;
private targetDescriptionGroup: azdata.FormComponent;
private isValid: boolean = false;
private isLoading: boolean = false;
private requiredTools: ToolInfo[];
@@ -74,24 +76,30 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
});
let cardsContainer = view.modelBuilder.flexContainer().withItems(self.cards, { flex: '0 0 auto' }).withLayout({ flexFlow: 'row', alignItems: 'left' }).component();
self.targetDescriptionText = view.modelBuilder.text().component();
let toolColumn: azdata.TableColumn = {
value: localize('bdc-create.toolNameColumnHeader', 'Tool'),
width: 100
};
let descriptionColumn: azdata.TableColumn = {
value: localize('bdc-create.toolDescriptionColumnHeader', 'Description'),
width: 500
};
let versionColumn: azdata.TableColumn = {
value: localize('bdc-create.toolVersionColumnHeader', 'Version'),
width: 200
};
let statusColumn: azdata.TableColumn = {
value: localize('bdc-create.toolStatusColumnHeader', 'Status'),
width: 100
width: 200
};
self.toolsTable = view.modelBuilder.table().withProperties<azdata.TableComponentProperties>({
height: 150,
data: [],
columns: [toolColumn, descriptionColumn, statusColumn],
width: 850
columns: [toolColumn, descriptionColumn, versionColumn, statusColumn],
width: 1000
}).component();
self.toolsLoadingWrapper = view.modelBuilder.loadingComponent().withItem(self.toolsTable).component();
@@ -170,12 +178,23 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
}
});
self.targetDescriptionText.value = targetClusterTypeInfo.description;
if (self.form.items.length === 1) {
self.formBuilder.addFormItem({
title: localize('bdc-create.RequiredToolsText', 'Required tools'),
component: self.toolsLoadingWrapper
});
} else {
self.formBuilder.removeFormItem(self.targetDescriptionGroup);
}
self.targetDescriptionGroup = {
title: targetClusterTypeInfo.fullName,
component: self.targetDescriptionText
};
self.formBuilder.insertFormItem(self.targetDescriptionGroup, 1);
self.updateRequiredToolStatus();
} else {
if (self.cards.filter(c => { return c !== card && c.selected; }).length === 0) {
@@ -223,7 +242,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
private updateToolStatusTable(): void {
if (this.requiredTools) {
let tableData = this.requiredTools.map(tool => {
return [tool.name, tool.description, this.getStatusText(tool.status)];
return [tool.name, tool.description, tool.version, this.getStatusText(tool.status)];
});
this.toolsTable.data = tableData;
}

View File

@@ -66,7 +66,7 @@
.dialogModal-wizardHeader h1 {
margin-top: 10px;
margin-bottom: 3px;
margin-bottom: 10px;
font-size: 1.5em;
font-weight: lighter;
}