[BUG] <title>阈值规则配置规则
- Dominant language
- Java
- Stars
- 7.4k
- Forks
- 1.3k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 32
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Current Behavior
1、在阈值规则新增界面配置了一条阈值规则后,再点编辑按钮,回显时,阈值规则从原来的两项规则变成了一项;
### Expected Behavior
新增/编辑阈值规则能新增成功/编辑时数据回显正确且可以提交成功
### Steps To Reproduce
1、新增一条阈值规则,规则(表达式)如下:equals(__app__,"linux_script") && equals(__metrics__,"disk") && contains(__labels__, "453") && equals(disk_num, "123") and (write_rate > 12),并新增成功,控制台无报错信息;
2、点击编辑按钮,进入编辑阈值规则界面,回显表达式时,仅剩一项: (write_rate > 12) ,如图:


3、基于此问题,同时创建了别的表达式来对比:对比表达式如下:equals(__app__,"linux_script") && equals(__metrics__,"basic") && (contains(__labels__, "213") or contains(__labels__, "2323")) && equals(version, "wew"),该表达式回显时,出现控制台报错,且表达式不能正常回显,如图:


4、此外,基于步骤3,由于表达式回显时控制台有报错,查阅了相关源码发现该处有关联到【关联监控】按钮,当次数出现错误时,【关联监控】按钮弹窗也会受影响,如图:

此时该弹窗无法正常关闭,只能通过刷新页面来消除;
### Environment
```markdown
HertzBeat version(s):1.7.1
```
### Debug logs
_No response_
### Anything else?
_No response_
Contributor guide
Research direction
Start by reproducing the issue in the threshold-rule add/edit interface using the expressions from the report. Trace the expression re-display and the associated-monitoring dialog behavior; done means all expression clauses reappear, the rule can be submitted, and the dialog closes normally.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend, observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100