mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 09:35:41 -05:00
Add "No instances available" node for empty arc controllers (#12374)
This commit is contained in:
@@ -96,7 +96,7 @@
|
||||
"view/item/context": [
|
||||
{
|
||||
"command": "arc.openDashboard",
|
||||
"when": "view == azureArc && viewItem != postgresInstances",
|
||||
"when": "view == azureArc && viewItem == sqlManagedInstances",
|
||||
"group": "navigation@1"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -72,6 +72,7 @@ export const direct = localize('arc.direct', "Direct");
|
||||
export const indirect = localize('arc.indirect', "Indirect");
|
||||
export const loading = localize('arc.loading', "Loading...");
|
||||
export const refreshToEnterCredentials = localize('arc.refreshToEnterCredentials', "Refresh node to enter credentials");
|
||||
export const noInstancesAvailable = localize('arc.noInstancesAvailable', "No instances available");
|
||||
export const connectToController = localize('arc.connectToController', "Connect to Existing Controller");
|
||||
export function connectToSql(name: string): string { return localize('arc.connectToSql', "Connect to SQL instance - Azure Arc ({0})", name); }
|
||||
export const passwordToController = localize('arc.passwordToController', "Provide Password to Controller");
|
||||
|
||||
@@ -13,6 +13,7 @@ import { PostgresModel } from '../../models/postgresModel';
|
||||
import { ControllerDashboard } from '../dashboards/controller/controllerDashboard';
|
||||
import { AzureArcTreeDataProvider } from './azureArcTreeDataProvider';
|
||||
import { MiaaTreeNode } from './miaaTreeNode';
|
||||
import { NoInstancesTreeNode } from './noInstancesTreeNode';
|
||||
import { PostgresTreeNode } from './postgresTreeNode';
|
||||
import { RefreshTreeNode } from './refreshTreeNode';
|
||||
import { ResourceTreeNode } from './resourceTreeNode';
|
||||
@@ -55,7 +56,7 @@ export class ControllerTreeNode extends TreeNode {
|
||||
}
|
||||
}
|
||||
|
||||
return this._children;
|
||||
return this._children.length > 0 ? this._children : [new NoInstancesTreeNode()];
|
||||
}
|
||||
|
||||
public async openDashboard(): Promise<void> {
|
||||
|
||||
18
extensions/arc/src/ui/tree/noInstancesTreeNode.ts
Normal file
18
extensions/arc/src/ui/tree/noInstancesTreeNode.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as loc from '../../localizedConstants';
|
||||
import { TreeNode } from './treeNode';
|
||||
|
||||
/**
|
||||
* A placeholder TreeNode to display when there aren't any child instances available
|
||||
*/
|
||||
export class NoInstancesTreeNode extends TreeNode {
|
||||
|
||||
constructor() {
|
||||
super(loc.noInstancesAvailable, vscode.TreeItemCollapsibleState.None, 'noInstances');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user