ProxMenux/AppImage/types/hardware.ts

218 lines
4.5 KiB
TypeScript
Raw Normal View History

2025-11-13 18:32:44 +01:00
import { fetchApi } from "@/lib/api-config"
2025-10-06 14:17:14 +02:00
export interface Temperature {
name: string
2025-10-06 18:02:40 +02:00
original_name?: string
2025-10-06 14:17:14 +02:00
current: number
high?: number
critical?: number
adapter?: string
}
export interface PowerMeter {
name: string
watts: number
adapter?: string
}
export interface NetworkInterface {
name: string
type: string
speed?: string
status?: string
}
export interface StorageDevice {
name: string
type: string
size?: string
model?: string
2025-10-06 18:29:00 +02:00
driver?: string
interface?: string
serial?: string
family?: string
firmware?: string
2025-10-29 22:16:40 +01:00
rotation_rate?: number | string
2025-10-06 18:29:00 +02:00
form_factor?: string
sata_version?: string
2025-11-04 12:47:26 +01:00
pcie_gen?: string // e.g., "PCIe 4.0"
pcie_width?: string // e.g., "x4"
pcie_max_gen?: string // Maximum supported PCIe generation
pcie_max_width?: string // Maximum supported PCIe lanes
sas_version?: string // e.g., "SAS-3"
sas_speed?: string // e.g., "12Gb/s"
link_speed?: string // Generic link speed info
2025-10-06 14:17:14 +02:00
}
export interface PCIDevice {
slot: string
type: string
device: string
vendor: string
class: string
driver?: string
kernel_module?: string
irq?: string
memory_address?: string
link_speed?: string
capabilities?: string[]
2025-10-06 16:40:14 +02:00
gpu_memory?: string
gpu_driver_version?: string
gpu_cuda_version?: string
gpu_compute_capability?: string
gpu_power_draw?: string
gpu_temperature?: number
gpu_utilization?: number
gpu_memory_used?: string
gpu_memory_total?: string
gpu_clock_speed?: string
gpu_memory_clock?: string
2025-10-06 14:17:14 +02:00
}
export interface Fan {
name: string
2025-10-06 18:29:00 +02:00
original_name?: string
2025-10-06 14:17:14 +02:00
speed: number
unit: string
2025-10-06 18:02:40 +02:00
adapter?: string
2025-10-06 14:17:14 +02:00
}
export interface PowerSupply {
name: string
watts: number
status?: string
}
export interface UPS {
name: string
2025-10-14 18:51:39 +02:00
host?: string
is_remote?: boolean
connection_type?: string
2025-10-06 14:17:14 +02:00
status: string
2025-10-14 18:51:39 +02:00
model?: string
manufacturer?: string
serial?: string
device_type?: string
firmware?: string
driver?: string
battery_charge?: string
battery_charge_raw?: number
battery_voltage?: string
battery_date?: string
time_left?: string
time_left_seconds?: number
load_percent?: string
load_percent_raw?: number
input_voltage?: string
input_frequency?: string
output_voltage?: string
output_frequency?: string
real_power?: string
apparent_power?: string
[key: string]: any
2025-10-06 14:17:14 +02:00
}
2025-10-06 18:29:00 +02:00
export interface GPU {
slot: string
2025-10-06 18:02:40 +02:00
name: string
2025-10-06 18:29:00 +02:00
vendor: string
type: string
2025-10-06 22:39:37 +02:00
pci_class?: string
pci_driver?: string
pci_kernel_module?: string
2025-10-06 18:29:00 +02:00
driver_version?: string
memory_total?: string
memory_used?: string
memory_free?: string
temperature?: number
power_draw?: string
power_limit?: string
utilization_gpu?: number
utilization_memory?: number
clock_graphics?: string
clock_memory?: string
2025-10-07 00:35:23 +02:00
engine_render?: number
engine_blitter?: number
engine_video?: number
engine_video_enhance?: number
2025-10-06 18:29:00 +02:00
pcie_gen?: string
pcie_width?: string
fan_speed?: number
fan_unit?: string
processes?: Array<{
pid: string
name: string
memory: string
}>
2025-10-07 00:35:23 +02:00
has_monitoring_tool?: boolean
2025-10-06 18:29:00 +02:00
note?: string
2025-10-06 18:02:40 +02:00
}
2025-10-06 18:29:00 +02:00
export interface DiskHardwareInfo {
2025-10-06 18:02:40 +02:00
type?: string
driver?: string
2025-10-06 18:29:00 +02:00
interface?: string
2025-10-06 18:02:40 +02:00
model?: string
serial?: string
2025-10-06 18:29:00 +02:00
family?: string
firmware?: string
rotation_rate?: string
form_factor?: string
sata_version?: string
2025-10-06 18:02:40 +02:00
}
2025-10-06 18:29:00 +02:00
export interface NetworkHardwareInfo {
2025-10-06 18:02:40 +02:00
driver?: string
2025-10-06 18:29:00 +02:00
kernel_modules?: string
subsystem?: string
max_link_speed?: string
max_link_width?: string
current_link_speed?: string
current_link_width?: string
interface_name?: string
interface_speed?: string
2025-10-06 18:02:40 +02:00
mac_address?: string
}
2025-10-06 14:17:14 +02:00
export interface HardwareData {
2025-10-06 18:29:00 +02:00
cpu?: {
model?: string
cores_per_socket?: number
sockets?: number
total_threads?: number
l3_cache?: string
virtualization?: string
}
motherboard?: {
manufacturer?: string
model?: string
bios?: {
vendor?: string
version?: string
date?: string
}
}
memory_modules?: Array<{
slot: string
size?: string
type?: string
speed?: string
manufacturer?: string
}>
2025-10-06 14:17:14 +02:00
temperatures?: Temperature[]
power_meter?: PowerMeter
network_cards?: NetworkInterface[]
storage_devices?: StorageDevice[]
pci_devices?: PCIDevice[]
2025-10-06 18:02:40 +02:00
gpus?: GPU[]
2025-10-06 14:17:14 +02:00
fans?: Fan[]
power_supplies?: PowerSupply[]
2025-10-14 18:51:39 +02:00
ups?: UPS | UPS[]
2025-10-06 14:17:14 +02:00
}
2025-11-13 18:32:44 +01:00
export const fetcher = async (url: string) => {
// Extract just the endpoint from the URL if it's a full URL
const endpoint = url.startsWith("http") ? new URL(url).pathname : url
return fetchApi(endpoint)
}