mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 09:35:37 -05:00
* Merge from vscode a234f13c45b40a0929777cb440ee011b7549eed2 * update distro * fix layering * update distro * fix tests
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as azdata from 'azdata';
|
|
import * as constants from './constants';
|
|
|
|
const cloudIcon = 'mssql:cloud';
|
|
const clusterIcon = 'mssql:cluster';
|
|
|
|
export class MssqlIconProvider implements azdata.IconProvider {
|
|
public readonly providerId: string = constants.sqlProviderName;
|
|
public handle: number;
|
|
getConnectionIconId(connection: azdata.IConnectionProfile, serverInfo: azdata.ServerInfo): Thenable<string> {
|
|
let iconName: string = undefined;
|
|
if (connection.providerName === 'MSSQL') {
|
|
if (serverInfo.isCloud) {
|
|
iconName = cloudIcon;
|
|
} else if (serverInfo.options['isBigDataCluster']) {
|
|
iconName = clusterIcon;
|
|
}
|
|
}
|
|
return Promise.resolve(iconName);
|
|
}
|
|
}
|