mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 01:25:38 -05:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { NodeType } from 'sql/parts/registeredServer/common/nodeType';
|
||||
import { TreeNode } from 'sql/parts/registeredServer/common/treeNode';
|
||||
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
@@ -337,13 +338,18 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
}
|
||||
|
||||
private toTreeNode(nodeInfo: data.NodeInfo, parent: TreeNode): TreeNode {
|
||||
// make Database nodes with a status field non-expandable
|
||||
// Show the status for database nodes with a status field
|
||||
let isLeaf: boolean = nodeInfo.isLeaf;
|
||||
if (nodeInfo.nodeType === 'Database' && nodeInfo.nodeStatus) {
|
||||
nodeInfo.label = nodeInfo.label + ' (' + nodeInfo.nodeStatus + ')';
|
||||
isLeaf = true;
|
||||
// set to common status so we can have a single 'Unavailable' db icon
|
||||
nodeInfo.nodeStatus = 'Unavailable';
|
||||
if (nodeInfo.nodeType === NodeType.Database) {
|
||||
if (nodeInfo.nodeStatus) {
|
||||
nodeInfo.label = nodeInfo.label + ' (' + nodeInfo.nodeStatus + ')';
|
||||
}
|
||||
if (isLeaf) {
|
||||
// set to common status so we can have a single 'Unavailable' db icon
|
||||
nodeInfo.nodeStatus = 'Unavailable';
|
||||
} else {
|
||||
nodeInfo.nodeStatus = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
return new TreeNode(nodeInfo.nodeType, nodeInfo.label, isLeaf, nodeInfo.nodePath,
|
||||
|
||||
Reference in New Issue
Block a user