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

Sync code from refs/heads/dev/1.10.4 to enterprise #3112

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hooks/Rule/KeysInRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import RuleFunc from './RuleFunc.json'
import RuleField from './RuleField.json'

const funcList = RuleFunc.reduce((arr: Array<string>, { list }): Array<string> => {
list.forEach(({ name }: { name: string }) => arr.push(name))
list?.forEach(({ name }: { name: string }) => arr.push(name))
return arr
}, [])

Expand Down
20 changes: 20 additions & 0 deletions src/hooks/Rule/RuleFunc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,26 @@
"required": true
}
]
},
{
"name": "str_utf16_le",
"args": [
{
"name": "Data",
"type": "string",
"required": true
}
]
},
{
"name": "sqlserver_bin2hexstr",
"args": [
{
"name": "Data",
"type": "string",
"required": true
}
]
}
]
},
Expand Down
1 change: 1 addition & 0 deletions src/hooks/Rule/bridge/useComponentsHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default (
} else if (prop.type === 'boolean' && prop.is_template) {
prop.type = 'enum'
prop.symbols = [true, false]
prop.default ??= ''
} else if (prop.type === 'object' && !prop.properties && prop.is_template) {
setComponentProps(prop, { supportPlaceholder: ['key', 'value'] })
}
Expand Down
24 changes: 24 additions & 0 deletions src/i18n/RuleSyntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -1188,4 +1188,28 @@ Typical JQ programs describe simple transformations or filters for JSON data, bu
zh: 'Map 的大小',
en: 'The size of the map',
},
strUtf16LeDesc: {
zh: '将 UTF-8 字符串转换为 UTF-16 小端序编码',
en: 'Convert a UTF-8 string to UTF-16 little-endian'
},
strUtf16LeParams: {
zh: '要转换的字符串',
en: 'String to convert'
},
strUtf16LeReturns: {
zh: 'UTF-16 小端序编码的字符串',
en: 'UTF-16 little-endian encoded string'
},
sqlserverBin2HexstrDesc: {
zh: '将字符串或二进制转换为 SQL Server 十六进制格式(带 0x 前缀)',
en: 'Convert string or binary to SQL Server hex format with 0x prefix'
},
sqlserverBin2HexstrParams: {
zh: '要转换的数据',
en: 'Data to convert'
},
sqlserverBin2HexstrReturns: {
zh: 'SQL Server 格式的十六进制字符串',
en: 'Hex string in SQL Server format'
}
}