Some cleanup and fixes for Arc/BDC dashboards (#11075)

This commit is contained in:
Charles Gagnon
2020-06-24 12:41:33 -07:00
committed by GitHub
parent 6f6bf3f3b3
commit c62394262a
19 changed files with 1021 additions and 1063 deletions

View File

@@ -62,7 +62,7 @@ export class ControllerModel {
}
}
public async refresh(): Promise<void> {
public async refresh(showErrors: boolean = true): Promise<void> {
// We haven't gotten our password yet, fetch it now
if (!this._auth) {
let password = '';
@@ -93,7 +93,9 @@ export class ControllerModel {
// If an error occurs show a message so the user knows something failed but still
// fire the event so callers can know to update (e.g. so dashboards don't show the
// loading icon forever)
vscode.window.showErrorMessage(loc.fetchEndpointsFailed(this.info.url, err));
if (showErrors) {
vscode.window.showErrorMessage(loc.fetchEndpointsFailed(this.info.url, err));
}
this._onEndpointsUpdated.fire(this._endpoints);
throw err;
}),
@@ -107,7 +109,9 @@ export class ControllerModel {
// If an error occurs show a message so the user knows something failed but still
// fire the event so callers can know to update (e.g. so dashboards don't show the
// loading icon forever)
vscode.window.showErrorMessage(loc.fetchRegistrationsFailed(this.info.url, err));
if (showErrors) {
vscode.window.showErrorMessage(loc.fetchRegistrationsFailed(this.info.url, err));
}
this._onRegistrationsUpdated.fire(this._registrations);
throw err;
}),

View File

@@ -184,8 +184,24 @@ export class MiaaModel extends ResourceModel {
}
if (!connection) {
// We need the password so prompt the user for it
const connectionProfile: azdata.IConnectionProfile = {
serverName: (this.registration.externalIp && this.registration.externalPort) ? `${this.registration.externalIp},${this.registration.externalPort}` : '',
databaseName: '',
authenticationType: 'SqlLogin',
providerName: 'MSSQL',
connectionName: '',
userName: 'sa',
password: '',
savePassword: true,
groupFullName: undefined,
saveProfile: true,
id: '',
groupId: undefined,
options: {}
};
// Weren't able to load the existing connection so prompt user for new one
connection = await azdata.connection.openConnectionDialog(['MSSQL']);
connection = await azdata.connection.openConnectionDialog(['MSSQL'], connectionProfile);
}
if (connection) {