Skip to content

Commit

Permalink
[INLONG-11496][Dashboard] File source adds a new judgment on spaces i…
Browse files Browse the repository at this point in the history
…n the file path (#11497)
  • Loading branch information
wohainilaodou authored Nov 14, 2024
1 parent ddaff24 commit 9bf8b5d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
8 changes: 7 additions & 1 deletion inlong-dashboard/src/plugins/sources/defaults/File.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ export default class PulsarSource
@FieldDecorator({
type: 'input',
tooltip: i18n.t('meta.Sources.File.FilePathHelp'),
rules: [{ required: true }],
rules: [
{ required: true },
{
pattern: /^\S*$/,
message: i18n.t('meta.Sources.File.FilePathPatternHelp'),
},
],
props: values => ({
disabled: Boolean(values.id),
}),
Expand Down
1 change: 1 addition & 0 deletions inlong-dashboard/src/ui/locales/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"meta.Sources.File.ClusterName": "集群名称",
"meta.Sources.File.FilePath": "⽂件路径",
"meta.Sources.File.FilePathHelp": "必须是绝对路径,支持正则表达式,多个时以逗号分隔,如:/data/.*log",
"meta.Sources.File.FilePathPatternHelp": "文件路径不能包含空格",
"meta.Sources.File.FileIpHelp": "请选择文件采集节点 IP,若 IP 不固定请选择 All",
"meta.Sources.File.IpRule": "请输入正确的 IP 地址",
"meta.Sources.File.VersionRule": "请输入正确的版本号",
Expand Down
1 change: 1 addition & 0 deletions inlong-dashboard/src/ui/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"meta.Sources.File.ClusterName": "Cluster name",
"meta.Sources.File.FilePath": "File path",
"meta.Sources.File.FilePathHelp": "Must be an absolute path and support regular expressions, such as: /data/.*log",
"meta.Sources.File.FilePathPatternHelp": "File path cannot contain spaces",
"meta.Sources.File.FileIpHelp": "Please select the file collection node IP. If the IP is not fixed, please select All",
"meta.Sources.File.IpRule": "Please enter the IP address correctly",
"meta.Sources.File.VersionRule":"Please enter the correct version number",
Expand Down
8 changes: 4 additions & 4 deletions inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ const Comp: React.FC<AuditProps> = ({ auditData }) => {
base:
sourceData[0].auditId === baseData.auditId
? cur.count
: sourceData[0].auditSet.find(item => (item.ip = cur.ip))
? sourceData[0].auditSet.find(item => (item.ip = cur.ip)).count
: sourceData[0].auditSet.find(item => item.ip === cur.ip)
? sourceData[0].auditSet.find(item => item.ip === cur.ip).count
: 0,
compared:
sourceData[1].auditId === baseData.auditId
? cur.count
: sourceData[1].auditSet.find(item => (item.ip = cur.ip))
? sourceData[1].auditSet.find(item => (item.ip = cur.ip)).count
: sourceData[1].auditSet.find(item => item.ip === cur.ip)
? sourceData[1].auditSet.find(item => item.ip === cur.ip).count
: 0,
};
return acc;
Expand Down

0 comments on commit 9bf8b5d

Please sign in to comment.