import { rpcOrNull } from '@/services/analytics/rpc.uts'

/**
 * 系统信息模型
 */
export type SystemInfo = {
  server_os : string
  web_server : string
  db_engine : string
  db_version : string
  uts_runtime : string
  auth_id : string
}

/**
 * 获取服务器及系统环境信息
 */
export async function fetchSystemInfo() : Promise<SystemInfo | null> {
  const res = await rpcOrNull('rpc_admin_get_system_info', {} as UTSJSONObject)
  if (res == null) return null
  return res as SystemInfo
}
