Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/tree/LocalGroupTreeItemBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
export abstract class LocalGroupTreeItemBase<TItem extends AnyContainerObject, TProperty extends string | CommonProperty> extends AzExtParentTreeItem {
public declare readonly parent: LocalRootTreeItemBase<TItem, TProperty>;
public readonly group: string;
private _items: TItem[];
protected _items: TItem[];

Check warning on line 13 in src/tree/LocalGroupTreeItemBase.ts

View workflow job for this annotation

GitHub Actions / Build / Build

Class Property name `_items` must match one of the following formats: camelCase, PascalCase
Comment thread
SATYAM-PRATIBHAN marked this conversation as resolved.
Outdated
private _childTreeItems: AzExtTreeItem[];

public constructor(parent: LocalRootTreeItemBase<TItem, TProperty>, group: string, items: TItem[]) {
Expand Down
2 changes: 1 addition & 1 deletion src/tree/LocalRootTreeItemBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
public descriptionSetting: TProperty[];
protected failedToConnect: boolean = false;

private _currentItems: TItem[] | undefined;
protected _currentItems: TItem[] | undefined;

Check warning on line 68 in src/tree/LocalRootTreeItemBase.ts

View workflow job for this annotation

GitHub Actions / Build / Build

Class Property name `_currentItems` must match one of the following formats: camelCase, PascalCase
private _cachedItems: TItem[] | undefined;
private _currentDockerStatus: DockerStatus;

Expand Down
10 changes: 9 additions & 1 deletion src/tree/containers/ContainerGroupTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import { AzExtTreeItem, IActionContext } from "@microsoft/vscode-azext-utils";
import { ThemeIcon, TreeItemCollapsibleState } from "vscode";
import { ThemeIcon, TreeItemCollapsibleState, l10n } from "vscode";
import { LocalGroupTreeItemBase } from "../LocalGroupTreeItemBase";
import { LocalRootTreeItemBase } from "../LocalRootTreeItemBase";
import { getCommonGroupIcon } from "../settings/CommonProperties";
Expand Down Expand Up @@ -33,6 +33,14 @@ export class ContainerGroupTreeItem extends LocalGroupTreeItemBase<DockerContain
return 'containerGroup';
}

public get description(): string | undefined {
const runningCount = this._items.filter(i => i.state.toLowerCase() === 'running').length;
if (runningCount > 0) {
return l10n.t('({0}/{1} running)', runningCount, this._items.length);
}
return undefined;
}

public get iconPath(): ThemeIcon {
switch (this.parent.groupBySetting) {
case 'ContainerId':
Expand Down
8 changes: 8 additions & 0 deletions src/tree/containers/ContainersTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ export class ContainersTreeItem extends LocalRootTreeItemBase<DockerContainerInf
return this.groupBySetting === 'None' ? l10n.t('container') : l10n.t('container group');
}

public get description(): string | undefined {
const runningCount = this._currentItems?.filter(i => i.state.toLowerCase() === 'running').length;
if (runningCount > 0) {
return l10n.t('({0} running)', runningCount);
}
return undefined;
}

public async getItems(context: IActionContext): Promise<DockerContainerInfo[]> {
const rawResults = await ext.runWithDefaults(client =>
client.listContainers({ all: true })
Expand Down
Loading