Skip to content

Commit

Permalink
Merge branch 'dev/1.10.4' into enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinplemelon committed Dec 17, 2024
2 parents c4d28ca + 8750521 commit 5ecd966
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/CustomInputPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { computed, defineEmits, defineProps } from 'vue'
const props = defineProps<{
modelValue?: string
[key: string]: any
}>()
const emit = defineEmits<{
Expand Down
11 changes: 11 additions & 0 deletions src/components/SchemaFormItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import InputWithUnit from './InputWithUnit.vue'
import KeyAndValueEditor from './KeyAndValueEditor.vue'
import OneOf from './Oneof.vue'
import TimeInputWithUnitSelect from './TimeInputWithUnitSelect.vue'
import CustomInputPassword from './CustomInputPassword.vue'

type FormItemType =
| 'string'
Expand Down Expand Up @@ -159,6 +160,16 @@ export default defineComponent({
{...customProps}
/>
)
} else if (props.format === 'password') {
return (
<CustomInputPassword
disabled={isDisabled}
placeholder={props.placeholder}
v-model={formItemValue.value}
clearable
{...customProps}
/>
)
}
return stringInput
}
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 @@ -336,6 +336,16 @@
"required": true
}
]
},
{
"name": "is_empty",
"args": [
{
"name": "Value",
"type": "any",
"required": true
}
]
}
]
},
Expand Down Expand Up @@ -756,6 +766,16 @@
"required": true
}
]
},
{
"name": "map_size",
"args": [
{
"name": "Map",
"type": "object",
"required": true
}
]
}
]
},
Expand Down
5 changes: 5 additions & 0 deletions src/hooks/Rule/bridge/useComponentsHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export default (
const walk = (prop: Property) => {
if (prop.properties) {
Object.values(prop.properties).forEach((item) => walk(item))
} else if (prop.type === 'array' && prop.items?.properties) {
Object.values(prop.items.properties).forEach((item) => walk(item))
} else if (prop.type === 'oneof') {
prop.oneOf?.forEach((item) => walk(item))
} else if (
Expand All @@ -106,6 +108,9 @@ export default (
prop.is_template
) {
setComponentProps(prop, { completionProvider })
} else if (prop.type === 'boolean' && prop.is_template) {
prop.type = 'enum'
prop.symbols = [true, false]
} else if (prop.type === 'object' && !prop.properties && prop.is_template) {
setComponentProps(prop, { supportPlaceholder: ['key', 'value'] })
}
Expand Down
1 change: 0 additions & 1 deletion src/hooks/Schema/useSchemaForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ export default function useSchemaForm(
return item
}) as Property[]
property.is_template = getIsTemplateFromOneOfArr(property.oneOf)
console.log(property.path)
}
if (!label) {
property.label = lastLabel
Expand Down
24 changes: 24 additions & 0 deletions src/i18n/RuleSyntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,30 @@ Typical JQ programs describe simple transformations or filters for JSON data, bu
zh: '返回值为执行生成生成的 JSON 对象列表。如果执行超时或者 JQ 程序抛出异常,该函数将抛出异常。',
en: 'list of objects corresponding to the JSON objects generated by the given JQ program (parameter 1) when given the input provided by parameter 2. The function throws an exception if the execution did not finish before the timeout or if the jq program throws an exception.',
},
isEmptyDesc: {
zh: '判断 Map 或数组是否为空',
en: 'Return true if the map or array is empty',
},
isEmptyParams: {
zh: '要检查的值',
en: 'Value to check',
},
isEmptyReturns: {
zh: '布尔值,为空时返回 true',
en: 'Boolean value, true if empty',
},
mapSizeDesc: {
zh: '获取 Map 的大小',
en: 'Return the size of a map',
},
mapSizeParams: {
zh: 'Map 对象',
en: 'Map object',
},
mapSizeReturns: {
zh: 'Map 的大小',
en: 'The size of the map',
},
schemaDecodeDesc: {
zh: `将数据解码为目标数据结构`,
en: `Decode data to target data structure`,
Expand Down
7 changes: 7 additions & 0 deletions src/style/rule.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
.detail-header img {
height: 40px;
}
.block-title {
max-width: 400px;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: nowrap;
margin: 0;
}
.info-tags {
.el-tag,
.node-status {
Expand Down
10 changes: 9 additions & 1 deletion src/views/RuleEngine/Bridge/BridgeDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
<template #content>
<div class="vertical-align-center">
<img :src="getBridgeIcon(bridgeInfo.type)" />
<p class="block-title">{{ bridgeInfo.name }}</p>
<el-tooltip :content="bridgeInfo.name">
<p class="vertical-align-center block-title">
<TextEasyCopy :content="bridgeInfo.name">
<PreWithEllipsis>{{ bridgeInfo.name }}</PreWithEllipsis>
</TextEasyCopy>
</p>
</el-tooltip>
<TargetItemStatus type="action" :target="bridgeInfo" is-tag />
<el-tag type="info" class="section-status">
{{ getGeneralTypeLabel(bridgeInfo.type) }}
Expand Down Expand Up @@ -176,6 +182,8 @@ import TargetItemStatus from '../components/TargetItemStatus.vue'
import BridgeItemOverview from './Components/BridgeItemOverview.vue'
import DeleteBridgeSecondConfirm from './Components/DeleteBridgeSecondConfirm.vue'
import UsingSchemaBridgeConfig from './Components/UsingSchemaBridgeConfig.vue'
import TextEasyCopy from '@/components/TextEasyCopy.vue'
import PreWithEllipsis from '@/components/PreWithEllipsis.vue'
enum Tab {
Overview = 'overview',
Expand Down
2 changes: 1 addition & 1 deletion src/views/RuleEngine/Connector/ConnectorCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ const checkClipStatus = async () => {
}
setTypeAndGoStepConf(currentType as BridgeType)
targetLoading.value = true
const connectorData = await getConnectorDetail<Connector>(route.query.target as string)
const connectorData = await getConnectorDetail(route.query.target as string)
if (connectorData) {
formData.value = {
...handleDataForCopy(connectorData),
Expand Down

0 comments on commit 5ecd966

Please sign in to comment.