mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-24 16:00:53 +00:00
* feat: Add PrettyDistro field to dashboard information and update related services and frontend components * fix: Trim whitespace and parentheses from detected Linux distribution name in GetDistro method * fix: Correctly trim parentheses from detected Linux distribution name in GetDistro method * refactor: Simplify Linux distribution detection by removing unnecessary checks and consolidating logic
160 lines
3.8 KiB
Go
160 lines
3.8 KiB
Go
export namespace Dashboard {
|
|
export interface OsInfo {
|
|
os: string;
|
|
platform: string;
|
|
platformFamily: string;
|
|
kernelArch: string;
|
|
kernelVersion: string;
|
|
|
|
diskSize: number;
|
|
}
|
|
export interface QuickJump {
|
|
id: number;
|
|
name: string;
|
|
alias: string;
|
|
title: string;
|
|
detail: string;
|
|
recommend: number;
|
|
isShow: boolean;
|
|
router: string;
|
|
}
|
|
export interface AppLauncher {
|
|
key: string;
|
|
icon: string;
|
|
limit: number;
|
|
shortDescEn: string;
|
|
shortDescZh: string;
|
|
currentRow: InstallDetail;
|
|
|
|
isInstall: boolean;
|
|
isRecommend: boolean;
|
|
detail: Array<InstallDetail>;
|
|
}
|
|
export interface AppLauncherOption {
|
|
key: string;
|
|
isShow: boolean;
|
|
}
|
|
export interface InstallDetail {
|
|
installID: number;
|
|
detailID: string;
|
|
name: string;
|
|
version: string;
|
|
path: string;
|
|
status: string;
|
|
appType: string;
|
|
webUI: string;
|
|
httpPort: string;
|
|
httpsPort: string;
|
|
}
|
|
export interface BaseInfo {
|
|
hostname: string;
|
|
os: string;
|
|
platform: string;
|
|
platformFamily: string;
|
|
platformVersion: string;
|
|
prettyDistro: string;
|
|
kernelArch: string;
|
|
kernelVersion: string;
|
|
virtualizationSystem: string;
|
|
ipV4Addr: string;
|
|
httpProxy: string;
|
|
|
|
cpuCores: number;
|
|
cpuLogicalCores: number;
|
|
cpuModelName: string;
|
|
cpuMhz: number;
|
|
|
|
currentInfo: CurrentInfo;
|
|
quickJump: Array<QuickJump>;
|
|
}
|
|
export interface CurrentInfo {
|
|
uptime: number;
|
|
timeSinceUptime: string;
|
|
procs: number;
|
|
|
|
load1: number;
|
|
load5: number;
|
|
load15: number;
|
|
loadUsagePercent: number;
|
|
|
|
cpuPercent: Array<number>;
|
|
cpuUsedPercent: number;
|
|
cpuUsed: number;
|
|
cpuTotal: number;
|
|
cpuDetailedPercent: Array<number>; // [user, system, nice, idle, iowait, irq, softirq, steal]
|
|
|
|
memoryTotal: number;
|
|
memoryAvailable: number;
|
|
memoryUsed: number;
|
|
memoryFree: number;
|
|
memoryShard: number;
|
|
memoryCache: number;
|
|
memoryUsedPercent: number;
|
|
swapMemoryTotal: number;
|
|
swapMemoryAvailable: number;
|
|
swapMemoryUsed: number;
|
|
swapMemoryUsedPercent: number;
|
|
|
|
ioReadBytes: number;
|
|
ioWriteBytes: number;
|
|
ioCount: number;
|
|
ioReadTime: number;
|
|
ioWriteTime: number;
|
|
|
|
diskData: Array<DiskInfo>;
|
|
|
|
gpuData: Array<GPUInfo>;
|
|
xpuData: Array<XPUInfo>;
|
|
|
|
topCPUItems?: Array<Process>;
|
|
topMemItems?: Array<Process>;
|
|
|
|
netBytesSent: number;
|
|
netBytesRecv: number;
|
|
|
|
shotTime: Date;
|
|
}
|
|
export interface Process {
|
|
name: string;
|
|
pid: number;
|
|
percent: number;
|
|
memory: number;
|
|
cmd: string;
|
|
user: string;
|
|
}
|
|
export interface DiskInfo {
|
|
path: string;
|
|
type: string;
|
|
device: string;
|
|
total: number;
|
|
free: number;
|
|
used: number;
|
|
usedPercent: number;
|
|
|
|
inodesTotal: number;
|
|
inodesUsed: number;
|
|
inodesFree: number;
|
|
inodesUsedPercent: number;
|
|
}
|
|
export interface GPUInfo {
|
|
index: number;
|
|
productName: string;
|
|
gpuUtil: string;
|
|
temperature: string;
|
|
performanceState: string;
|
|
powerUsage: string;
|
|
memoryUsage: string;
|
|
fanSpeed: string;
|
|
}
|
|
|
|
export interface XPUInfo {
|
|
deviceID: number;
|
|
deviceName: string;
|
|
memory: string;
|
|
temperature: string;
|
|
memoryUsed: string;
|
|
power: string;
|
|
memoryUtil: string;
|
|
}
|
|
}
|