Fix arc node info updating (#12007)

* Fix arc node info updating

* Missed await
This commit is contained in:
Charles Gagnon
2020-08-28 15:53:17 -07:00
committed by GitHub
parent ceb4df5b8b
commit 47c1204e89
12 changed files with 179 additions and 50 deletions

View File

@@ -12,6 +12,7 @@ import * as loc from '../localizedConstants';
import { ConnectToControllerDialog } from '../ui/dialogs/connectControllerDialog';
export type ControllerInfo = {
id: string,
url: string,
name: string,
username: string,
@@ -41,19 +42,30 @@ export class ControllerModel {
private readonly _onConfigUpdated = new vscode.EventEmitter<azdataExt.DcConfigShowResult | undefined>();
private readonly _onEndpointsUpdated = new vscode.EventEmitter<azdataExt.DcEndpointListResult[]>();
private readonly _onRegistrationsUpdated = new vscode.EventEmitter<Registration[]>();
private readonly _onInfoUpdated = new vscode.EventEmitter<ControllerInfo>();
public onConfigUpdated = this._onConfigUpdated.event;
public onEndpointsUpdated = this._onEndpointsUpdated.event;
public onRegistrationsUpdated = this._onRegistrationsUpdated.event;
public onInfoUpdated = this._onInfoUpdated.event;
public configLastUpdated?: Date;
public endpointsLastUpdated?: Date;
public registrationsLastUpdated?: Date;
constructor(public treeDataProvider: AzureArcTreeDataProvider, public info: ControllerInfo, private _password?: string) {
constructor(public treeDataProvider: AzureArcTreeDataProvider, private _info: ControllerInfo, private _password?: string) {
this._azdataApi = <azdataExt.IExtension>vscode.extensions.getExtension(azdataExt.extension.name)?.exports;
}
public get info(): ControllerInfo {
return this._info;
}
public set info(value: ControllerInfo) {
this._info = value;
this._onInfoUpdated.fire(this._info);
}
/**
* Calls azdata login to set the context to this controller
* @param promptReconnect
@@ -187,15 +199,6 @@ export class ControllerModel {
*/
}
/**
* Tests whether this model is for the same controller as another
* @param other The other instance to test
*/
public equals(other: ControllerModel): boolean {
return this.info.url === other.info.url &&
this.info.username === other.info.username;
}
/**
* property to for use a display label for this controller
*/