mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-09 11:55:52 +08:00
parent
88c3559245
commit
adde751b73
11 changed files with 214 additions and 44 deletions
|
|
@ -43,7 +43,12 @@ type DashboardCurrent struct {
|
||||||
MemoryTotal uint64 `json:"memoryTotal"`
|
MemoryTotal uint64 `json:"memoryTotal"`
|
||||||
MemoryAvailable uint64 `json:"memoryAvailable"`
|
MemoryAvailable uint64 `json:"memoryAvailable"`
|
||||||
MemoryUsed uint64 `json:"memoryUsed"`
|
MemoryUsed uint64 `json:"memoryUsed"`
|
||||||
MemoryUsedPercent float64 `json:"MemoryUsedPercent"`
|
MemoryUsedPercent float64 `json:"memoryUsedPercent"`
|
||||||
|
|
||||||
|
SwapMemoryTotal uint64 `json:"swapMemoryTotal"`
|
||||||
|
SwapMemoryAvailable uint64 `json:"swapMemoryAvailable"`
|
||||||
|
SwapMemoryUsed uint64 `json:"swapMemoryUsed"`
|
||||||
|
SwapMemoryUsedPercent float64 `json:"swapMemoryUsedPercent"`
|
||||||
|
|
||||||
IOReadBytes uint64 `json:"ioReadBytes"`
|
IOReadBytes uint64 `json:"ioReadBytes"`
|
||||||
IOWriteBytes uint64 `json:"ioWriteBytes"`
|
IOWriteBytes uint64 `json:"ioWriteBytes"`
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,12 @@ func (u *DashboardService) LoadCurrentInfo(ioOption string, netOption string) *d
|
||||||
currentInfo.MemoryUsed = memoryInfo.Used
|
currentInfo.MemoryUsed = memoryInfo.Used
|
||||||
currentInfo.MemoryUsedPercent = memoryInfo.UsedPercent
|
currentInfo.MemoryUsedPercent = memoryInfo.UsedPercent
|
||||||
|
|
||||||
|
swapInfo, _ := mem.SwapMemory()
|
||||||
|
currentInfo.SwapMemoryTotal = swapInfo.Total
|
||||||
|
currentInfo.SwapMemoryAvailable = swapInfo.Free
|
||||||
|
currentInfo.SwapMemoryUsed = swapInfo.Used
|
||||||
|
currentInfo.SwapMemoryUsedPercent = swapInfo.UsedPercent
|
||||||
|
|
||||||
currentInfo.DiskData = loadDiskInfo()
|
currentInfo.DiskData = loadDiskInfo()
|
||||||
|
|
||||||
if ioOption == "all" {
|
if ioOption == "all" {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Package docs GENERATED BY SWAG; DO NOT EDIT
|
// Code generated by swaggo/swag. DO NOT EDIT.
|
||||||
// This file was generated by swaggo/swag
|
|
||||||
package docs
|
package docs
|
||||||
|
|
||||||
import "github.com/swaggo/swag"
|
import "github.com/swaggo/swag"
|
||||||
|
|
@ -13873,9 +13873,6 @@ const docTemplate = `{
|
||||||
"dto.DashboardCurrent": {
|
"dto.DashboardCurrent": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"MemoryUsedPercent": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"cpuPercent": {
|
"cpuPercent": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
|
|
@ -13933,6 +13930,9 @@ const docTemplate = `{
|
||||||
"memoryUsed": {
|
"memoryUsed": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"memoryUsedPercent": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"netBytesRecv": {
|
"netBytesRecv": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
|
@ -13945,6 +13945,18 @@ const docTemplate = `{
|
||||||
"shotTime": {
|
"shotTime": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"swapMemoryAvailable": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"swapMemoryTotal": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"swapMemoryUsed": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"swapMemoryUsedPercent": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"timeSinceUptime": {
|
"timeSinceUptime": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
@ -16712,12 +16724,21 @@ const docTemplate = `{
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"eabHmacKey": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"eabKid": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"updatedAt": {
|
"updatedAt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
@ -17610,8 +17631,6 @@ const docTemplate = `{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"operate",
|
"operate",
|
||||||
"password",
|
|
||||||
"username",
|
|
||||||
"websiteID"
|
"websiteID"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -17660,8 +17679,7 @@ const docTemplate = `{
|
||||||
"request.NginxConfigUpdate": {
|
"request.NginxConfigUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"operate",
|
"operate"
|
||||||
"websiteId"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"operate": {
|
"operate": {
|
||||||
|
|
@ -18094,11 +18112,27 @@ const docTemplate = `{
|
||||||
"request.WebsiteAcmeAccountCreate": {
|
"request.WebsiteAcmeAccountCreate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"email"
|
"email",
|
||||||
|
"type"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"eabHmacKey": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"eabKid": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"letsencrypt",
|
||||||
|
"zerossl",
|
||||||
|
"buypass",
|
||||||
|
"google"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -18193,9 +18227,6 @@ const docTemplate = `{
|
||||||
},
|
},
|
||||||
"request.WebsiteDefaultUpdate": {
|
"request.WebsiteDefaultUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
|
@ -19188,12 +19219,21 @@ const docTemplate = `{
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"eabHmacKey": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"eabKid": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"updatedAt": {
|
"updatedAt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -13866,9 +13866,6 @@
|
||||||
"dto.DashboardCurrent": {
|
"dto.DashboardCurrent": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"MemoryUsedPercent": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"cpuPercent": {
|
"cpuPercent": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
|
|
@ -13926,6 +13923,9 @@
|
||||||
"memoryUsed": {
|
"memoryUsed": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"memoryUsedPercent": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"netBytesRecv": {
|
"netBytesRecv": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
|
@ -13938,6 +13938,18 @@
|
||||||
"shotTime": {
|
"shotTime": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"swapMemoryAvailable": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"swapMemoryTotal": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"swapMemoryUsed": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"swapMemoryUsedPercent": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"timeSinceUptime": {
|
"timeSinceUptime": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
@ -16705,12 +16717,21 @@
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"eabHmacKey": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"eabKid": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"updatedAt": {
|
"updatedAt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
@ -17603,8 +17624,6 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"operate",
|
"operate",
|
||||||
"password",
|
|
||||||
"username",
|
|
||||||
"websiteID"
|
"websiteID"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -17653,8 +17672,7 @@
|
||||||
"request.NginxConfigUpdate": {
|
"request.NginxConfigUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"operate",
|
"operate"
|
||||||
"websiteId"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"operate": {
|
"operate": {
|
||||||
|
|
@ -18087,11 +18105,27 @@
|
||||||
"request.WebsiteAcmeAccountCreate": {
|
"request.WebsiteAcmeAccountCreate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"email"
|
"email",
|
||||||
|
"type"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"eabHmacKey": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"eabKid": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"letsencrypt",
|
||||||
|
"zerossl",
|
||||||
|
"buypass",
|
||||||
|
"google"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -18186,9 +18220,6 @@
|
||||||
},
|
},
|
||||||
"request.WebsiteDefaultUpdate": {
|
"request.WebsiteDefaultUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
|
@ -19181,12 +19212,21 @@
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"eabHmacKey": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"eabKid": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"updatedAt": {
|
"updatedAt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -736,8 +736,6 @@ definitions:
|
||||||
type: object
|
type: object
|
||||||
dto.DashboardCurrent:
|
dto.DashboardCurrent:
|
||||||
properties:
|
properties:
|
||||||
MemoryUsedPercent:
|
|
||||||
type: number
|
|
||||||
cpuPercent:
|
cpuPercent:
|
||||||
items:
|
items:
|
||||||
type: number
|
type: number
|
||||||
|
|
@ -776,6 +774,8 @@ definitions:
|
||||||
type: integer
|
type: integer
|
||||||
memoryUsed:
|
memoryUsed:
|
||||||
type: integer
|
type: integer
|
||||||
|
memoryUsedPercent:
|
||||||
|
type: number
|
||||||
netBytesRecv:
|
netBytesRecv:
|
||||||
type: integer
|
type: integer
|
||||||
netBytesSent:
|
netBytesSent:
|
||||||
|
|
@ -784,6 +784,14 @@ definitions:
|
||||||
type: integer
|
type: integer
|
||||||
shotTime:
|
shotTime:
|
||||||
type: string
|
type: string
|
||||||
|
swapMemoryAvailable:
|
||||||
|
type: integer
|
||||||
|
swapMemoryTotal:
|
||||||
|
type: integer
|
||||||
|
swapMemoryUsed:
|
||||||
|
type: integer
|
||||||
|
swapMemoryUsedPercent:
|
||||||
|
type: number
|
||||||
timeSinceUptime:
|
timeSinceUptime:
|
||||||
type: string
|
type: string
|
||||||
uptime:
|
uptime:
|
||||||
|
|
@ -2645,10 +2653,16 @@ definitions:
|
||||||
properties:
|
properties:
|
||||||
createdAt:
|
createdAt:
|
||||||
type: string
|
type: string
|
||||||
|
eabHmacKey:
|
||||||
|
type: string
|
||||||
|
eabKid:
|
||||||
|
type: string
|
||||||
email:
|
email:
|
||||||
type: string
|
type: string
|
||||||
id:
|
id:
|
||||||
type: integer
|
type: integer
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
updatedAt:
|
updatedAt:
|
||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
|
|
@ -3255,8 +3269,6 @@ definitions:
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
required:
|
||||||
- operate
|
- operate
|
||||||
- password
|
|
||||||
- username
|
|
||||||
- websiteID
|
- websiteID
|
||||||
type: object
|
type: object
|
||||||
request.NginxCommonReq:
|
request.NginxCommonReq:
|
||||||
|
|
@ -3290,7 +3302,6 @@ definitions:
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
required:
|
||||||
- operate
|
- operate
|
||||||
- websiteId
|
|
||||||
type: object
|
type: object
|
||||||
request.NginxProxyUpdate:
|
request.NginxProxyUpdate:
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -3569,10 +3580,22 @@ definitions:
|
||||||
type: object
|
type: object
|
||||||
request.WebsiteAcmeAccountCreate:
|
request.WebsiteAcmeAccountCreate:
|
||||||
properties:
|
properties:
|
||||||
|
eabHmacKey:
|
||||||
|
type: string
|
||||||
|
eabKid:
|
||||||
|
type: string
|
||||||
email:
|
email:
|
||||||
type: string
|
type: string
|
||||||
|
type:
|
||||||
|
enum:
|
||||||
|
- letsencrypt
|
||||||
|
- zerossl
|
||||||
|
- buypass
|
||||||
|
- google
|
||||||
|
type: string
|
||||||
required:
|
required:
|
||||||
- email
|
- email
|
||||||
|
- type
|
||||||
type: object
|
type: object
|
||||||
request.WebsiteCommonReq:
|
request.WebsiteCommonReq:
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -3638,8 +3661,6 @@ definitions:
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
|
||||||
- id
|
|
||||||
type: object
|
type: object
|
||||||
request.WebsiteDelete:
|
request.WebsiteDelete:
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -4299,10 +4320,16 @@ definitions:
|
||||||
properties:
|
properties:
|
||||||
createdAt:
|
createdAt:
|
||||||
type: string
|
type: string
|
||||||
|
eabHmacKey:
|
||||||
|
type: string
|
||||||
|
eabKid:
|
||||||
|
type: string
|
||||||
email:
|
email:
|
||||||
type: string
|
type: string
|
||||||
id:
|
id:
|
||||||
type: integer
|
type: integer
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
updatedAt:
|
updatedAt:
|
||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,11 @@ export namespace Dashboard {
|
||||||
memoryTotal: number;
|
memoryTotal: number;
|
||||||
memoryAvailable: number;
|
memoryAvailable: number;
|
||||||
memoryUsed: number;
|
memoryUsed: number;
|
||||||
MemoryUsedPercent: number;
|
memoryUsedPercent: number;
|
||||||
|
swapMemoryTotal: number;
|
||||||
|
swapMemoryAvailable: number;
|
||||||
|
swapMemoryUsed: number;
|
||||||
|
swapMemoryUsedPercent: number;
|
||||||
|
|
||||||
ioReadBytes: number;
|
ioReadBytes: number;
|
||||||
ioWriteBytes: number;
|
ioWriteBytes: number;
|
||||||
|
|
|
||||||
|
|
@ -305,6 +305,8 @@ const message = {
|
||||||
ioDelay: 'IO delay',
|
ioDelay: 'IO delay',
|
||||||
uptime: 'Up Time',
|
uptime: 'Up Time',
|
||||||
runningTime: 'Running Time',
|
runningTime: 'Running Time',
|
||||||
|
mem: 'System',
|
||||||
|
swapMem: 'Swap Partition',
|
||||||
|
|
||||||
runSmoothly: 'Run smoothly',
|
runSmoothly: 'Run smoothly',
|
||||||
runNormal: 'Run normal',
|
runNormal: 'Run normal',
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,8 @@ const message = {
|
||||||
ioDelay: '讀寫延遲',
|
ioDelay: '讀寫延遲',
|
||||||
uptime: '啟動時間',
|
uptime: '啟動時間',
|
||||||
runningTime: '運行時間',
|
runningTime: '運行時間',
|
||||||
|
mem: '系統',
|
||||||
|
swapMem: 'Swap 分區',
|
||||||
|
|
||||||
runSmoothly: '運行流暢',
|
runSmoothly: '運行流暢',
|
||||||
runNormal: '運行正常',
|
runNormal: '運行正常',
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,8 @@ const message = {
|
||||||
ioDelay: '读写延迟',
|
ioDelay: '读写延迟',
|
||||||
uptime: '启动时间',
|
uptime: '启动时间',
|
||||||
runningTime: '运行时间',
|
runningTime: '运行时间',
|
||||||
|
mem: '系统',
|
||||||
|
swapMem: 'Swap 分区',
|
||||||
|
|
||||||
runSmoothly: '运行流畅',
|
runSmoothly: '运行流畅',
|
||||||
runNormal: '运行正常',
|
runNormal: '运行正常',
|
||||||
|
|
|
||||||
|
|
@ -319,7 +319,11 @@ const currentInfo = ref<Dashboard.CurrentInfo>({
|
||||||
memoryTotal: 0,
|
memoryTotal: 0,
|
||||||
memoryAvailable: 0,
|
memoryAvailable: 0,
|
||||||
memoryUsed: 0,
|
memoryUsed: 0,
|
||||||
MemoryUsedPercent: 0,
|
memoryUsedPercent: 0,
|
||||||
|
swapMemoryTotal: 0,
|
||||||
|
swapMemoryAvailable: 0,
|
||||||
|
swapMemoryUsed: 0,
|
||||||
|
swapMemoryUsedPercent: 0,
|
||||||
|
|
||||||
ioReadBytes: 0,
|
ioReadBytes: 0,
|
||||||
ioWriteBytes: 0,
|
ioWriteBytes: 0,
|
||||||
|
|
@ -389,7 +393,7 @@ const onLoadBaseInfo = async (isInit: boolean, range: string) => {
|
||||||
if (isActive.value && !globalStore.isOnRestart) {
|
if (isActive.value && !globalStore.isOnRestart) {
|
||||||
await onLoadCurrentInfo();
|
await onLoadCurrentInfo();
|
||||||
}
|
}
|
||||||
}, 3000);
|
}, 300000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,13 +43,47 @@
|
||||||
</span>
|
</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" align="center">
|
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" align="center">
|
||||||
<v-charts
|
<el-popover placement="bottom" :width="160" trigger="hover">
|
||||||
height="160px"
|
<el-tag style="font-weight: 500">{{ $t('home.mem') }}:</el-tag>
|
||||||
id="memory"
|
<el-tag class="tagClass">
|
||||||
type="pie"
|
{{ $t('home.total') }}: {{ formatNumber(currentInfo.memoryTotal / 1024 / 1024) }} MB
|
||||||
:option="chartsOption['memory']"
|
</el-tag>
|
||||||
v-if="chartsOption['memory']"
|
<el-tag class="tagClass">
|
||||||
/>
|
{{ $t('home.used') }}: {{ formatNumber(currentInfo.memoryUsed / 1024 / 1024) }} MB
|
||||||
|
</el-tag>
|
||||||
|
<el-tag class="tagClass">
|
||||||
|
{{ $t('home.free') }}: {{ formatNumber(currentInfo.memoryAvailable / 1024 / 1024) }} MB
|
||||||
|
</el-tag>
|
||||||
|
<el-tag class="tagClass">
|
||||||
|
{{ $t('home.percent') }}: {{ formatNumber(currentInfo.memoryUsedPercent) }}%
|
||||||
|
</el-tag>
|
||||||
|
<div v-if="currentInfo.swapMemoryTotal">
|
||||||
|
<el-row :gutter="5" class="mt-2">
|
||||||
|
<el-tag style="font-weight: 500">{{ $t('home.swapMem') }}:</el-tag>
|
||||||
|
</el-row>
|
||||||
|
<el-tag class="tagClass">
|
||||||
|
{{ $t('home.total') }}: {{ formatNumber(currentInfo.swapMemoryTotal / 1024 / 1024) }} MB
|
||||||
|
</el-tag>
|
||||||
|
<el-tag class="tagClass">
|
||||||
|
{{ $t('home.used') }}: {{ formatNumber(currentInfo.swapMemoryUsed / 1024 / 1024) }} MB
|
||||||
|
</el-tag>
|
||||||
|
<el-tag class="tagClass">
|
||||||
|
{{ $t('home.free') }}: {{ formatNumber(currentInfo.swapMemoryAvailable / 1024 / 1024) }} MB
|
||||||
|
</el-tag>
|
||||||
|
<el-tag class="tagClass">
|
||||||
|
{{ $t('home.percent') }}: {{ formatNumber(100 - currentInfo.swapMemoryUsedPercent * 100) }}%
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
<template #reference>
|
||||||
|
<v-charts
|
||||||
|
height="160px"
|
||||||
|
id="memory"
|
||||||
|
type="pie"
|
||||||
|
:option="chartsOption['memory']"
|
||||||
|
v-if="chartsOption['memory']"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-popover>
|
||||||
<span class="input-help">
|
<span class="input-help">
|
||||||
( {{ formatNumber(currentInfo.memoryUsed / 1024 / 1024) }} /
|
( {{ formatNumber(currentInfo.memoryUsed / 1024 / 1024) }} /
|
||||||
{{ formatNumber(currentInfo.memoryTotal / 1024 / 1024) }} ) MB
|
{{ formatNumber(currentInfo.memoryTotal / 1024 / 1024) }} ) MB
|
||||||
|
|
@ -193,7 +227,11 @@ const currentInfo = ref<Dashboard.CurrentInfo>({
|
||||||
memoryTotal: 0,
|
memoryTotal: 0,
|
||||||
memoryAvailable: 0,
|
memoryAvailable: 0,
|
||||||
memoryUsed: 0,
|
memoryUsed: 0,
|
||||||
MemoryUsedPercent: 0,
|
memoryUsedPercent: 0,
|
||||||
|
swapMemoryTotal: 0,
|
||||||
|
swapMemoryAvailable: 0,
|
||||||
|
swapMemoryUsed: 0,
|
||||||
|
swapMemoryUsedPercent: 0,
|
||||||
|
|
||||||
ioReadBytes: 0,
|
ioReadBytes: 0,
|
||||||
ioWriteBytes: 0,
|
ioWriteBytes: 0,
|
||||||
|
|
@ -219,7 +257,7 @@ const acceptParams = (current: Dashboard.CurrentInfo, base: Dashboard.BaseInfo,
|
||||||
};
|
};
|
||||||
chartsOption.value['memory'] = {
|
chartsOption.value['memory'] = {
|
||||||
title: i18n.global.t('monitor.memory'),
|
title: i18n.global.t('monitor.memory'),
|
||||||
data: formatNumber(currentInfo.value.MemoryUsedPercent),
|
data: formatNumber(currentInfo.value.memoryUsedPercent),
|
||||||
};
|
};
|
||||||
chartsOption.value['load'] = {
|
chartsOption.value['load'] = {
|
||||||
title: i18n.global.t('home.load'),
|
title: i18n.global.t('home.load'),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue