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 = {
jobName: {
label: l('sys.alert.rule.label.taskId'),
valueType: OperatorType.NUMBER_VALUE,
options_enum: EqRuleOperator
},
duration: {
label: l('sys.alert.rule.label.duration'),
......@@ -82,8 +81,7 @@ export const AlertRules: any = {
},
checkpointCostTime: {
label: l('sys.alert.rule.label.checkpointTime'),
valueType: OperatorType.OPTIONS_SEL,
valueEnum: BOOLEAN_VALUE_ENUM
valueType: OperatorType.NUMBER_VALUE,
},
isCheckpointFailed: {
label: l('sys.alert.rule.label.checkpointFailed'),
......
......@@ -62,13 +62,15 @@ export const buildValueItem = (key: string, isSystem: boolean) => {
name={'ruleValue'}
fieldProps={{ precision: 0 }}
placeholder={plh}
width={'sm'}
/>
);
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:
return (
<ProFormSelect
width={'sm'}
disabled={isSystem}
width={'sm'}
name='ruleValue'
......
......@@ -195,6 +195,7 @@ const RuleEditForm = (props: AlertRuleFormProps) => {
disabled={isSystem}
name='ruleOperator'
mode={'single'}
width={'sm'}
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