Remove extra id property from azure subs and add type name helper (#12145)

* Remove extra id property from azure subs and add type name helper

* case

* Change a few names
This commit is contained in:
Charles Gagnon
2020-09-04 16:01:05 -07:00
committed by GitHub
parent f6b46a1c5c
commit 84ca18b428
24 changed files with 66 additions and 30 deletions

View File

@@ -3,6 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { azureResource } from 'azureResource';
import * as loc from './localizedConstants';
import { AzureRegion } from 'azurecore';
@@ -98,3 +99,21 @@ export function getRegionDisplayName(region?: string): string {
console.warn(`Unknown Azure region ${region}`);
return region;
}
export function getResourceTypeDisplayName(type: string): string {
switch (type) {
case azureResource.AzureResourceType.sqlServer:
return loc.sqlServer;
case azureResource.AzureResourceType.sqlDatabase:
return loc.sqlDatabase;
case azureResource.AzureResourceType.sqlManagedInstance:
return loc.sqlManagedInstance;
case azureResource.AzureResourceType.azureArcSqlManagedInstance:
return loc.azureArcsqlManagedInstance;
case azureResource.AzureResourceType.azureArcService:
return loc.azureArcService;
case azureResource.AzureResourceType.azureArcPostgresServer:
return loc.azureArcPostgresServer;
}
return type;
}