Add dashboard links to arc controller dashboard (#11076)

* Add dashboard links to arc controller dashboard

* Fix compile error
This commit is contained in:
Charles Gagnon
2020-06-24 15:15:27 -07:00
committed by GitHub
parent e1bbbf2c9e
commit c3fbce4b83
4 changed files with 51 additions and 9 deletions

View File

@@ -110,6 +110,28 @@ export class AzureArcTreeDataProvider implements vscode.TreeDataProvider<TreeNod
const controllerInfo = this._controllerNodes.map(node => node.model.info);
await this._context.globalState.update(mementoToken, controllerInfo);
}
/**
* Opens the dashboard for the specified resource
* @param controllerModel The model for the controller containing the resource we want to open the dashboard for
* @param resourceType The resourceType for the resource
* @param namespace The namespace of the resource
* @param name The name of the resource
*/
public async openResourceDashboard(controllerModel: ControllerModel, resourceType: string, namespace: string, name: string): Promise<void> {
const controllerNode = this._controllerNodes.find(n => n.model === controllerModel);
if (controllerNode) {
const resourceNode = controllerNode.getResourceNode(resourceType, namespace, name);
if (resourceNode) {
} else {
console.log(`Couldn't find resource node for ${namespace}.${name} (${resourceType})`);
}
await resourceNode?.openDashboard();
} else {
console.log('Couldn\'t find controller node for opening dashboard');
}
}
}
function getCredentialId(info: ControllerInfo): string {