feat: 新增网关限流
All checks were successful
构建并部署前端到测试环境 / deploy (push) Successful in 56s

This commit is contained in:
luo
2026-10-24 16:22:28 +08:00
parent ecce4f6e7b
commit 049f8257fb
32 changed files with 3569 additions and 4 deletions

View File

@@ -0,0 +1,41 @@
<template>
<ElForm label-width="130px" :disabled="disabled">
<ElFormItem label="错误分类" required>
<ElSelect v-model="model.category"
><ElOption v-for="opt in options.error_categories" :key="opt.value" v-bind="opt"
/></ElSelect>
</ElFormItem>
<ElFormItem label="关键字或正则" required
><ElInput v-model="model.keyword" maxlength="200" show-word-limit
/></ElFormItem>
<ElFormItem label="匹配方式" required>
<ElSelect v-model="model.match_type"
><ElOption v-for="opt in options.match_types" :key="opt.value" v-bind="opt"
/></ElSelect>
</ElFormItem>
<ElFormItem label="适用操作">
<ElSelect v-model="model.operations" multiple clearable placeholder="留空表示全部操作"
><ElOption v-for="opt in options.gateway_operations" :key="opt.value" v-bind="opt"
/></ElSelect>
</ElFormItem>
<ElFormItem label="上游可能已受理"><ElSwitch v-model="model.maybe_accepted" /></ElFormItem>
<ElFormItem label="匹配优先级"
><ElInputNumber v-model="model.priority" :min="1" :max="10000" :precision="0" /><span
>数值越小越先匹配</span
></ElFormItem
>
<ElFormItem label="状态"
><ElSelect v-model="model.status"
><ElOption label="启用" :value="1" /><ElOption label="停用" :value="0" /></ElSelect
></ElFormItem>
<ElFormItem label="备注"
><ElInput v-model="model.remark" type="textarea" maxlength="500" show-word-limit
/></ElFormItem>
</ElForm>
</template>
<script setup lang="ts">
import type { GatewayRuleInput, GatewayOptions } from '@/types/api/gateway'
const model = defineModel<GatewayRuleInput>({ required: true })
defineProps<{ options: GatewayOptions; disabled?: boolean }>()
</script>