mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Always set up default container
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
3095ed4f7c
commit
68fd6014b9
@ -3,10 +3,9 @@ import "./pod-menu.scss";
|
||||
import React from "react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { MenuItem, SubMenu } from "../menu";
|
||||
import { IPodContainer, Pod, nodesApi } from "../../api/endpoints";
|
||||
import { IPodContainer, Pod } from "../../api/endpoints";
|
||||
import { Icon } from "../icon";
|
||||
import { StatusBrick } from "../status-brick";
|
||||
import { PodLogsDialog } from "./pod-logs-dialog";
|
||||
import { KubeObjectMenu, KubeObjectMenuProps } from "../kube-object/kube-object-menu";
|
||||
import { cssNames, prevDefault } from "../../utils";
|
||||
import { terminalStore, createTerminalTab } from "../dock/terminal.store";
|
||||
|
||||
@ -62,6 +62,7 @@ export class PodLogs extends React.Component<Props> {
|
||||
const { pod, container } = this.tabData;
|
||||
this.containers = pod.getContainers();
|
||||
this.initContainers = pod.getInitContainers();
|
||||
this.selectedContainer = container || this.containers[0];
|
||||
await this.load();
|
||||
this.refresher.start();
|
||||
}
|
||||
@ -158,9 +159,6 @@ export class PodLogs extends React.Component<Props> {
|
||||
|
||||
get containerSelectOptions() {
|
||||
return [
|
||||
{
|
||||
label: _i18n._(t`All Containers`),
|
||||
},
|
||||
{
|
||||
label: _i18n._(t`Containers`),
|
||||
options: this.containers.map(container => {
|
||||
@ -178,7 +176,6 @@ export class PodLogs extends React.Component<Props> {
|
||||
|
||||
formatOptionLabel = (option: SelectOption) => {
|
||||
const { value, label } = option;
|
||||
if (!value) return _i18n._(t`All Containers`);
|
||||
return label || <><Icon small material="view_carousel"/> {value}</>;
|
||||
}
|
||||
|
||||
@ -190,7 +187,7 @@ export class PodLogs extends React.Component<Props> {
|
||||
<span><Trans>Container</Trans></span>
|
||||
<Select
|
||||
options={this.containerSelectOptions}
|
||||
value={{ value: this.selectedContainer?.name }}
|
||||
value={{ value: this.selectedContainer.name }}
|
||||
formatOptionLabel={this.formatOptionLabel}
|
||||
onChange={this.onContainerChange}
|
||||
autoConvertOptions={false}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user