Add hint for visual task when user setting is in cloudshell (#112)
* add hint for visual task when user setting is in cloudshell * refine the wording
This commit is contained in:
Родитель
09485fbd0a
Коммит
09fae2bd9e
|
@ -6,7 +6,7 @@ import { CloudShell } from "./cloudShell";
|
|||
import { Constants } from "./constants";
|
||||
import { IntegratedShell } from "./integratedShell";
|
||||
import { TestOption } from "./shared";
|
||||
import { isDotInstalled } from "./utils/dotUtils";
|
||||
import { DialogOption } from "./utils/uiUtils";
|
||||
import { selectWorkspaceFolder } from "./utils/workspaceUtils";
|
||||
|
||||
let cs: CloudShell;
|
||||
|
@ -52,9 +52,17 @@ export function activate(ctx: vscode.ExtensionContext) {
|
|||
}));
|
||||
|
||||
ctx.subscriptions.push(vscode.commands.registerCommand("vscode-terraform-azure.visualize", async () => {
|
||||
if (await isDotInstalled()) {
|
||||
await is.visualize();
|
||||
if (terminalSetToCloudshell()) {
|
||||
const choice: vscode.MessageItem = await vscode.window.showInformationMessage(
|
||||
"Visualization only works locally. Would you like to run it in the integrated terminal?",
|
||||
DialogOption.OK,
|
||||
DialogOption.CANCEL,
|
||||
);
|
||||
if (choice === DialogOption.CANCEL) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
await is.visualize();
|
||||
}));
|
||||
|
||||
ctx.subscriptions.push(vscode.commands.registerCommand("vscode-terraform-azure.exectest", async () => {
|
||||
|
|
|
@ -13,6 +13,7 @@ import { isServicePrincipalSetInEnv } from "./utils/azureUtils";
|
|||
import { executeCommand } from "./utils/cpUtils";
|
||||
import { isDockerInstalled, latestTestingImagePulled, runE2EInDocker, runLintInDocker } from "./utils/dockerUtils";
|
||||
import { drawGraph } from "./utils/dotUtils";
|
||||
import { isDotInstalled } from "./utils/dotUtils";
|
||||
import { selectWorkspaceFolder } from "./utils/workspaceUtils";
|
||||
|
||||
export class IntegratedShell extends BaseShell {
|
||||
|
@ -20,6 +21,9 @@ export class IntegratedShell extends BaseShell {
|
|||
|
||||
// Creates a png of terraform resource graph to visualize the resources under management.
|
||||
public async visualize(): Promise<void> {
|
||||
if (!await isDotInstalled()) {
|
||||
return;
|
||||
}
|
||||
const cwd: string = await selectWorkspaceFolder();
|
||||
if (!cwd) {
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче