mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Initial work on Arc tree view (#11008)
* Initial work on Arc tree view * finish my thoughts
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as loc from './localizedConstants';
|
||||
import { IconPathHelper } from './constants';
|
||||
@@ -14,10 +13,33 @@ import { PostgresModel } from './models/postgresModel';
|
||||
import { ControllerDashboard } from './ui/dashboards/controller/controllerDashboard';
|
||||
import { MiaaDashboard } from './ui/dashboards/miaa/miaaDashboard';
|
||||
import { MiaaModel } from './models/miaaModel';
|
||||
import { AzureArcTreeDataProvider } from './ui/tree/controllerTreeDataProvider';
|
||||
import { ControllerTreeNode } from './ui/tree/controllerTreeNode';
|
||||
import { TreeNode } from './ui/tree/treeNode';
|
||||
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<void> {
|
||||
IconPathHelper.setExtensionContext(context);
|
||||
|
||||
const treeDataProvider = new AzureArcTreeDataProvider(context);
|
||||
vscode.window.registerTreeDataProvider('azureArc', treeDataProvider);
|
||||
|
||||
vscode.commands.registerCommand('arc.addController', () => {
|
||||
// Controller information
|
||||
const controllerUrl = '';
|
||||
const auth = new BasicAuth('', '');
|
||||
|
||||
const controllerModel = new ControllerModel(controllerUrl, auth);
|
||||
treeDataProvider.addController(controllerModel);
|
||||
});
|
||||
|
||||
vscode.commands.registerCommand('arc.removeController', (controllerNode: ControllerTreeNode) => {
|
||||
treeDataProvider.removeController(controllerNode);
|
||||
});
|
||||
|
||||
vscode.commands.registerCommand('arc.openDashboard', async (treeNode: TreeNode) => {
|
||||
await treeNode.openDashboard().catch(err => vscode.window.showErrorMessage(loc.openDashboardFailed(err)));
|
||||
});
|
||||
|
||||
vscode.commands.registerCommand('arc.manageArcController', async () => {
|
||||
// Controller information
|
||||
const controllerUrl = '';
|
||||
@@ -40,28 +62,12 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
|
||||
// Controller information
|
||||
const controllerUrl = '';
|
||||
const auth = new BasicAuth('', '');
|
||||
const connection = await azdata.connection.openConnectionDialog(['MSSQL']);
|
||||
const connectionProfile: azdata.IConnectionProfile = {
|
||||
serverName: connection.options['serverName'],
|
||||
databaseName: connection.options['databaseName'],
|
||||
authenticationType: connection.options['authenticationType'],
|
||||
providerName: 'MSSQL',
|
||||
connectionName: '',
|
||||
userName: connection.options['user'],
|
||||
password: connection.options['password'],
|
||||
savePassword: false,
|
||||
groupFullName: undefined,
|
||||
saveProfile: true,
|
||||
id: connection.connectionId,
|
||||
groupId: undefined,
|
||||
options: connection.options
|
||||
};
|
||||
const instanceNamespace = '';
|
||||
const instanceName = '';
|
||||
|
||||
try {
|
||||
const controllerModel = new ControllerModel(controllerUrl, auth);
|
||||
const miaaModel = new MiaaModel(connectionProfile, controllerUrl, auth, instanceNamespace, instanceName);
|
||||
const miaaModel = new MiaaModel(controllerUrl, auth, instanceNamespace, instanceName);
|
||||
const miaaDashboard = new MiaaDashboard(controllerModel, miaaModel);
|
||||
|
||||
await Promise.all([
|
||||
@@ -85,7 +91,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
|
||||
try {
|
||||
const controllerModel = new ControllerModel(controllerUrl, auth);
|
||||
const postgresModel = new PostgresModel(controllerUrl, auth, dbNamespace, dbName);
|
||||
const postgresDashboard = new PostgresDashboard(loc.postgresDashboard, context, controllerModel, postgresModel);
|
||||
const postgresDashboard = new PostgresDashboard(context, controllerModel, postgresModel);
|
||||
|
||||
await Promise.all([
|
||||
postgresDashboard.showDashboard(),
|
||||
|
||||
Reference in New Issue
Block a user