mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Added check for .toLowerCase and added upgrade message for clarity. (#20187)
Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
@@ -222,15 +222,15 @@ export class ControllerUpgradesPage extends DashboardPage {
|
||||
try {
|
||||
upgradeButton.enabled = false;
|
||||
vscode.window.showInformationMessage(loc.upgradingController('kubectl get datacontrollers -A\' should not be localized.'));
|
||||
await vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title: loc.updatingInstance(this._controllerModel.info.name),
|
||||
cancellable: true
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
if (nextVersion !== '') {
|
||||
if (this._controllerModel.info.connectionMode === ConnectionMode.direct) {
|
||||
if (this._controllerModel.info.connectionMode.toLowerCase() === ConnectionMode.direct) {
|
||||
await vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title: loc.upgradingDirectDC(this._controllerModel.info.name, nextVersion, this._controllerModel.info.resourceGroup),
|
||||
cancellable: true
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
if (nextVersion !== '') {
|
||||
await this._azApi.az.arcdata.dc.upgrade(
|
||||
nextVersion,
|
||||
this._controllerModel.info.name,
|
||||
@@ -238,24 +238,41 @@ export class ControllerUpgradesPage extends DashboardPage {
|
||||
undefined, // Indirect mode argument - namespace
|
||||
);
|
||||
} else {
|
||||
vscode.window.showInformationMessage(loc.noUpgrades);
|
||||
}
|
||||
try {
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.namespace);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.refreshFailed(error));
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
await vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title: loc.upgradingIndirectDC(this._controllerModel.info.name, nextVersion, this._controllerModel.info.namespace),
|
||||
cancellable: true
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
if (nextVersion !== '') {
|
||||
await this._azApi.az.arcdata.dc.upgrade(
|
||||
nextVersion,
|
||||
this._controllerModel.info.name,
|
||||
undefined, // Direct mode argument - resourceGroup
|
||||
this._controllerModel.info.namespace,
|
||||
);
|
||||
} else {
|
||||
vscode.window.showInformationMessage(loc.noUpgrades);
|
||||
}
|
||||
try {
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.namespace);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.refreshFailed(error));
|
||||
}
|
||||
} else {
|
||||
vscode.window.showInformationMessage(loc.noUpgrades);
|
||||
}
|
||||
|
||||
try {
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.namespace);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.refreshFailed(error));
|
||||
}
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ export class MiaaBackupsPage extends DashboardPage {
|
||||
cancellable: false
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
if (this._miaaModel.controllerModel.info.connectionMode === ConnectionMode.direct) {
|
||||
if (this._miaaModel.controllerModel.info.connectionMode.toLowerCase() === ConnectionMode.direct) {
|
||||
await this._azApi.az.sql.miarc.update(
|
||||
this._miaaModel.info.name,
|
||||
this._saveArgs,
|
||||
|
||||
@@ -132,7 +132,7 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
try {
|
||||
if (this._miaaModel.controllerModel.info.connectionMode === ConnectionMode.direct) {
|
||||
if (this._miaaModel.controllerModel.info.connectionMode.toLowerCase() === ConnectionMode.direct) {
|
||||
await this._azApi.az.sql.miarc.update(
|
||||
this._miaaModel.info.name,
|
||||
this.saveArgs,
|
||||
|
||||
@@ -243,7 +243,7 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
cancellable: false
|
||||
},
|
||||
async (_progress, _token) => {
|
||||
if (this._controllerModel.info.connectionMode === ConnectionMode.direct) {
|
||||
if (this._controllerModel.info.connectionMode.toLowerCase() === ConnectionMode.direct) {
|
||||
return await this._azApi.az.sql.miarc.delete(
|
||||
this._miaaModel.info.name,
|
||||
{
|
||||
|
||||
@@ -160,7 +160,7 @@ export class MiaaUpgradeManagementPage extends DashboardPage {
|
||||
private async getMiaaVersion(): Promise<string | undefined> {
|
||||
try {
|
||||
let miaaShowResult;
|
||||
if (this._controllerModel.info.connectionMode === ConnectionMode.direct || this._controllerModel.controllerConfig?.spec.settings.azure.connectionMode.toLowerCase() === ConnectionMode.direct) {
|
||||
if (this._controllerModel.info.connectionMode.toLowerCase() === ConnectionMode.direct || this._controllerModel.controllerConfig?.spec.settings.azure.connectionMode.toLowerCase() === ConnectionMode.direct) {
|
||||
miaaShowResult = await this._azApi.az.sql.miarc.show(
|
||||
this._miaaModel.info.name,
|
||||
{
|
||||
@@ -263,14 +263,14 @@ export class MiaaUpgradeManagementPage extends DashboardPage {
|
||||
try {
|
||||
upgradeButton.enabled = false;
|
||||
vscode.window.showInformationMessage(loc.upgradingMiaa('kubectl get sqlmi -A\' should not be localized.'));
|
||||
await vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title: loc.updatingInstance(this._miaaModel.info.name),
|
||||
cancellable: true
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
if (this._controllerModel.info.connectionMode === ConnectionMode.direct) {
|
||||
if (this._controllerModel.info.connectionMode.toLowerCase() === ConnectionMode.direct) {
|
||||
await vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title: loc.upgradingDirectMiaa(this._miaaModel.info.name, this._controllerModel.info.resourceGroup),
|
||||
cancellable: true
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
await this._azApi.az.sql.miarc.upgrade(
|
||||
this._miaaModel.info.name,
|
||||
{
|
||||
@@ -278,7 +278,21 @@ export class MiaaUpgradeManagementPage extends DashboardPage {
|
||||
namespace: undefined
|
||||
}
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.namespace);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.refreshFailed(error));
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
await vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title: loc.upgradingIndirectMiaa(this._miaaModel.info.name, this._controllerModel.info.namespace),
|
||||
cancellable: true
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
await this._azApi.az.sql.miarc.upgrade(
|
||||
this._miaaModel.info.name,
|
||||
{
|
||||
@@ -286,15 +300,14 @@ export class MiaaUpgradeManagementPage extends DashboardPage {
|
||||
namespace: this._controllerModel.info.namespace,
|
||||
}
|
||||
);
|
||||
try {
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.namespace);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.refreshFailed(error));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.namespace);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.refreshFailed(error));
|
||||
}
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user