mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 10:46:16 +01:00
add gpu usage alerts
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { t } from "@lingui/core/macro"
|
||||
import { CpuIcon, HardDriveIcon, HourglassIcon, MemoryStickIcon, ServerIcon, ThermometerIcon } from "lucide-react"
|
||||
import type { RecordSubscription } from "pocketbase"
|
||||
import { EthernetIcon } from "@/components/ui/icons"
|
||||
import { EthernetIcon, GpuIcon } from "@/components/ui/icons"
|
||||
import { $alerts } from "@/lib/stores"
|
||||
import type { AlertInfo, AlertRecord } from "@/types"
|
||||
import { pb } from "./api"
|
||||
@@ -41,6 +41,12 @@ export const alertInfo: Record<string, AlertInfo> = {
|
||||
desc: () => t`Triggers when combined up/down exceeds a threshold`,
|
||||
max: 125,
|
||||
},
|
||||
GPU: {
|
||||
name: () => t`GPU Usage`,
|
||||
unit: "%",
|
||||
icon: GpuIcon,
|
||||
desc: () => t`Triggers when GPU usage exceeds a threshold`,
|
||||
},
|
||||
Temperature: {
|
||||
name: () => t`Temperature`,
|
||||
unit: "°C",
|
||||
|
||||
24
internal/site/src/types.d.ts
vendored
24
internal/site/src/types.d.ts
vendored
@@ -301,18 +301,18 @@ export interface ChartData {
|
||||
chartTime: ChartTimes
|
||||
}
|
||||
|
||||
// interface AlertInfo {
|
||||
// name: () => string
|
||||
// unit: string
|
||||
// icon: any
|
||||
// desc: () => string
|
||||
// max?: number
|
||||
// min?: number
|
||||
// step?: number
|
||||
// start?: number
|
||||
// /** Single value description (when there's only one value, like status) */
|
||||
// singleDesc?: () => string
|
||||
// }
|
||||
export interface AlertInfo {
|
||||
name: () => string
|
||||
unit: string
|
||||
icon: any
|
||||
desc: () => string
|
||||
max?: number
|
||||
min?: number
|
||||
step?: number
|
||||
start?: number
|
||||
/** Single value description (when there's only one value, like status) */
|
||||
singleDesc?: () => string
|
||||
}
|
||||
|
||||
export type AlertMap = Record<string, Map<string, AlertRecord>>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user