Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion backend/app/dto/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ type ContainerInfo struct {
State string `json:"state"`
RunTime string `json:"runTime"`

Ports []string `json:"ports"`
Network []string `json:"network"`
Ports []string `json:"ports"`

IsFromApp bool `json:"isFromApp"`
IsFromCompose bool `json:"isFromCompose"`
Expand Down
8 changes: 8 additions & 0 deletions backend/app/service/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ func (u *ContainerService) Page(req dto.PageContainer) (int64, interface{}, erro
IsFromApp: IsFromApp,
IsFromCompose: IsFromCompose,
}
if item.NetworkSettings != nil && len(item.NetworkSettings.Networks) > 0 {
networks := make([]string, 0, len(item.NetworkSettings.Networks))
for key := range item.NetworkSettings.Networks {
networks = append(networks, key+":"+item.NetworkSettings.Networks[key].IPAddress)
}
sort.Strings(networks)
backDatas[i].Network = networks
}
}

return int64(total), backDatas, nil
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const message = {
interval: 'Interval',
user: 'User',
title: 'Title',
network: 'Network',
port: 'Port',
protocol: 'Protocol',
tableSetting: 'Table setting',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const message = {
interval: '耗時',
user: '用戶',
title: '標題',
network: '網絡',
port: '端口',
protocol: '協議',
tableSetting: '列表設置',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const message = {
interval: '耗时',
user: '用户',
title: '标题',
network: '网络',
port: '端口',
protocol: '协议',
tableSetting: '列表设置',
Expand Down
15 changes: 13 additions & 2 deletions frontend/src/views/container/container/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,25 @@
<el-table-column :label="$t('container.source')" show-overflow-tooltip min-width="100" fix>
<template #default="{ row }">
<div v-if="row.hasLoad">
<div>CPU: {{ row.cpuPercent.toFixed(2) }}%</div>
<div>{{ $t('monitor.memory') }}: {{ row.memoryPercent.toFixed(2) }}%</div>
<div>CPU: {{ row.cpuPercent.toFixed(2) }}% {{ $t('monitor.memory') }}: {{ row.memoryPercent.toFixed(2) }}%</div>
</div>
<div v-if="!row.hasLoad">
<el-button link loading></el-button>
</div>
</template>
</el-table-column>
<el-table-column
:label="$t('commons.table.network')"
:width="mobile ? 80 : 'auto'"
min-width="80"
fix
>
<div v-if="row.network">
<div v-for="(item, index) in row.network" :key="index">
<div>{{ item }}</div>
</div>
</div>
</el-table-column>
<el-table-column
:label="$t('commons.table.port')"
:width="mobile ? 260 : 'auto'"
Expand Down