mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +08:00
🎨 容器列表添加网络地址列 (#2169)
This commit is contained in:
parent
ecc444db9f
commit
f75744e252
@ -24,6 +24,7 @@ type ContainerInfo struct {
|
|||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
RunTime string `json:"runTime"`
|
RunTime string `json:"runTime"`
|
||||||
|
|
||||||
|
Network []string `json:"network"`
|
||||||
Ports []string `json:"ports"`
|
Ports []string `json:"ports"`
|
||||||
|
|
||||||
IsFromApp bool `json:"isFromApp"`
|
IsFromApp bool `json:"isFromApp"`
|
||||||
|
@ -167,6 +167,14 @@ func (u *ContainerService) Page(req dto.PageContainer) (int64, interface{}, erro
|
|||||||
IsFromApp: IsFromApp,
|
IsFromApp: IsFromApp,
|
||||||
IsFromCompose: IsFromCompose,
|
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
|
return int64(total), backDatas, nil
|
||||||
|
@ -78,6 +78,7 @@ const message = {
|
|||||||
interval: 'Interval',
|
interval: 'Interval',
|
||||||
user: 'User',
|
user: 'User',
|
||||||
title: 'Title',
|
title: 'Title',
|
||||||
|
network: 'Network',
|
||||||
port: 'Port',
|
port: 'Port',
|
||||||
protocol: 'Protocol',
|
protocol: 'Protocol',
|
||||||
tableSetting: 'Table setting',
|
tableSetting: 'Table setting',
|
||||||
|
@ -78,6 +78,7 @@ const message = {
|
|||||||
interval: '耗時',
|
interval: '耗時',
|
||||||
user: '用戶',
|
user: '用戶',
|
||||||
title: '標題',
|
title: '標題',
|
||||||
|
network: '網絡',
|
||||||
port: '端口',
|
port: '端口',
|
||||||
protocol: '協議',
|
protocol: '協議',
|
||||||
tableSetting: '列表設置',
|
tableSetting: '列表設置',
|
||||||
|
@ -78,6 +78,7 @@ const message = {
|
|||||||
interval: '耗时',
|
interval: '耗时',
|
||||||
user: '用户',
|
user: '用户',
|
||||||
title: '标题',
|
title: '标题',
|
||||||
|
network: '网络',
|
||||||
port: '端口',
|
port: '端口',
|
||||||
protocol: '协议',
|
protocol: '协议',
|
||||||
tableSetting: '列表设置',
|
tableSetting: '列表设置',
|
||||||
|
@ -90,14 +90,25 @@
|
|||||||
<el-table-column :label="$t('container.source')" show-overflow-tooltip min-width="100" fix>
|
<el-table-column :label="$t('container.source')" show-overflow-tooltip min-width="100" fix>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div v-if="row.hasLoad">
|
<div v-if="row.hasLoad">
|
||||||
<div>CPU: {{ row.cpuPercent.toFixed(2) }}%</div>
|
<div>CPU: {{ row.cpuPercent.toFixed(2) }}% {{ $t('monitor.memory') }}: {{ row.memoryPercent.toFixed(2) }}%</div>
|
||||||
<div>{{ $t('monitor.memory') }}: {{ row.memoryPercent.toFixed(2) }}%</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!row.hasLoad">
|
<div v-if="!row.hasLoad">
|
||||||
<el-button link loading></el-button>
|
<el-button link loading></el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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
|
<el-table-column
|
||||||
:label="$t('commons.table.port')"
|
:label="$t('commons.table.port')"
|
||||||
:width="mobile ? 260 : 'auto'"
|
:width="mobile ? 260 : 'auto'"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user