Skip to content

Commit c9f84f7

Browse files
committed
Java:MultiDataSource 中 APIAuto AI:接入 page-agent 自动操作网页;优化设置项 UI
1 parent 6e7b847 commit c9f84f7

4 files changed

Lines changed: 291 additions & 60 deletions

File tree

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/css/main.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ textarea {
276276
padding-right: 10px;
277277
display: flex;
278278
align-items: center;
279-
z-index: 102;
279+
z-index: 101;
280280
background-color: #FFF;
281281
box-shadow: 1px 1px 1px rgba(244, 243, 243, 0.64)
282282
}
@@ -722,3 +722,11 @@ table.diff thead th.texttitle {
722722
border-color: #bce8f1;
723723
color: #31708f;
724724
}
725+
726+
.setting-item {
727+
border-bottom: #DDD 1px solid;
728+
width: 100%;
729+
padding-top: 2px;
730+
padding-bottom: 2px;
731+
font-size: small;
732+
}

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -124,25 +124,30 @@
124124
<a href="javascript:void(0)" style="padding: 14px">
125125
{{ User.id != null && User.id > 0 ? User.name : '设置' }}
126126
</a>
127-
<ul class="themes pop" style="z-index: 200;padding: 0px;margin-top: 8px;width: 300px">
128-
<a style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(! isDelegateEnabled, 9)">托管服务器代理: {{ isDelegateEnabled ? '已开启,点击关闭' : '已关闭,点击开启' }}</a>
129-
<a style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(! isEnvCompareEnabled, 14)">对比其它环境结果: {{ isEnvCompareEnabled ? '已开启,点击关闭' : '已关闭,点击开启' }}</a>
130-
<a style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(! isEncodeEnabled, 12)">自动 URL 转义: {{ isEncodeEnabled ? '已开启,点击关闭' : '已关闭,点击开启' }}</a>
131-
<a style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(! isPreviewEnabled, 10)">预览左侧输入框: {{ isPreviewEnabled ? '已开启,点击关闭' : '已关闭,点击开启' }}</a>
132-
<a v-show="User.id != null && User.id > 0" style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(! isEditResponse, 11)">当前编辑模式: {{ isEditResponse ? 'Response 后端响应结果' : 'Request 前端请求参数' }}</a>
133-
<a style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(StringUtil.isEmpty(host, true), 3)">{{ StringUtil.isEmpty(host, true) ? '隐藏(固定)URL Host: 可用空格隔开' : '显示(编辑)URL Host: \n' + host }}</a>
127+
<ul class="themes pop" style="z-index: 200;padding: 0px;margin-top: 8px;width: 300px; line-height: 16px">
128+
<a class="setting-item" href="javascript:void(0)" @click="showConfig(! isDelegateEnabled, 9)">托管服务器代理: {{ isDelegateEnabled ? '已开启,点击关闭' : '已关闭,点击开启' }}</a>
129+
<a class="setting-item" href="javascript:void(0)" @click="showConfig(! isEnvCompareEnabled, 14)">对比其它环境结果: {{ isEnvCompareEnabled ? '已开启,点击关闭' : '已关闭,点击开启' }}</a>
130+
<a class="setting-item" href="javascript:void(0)" @click="showConfig(! isEncodeEnabled, 12)">自动 URL 转义: {{ isEncodeEnabled ? '已开启,点击关闭' : '已关闭,点击开启' }}</a>
131+
<a class="setting-item" href="javascript:void(0)" @click="showConfig(! isPreviewEnabled, 10)">预览左侧输入框: {{ isPreviewEnabled ? '已开启,点击关闭' : '已关闭,点击开启' }}</a>
132+
<a v-show="User.id != null && User.id > 0" class="setting-item" href="javascript:void(0)" @click="showConfig(! isEditResponse, 11)">当前编辑模式: {{ isEditResponse ? 'Response 后端响应结果' : 'Request 前端请求参数' }}</a>
133+
<a class="setting-item" href="javascript:void(0)" @click="showConfig(StringUtil.isEmpty(host, true), 3)">{{ StringUtil.isEmpty(host, true) ? '隐藏(固定)URL Host: 可用空格隔开' : '显示(编辑)URL Host: \n' + host }}</a>
134134
<a style="border-bottom: #DDD 1px solid;width: 100%;display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden;" href="javascript:void(0)" @click="showConfig(! isRandomShow, 5)">{{ isRandomShow ? '隐藏(固定)参数注入 Random Test' : '显示(编辑)参数注入 Random Test' }}</a>
135135
<a style="border-bottom: #DDD 1px solid;width: 100%;display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden;" href="javascript:void(0)" @click="showConfig(! isHeaderShow, 4)">{{ (isHeaderShow ? '隐藏(固定)' : '显示(编辑)') + (isEditResponse ? '响应头 Response Header' : '请求头 Request Header' ) }}</a>
136136
<a style="border-bottom: #DDD 1px solid;width: 100%;display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden;" href="javascript:void(0)" @click="showConfig(! isScriptShow, 13)">{{ (isScriptShow ? '隐藏(固定)' : '显示(编辑)') + '执行脚本 JavaScript' }}</a>
137-
<a v-show="User.id != null && User.id > 0" style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(! isStatisticsEnabled, 17)">{{ (isStatisticsEnabled ? '隐藏' : '显示') + '测试统计报告 Test Report' }} </a>
138-
<a style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 2)">生成代码(封装,解析) : {{ language || '例如 Java' }}</a>
139-
<a style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 0)">数据库类型 Database: {{ database || '例如 MYSQL' }}</a>
140-
<a style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 1)">数据库名/模式 Schema: {{ schema || '例如 sys' }}</a>
141-
<a v-show="User.id == null || User.id <= 0" style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 16)">使用的请求方法: {{ methods == null || methods.length <= 0 ? '默认全部,点击设置' : (methods instanceof Array ? methods.join() : methods) }}</a>
142-
<a v-show="User.id == null || User.id <= 0" style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 7)">使用的请求类型: {{ types == null || types.length <= 0 ? '默认全部,点击设置' : (types instanceof Array ? types.join() : types) }}</a>
143-
<a style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 15)">其它环境地址 URL Host: {{ otherEnv || '点击设置' }}</a>
144-
<a v-show="User.id == null || User.id <= 0" style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 6)">托管服务器地址 URL: {{ server || '点击设置' }}</a>
145-
<a v-show="User.id != null && User.id > 0" style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 8)">导入第三方文档(平台名 URL): <br/>{{ thirdParty || '点击设置' }}</a>
137+
<a v-show="User.id != null && User.id > 0" class="setting-item" href="javascript:void(0)" @click="showConfig(! isAgentEnabled, 18)">{{ (isAgentEnabled ? '隐藏' : '显示') + '网页自动操作 AI Agent' }} </a>
138+
<a v-show="User.id != null && User.id > 0" class="setting-item" href="javascript:void(0)" @click="showConfig(! isStatisticsEnabled, 17)">{{ (isStatisticsEnabled ? '隐藏' : '显示') + '测试统计报告 Test Report' }} </a>
139+
<a class="setting-item" href="javascript:void(0)" @click="showConfig(true, 2)">生成代码(封装,解析) : {{ language || '例如 Java' }}</a>
140+
<a v-show="User.id != null && User.id > 0" class="setting-item" href="javascript:void(0)" @click="showConfig(true, 0)">数据库类型 Database: {{ database || '例如 MYSQL' }}</a>
141+
<a v-show="User.id != null && User.id > 0" class="setting-item" href="javascript:void(0)" @click="showConfig(true, 1)">数据库名/模式 Schema: {{ schema || '例如 sys' }}</a>
142+
<a v-show="false" class="setting-item" href="javascript:void(0)" @click="showConfig(true, 16)">使用的请求方法: {{ methods == null || methods.length <= 0 ? '默认全部,点击设置' : (methods instanceof Array ? methods.join() : methods) }}</a>
143+
<a v-show="false" class="setting-item" href="javascript:void(0)" @click="showConfig(true, 7)">使用的请求类型: {{ types == null || types.length <= 0 ? '默认全部,点击设置' : (types instanceof Array ? types.join() : types) }}</a>
144+
<a class="setting-item" href="javascript:void(0)" @click="showConfig(true, 15)">其它环境地址 URL Host: {{ otherEnv || '点击设置' }}</a>
145+
<a v-show="User.id == null || User.id <= 0" class="setting-item" href="javascript:void(0)" @click="showConfig(true, 6)">托管服务器地址 URL: {{ server || '点击设置' }}</a>
146+
<a v-show="User.id != null && User.id > 0" class="setting-item" href="javascript:void(0)" @click="showConfig(true, 8)">导入第三方文档(平台名 URL): <br/>{{ thirdParty || '点击设置' }}</a>
147+
<a v-show="User.id == null || User.id <= 0" class="setting-item" href="javascript:void(0)" @click="showConfig(true, 19)">AI Model: <br/>{{ aiModel || '点击设置' }}</a>
148+
<a v-show="User.id == null || User.id <= 0" class="setting-item" href="javascript:void(0)" @click="showConfig(true, 20)">AI Base URL: <br/>{{ aiBaseUrl || '点击设置' }}</a>
149+
<a v-show="User.id == null || User.id <= 0" class="setting-item" href="javascript:void(0)" @click="showConfig(true, 21)">AI API Key: <br/>{{ aiApiKey || '点击设置' }}</a>
150+
<a v-show="User.id == null || User.id <= 0" class="setting-item" href="javascript:void(0)" @click="showConfig(true, 22)">AI Language: <br/>{{ aiLanguage || '点击设置' }}</a>
146151
</ul>
147152
</span>
148153

@@ -175,12 +180,17 @@
175180

176181
<span v-show="isShowType()" class="pop-btn transfer">
177182
<button class="transfer" id="vType" :disabled="isEditResponse" @click="changeType()">{{ getTypeName(type, method) }}</button>
178-
<ul class="historys pop type-pop" style="width: 250px;">
183+
<ul class="historys pop type-pop" style="width: 360px;">
179184
<li ><a href="javascript:void(0)" :style="{color: type == 'PARAM' ? 'red' : 'black'}" @click="changeType('PARAM')" >PARAM // ?a=1&b=c&key=value</a></li>
180-
<li ><a href="javascript:void(0)" :style="{color: type == 'FORM' ? 'red' : 'black'}" @click="changeType('FORM')" >FORM // x-www-form-urlencoded</a></li>
181-
<li ><a href="javascript:void(0)" :style="{color: type == 'DATA' ? 'red' : 'black'}" @click="changeType('DATA')" >DATA // form-data</a></li>
185+
<li ><a href="javascript:void(0)" :style="{color: type == 'FORM' ? 'red' : 'black'}" @click="changeType('FORM')" >FORM // application/x-www-form-urlencoded</a></li>
186+
<li ><a href="javascript:void(0)" :style="{color: type == 'DATA' ? 'red' : 'black'}" @click="changeType('DATA')" >DATA // multipart/form-data</a></li>
182187
<li ><a href="javascript:void(0)" :style="{color: type == 'JSON' ? 'red' : 'black'}" @click="changeType('JSON')" >JSON // application/json</a></li>
183188
<li ><a href="javascript:void(0)" :style="{color: type == 'GRPC' ? 'red' : 'black'}" @click="changeType('GRPC')" >GRPC // application/json</a></li>
189+
<li ><a href="javascript:void(0)" :style="{color: type == 'TEXT' ? 'red' : 'black'}" @click="changeType('TEXT')" >TEXT // text/plain</a></li>
190+
<li ><a href="javascript:void(0)" :style="{color: type == 'TXML' ? 'red' : 'black'}" @click="changeType('TXML')" >TXML // text/xml</a></li>
191+
<li ><a href="javascript:void(0)" :style="{color: type == 'AXML' ? 'red' : 'black'}" @click="changeType('AXML')" >AXML // application/xml</a></li>
192+
<li ><a href="javascript:void(0)" :style="{color: type == 'HTML' ? 'red' : 'black'}" @click="changeType('HTML')" >HTML // text/html</a></li>
193+
<li ><a href="javascript:void(0)" :style="{color: type == 'XHTML' ? 'red' : 'black'}" @click="changeType('XHTML')" >XHTML // application/xhtml+xml</a></li>
184194
</ul>
185195
</span>
186196

@@ -1143,6 +1153,7 @@
11431153
<script src="md/lib/jquery.flowchart.min.js"></script>
11441154

11451155
<script src="md/editormd.js"></script>
1156+
<script src="https://registry.npmmirror.com/page-agent/1.10.0/files/dist/iife/page-agent.demo.js" crossorigin="true"></script>
11461157

11471158
</body>
11481159
</html>

0 commit comments

Comments
 (0)