|
|
@@ -127,6 +127,17 @@
|
|
|
{{ record.output_text }}
|
|
|
</a-typography-text>
|
|
|
</a-typography-paragraph>
|
|
|
+ <div>
|
|
|
+ <a-tag :color="record.response_success ? 'green' : 'red'" size="small">
|
|
|
+ success: {{ record.response_success ? '成功' : '失败' }}
|
|
|
+ </a-tag>
|
|
|
+ </div>
|
|
|
+ <a-typography-text v-if="record.response_message || record.response_reason" type="secondary"
|
|
|
+ style="font-size: 12px;">
|
|
|
+ <span v-if="record.response_message">message: {{ record.response_message }}</span>
|
|
|
+ <span v-if="record.response_message && record.response_reason">;</span>
|
|
|
+ <span v-if="record.response_reason">reason: {{ record.response_reason }}</span>
|
|
|
+ </a-typography-text>
|
|
|
</template>
|
|
|
<template #status="{ record }">
|
|
|
<a-tag v-if="record.status" bordered color="green">
|
|
|
@@ -221,6 +232,34 @@
|
|
|
:auto-size="{ minRows: 2, maxRows: 4 }" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-divider orientation="left" style="margin-top: 0;">响应字段覆写</a-divider>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-form-item label="响应结果 success" required>
|
|
|
+ <a-radio-group v-model="editForm.response_success" type="button">
|
|
|
+ <a-radio :value="true">成功</a-radio>
|
|
|
+ <a-radio :value="false">失败</a-radio>
|
|
|
+ </a-radio-group>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-form-item label="message">
|
|
|
+ <a-input v-model="editForm.response_message" placeholder="留空沿用默认值" allow-clear
|
|
|
+ :max-length="255" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-form-item label="reason / sub_message">
|
|
|
+ <a-input v-model="editForm.response_reason" placeholder="留空沿用默认值" allow-clear
|
|
|
+ :max-length="255" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <div style="font-size: 12px; color: #999; margin: -12px 0 16px;">
|
|
|
+ 命中本规则后,API 响应及转链日志(后续统计)中的 success/message/reason 将使用此处配置;reason 同时作为 sub_message 输出
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
<a-col :span="24">
|
|
|
<a-form-item label="备注">
|
|
|
<a-textarea v-model="editForm.description" placeholder="请输入备注说明"
|
|
|
@@ -312,6 +351,9 @@ const size = ref<SizeProps>('small');
|
|
|
const basePagination: Pagination = {
|
|
|
current: 1,
|
|
|
pageSize: 50,
|
|
|
+ showPageSize: true,
|
|
|
+ showTotal: true,
|
|
|
+ pageSizeOptions: [20, 50, 100],
|
|
|
};
|
|
|
const pagination = reactive({
|
|
|
...basePagination,
|
|
|
@@ -470,6 +512,9 @@ const editForm = ref<Partial<OverrideRuleRecord>>({
|
|
|
hourly_calls_limit: 0,
|
|
|
use_special_text: 0,
|
|
|
use_risk_control: 0,
|
|
|
+ response_success: true,
|
|
|
+ response_message: '',
|
|
|
+ response_reason: '',
|
|
|
});
|
|
|
|
|
|
const onEdit = (current: OverrideRuleRecord) => {
|
|
|
@@ -477,6 +522,7 @@ const onEdit = (current: OverrideRuleRecord) => {
|
|
|
editForm.value = {
|
|
|
...current,
|
|
|
status: Boolean(current.status),
|
|
|
+ response_success: Boolean(current.response_success ?? true),
|
|
|
};
|
|
|
visible.value = true;
|
|
|
};
|
|
|
@@ -496,6 +542,9 @@ const onAdd = () => {
|
|
|
hourly_calls_limit: 0,
|
|
|
use_special_text: 0,
|
|
|
use_risk_control: 0,
|
|
|
+ response_success: true,
|
|
|
+ response_message: '',
|
|
|
+ response_reason: '',
|
|
|
};
|
|
|
visible.value = true;
|
|
|
};
|