Skip to content

Commit

Permalink
增加规则服务测试页面
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Sep 3, 2023
1 parent 193cbeb commit f320e24
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
${field.name}
</c:for>
</layout>

<cells>
<c:for var="field" items="${message?.fields}">
<cell id="${field.name}" label="${field.displayName}"/>
</c:for>
</cells>
</form>
</c:for>
</forms>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50210,6 +50210,31 @@
"name": "java.lang.Iterable",
"unsafeAllocated": false
},
{
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allPublicConstructors": true,
"allPublicMethods": true,
"fields": [],
"methods": [
{
"name": "equals",
"parameterTypes": [
"java.lang.Object"
]
},
{
"name": "hashCode",
"parameterTypes": []
},
{
"name": "toString",
"parameterTypes": []
}
],
"name": "java.lang.Object",
"unsafeAllocated": false
},
{
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@
/nop/rule/pages/RuleService/RuleService.view.xml
/nop/rule/pages/RuleService/_RuleService.view.xml
/nop/rule/pages/RuleService/main.page.yaml
/nop/rule/pages/RuleService/test-rule.page.yaml
/nop/schema/action-auth.xdef
/nop/schema/api.xdef
/nop/schema/beans.xdef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
<form id="edit" x:prototype="template">
<layout>
==baseInfo[基本信息]====
__useImportFile importFile
__useImportFile
importFile

ruleName[规则名称] ruleVersion[规则版本]
displayName[显示名称] ruleGroup[规则分组]
ruleType[规则类型] status[状态]
Expand Down Expand Up @@ -149,6 +151,9 @@
<crud name="main">
<rowActions>
<actionGroup id="row-more-button">
<action id="row-test-rule" label="@i18n:rule.testRule|测试规则" actionType="dialog">
<dialog page="/nop/rule/pages/RuleService/test-rule.page.yaml" />
</action>
<action id="row-edit-rule-nodes" label="@i18n:rule.ruleNodes|规则节点" actionType="drawer">
<dialog page="/nop/rule/pages/NopRuleNode/ref-ruleDefinition.page.yaml" size="xl">
<data>
Expand All @@ -164,5 +169,6 @@
</rowActions>
</crud>
<picker name="picker"/>

</pages>
</view>
Original file line number Diff line number Diff line change
@@ -1,7 +1,58 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:extends="_RuleService.view.xml" x:schema="/nop/schema/xui/xview.xdef" xmlns:x="/nop/schema/xdsl.xdef">

<forms>
<form id="RuleRequestBean" size="md">
<cells>
<cell id="inputs">
<gen-control>
<editor language="json">
<value>
<_ j:key="$schema">/p/NopRuleDefinition__getInputJsonSchema?ruleName=$ruleName&amp;ruleVersion=$ruleVersion</_>
</value>
<!--
editorDidMount函数传入 (editor, monaco) 两个参数,通过它们可以定制代码编辑器
-->
<editorDidMount><![CDATA[
debugger; let monaco = {}
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
validate: true, enableSchemaRequest: true
})
]]></editorDidMount>
</editor>
</gen-control>
</cell>
</cells>
</form>

<form id="rule-result">
<layout>
response
</layout>

<cells>
<cell id="response">
<gen-control>
<code language="json" />
</gen-control>
</cell>
</cells>
</form>
</forms>
<pages>
<tabs name="main"/>

<simple name="test-rule" form="RuleRequestBean">
<actions>
<action id="submit-rule-service" label="提交" actionType="ajax">
<api url="/r/RuleService__executeRule" >
</api>

<feedback page="rule-result"/>
</action>
</actions>
</simple>

<simple name="rule-result" form="rule-result" />
</pages>
</view>
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@

inputs
</layout>
<cells>
<cell id="ruleName" label="规则名称"/>
<cell id="ruleVersion" label="规则版本"/>
<cell id="inputs" label="输入参数"/>
</cells>
</form>
<form id="RuleKeyBean" editMode="edit">
<layout>
ruleName

ruleVersion
</layout>
<cells>
<cell id="ruleName" label="规则名称"/>
<cell id="ruleVersion" label="规则版本"/>
</cells>
</form>
</forms>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

x:gen-extends: |
<web:GenPage view="RuleService.view.xml" page="test-rule" xpl:lib="/nop/web/xlib/web.xlib" />

0 comments on commit f320e24

Please sign in to comment.