57 lines
1.5 KiB
C
57 lines
1.5 KiB
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define UI_MAX_DISK_TEXT 128
|
|
#define UI_MAX_CPU_CORE_TEXT 48
|
|
#define UI_CODEX_DAILY_BAR_COUNT 14
|
|
#define UI_ZHIPU_DAILY_BAR_COUNT UI_CODEX_DAILY_BAR_COUNT
|
|
|
|
typedef struct {
|
|
int cpu_percent;
|
|
int cpu_mhz;
|
|
int memory_percent;
|
|
int memory_used_mb;
|
|
int memory_total_mb;
|
|
int disk_percent;
|
|
int disk_read_kbps;
|
|
int disk_write_kbps;
|
|
int rx_kbps;
|
|
int tx_kbps;
|
|
int disk_count;
|
|
int codex_5h_percent;
|
|
int codex_week_percent;
|
|
int codex_5h_reset_mins;
|
|
int codex_week_reset_mins;
|
|
int codex_reset_credits;
|
|
int codex_today_tokens_m10;
|
|
int codex_daily_count;
|
|
int codex_daily_percent[UI_CODEX_DAILY_BAR_COUNT];
|
|
int zhipu_status;
|
|
int zhipu_quota_percent;
|
|
int zhipu_latency_ms;
|
|
int zhipu_5h_percent;
|
|
int zhipu_week_percent;
|
|
int zhipu_5h_reset_mins;
|
|
int zhipu_week_reset_mins;
|
|
int zhipu_today_tokens_m10;
|
|
int zhipu_daily_count;
|
|
int zhipu_daily_percent[UI_ZHIPU_DAILY_BAR_COUNT];
|
|
char cpu_core_text[UI_MAX_CPU_CORE_TEXT];
|
|
char disk_text[UI_MAX_DISK_TEXT];
|
|
} ui_metrics_t;
|
|
|
|
void ui_screen_create(void);
|
|
void ui_screen_tick(void);
|
|
void ui_screen_update_metrics(const ui_metrics_t *metrics);
|
|
void ui_screen_update_metrics_from_source(const ui_metrics_t *metrics, const char *source);
|
|
void ui_screen_set_status(const char *status);
|
|
void ui_screen_update_battery(int percent, int millivolts);
|
|
void ui_screen_update_environment(int temperature_c10, int humidity_percent);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|