mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
@@ -254,7 +254,8 @@
|
|||||||
"name": "azure-cli"
|
"name": "azure-cli"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "azdata"
|
"name": "azdata",
|
||||||
|
"version": "15.0.2070"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"when": "target=new-aks&&version=bdc2019"
|
"when": "target=new-aks&&version=bdc2019"
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ export const enum ToolStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ITool {
|
export interface ITool {
|
||||||
|
readonly status: ToolStatus;
|
||||||
readonly isInstalling: boolean;
|
readonly isInstalling: boolean;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly displayName: string;
|
readonly displayName: string;
|
||||||
@@ -245,6 +246,7 @@ export interface ITool {
|
|||||||
showOutputChannel(preserveFocus?: boolean): void;
|
showOutputChannel(preserveFocus?: boolean): void;
|
||||||
loadInformation(): Promise<void>;
|
loadInformation(): Promise<void>;
|
||||||
install(): Promise<void>;
|
install(): Promise<void>;
|
||||||
|
isSameOrNewerThan(version: string): boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const enum BdcDeploymentType {
|
export const enum BdcDeploymentType {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
import { EOL } from 'os';
|
import { EOL } from 'os';
|
||||||
import { delimiter } from 'path';
|
import { delimiter } from 'path';
|
||||||
import { SemVer } from 'semver';
|
import { SemVer, compare } from 'semver';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
import { Command, ITool, OsType, ToolStatus, ToolType } from '../../interfaces';
|
import { Command, ITool, OsType, ToolStatus, ToolType } from '../../interfaces';
|
||||||
@@ -63,11 +63,11 @@ export abstract class ToolBase implements ITool {
|
|||||||
return this._onDidUpdateData.event;
|
return this._onDidUpdateData.event;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get status(): ToolStatus {
|
get status(): ToolStatus {
|
||||||
return this._status;
|
return this._status;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected set status(value: ToolStatus) {
|
set status(value: ToolStatus) {
|
||||||
this._status = value;
|
this._status = value;
|
||||||
this._onDidUpdateData.fire(this);
|
this._onDidUpdateData.fire(this);
|
||||||
}
|
}
|
||||||
@@ -270,6 +270,13 @@ export abstract class ToolBase implements ITool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isSameOrNewerThan(version: string): boolean {
|
||||||
|
const currentVersion = new SemVer(this.fullVersion!);
|
||||||
|
const requiredVersion = new SemVer(version);
|
||||||
|
|
||||||
|
return compare(currentVersion, requiredVersion) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
private _storagePathEnsured: boolean = false;
|
private _storagePathEnsured: boolean = false;
|
||||||
private _status: ToolStatus = ToolStatus.NotInstalled;
|
private _status: ToolStatus = ToolStatus.NotInstalled;
|
||||||
private _osType: OsType;
|
private _osType: OsType;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
import { EOL } from 'os';
|
import { EOL } from 'os';
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
import { AgreementInfo, DeploymentProvider, ITool, ResourceType } from '../interfaces';
|
import { AgreementInfo, DeploymentProvider, ITool, ResourceType, ToolStatus } from '../interfaces';
|
||||||
import { IResourceTypeService } from '../services/resourceTypeService';
|
import { IResourceTypeService } from '../services/resourceTypeService';
|
||||||
import { IToolsService } from '../services/toolsService';
|
import { IToolsService } from '../services/toolsService';
|
||||||
import { getErrorMessage, setEnvironmentVariablesForInstallPaths } from '../utils';
|
import { getErrorMessage, setEnvironmentVariablesForInstallPaths } from '../utils';
|
||||||
@@ -84,10 +84,14 @@ export class ResourceTypePickerDialog extends DialogBase {
|
|||||||
value: localize('deploymentDialog.toolVersionColumnHeader', "Version"),
|
value: localize('deploymentDialog.toolVersionColumnHeader', "Version"),
|
||||||
width: 100
|
width: 100
|
||||||
};
|
};
|
||||||
|
const minVersionColumn: azdata.TableColumn = {
|
||||||
|
value: localize('deploymentDialog.toolMinimumVersionColumnHeader', "Minimum Version"),
|
||||||
|
width: 100
|
||||||
|
};
|
||||||
|
|
||||||
this._toolsTable = view.modelBuilder.table().withProperties<azdata.TableComponentProperties>({
|
this._toolsTable = view.modelBuilder.table().withProperties<azdata.TableComponentProperties>({
|
||||||
data: [],
|
data: [],
|
||||||
columns: [toolColumn, descriptionColumn, installStatusColumn, versionColumn],
|
columns: [toolColumn, descriptionColumn, installStatusColumn, versionColumn, minVersionColumn],
|
||||||
width: tableWidth
|
width: tableWidth
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
@@ -222,6 +226,7 @@ export class ResourceTypePickerDialog extends DialogBase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let autoInstallRequired = false;
|
let autoInstallRequired = false;
|
||||||
|
let minVersionCheckFailed = false;
|
||||||
const messages: string[] = [];
|
const messages: string[] = [];
|
||||||
this._toolsTable.data = toolRequirements.map(toolReq => {
|
this._toolsTable.data = toolRequirements.map(toolReq => {
|
||||||
const tool = this.toolsService.getToolByName(toolReq.name)!;
|
const tool = this.toolsService.getToolByName(toolReq.name)!;
|
||||||
@@ -234,19 +239,24 @@ export class ResourceTypePickerDialog extends DialogBase {
|
|||||||
if (tool.statusDescription !== undefined) {
|
if (tool.statusDescription !== undefined) {
|
||||||
console.warn(localize('deploymentDialog.DetailToolStatusDescription', "Additional status information for tool: '{0}' [ {1} ]. {2}", tool.name, tool.homePage, tool.statusDescription));
|
console.warn(localize('deploymentDialog.DetailToolStatusDescription', "Additional status information for tool: '{0}' [ {1} ]. {2}", tool.name, tool.homePage, tool.statusDescription));
|
||||||
}
|
}
|
||||||
}
|
} else if (tool.status === ToolStatus.Installed && toolReq.version && !tool.isSameOrNewerThan(toolReq.version)) {
|
||||||
|
minVersionCheckFailed = true;
|
||||||
|
messages.push(localize('deploymentDialog.ToolDoesNotMeetVersionRequirement', "'{0}' [ {1} ] does not meet the minimum version requirement, please uninstall it and restart Azure Data Studio.", tool.displayName, tool.homePage));
|
||||||
|
|
||||||
autoInstallRequired = tool.autoInstallRequired;
|
}
|
||||||
return [tool.displayName, tool.description, tool.displayStatus, tool.fullVersion || ''];
|
autoInstallRequired = autoInstallRequired || tool.autoInstallRequired;
|
||||||
|
return [tool.displayName, tool.description, tool.displayStatus, tool.fullVersion || '', toolReq.version || ''];
|
||||||
});
|
});
|
||||||
|
|
||||||
this._installToolButton.hidden = !autoInstallRequired;
|
this._installToolButton.hidden = !autoInstallRequired;
|
||||||
this._dialogObject.okButton.enabled = messages.length === 0 && !autoInstallRequired;
|
this._dialogObject.okButton.enabled = messages.length === 0 && !autoInstallRequired;
|
||||||
if (messages.length !== 0) {
|
if (messages.length !== 0) {
|
||||||
messages.push(localize('deploymentDialog.VersionInformationDebugHint', "You will need to restart Azure Data Studio if the tools are installed by yourself after Azure Data Studio is launched to pick up the updated PATH environment variable. You may find additional details in the debug console by running the 'Toggle Developer Tools' command in the Azure Data Studio Command Palette."));
|
if (!minVersionCheckFailed) {
|
||||||
|
messages.push(localize('deploymentDialog.VersionInformationDebugHint', "You will need to restart Azure Data Studio if the tools are installed by yourself after Azure Data Studio is launched to pick up the updated PATH environment variable. You may find additional details in the debug console by running the 'Toggle Developer Tools' command in the Azure Data Studio Command Palette."));
|
||||||
|
}
|
||||||
this._dialogObject.message = {
|
this._dialogObject.message = {
|
||||||
level: azdata.window.MessageLevel.Error,
|
level: azdata.window.MessageLevel.Error,
|
||||||
text: localize('deploymentDialog.ToolCheckFailed', "Some required tools are not installed."),
|
text: localize('deploymentDialog.ToolCheckFailed', "Some required tools are not installed or do not meet the minimum version requirement."),
|
||||||
description: messages.join(EOL)
|
description: messages.join(EOL)
|
||||||
};
|
};
|
||||||
} else if (autoInstallRequired) {
|
} else if (autoInstallRequired) {
|
||||||
@@ -295,7 +305,7 @@ export class ResourceTypePickerDialog extends DialogBase {
|
|||||||
public updateToolsDisplayTableData(tool: ITool) {
|
public updateToolsDisplayTableData(tool: ITool) {
|
||||||
this._toolsTable.data = this._toolsTable.data.map(rowData => {
|
this._toolsTable.data = this._toolsTable.data.map(rowData => {
|
||||||
if (rowData[0] === tool.displayName) {
|
if (rowData[0] === tool.displayName) {
|
||||||
return [tool.displayName, tool.description, tool.displayStatus, tool.fullVersion || ''];
|
return [tool.displayName, tool.description, tool.displayStatus, tool.fullVersion || '', rowData[4]];
|
||||||
} else {
|
} else {
|
||||||
return rowData;
|
return rowData;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user