mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Differentiated server icons by server type: box, big data cluster, cloud... (#5241)
This commit is contained in:
28
extensions/mssql/src/iconProvider.ts
Normal file
28
extensions/mssql/src/iconProvider.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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user