mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 01:25:38 -05:00
Some general cleanup/fixes for Arc dashboards (#11066)
* Some general cleanup/fixes for Arc dashboards * more disposables * refresh controller model for miaa dashboard too * fixes
This commit is contained in:
@@ -10,6 +10,7 @@ import { parseEndpoint, parseInstanceName } from '../common/utils';
|
||||
import { ResourceType } from '../constants';
|
||||
import { ConnectToControllerDialog } from '../ui/dialogs/connectControllerDialog';
|
||||
import { AzureArcTreeDataProvider } from '../ui/tree/azureArcTreeDataProvider';
|
||||
import * as loc from '../localizedConstants';
|
||||
|
||||
export type ControllerInfo = {
|
||||
url: string,
|
||||
@@ -88,6 +89,13 @@ export class ControllerModel {
|
||||
this._endpoints = response.body;
|
||||
this.endpointsLastUpdated = new Date();
|
||||
this._onEndpointsUpdated.fire(this._endpoints);
|
||||
}).catch(err => {
|
||||
// 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));
|
||||
this._onEndpointsUpdated.fire(this._endpoints);
|
||||
throw err;
|
||||
}),
|
||||
this._tokenRouter.apiV1TokenPost().then(async response => {
|
||||
this._namespace = response.body.namespace!;
|
||||
@@ -95,7 +103,14 @@ export class ControllerModel {
|
||||
this._controllerRegistration = this._registrations.find(r => r.instanceType === ResourceType.dataControllers);
|
||||
this.registrationsLastUpdated = new Date();
|
||||
this._onRegistrationsUpdated.fire(this._registrations);
|
||||
})
|
||||
}).catch(err => {
|
||||
// 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));
|
||||
this._onRegistrationsUpdated.fire(this._registrations);
|
||||
throw err;
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user