mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
More arc controller dashboard updates (#10949)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user