mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Added multiple location option to package management dialog (#9790)
* Added multiple location option to package management dialog
This commit is contained in:
@@ -207,7 +207,6 @@ export class JupyterController implements vscode.Disposable {
|
||||
try {
|
||||
if (!options) {
|
||||
options = {
|
||||
multiLocations: false,
|
||||
defaultLocation: constants.localhostName,
|
||||
defaultProviderId: LocalPipPackageManageProvider.ProviderId
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IPackageManageProvider, IPackageDetails, IPackageTarget, IPackageOverview } from '../types';
|
||||
import { IPackageManageProvider, IPackageDetails, IPackageTarget, IPackageOverview, IPackageLocation } from '../types';
|
||||
import { IJupyterServerInstallation } from './jupyterServerInstallation';
|
||||
import * as constants from '../common/constants';
|
||||
import * as utils from '../common/utils';
|
||||
@@ -35,7 +35,7 @@ export class LocalCondaPackageManageProvider implements IPackageManageProvider {
|
||||
/**
|
||||
* Returns list of packages
|
||||
*/
|
||||
public async listPackages(): Promise<IPackageDetails[]> {
|
||||
public async listPackages(location?: string): Promise<IPackageDetails[]> {
|
||||
return await this.jupyterInstallation.getInstalledCondaPackages();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export class LocalCondaPackageManageProvider implements IPackageManageProvider {
|
||||
* @param packages Packages to install
|
||||
* @param useMinVersion minimum version
|
||||
*/
|
||||
installPackages(packages: IPackageDetails[], useMinVersion: boolean): Promise<void> {
|
||||
installPackages(packages: IPackageDetails[], useMinVersion: boolean, location?: string): Promise<void> {
|
||||
return this.jupyterInstallation.installCondaPackages(packages, useMinVersion);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export class LocalCondaPackageManageProvider implements IPackageManageProvider {
|
||||
* Uninstalls given packages
|
||||
* @param packages Packages to uninstall
|
||||
*/
|
||||
uninstallPackages(packages: IPackageDetails[]): Promise<void> {
|
||||
uninstallPackages(packages: IPackageDetails[], location?: string): Promise<void> {
|
||||
return this.jupyterInstallation.uninstallCondaPackages(packages);
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ export class LocalCondaPackageManageProvider implements IPackageManageProvider {
|
||||
/**
|
||||
* Returns location title
|
||||
*/
|
||||
getLocationTitle(): Promise<string> {
|
||||
return Promise.resolve(constants.localhostTitle);
|
||||
getLocations(): Promise<IPackageLocation[]> {
|
||||
return Promise.resolve([{ displayName: constants.localhostTitle, name: constants.localhostName }]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IPackageManageProvider, IPackageDetails, IPackageTarget, IPackageOverview } from '../types';
|
||||
import { IPackageManageProvider, IPackageDetails, IPackageTarget, IPackageOverview, IPackageLocation } from '../types';
|
||||
import { IJupyterServerInstallation } from './jupyterServerInstallation';
|
||||
import * as constants from '../common/constants';
|
||||
import * as utils from '../common/utils';
|
||||
@@ -38,7 +38,7 @@ export class LocalPipPackageManageProvider implements IPackageManageProvider {
|
||||
/**
|
||||
* Returns list of packages
|
||||
*/
|
||||
public async listPackages(): Promise<IPackageDetails[]> {
|
||||
public async listPackages(location?: string): Promise<IPackageDetails[]> {
|
||||
return await this.jupyterInstallation.getInstalledPipPackages();
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export class LocalPipPackageManageProvider implements IPackageManageProvider {
|
||||
* @param packages Packages to install
|
||||
* @param useMinVersion minimum version
|
||||
*/
|
||||
installPackages(packages: IPackageDetails[], useMinVersion: boolean): Promise<void> {
|
||||
installPackages(packages: IPackageDetails[], useMinVersion: boolean, location?: string): Promise<void> {
|
||||
return this.jupyterInstallation.installPipPackages(packages, useMinVersion);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export class LocalPipPackageManageProvider implements IPackageManageProvider {
|
||||
* Uninstalls given packages
|
||||
* @param packages Packages to uninstall
|
||||
*/
|
||||
uninstallPackages(packages: IPackageDetails[]): Promise<void> {
|
||||
uninstallPackages(packages: IPackageDetails[], location?: string): Promise<void> {
|
||||
return this.jupyterInstallation.uninstallPipPackages(packages);
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ export class LocalPipPackageManageProvider implements IPackageManageProvider {
|
||||
/**
|
||||
* Returns location title
|
||||
*/
|
||||
getLocationTitle(): Promise<string> {
|
||||
return Promise.resolve(constants.localhostTitle);
|
||||
getLocations(): Promise<IPackageLocation[]> {
|
||||
return Promise.resolve([{ displayName: constants.localhostTitle, name: constants.localhostName }]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user