mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Canye/fix refresh (#19424)
* Bump version of arc and azcli to 1.3.0 * Fixed refresh to do dc config show and endpoint list first, then check the connectionmode * Await calls to refresh indirect and direct * Made sql mi-arc delete also handle direct mode. Made customlocation for sql mi create work again, regex problem. Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
@@ -19,7 +19,7 @@ export class ControllerDashboard extends Dashboard {
|
||||
public override async showDashboard(): Promise<void> {
|
||||
await super.showDashboard();
|
||||
// Kick off the model refresh but don't wait on it since that's all handled with callbacks anyways
|
||||
this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace).catch(err => console.log(`Error refreshing Controller dashboard ${err}`));
|
||||
this._controllerModel.refresh(false, this._controllerModel.info.namespace).catch(err => console.log(`Error refreshing Controller dashboard ${err}`));
|
||||
}
|
||||
|
||||
protected async registerTabs(modelView: azdata.ModelView): Promise<(azdata.DashboardTab | azdata.DashboardTabGroup)[]> {
|
||||
|
||||
@@ -57,7 +57,7 @@ export class ControllerDashboardOverviewPage extends DashboardPage {
|
||||
}
|
||||
|
||||
protected async refresh(): Promise<void> {
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace);
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.namespace);
|
||||
}
|
||||
|
||||
public get container(): azdata.Component {
|
||||
|
||||
@@ -35,7 +35,7 @@ export class ControllerUpgradesPage extends DashboardPage {
|
||||
return IconPathHelper.upgrade;
|
||||
}
|
||||
protected async refresh(): Promise<void> {
|
||||
await Promise.resolve(this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace));
|
||||
await Promise.resolve(this._controllerModel.refresh(false, this._controllerModel.info.namespace));
|
||||
this.handleTableUpdated();
|
||||
}
|
||||
|
||||
@@ -236,7 +236,6 @@ export class ControllerUpgradesPage extends DashboardPage {
|
||||
this._controllerModel.info.name,
|
||||
this._controllerModel.info.resourceGroup,
|
||||
undefined, // Indirect mode argument - namespace
|
||||
undefined // Indirect mode argument - usek8s
|
||||
);
|
||||
} else {
|
||||
await this._azApi.az.arcdata.dc.upgrade(
|
||||
@@ -244,7 +243,6 @@ export class ControllerUpgradesPage extends DashboardPage {
|
||||
this._controllerModel.info.name,
|
||||
undefined, // Direct mode argument - resourceGroup
|
||||
this._controllerModel.info.namespace,
|
||||
true
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -252,7 +250,7 @@ export class ControllerUpgradesPage extends DashboardPage {
|
||||
}
|
||||
|
||||
try {
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace);
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.namespace);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.refreshFailed(error));
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export class MiaaBackupsPage extends DashboardPage {
|
||||
return IconPathHelper.pitr;
|
||||
}
|
||||
protected async refresh(): Promise<void> {
|
||||
await Promise.all([this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace), this._miaaModel.refresh()]);
|
||||
await Promise.all([this._controllerModel.refresh(false, this._controllerModel.info.namespace), this._miaaModel.refresh()]);
|
||||
}
|
||||
|
||||
public get container(): azdata.Component {
|
||||
|
||||
@@ -23,7 +23,7 @@ export class MiaaDashboard extends Dashboard {
|
||||
public override async showDashboard(): Promise<void> {
|
||||
await super.showDashboard();
|
||||
// Kick off the model refreshes but don't wait on it since that's all handled with callbacks anyways
|
||||
this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace).catch(err => console.log(`Error refreshing controller model for MIAA dashboard ${err}`));
|
||||
this._controllerModel.refresh(false, this._controllerModel.info.namespace).catch(err => console.log(`Error refreshing controller model for MIAA dashboard ${err}`));
|
||||
this._miaaModel.refresh().catch(err => console.log(`Error refreshing MIAA model for MIAA dashboard ${err}`));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as azExt from 'az-ext';
|
||||
import * as azurecore from 'azurecore';
|
||||
import * as vscode from 'vscode';
|
||||
import { getDatabaseStateDisplayText, promptForInstanceDeletion } from '../../../common/utils';
|
||||
import { cssStyles, IconPathHelper, miaaTroubleshootDocsUrl } from '../../../constants';
|
||||
import { ConnectionMode, cssStyles, IconPathHelper, miaaTroubleshootDocsUrl } from '../../../constants';
|
||||
import * as loc from '../../../localizedConstants';
|
||||
import { ControllerModel } from '../../../models/controllerModel';
|
||||
import { MiaaModel } from '../../../models/miaaModel';
|
||||
@@ -74,7 +74,7 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
}
|
||||
|
||||
protected async refresh(): Promise<void> {
|
||||
await Promise.all([this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace), this._miaaModel.refresh()]);
|
||||
await Promise.all([this._controllerModel.refresh(false, this._controllerModel.info.namespace), this._miaaModel.refresh()]);
|
||||
}
|
||||
|
||||
public get container(): azdata.Component {
|
||||
@@ -243,7 +243,25 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
cancellable: false
|
||||
},
|
||||
async (_progress, _token) => {
|
||||
return await this._azApi.az.sql.miarc.delete(this._miaaModel.info.name, this._controllerModel.info.namespace, this._controllerModel.azAdditionalEnvVars);
|
||||
if (this._controllerModel.info.connectionMode === ConnectionMode.direct) {
|
||||
return await this._azApi.az.sql.miarc.delete(
|
||||
this._miaaModel.info.name,
|
||||
{
|
||||
resourceGroup: this._controllerModel.info.resourceGroup,
|
||||
namespace: undefined,
|
||||
},
|
||||
this._controllerModel.azAdditionalEnvVars
|
||||
);
|
||||
} else {
|
||||
return await this._azApi.az.sql.miarc.delete(
|
||||
this._miaaModel.info.name,
|
||||
{
|
||||
resourceGroup: undefined,
|
||||
namespace: this._controllerModel.info.namespace,
|
||||
},
|
||||
this._controllerModel.azAdditionalEnvVars
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
await this._controllerModel.refreshTreeNode();
|
||||
|
||||
@@ -36,7 +36,7 @@ export class MiaaUpgradeManagementPage extends DashboardPage {
|
||||
return IconPathHelper.upgrade;
|
||||
}
|
||||
protected async refresh(): Promise<void> {
|
||||
await Promise.resolve(this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace));
|
||||
await Promise.resolve(this._controllerModel.refresh(false, this._controllerModel.info.namespace));
|
||||
this.handleTableUpdated();
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
if (this._controllerModel.info.connectionMode === ConnectionMode.direct || this._controllerModel.controllerConfig?.spec.settings.azure.connectionMode === ConnectionMode.direct) {
|
||||
miaaShowResult = await this._azApi.az.sql.miarc.show(
|
||||
this._miaaModel.info.name,
|
||||
{
|
||||
@@ -289,7 +289,7 @@ export class MiaaUpgradeManagementPage extends DashboardPage {
|
||||
}
|
||||
|
||||
try {
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace);
|
||||
await this._controllerModel.refresh(false, this._controllerModel.info.namespace);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.refreshFailed(error));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export class PostgresDashboard extends Dashboard {
|
||||
await super.showDashboard();
|
||||
|
||||
// Kick off the model refresh but don't wait on it since that's all handled with callbacks anyways
|
||||
this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace).catch(err => console.log(`Error refreshing controller model for Postgres dashboard ${err}`));
|
||||
this._controllerModel.refresh(false, this._controllerModel.info.namespace).catch(err => console.log(`Error refreshing controller model for Postgres dashboard ${err}`));
|
||||
this._postgresModel.refresh().catch(err => console.log(`Error refreshing Postgres model for Postgres dashboard ${err}`));
|
||||
}
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
|
||||
await Promise.all([
|
||||
this._postgresModel.refresh(),
|
||||
this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace)
|
||||
this._controllerModel.refresh(false, this._controllerModel.info.namespace)
|
||||
]);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.refreshFailed(error));
|
||||
|
||||
@@ -77,7 +77,7 @@ export class PostgresPropertiesPage extends DashboardPage {
|
||||
this.loading!.loading = true;
|
||||
await Promise.all([
|
||||
this._postgresModel.refresh(),
|
||||
this._controllerModel.refresh(false, this._controllerModel.info.resourceGroup, this._controllerModel.info.namespace)
|
||||
this._controllerModel.refresh(false, this._controllerModel.info.namespace)
|
||||
]);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.refreshFailed(error));
|
||||
|
||||
Reference in New Issue
Block a user