Unverified Commit b25694d0 authored by gaoyan's avatar gaoyan Committed by GitHub

Fix the alert option is incorrect (#2798)

* fix log error * Fix the alert option is incorrect * Fix the alert option is incorrect
parent 1a3cc6ac
...@@ -59,7 +59,6 @@ export const AlertRules: any = { ...@@ -59,7 +59,6 @@ export const AlertRules: any = {
jobName: { jobName: {
label: l('sys.alert.rule.label.taskId'), label: l('sys.alert.rule.label.taskId'),
valueType: OperatorType.NUMBER_VALUE, valueType: OperatorType.NUMBER_VALUE,
options_enum: EqRuleOperator
}, },
duration: { duration: {
label: l('sys.alert.rule.label.duration'), label: l('sys.alert.rule.label.duration'),
...@@ -82,8 +81,7 @@ export const AlertRules: any = { ...@@ -82,8 +81,7 @@ export const AlertRules: any = {
}, },
checkpointCostTime: { checkpointCostTime: {
label: l('sys.alert.rule.label.checkpointTime'), label: l('sys.alert.rule.label.checkpointTime'),
valueType: OperatorType.OPTIONS_SEL, valueType: OperatorType.NUMBER_VALUE,
valueEnum: BOOLEAN_VALUE_ENUM
}, },
isCheckpointFailed: { isCheckpointFailed: {
label: l('sys.alert.rule.label.checkpointFailed'), label: l('sys.alert.rule.label.checkpointFailed'),
......
...@@ -62,13 +62,15 @@ export const buildValueItem = (key: string, isSystem: boolean) => { ...@@ -62,13 +62,15 @@ export const buildValueItem = (key: string, isSystem: boolean) => {
name={'ruleValue'} name={'ruleValue'}
fieldProps={{ precision: 0 }} fieldProps={{ precision: 0 }}
placeholder={plh} placeholder={plh}
width={'sm'}
/> />
); );
case OperatorType.STR_VALUE: case OperatorType.STR_VALUE:
return <ProFormText disabled={isSystem} name={'ruleValue'} placeholder={plh} />; return <ProFormText width={'sm'} disabled={isSystem} name={'ruleValue'} placeholder={plh} />;
case OperatorType.OPTIONS_SEL: case OperatorType.OPTIONS_SEL:
return ( return (
<ProFormSelect <ProFormSelect
width={'sm'}
disabled={isSystem} disabled={isSystem}
width={'sm'} width={'sm'}
name='ruleValue' name='ruleValue'
......
...@@ -195,6 +195,7 @@ const RuleEditForm = (props: AlertRuleFormProps) => { ...@@ -195,6 +195,7 @@ const RuleEditForm = (props: AlertRuleFormProps) => {
disabled={isSystem} disabled={isSystem}
name='ruleOperator' name='ruleOperator'
mode={'single'} mode={'single'}
width={'sm'}
options={getOperatorOptions(ruleKey.ruleKey)} options={getOperatorOptions(ruleKey.ruleKey)}
/> />
)} )}
......
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
export const validationOptions = (value: string) => {
switch (value) {
case 'jobInstance.status':
case 'checkPoints.checkFailed(#key,#checkPoints)':
case 'exceptionRule.isException(#key,#exceptions)':
return true;
case 'checkPoints.checkpointTime(#key,#checkPoints)':
return false;
default:
return false;
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment