Skip to content

Commit 12af51f

Browse files
authored
Merge pull request #38 from flyhope/37-show-pod-name-on-container-list
show pod name on container list
2 parents 97714e9 + 50507bb commit 12af51f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

comm/kubetea.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,27 @@ template:
4545
column:
4646
- { title: '{{ txt "name" }}', width: 0 }
4747
- { title: 'IP', width: 15 }
48+
- { title: '{{ txt "createdAt" }}', width: 19 }
4849
- { title: '{{ txt "status" }}', width: 4 }
4950
- { title: '{{ txt "ready" }}', width: 4 }
50-
- { title: '{{ txt "createdAt" }}', width: 19 }
5151
body:
5252
# first cloume must be .Name
5353
- "{{ .Name }}"
5454
- "{{ .Status.PodIP }}"
55+
- "{{ if .Status.StartTime }}{{ FormatTime .Status.StartTime.Time }}{{else}}-{{end}}"
5556
- "{{ PodPhaseView . }}"
5657
- "{{ PodReadyView . }}"
57-
- "{{ if .Status.StartTime }}{{ FormatTime .Status.StartTime.Time }}{{else}}-{{end}}"
5858
container:
5959
column:
6060
- { title: '{{ txt "containerName" }}', width: 0 }
6161
- { title: '{{ txt "imageUrl" }}', width: 0 }
62+
- { title: '{{ txt "createdAt" }}', width: 19 }
6263
- { title: '{{ txt "status" }}', width: 4 }
63-
- { title: '{{ txt "createdAt" }}', width: 4 }
64+
- { title: '{{ txt "ready" }}', width: 4 }
6465
body:
6566
# first cloume must be .Name
6667
- "{{ .Name }}"
6768
- "{{ .Image }}"
69+
- "{{ if .State.Running }}{{ FormatTime .State.Running.StartedAt.Time }}{{else}}-{{end}}"
6870
- "{{ ContainerStateView . }}"
6971
- "{{ BoolView .Ready }}"

view/container.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func (m *containerModel) updateData(force bool) {
4444

4545
m.Table.SetRows(rows)
4646
m.SubDescs = []string{
47+
pod.Name,
4748
lang.Data(langTotalWithNumber, lang.Map{"number": len(rows)}),
4849
lang.Data(langUpdateTime, lang.Map{"UpdateTime": lastUpdate.Format(time.DateTime)}),
4950
}

0 commit comments

Comments
 (0)