fix: trim parsed snmp oid rows

This commit is contained in:
zxr
2026-07-05 17:54:23 +08:00
parent 9f1c3eb660
commit 99a5f8bd16

View File

@@ -290,10 +290,10 @@ const parseSnmpOidRows = (raw: string): SnmpOidRow[] => {
throw new Error('SNMP OID 配置必须是 JSON 数组') throw new Error('SNMP OID 配置必须是 JSON 数组')
} }
return parsed.map((item) => ({ return parsed.map((item) => ({
oid: String(item?.oid ?? ''), oid: String(item?.oid ?? '').trim(),
metric_name: String(item?.metric_name ?? ''), metric_name: String(item?.metric_name ?? '').trim(),
metric_unit: String(item?.metric_unit ?? ''), metric_unit: String(item?.metric_unit ?? '').trim(),
type: String(item?.type ?? ''), type: String(item?.type ?? '').trim(),
})) }))
} }