mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Initial work on Arc controller + MIAA dashboards (#10781)
* initial * postgres overview dashboard * fewer dependencies * stricter compile options * make vsce package work * Add localizedConstants * Add localizedConstants (cherry picked from commit 3ceed3e82b918ac829a7eac01487844e7d2ec02d) * common WIP * Initial dashboard work * separate ui and models * extend DashboardPage * remove error handling * wip * Add more localized constants * More updates * Use api to populate instances * merge master, strict mode, error handling, propertiesContainer, openInAzure * use more localizedConstants * localization * connection strings and properties pages * don't include arc extension by default * don't include arc extension by default * Address PR feedback * undo changes to modelview components * localize copied to clipboard * localize copied to clipboard with function * Update gulpfile.hygiene.js * Move the gulpfile * More updates * more updates * More updates * re-delete file * Fix compile error * PR comments Co-authored-by: Brian Bergeron <brberger@microsoft.com> Co-authored-by: Brian Bergeron <brian.e.bergeron@gmail.com> Co-authored-by: Amir Omidi <amomidi@microsoft.com>
This commit is contained in:
28
extensions/arc/src/common/utils.ts
Normal file
28
extensions/arc/src/common/utils.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as loc from '../localizedConstants';
|
||||
|
||||
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
|
||||
*/
|
||||
export function resourceTypeToDisplayName(resourceType: string | undefined): string {
|
||||
resourceType = resourceType || 'undefined';
|
||||
switch (resourceType) {
|
||||
case ResourceType.dataControllers:
|
||||
return loc.dataControllersType;
|
||||
case ResourceType.postgresInstances:
|
||||
return loc.pgSqlType;
|
||||
case ResourceType.sqlManagedInstances:
|
||||
return loc.miaaType;
|
||||
}
|
||||
return resourceType;
|
||||
}
|
||||
Reference in New Issue
Block a user