More arc controller dashboard updates (#10949)

This commit is contained in:
Charles Gagnon
2020-06-17 07:50:10 -07:00
committed by GitHub
parent 691985af2d
commit c86f301e0e
13 changed files with 169 additions and 40 deletions

View File

@@ -6,12 +6,8 @@
import * as vscode from 'vscode';
import * as azurecore from '../../../azurecore/src/azurecore';
import * as loc from '../localizedConstants';
import { IconPathHelper, IconPath, ResourceType, Connectionmode } from '../constants';
export enum ResourceType {
dataControllers = 'dataControllers',
postgresInstances = 'postgresInstances',
sqlManagedInstances = 'sqlManagedInstances'
}
/**
* Converts the resource type name into the localized Display Name for that type.
* @param resourceType The resource type name to convert
@@ -49,3 +45,24 @@ export async function getAzurecoreApi(): Promise<azurecore.IExtension> {
}
return azurecoreApi;
}
export function getResourceTypeIcon(resourceType: string): IconPath | undefined {
switch (resourceType) {
case ResourceType.sqlManagedInstances:
return IconPathHelper.miaa;
case ResourceType.postgresInstances:
return IconPathHelper.postgres;
}
return undefined;
}
export function getConnectionModeDisplayText(connectionMode: string | undefined): string {
connectionMode = connectionMode ?? '';
switch (connectionMode) {
case Connectionmode.connected:
return loc.connected;
case Connectionmode.disconnected:
return loc.disconnected;
}
return connectionMode;
}