移除告警规则界面、恢复 Chat 端点并优化列表
This commit is contained in:
@@ -27,6 +27,7 @@ const blacklist = useAsync(listAiBlacklist)
|
||||
const baseUrl = `${window.location.origin}/ai/v1`
|
||||
|
||||
const endpoints = [
|
||||
{ method: 'POST', path: '/chat/completions', note: 'OpenAI · 流式/非流式' },
|
||||
{ method: 'POST', path: '/responses', note: 'OpenAI Responses · 无状态子集' },
|
||||
{ method: 'POST', path: '/messages', note: 'Claude · 流式/非流式' },
|
||||
{ method: 'POST', path: '/embeddings', note: 'OpenAI Embeddings · 向量化' },
|
||||
|
||||
@@ -163,7 +163,8 @@ const currencySymbol = computed(() => {
|
||||
{{ ov?.tenants.alive ?? 0 }}/{{ ov?.tenants.total ?? 0 }} 存活
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-4.5 py-1.5">
|
||||
<!-- 限高内部滚动:租户多时不撑高整行,底部露半行暗示可滚 -->
|
||||
<div class="max-h-90 overflow-y-auto px-4.5 py-1.5">
|
||||
<div
|
||||
v-for="c in configs.data.value ?? []"
|
||||
:key="c.id"
|
||||
@@ -188,13 +189,13 @@ const currencySymbol = computed(() => {
|
||||
</div>
|
||||
<div class="w-18 flex-none text-right text-xs text-ink-3">{{ fmtRelative(c.lastVerifiedAt) }}</div>
|
||||
</div>
|
||||
<div class="py-2.5 text-center">
|
||||
<RouterLink
|
||||
class="text-[13px] font-medium text-accent hover:text-accent-hover"
|
||||
:to="{ name: 'tenants' }"
|
||||
>查看全部租户</RouterLink
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-line-soft py-2.5 text-center">
|
||||
<RouterLink
|
||||
class="text-[13px] font-medium text-accent hover:text-accent-hover"
|
||||
:to="{ name: 'tenants' }"
|
||||
>查看全部租户</RouterLink
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -143,7 +143,7 @@ async function remove() {
|
||||
<div class="max-w-80 text-[13px] leading-relaxed">
|
||||
<div class="font-medium">删除「{{ config.data.value.alias }}」?</div>
|
||||
<div class="mt-1 text-xs text-ink-3">
|
||||
将清理面板内关联数据:后台任务、测活 / 成本快照、回传事件、Webhook 密钥、告警规则与 AI 渠道。
|
||||
将清理面板内关联数据:后台任务、测活 / 成本快照、回传事件、Webhook 密钥与 AI 渠道。
|
||||
</div>
|
||||
<div class="mt-0.5 text-xs text-ink-3">
|
||||
OCI 云端资源不受影响;云端日志回传链路请先在「其他」页销毁。
|
||||
|
||||
@@ -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