-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathEnableIngressStep.ts
More file actions
33 lines (27 loc) · 1.65 KB
/
EnableIngressStep.ts
File metadata and controls
33 lines (27 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { AzureWizardPromptStep, IWizardOptions } from "@microsoft/vscode-azext-utils";
import { localize } from "../../utils/localize";
import { TargetPortInputStep } from "../ingress/editTargetPort/TargetPortInputStep";
import { ICreateContainerAppContext } from "./ICreateContainerAppContext";
import { IngressVisibilityStep } from "./IngressVisibilityStep";
export class EnableIngressStep extends AzureWizardPromptStep<ICreateContainerAppContext> {
public async prompt(context: ICreateContainerAppContext): Promise<void> {
context.enableIngress = (await context.ui.showQuickPick([{ label: localize('enable', 'Enable'), data: true }, { label: localize('disable', 'Disable'), data: false }],
{ placeHolder: localize('enableIngress', 'Enable ingress for applications that need an HTTP endpoint.') })).data;
}
public shouldPrompt(context: ICreateContainerAppContext): boolean {
return context.enableIngress === undefined
}
public async getSubWizard(context: ICreateContainerAppContext): Promise<IWizardOptions<ICreateContainerAppContext> | undefined> {
if (context.enableIngress) {
return {
// @ts-ignore
promptSteps: [new IngressVisibilityStep(), new TargetPortInputStep()]
}
}
return undefined;
}
}