Revert commit 3d5580a: feat:显示当前ip,系统网络代理地址

pull/6249/head
wanghe-fit2cloud 2024-08-26 15:55:07 +08:00
parent 3d5580ad9d
commit 5e82bda666
6 changed files with 4 additions and 42 deletions

View File

@ -16,8 +16,7 @@ type DashboardBase struct {
KernelArch string `json:"kernelArch"` KernelArch string `json:"kernelArch"`
KernelVersion string `json:"kernelVersion"` KernelVersion string `json:"kernelVersion"`
VirtualizationSystem string `json:"virtualizationSystem"` VirtualizationSystem string `json:"virtualizationSystem"`
IpV4Addr string `json:"ipV4Addr"`
SystemProxy string `json:"systemProxy"`
CPUCores int `json:"cpuCores"` CPUCores int `json:"cpuCores"`
CPULogicalCores int `json:"cpuLogicalCores"` CPULogicalCores int `json:"cpuLogicalCores"`
CPUModelName string `json:"cpuModelName"` CPUModelName string `json:"cpuModelName"`

View File

@ -1,10 +1,8 @@
package service package service
import ( import (
"context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"os"
"sort" "sort"
"strings" "strings"
"sync" "sync"
@ -96,20 +94,11 @@ func (u *DashboardService) LoadBaseInfo(ioOption string, netOption string) (*dto
baseInfo.KernelVersion = hostInfo.KernelVersion baseInfo.KernelVersion = hostInfo.KernelVersion
ss, _ := json.Marshal(hostInfo) ss, _ := json.Marshal(hostInfo)
baseInfo.VirtualizationSystem = string(ss) baseInfo.VirtualizationSystem = string(ss)
baseInfo.IpV4Addr=host.IpV4AddrWithContext(context.Background())
httpProxy := os.Getenv("http_proxy")
if httpProxy == "" {
httpProxy = os.Getenv("HTTP_PROXY") // 也检查大写的环境变量名
}
if httpProxy!=""{
baseInfo.SystemProxy=httpProxy
}
baseInfo.SystemProxy="noProxy"
appInstall, err := appInstallRepo.ListBy() appInstall, err := appInstallRepo.ListBy()
if err != nil { if err != nil {
return nil, err return nil, err
} }
baseInfo.AppInstalledNumber = len(appInstall) baseInfo.AppInstalledNumber = len(appInstall)
postgresqlDbs, err := postgresqlRepo.List() postgresqlDbs, err := postgresqlRepo.List()
if err != nil { if err != nil {

View File

@ -22,8 +22,6 @@ export namespace Dashboard {
kernelArch: string; kernelArch: string;
kernelVersion: string; kernelVersion: string;
virtualizationSystem: string; virtualizationSystem: string;
IpV4Addr: string;
httpProxy: string;
cpuCores: number; cpuCores: number;
cpuLogicalCores: number; cpuLogicalCores: number;

View File

@ -344,8 +344,6 @@ const message = {
kernelArch: 'Kernel arch', kernelArch: 'Kernel arch',
network: 'Network', network: 'Network',
io: 'Disk IO', io: 'Disk IO',
ip: 'Ip Addr',
proxy: 'System Proxy',
baseInfo: 'Base info', baseInfo: 'Base info',
totalSend: 'Total send', totalSend: 'Total send',
totalRecv: 'Total recv', totalRecv: 'Total recv',

View File

@ -337,8 +337,6 @@ const message = {
kernelArch: '', kernelArch: '',
network: '', network: '',
io: ' IO', io: ' IO',
ip: 'IP',
proxy: '',
baseInfo: '', baseInfo: '',
totalSend: '', totalSend: '',
totalRecv: '', totalRecv: '',

View File

@ -225,25 +225,6 @@
</template> </template>
{{ loadUpTime(currentInfo.uptime) }} {{ loadUpTime(currentInfo.uptime) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item class-name="system-content">
<template #label>
<span class="system-label">
{{ $t('home.ip') }}
</span>
{{ baseInfo.IpV4Addr }}
</template>
</el-descriptions-item>
<el-descriptions-item
v-if="baseInfo.httpProxy !== 'noProxy'"
class-name="system-content"
>
<template #label>
<span class="system-label">
{{ $t('home.proxy') }}
</span>
{{ baseInfo.httpProxy }}
</template>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-scrollbar> </el-scrollbar>
</template> </template>
@ -322,8 +303,7 @@ const baseInfo = ref<Dashboard.BaseInfo>({
kernelArch: '', kernelArch: '',
kernelVersion: '', kernelVersion: '',
virtualizationSystem: '', virtualizationSystem: '',
IpV4Addr: '',
httpProxy: '',
cpuCores: 0, cpuCores: 0,
cpuLogicalCores: 0, cpuLogicalCores: 0,
cpuModelName: '', cpuModelName: '',