Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前端在截断Value时,当value为null时,会导致页面加载不出来。 #94

Open
jibill opened this issue Feb 18, 2025 · 0 comments

Comments

@jibill
Copy link

jibill commented Feb 18, 2025

问题描述

前端在截断Value时,当value为null时,会导致页面加载不出来。

修复问题

例如src/pages/event/index.jsx

269                const truncatedValue = value.length > 20 ? value.substring(0, 20) + '...' : value;
283                const truncatedValue = value.length > 20 ? value.substring(0, 20) + '...' : value;

改为

269                    const truncatedValue = value ? (value.length > 20 ? value.substring(0, 20) + '...' : value) : "null";
283                    const truncatedValue = value ? (value.length > 20 ? value.substring(0, 20) + '...' : value) : "null";

还有src/pages/alert/event/AlertHisEvent.jsx, src/pages/alert/event/AlertCurEvent.jsx,这2个文件都有类似的情况。

触发该Bug时的场景

ali SLS源,规则:level: info > 10时,
找到Redis中的该告警,值为

    "datasource_type": "AliCloudSLS",
    "datasource_id": "ds-xxx",
    "fingerprint": "xxx",
    "severity": "P1",
    "metric": {
        "_container_name_": null,
        "_namespace_": null
    },
    "labels": {
        "mykey": "myvalue"
    },

其中metric的2个值均为null,触发了该BUG,将值改为字符串,页面正常加载

    "metric": {
        "_container_name_": "null",
        "_namespace_": "null"
    },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant