Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 27 additions & 127 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 21 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@
"command": "containerApps.addScaleRule",
"title": "%containerApps.addScaleRule%",
"category": "Azure Container Apps"
},
{
"command": "containerApps.startStreamingLogs",
"title": "%containerApps.startStreamingLogs%",
"category": "Azure Container Apps"
},
{
"command": "containerApps.stopStreamingLogs",
"title": "%containerApps.stopStreamingLogs%",
"category": "Azure Container Apps"
}
],
"menus": {
Expand Down Expand Up @@ -252,6 +262,15 @@
"command": "containerApps.addScaleRule",
"when": "view == azureResourceGroups && viewItem =~ /scaleRules/i",
"group": "1@1"
},
{
"command": "containerApps.startStreamingLogs",
"when": "view == azureResourceGroups && viewItem =~ /containerApp[^s]/i",
"group": "4@1"
},{
"command": "containerApps.stopStreamingLogs",
"when": "view == azureResourceGroups && viewItem =~ /containerApp[^s]/i",
"group": "4@2"
}
],
"commandPalette": [
Expand Down Expand Up @@ -343,12 +362,13 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
"@azure/arm-appcontainers": "^1.1.0",
"@azure/arm-appcontainers": "^2.0.0-beta.1",
"@azure/arm-containerregistry": "^10.0.0",
"@azure/arm-operationalinsights": "^8.0.0",
"@azure/arm-resources": "^5.0.1",
"@azure/container-registry": "1.0.0-beta.5",
"@azure/storage-blob": "^12.4.1",
"@azure/core-rest-pipeline": "1.10.3",
"@microsoft/vscode-azext-azureutils": "^1.0.1",
"@microsoft/vscode-azext-utils": "^1.2.0",
"@microsoft/vscode-azureresources-api": "^2.0.2",
Expand Down
4 changes: 3 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
"containerApps.openInPortal": "Open in Portal",
"containerApps.openConsoleInPortal": "Open Console in Portal",
"containerApps.editScalingRange": "Edit Scaling Range...",
"containerApps.addScaleRule": "Add Scale Rule..."
"containerApps.addScaleRule": "Add Scale Rule...",
"containerApps.startStreamingLogs": "Start Streaming Logs...",
"containerApps.stopStreamingLogs": "Stop Streaming Logs..."
}
26 changes: 26 additions & 0 deletions src/commands/logStream/ContainerListStep.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import type { ReplicaContainer } from "@azure/arm-appcontainers";
import { AzureWizardPromptStep, IAzureQuickPickItem, nonNullProp, nonNullValue } from "@microsoft/vscode-azext-utils";
import { localize } from "../../utils/localize";
import { IStreamLogsContext } from "./IStreamLogsContext";

export class ContainerListStep extends AzureWizardPromptStep<IStreamLogsContext> {
public async prompt(context: IStreamLogsContext): Promise<void> {
const placeHolder: string = localize('selectContainer', 'Select a container');
context.container = (await context.ui.showQuickPick(this.getPicks(context), { placeHolder })).data;
}

public shouldPrompt(context: IStreamLogsContext): boolean {
return !context.container;
}

private async getPicks(context: IStreamLogsContext): Promise<IAzureQuickPickItem<ReplicaContainer>[]> {
return nonNullValue(context.replica?.containers).map((c) => {
return { label: nonNullProp(c, 'name'), data: c, suppressPersistance: true };
})
}
}
Loading