mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
update target environment type page based on latest design (#4311)
This commit is contained in:
@@ -52,6 +52,8 @@ export interface ContainerRegistryInfo {
|
|||||||
export interface TargetClusterTypeInfo {
|
export interface TargetClusterTypeInfo {
|
||||||
type: TargetClusterType;
|
type: TargetClusterType;
|
||||||
name: string;
|
name: string;
|
||||||
|
fullName: string;
|
||||||
|
description: string;
|
||||||
iconPath: {
|
iconPath: {
|
||||||
dark: string,
|
dark: string,
|
||||||
light: string
|
light: string
|
||||||
@@ -61,6 +63,7 @@ export interface TargetClusterTypeInfo {
|
|||||||
export interface ToolInfo {
|
export interface ToolInfo {
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
version: string;
|
||||||
status: ToolInstallationStatus;
|
status: ToolInstallationStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,10 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import { TargetClusterType, ClusterPorts, ContainerRegistryInfo, TargetClusterTypeInfo, ToolInfo, ToolInstallationStatus } from '../../interfaces';
|
import { TargetClusterType, ClusterPorts, ClusterType, ContainerRegistryInfo, TargetClusterTypeInfo, ToolInfo, ToolInstallationStatus } from '../../interfaces';
|
||||||
import { getContexts, KubectlContext, setContext, inferCurrentClusterType } from '../../kubectl/kubectlUtils';
|
import { getContexts, KubectlContext, setContext, inferCurrentClusterType } from '../../kubectl/kubectlUtils';
|
||||||
import { Kubectl } from '../../kubectl/kubectl';
|
import { Kubectl } from '../../kubectl/kubectl';
|
||||||
import { Scriptable, ScriptingDictionary } from '../../scripting/scripting';
|
import { Scriptable, ScriptingDictionary } from '../../scripting/scripting';
|
||||||
import { ClusterType} from '../../interfaces';
|
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
@@ -16,8 +15,8 @@ const localize = nls.loadMessageBundle();
|
|||||||
export class CreateClusterModel implements Scriptable {
|
export class CreateClusterModel implements Scriptable {
|
||||||
|
|
||||||
private _tmp_tools_installed: boolean = false;
|
private _tmp_tools_installed: boolean = false;
|
||||||
private scriptingProperties : ScriptingDictionary<string> = {};
|
private scriptingProperties: ScriptingDictionary<string> = {};
|
||||||
constructor(private _kubectl : Kubectl) {
|
constructor(private _kubectl: Kubectl) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async loadClusters(): Promise<KubectlContext[]> {
|
public async loadClusters(): Promise<KubectlContext[]> {
|
||||||
@@ -58,6 +57,9 @@ export class CreateClusterModel implements Scriptable {
|
|||||||
let aksCluster: TargetClusterTypeInfo = {
|
let aksCluster: TargetClusterTypeInfo = {
|
||||||
type: TargetClusterType.NewAksCluster,
|
type: TargetClusterType.NewAksCluster,
|
||||||
name: localize('bdc-create.AKSClusterCardText', 'New AKS Cluster'),
|
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: {
|
iconPath: {
|
||||||
dark: 'images/cluster_inverse.svg',
|
dark: 'images/cluster_inverse.svg',
|
||||||
light: 'images/cluster.svg'
|
light: 'images/cluster.svg'
|
||||||
@@ -66,7 +68,9 @@ export class CreateClusterModel implements Scriptable {
|
|||||||
|
|
||||||
let existingCluster: TargetClusterTypeInfo = {
|
let existingCluster: TargetClusterTypeInfo = {
|
||||||
type: TargetClusterType.ExistingKubernetesCluster,
|
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: {
|
iconPath: {
|
||||||
dark: 'images/cluster_inverse.svg',
|
dark: 'images/cluster_inverse.svg',
|
||||||
light: 'images/cluster.svg'
|
light: 'images/cluster.svg'
|
||||||
@@ -81,16 +85,19 @@ export class CreateClusterModel implements Scriptable {
|
|||||||
let kubeCtl = {
|
let kubeCtl = {
|
||||||
name: 'kubectl',
|
name: 'kubectl',
|
||||||
description: 'Tool used for managing the Kubernetes cluster',
|
description: 'Tool used for managing the Kubernetes cluster',
|
||||||
|
version: '',
|
||||||
status: ToolInstallationStatus.Installed
|
status: ToolInstallationStatus.Installed
|
||||||
};
|
};
|
||||||
let mssqlCtl = {
|
let mssqlCtl = {
|
||||||
name: 'mssqlctl',
|
name: 'mssqlctl',
|
||||||
description: 'Command-line tool for installing and managing the SQL Server big data cluster',
|
description: 'Command-line tool for installing and managing the SQL Server big data cluster',
|
||||||
|
version: '',
|
||||||
status: ToolInstallationStatus.Installed
|
status: ToolInstallationStatus.Installed
|
||||||
};
|
};
|
||||||
let azureCli = {
|
let azureCli = {
|
||||||
name: 'Azure CLI',
|
name: 'Azure CLI',
|
||||||
description: 'Tool used for managing Azure services',
|
description: 'Tool used for managing Azure services',
|
||||||
|
version: '',
|
||||||
status: this._tmp_tools_installed ? ToolInstallationStatus.Installed : ToolInstallationStatus.NotInstalled
|
status: this._tmp_tools_installed ? ToolInstallationStatus.Installed : ToolInstallationStatus.NotInstalled
|
||||||
};
|
};
|
||||||
let promise = new Promise<ToolInfo[]>(resolve => {
|
let promise = new Promise<ToolInfo[]>(resolve => {
|
||||||
@@ -143,7 +150,7 @@ export class CreateClusterModel implements Scriptable {
|
|||||||
|
|
||||||
public containerRegistryPassword: string;
|
public containerRegistryPassword: string;
|
||||||
|
|
||||||
public async getTargetClusterPlatform(targetContextName : string) : Promise<string> {
|
public async getTargetClusterPlatform(targetContextName: string): Promise<string> {
|
||||||
await setContext(this._kubectl, targetContextName);
|
await setContext(this._kubectl, targetContextName);
|
||||||
let clusterType = await inferCurrentClusterType(this._kubectl);
|
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
|
// Cluster settings
|
||||||
this.scriptingProperties['CLUSTER_NAME'] = this.selectedCluster.clusterName;
|
this.scriptingProperties['CLUSTER_NAME'] = this.selectedCluster.clusterName;
|
||||||
@@ -177,7 +184,7 @@ export class CreateClusterModel implements Scriptable {
|
|||||||
|
|
||||||
// docker settings
|
// docker settings
|
||||||
this.scriptingProperties['DOCKER_REPOSITORY'] = this.containerRepository;
|
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_PASSWORD'] = this.containerRegistryPassword;
|
||||||
this.scriptingProperties['DOCKER_USERNAME'] = this.containerRegistryUserName;
|
this.scriptingProperties['DOCKER_USERNAME'] = this.containerRegistryUserName;
|
||||||
this.scriptingProperties['DOCKER_IMAGE_TAG'] = this.containerImageTag;
|
this.scriptingProperties['DOCKER_IMAGE_TAG'] = this.containerImageTag;
|
||||||
@@ -191,7 +198,7 @@ export class CreateClusterModel implements Scriptable {
|
|||||||
return this.scriptingProperties;
|
return this.scriptingProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getTargetKubectlContext() : KubectlContext {
|
public getTargetKubectlContext(): KubectlContext {
|
||||||
return this.selectedCluster;
|
return this.selectedCluster;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export class SelectExistingClusterPage extends WizardPageBase<CreateClusterWizar
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
{
|
{
|
||||||
horizontal: true
|
horizontal: false
|
||||||
}
|
}
|
||||||
).withLayout({ width: '100%', height: '100%' });
|
).withLayout({ width: '100%', height: '100%' });
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
|
|||||||
private installToolsButton: azdata.window.Button;
|
private installToolsButton: azdata.window.Button;
|
||||||
private toolsLoadingWrapper: azdata.LoadingComponent;
|
private toolsLoadingWrapper: azdata.LoadingComponent;
|
||||||
private refreshToolsButton: azdata.window.Button;
|
private refreshToolsButton: azdata.window.Button;
|
||||||
|
private targetDescriptionText: azdata.TextComponent;
|
||||||
|
private targetDescriptionGroup: azdata.FormComponent;
|
||||||
private isValid: boolean = false;
|
private isValid: boolean = false;
|
||||||
private isLoading: boolean = false;
|
private isLoading: boolean = false;
|
||||||
private requiredTools: ToolInfo[];
|
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();
|
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 = {
|
let toolColumn: azdata.TableColumn = {
|
||||||
value: localize('bdc-create.toolNameColumnHeader', 'Tool'),
|
value: localize('bdc-create.toolNameColumnHeader', 'Tool'),
|
||||||
width: 100
|
width: 100
|
||||||
};
|
};
|
||||||
let descriptionColumn: azdata.TableColumn = {
|
let descriptionColumn: azdata.TableColumn = {
|
||||||
value: localize('bdc-create.toolDescriptionColumnHeader', 'Description'),
|
value: localize('bdc-create.toolDescriptionColumnHeader', 'Description'),
|
||||||
|
width: 500
|
||||||
|
};
|
||||||
|
let versionColumn: azdata.TableColumn = {
|
||||||
|
value: localize('bdc-create.toolVersionColumnHeader', 'Version'),
|
||||||
width: 200
|
width: 200
|
||||||
};
|
};
|
||||||
let statusColumn: azdata.TableColumn = {
|
let statusColumn: azdata.TableColumn = {
|
||||||
value: localize('bdc-create.toolStatusColumnHeader', 'Status'),
|
value: localize('bdc-create.toolStatusColumnHeader', 'Status'),
|
||||||
width: 100
|
width: 200
|
||||||
};
|
};
|
||||||
|
|
||||||
self.toolsTable = view.modelBuilder.table().withProperties<azdata.TableComponentProperties>({
|
self.toolsTable = view.modelBuilder.table().withProperties<azdata.TableComponentProperties>({
|
||||||
height: 150,
|
height: 150,
|
||||||
data: [],
|
data: [],
|
||||||
columns: [toolColumn, descriptionColumn, statusColumn],
|
columns: [toolColumn, descriptionColumn, versionColumn, statusColumn],
|
||||||
width: 850
|
width: 1000
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
self.toolsLoadingWrapper = view.modelBuilder.loadingComponent().withItem(self.toolsTable).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) {
|
if (self.form.items.length === 1) {
|
||||||
self.formBuilder.addFormItem({
|
self.formBuilder.addFormItem({
|
||||||
title: localize('bdc-create.RequiredToolsText', 'Required tools'),
|
title: localize('bdc-create.RequiredToolsText', 'Required tools'),
|
||||||
component: self.toolsLoadingWrapper
|
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();
|
self.updateRequiredToolStatus();
|
||||||
} else {
|
} else {
|
||||||
if (self.cards.filter(c => { return c !== card && c.selected; }).length === 0) {
|
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 {
|
private updateToolStatusTable(): void {
|
||||||
if (this.requiredTools) {
|
if (this.requiredTools) {
|
||||||
let tableData = this.requiredTools.map(tool => {
|
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;
|
this.toolsTable.data = tableData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
.dialogModal-wizardHeader h1 {
|
.dialogModal-wizardHeader h1 {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 3px;
|
margin-bottom: 10px;
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
font-weight: lighter;
|
font-weight: lighter;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user