移除告警规则界面、恢复 Chat 端点并优化列表
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { NButton, NDataTable, NInput, NInputGroup, NInputGroupLabel, NPopconfirm, NPopover, NSelect, NTooltip, type DataTableColumns } from 'naive-ui'
|
||||
import { computed, h, ref, type VNodeChild } from 'vue'
|
||||
import { computed, h, reactive, ref, watch, type VNodeChild } from 'vue'
|
||||
import { RouterLink, useRouter } from 'vue-router'
|
||||
|
||||
import { listAiChannels } from '@/api/aigateway'
|
||||
@@ -63,6 +63,25 @@ const filtered = computed(() => {
|
||||
)
|
||||
})
|
||||
|
||||
/** 客户端分页:字面量对象会在重渲染时被重建导致状态丢失,须用 reactive 受控 */
|
||||
const pagination = reactive({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
showSizePicker: true,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
onUpdatePage: (p: number) => {
|
||||
pagination.page = p
|
||||
},
|
||||
onUpdatePageSize: (ps: number) => {
|
||||
pagination.pageSize = ps
|
||||
pagination.page = 1
|
||||
},
|
||||
})
|
||||
/** 搜索或分组过滤变化后回第 1 页,避免停留在越界页码 */
|
||||
watch([keyword, groupFilter], () => {
|
||||
pagination.page = 1
|
||||
})
|
||||
|
||||
/** 任务是否作用于该租户:抢机看目标租户;AI 探测看号池渠道(仅入池租户);
|
||||
* 测活 / 成本看范围(空 = 全部租户) */
|
||||
function taskTouchesCfg(task: Task, cfgId: number): boolean {
|
||||
@@ -227,7 +246,7 @@ function renderActions(row: OciConfigSummary): VNodeChild {
|
||||
h(
|
||||
'div',
|
||||
{ class: 'mt-1 text-xs text-ink-3' },
|
||||
'将清理面板内关联数据:后台任务、测活 / 成本快照、回传事件、Webhook 密钥、告警规则与 AI 渠道。',
|
||||
'将清理面板内关联数据:后台任务、测活 / 成本快照、回传事件、Webhook 密钥与 AI 渠道。',
|
||||
),
|
||||
h(
|
||||
'div',
|
||||
@@ -332,7 +351,7 @@ const columns = computed<DataTableColumns<OciConfigSummary>>(() => [
|
||||
:columns="columns"
|
||||
:data="filtered"
|
||||
:loading="configs.loading.value"
|
||||
:pagination="{ pageSize: 10 }"
|
||||
:pagination="pagination"
|
||||
:scroll-x="1200"
|
||||
:row-key="(r: OciConfigSummary) => r.id"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user