Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08fa529348 | ||
|
|
e2cdb99194 | ||
|
|
7f529bd991 |
+29
-5
@@ -1,8 +1,32 @@
|
||||
# Changelog
|
||||
|
||||
格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循语义化版本。
|
||||
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)(版本段不记日期),版本号遵循语义化版本。
|
||||
|
||||
## [0.3.0] - 2026-07-13
|
||||
## [0.5.1]
|
||||
|
||||
### Changed
|
||||
|
||||
- 设置 · 账号安全绑定入口:已绑定的登录方式按钮置禁用态并显示「已绑定」,解绑后自动恢复可点
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复禁用密码登录后登录页闪烁:登录方式加载完成前显示加载态,不再先渲染密码表单再切换,同时消除了闪烁窗口内误提交密码触发 403「密码登录已禁用」日志的问题
|
||||
- 系统日志「动作」列补齐 26 条缺失描述(退出登录、外部身份登录 / 绑定、修改登录凭据、AI 密钥 / 渠道 / 黑名单 / 网关设置、通知渠道 / 模板、代理导入 / 探测 / 关联租户等)
|
||||
|
||||
## [0.5.0]
|
||||
|
||||
### Added
|
||||
|
||||
- AI 网关「接入信息」新增 `POST /tts` 端点展示(文本转语音 · xAI 官方格式)
|
||||
- AI 网关「可用模型」新增「过滤弃用」开关:开启后已宣布弃用(即使未退役)的模型从模型列表与路由中排除,状态持久化,切换即时刷新列表
|
||||
|
||||
## [0.4.0]
|
||||
|
||||
### Added
|
||||
|
||||
- AI 网关「接入信息」补齐新端点展示:`POST /audio/speech`(文本转语音 · xAI Voice)、`POST /rerank`(文档重排 · Cohere Rerank)、`POST /moderations`(内容审核 · OCI Guardrails)
|
||||
|
||||
## [0.3.0]
|
||||
|
||||
### Added
|
||||
|
||||
@@ -27,7 +51,7 @@
|
||||
- 修复租户列表分页状态在页面重绘时丢失,以及筛选后停留在越界页码的问题
|
||||
- 修复「引导卷(GB)」等可清空数字输入框的步进箭头挤出输入框右缘的错位;清空图标改为悬浮在步进竖栏左侧,输入文本自动避让
|
||||
|
||||
## [0.2.0] - 2026-07-12
|
||||
## [0.2.0]
|
||||
|
||||
### Added
|
||||
|
||||
@@ -39,7 +63,7 @@
|
||||
|
||||
- 租户删除确认弹窗分段排版(标题 / 面板清理范围 / 云端提示),列表与详情页文案一致
|
||||
|
||||
## [0.1.0] - 2026-07-10
|
||||
## [0.1.0]
|
||||
|
||||
### Added
|
||||
|
||||
@@ -61,7 +85,7 @@
|
||||
- 租户详情「用户」「策略」等 Tab 切换域后内容不刷新
|
||||
- 实例详情区块加载中时禁用头部操作按钮,防误点
|
||||
|
||||
## [0.0.1] - 2026-07-09
|
||||
## [0.0.1]
|
||||
|
||||
首个版本:OCI Portal 前端。
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import type {
|
||||
AiModel,
|
||||
AiModelBlacklistItem,
|
||||
AiModelCacheItem,
|
||||
AiSettings,
|
||||
} from '@/types/api'
|
||||
|
||||
// ---- 网关密钥 ----
|
||||
@@ -88,6 +89,16 @@ export function listAiModels(): Promise<AiModel[]> {
|
||||
return request<{ items: AiModel[] }>('/ai-models').then((r) => r.items)
|
||||
}
|
||||
|
||||
// ---- 网关全局设置 ----
|
||||
|
||||
export function getAiSettings(): Promise<AiSettings> {
|
||||
return request<AiSettings>('/ai-settings')
|
||||
}
|
||||
|
||||
export function updateAiSettings(body: AiSettings): Promise<AiSettings> {
|
||||
return request<AiSettings>('/ai-settings', { method: 'PUT', body })
|
||||
}
|
||||
|
||||
// ---- 模型黑名单 ----
|
||||
|
||||
export function listAiBlacklist(): Promise<AiModelBlacklistItem[]> {
|
||||
|
||||
@@ -204,6 +204,11 @@ const bindableProviders = computed(() => {
|
||||
return out
|
||||
})
|
||||
|
||||
/** 已绑定的 provider 集合;绑定入口按钮据此禁用,解绑后自动恢复 */
|
||||
const boundProviders = computed(
|
||||
() => new Set((identities.data.value?.items ?? []).map((it) => it.provider)),
|
||||
)
|
||||
|
||||
async function bindProvider(provider: string) {
|
||||
binding.value = provider
|
||||
try {
|
||||
@@ -507,9 +512,10 @@ async function deleteProvider(p: ProviderType) {
|
||||
:key="p"
|
||||
size="small"
|
||||
:loading="binding === p"
|
||||
:disabled="boundProviders.has(p)"
|
||||
@click="bindProvider(p)"
|
||||
>
|
||||
绑定 {{ displayNameOf(p) }}
|
||||
{{ boundProviders.has(p) ? '已绑定' : '绑定' }} {{ displayNameOf(p) }}
|
||||
</NButton>
|
||||
<span class="text-xs text-ink-3">将跳转到对应平台授权</span>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
*/
|
||||
const exact: Record<string, string> = {
|
||||
'POST /api/v1/auth/login': '登录面板',
|
||||
'POST /api/v1/auth/logout': '退出登录',
|
||||
'GET /api/v1/auth/oauth/:provider/callback': '外部身份登录 / 绑定',
|
||||
'PUT /api/v1/auth/credentials': '修改登录凭据',
|
||||
'PUT /api/v1/auth/password-login': '切换密码登录开关',
|
||||
'POST /api/v1/auth/revoke-sessions': '撤销全部会话',
|
||||
'POST /api/v1/auth/totp/setup': '发起两步验证绑定',
|
||||
'POST /api/v1/auth/totp/activate': '启用两步验证',
|
||||
'POST /api/v1/auth/totp/disable': '停用两步验证',
|
||||
@@ -42,6 +47,25 @@ const exact: Record<string, string> = {
|
||||
'DELETE /api/v1/tasks/:id': '删除后台任务',
|
||||
'POST /api/v1/tasks/:id/run': '手动执行任务',
|
||||
'POST /api/v1/webhooks/oci-logs/:secret': '回传消息投递',
|
||||
'POST /api/v1/ai-keys': '创建网关密钥',
|
||||
'PUT /api/v1/ai-keys/:id': '修改网关密钥',
|
||||
'DELETE /api/v1/ai-keys/:id': '删除网关密钥',
|
||||
'PUT /api/v1/ai-keys/:id/content-log': '设置密钥内容留痕',
|
||||
'POST /api/v1/ai-channels': '创建网关渠道',
|
||||
'PUT /api/v1/ai-channels/:id': '修改网关渠道',
|
||||
'DELETE /api/v1/ai-channels/:id': '删除网关渠道',
|
||||
'POST /api/v1/ai-channels/:id/probe': '探测网关渠道',
|
||||
'POST /api/v1/ai-channels/:id/sync-models': '同步渠道模型',
|
||||
'POST /api/v1/ai-blacklist': '拉黑模型',
|
||||
'DELETE /api/v1/ai-blacklist/:id': '移出模型黑名单',
|
||||
'PUT /api/v1/ai-settings': '保存网关设置',
|
||||
'PUT /api/v1/settings/notify-channels/:type': '保存通知渠道配置',
|
||||
'POST /api/v1/settings/notify-channels/:type/test': '发送通知测试消息',
|
||||
'PUT /api/v1/settings/notify-templates/:kind': '保存通知模板',
|
||||
'POST /api/v1/settings/notify-templates/:kind/test': '发送模板测试消息',
|
||||
'POST /api/v1/proxies/import': '批量导入代理',
|
||||
'POST /api/v1/proxies/:id/probe': '探测代理',
|
||||
'PUT /api/v1/proxies/:id/tenants': '设置代理关联租户',
|
||||
}
|
||||
|
||||
/** 资源段兜底词典:精确表未命中时以「动词 + 资源」组合 */
|
||||
|
||||
@@ -968,6 +968,11 @@ export interface AiModelCacheItem {
|
||||
}
|
||||
|
||||
/** 模型黑名单条目:拉黑即全渠道剔除,同步 / 探测不再入库 */
|
||||
/** AI 网关全局设置 */
|
||||
export interface AiSettings {
|
||||
filterDeprecated: boolean
|
||||
}
|
||||
|
||||
export interface AiModelBlacklistItem {
|
||||
id: number
|
||||
name: string
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { NButton, useDialog } from 'naive-ui'
|
||||
import { NButton, NSwitch, useDialog } from 'naive-ui'
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
import {
|
||||
addAiBlacklist,
|
||||
getAiSettings,
|
||||
listAiBlacklist,
|
||||
listAiChannels,
|
||||
listAiKeys,
|
||||
listAiModels,
|
||||
removeAiBlacklist,
|
||||
updateAiSettings,
|
||||
} from '@/api/aigateway'
|
||||
import AiChannelPanel from '@/components/ai/AiChannelPanel.vue'
|
||||
import AiKeyPanel from '@/components/ai/AiKeyPanel.vue'
|
||||
@@ -31,6 +33,10 @@ const endpoints = [
|
||||
{ method: 'POST', path: '/responses', note: 'OpenAI Responses · 无状态子集' },
|
||||
{ method: 'POST', path: '/messages', note: 'Claude · 流式/非流式' },
|
||||
{ method: 'POST', path: '/embeddings', note: 'OpenAI Embeddings · 向量化' },
|
||||
{ method: 'POST', path: '/audio/speech', note: '文本转语音 · xAI Voice' },
|
||||
{ method: 'POST', path: '/tts', note: '文本转语音 · xAI 官方格式' },
|
||||
{ method: 'POST', path: '/rerank', note: '文档重排 · Cohere Rerank' },
|
||||
{ method: 'POST', path: '/moderations', note: '内容审核 · OCI Guardrails' },
|
||||
{ method: 'GET', path: '/models', note: '模型列表(按密钥分组过滤)' },
|
||||
]
|
||||
|
||||
@@ -84,6 +90,25 @@ async function copyModel(id: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/** 「过滤弃用模型」开关:开启后已宣布弃用(即使未退役)的模型从列表与路由中排除 */
|
||||
const filterDeprecated = ref(false)
|
||||
void getAiSettings()
|
||||
.then((s) => { filterDeprecated.value = s.filterDeprecated })
|
||||
.catch(() => {})
|
||||
|
||||
async function toggleFilterDeprecated(v: boolean) {
|
||||
filterDeprecated.value = v
|
||||
try {
|
||||
const s = await updateAiSettings({ filterDeprecated: v })
|
||||
filterDeprecated.value = s.filterDeprecated
|
||||
message.success(v ? '已过滤弃用模型(列表与路由同时排除)' : '已恢复展示弃用模型')
|
||||
} catch (e) {
|
||||
message.error(e instanceof Error ? e.message : '操作失败')
|
||||
filterDeprecated.value = !v
|
||||
}
|
||||
refreshModels()
|
||||
}
|
||||
|
||||
function refreshModels() {
|
||||
void models.run({ silent: true })
|
||||
void blacklist.run({ silent: true })
|
||||
@@ -163,7 +188,16 @@ async function unbanModel(b: AiModelBlacklistItem) {
|
||||
<div class="text-sm font-semibold">可用模型</div>
|
||||
<div class="mt-0.5 text-xs text-ink-3">按厂商分组;点击厂商展开,点击模型名复制,✕ 加入黑名单</div>
|
||||
</div>
|
||||
<span class="text-xs text-ink-3">{{ models.data.value?.length ?? '…' }} 个</span>
|
||||
<div class="flex flex-none items-center gap-3">
|
||||
<label
|
||||
class="flex cursor-pointer items-center gap-1.5 text-xs text-ink-3"
|
||||
title="开启后,已宣布弃用(即使未退役)的模型从模型列表与路由中排除;关闭恢复"
|
||||
>
|
||||
过滤弃用
|
||||
<NSwitch size="small" :value="filterDeprecated" @update:value="toggleFilterDeprecated" />
|
||||
</label>
|
||||
<span class="text-xs text-ink-3">{{ models.data.value?.length ?? '…' }} 个</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-4.5 py-1.5">
|
||||
<div
|
||||
|
||||
+11
-1
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { NButton, NInput } from 'naive-ui'
|
||||
import { NButton, NInput, NSpin } from 'naive-ui'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
@@ -30,6 +30,8 @@ const errorMsg = ref('')
|
||||
const providers = ref<OauthProviderInfo[]>([])
|
||||
// 密码登录已禁用(设置里开启且存在可用外部身份):隐藏用户名密码表单
|
||||
const passwordLoginDisabled = ref(false)
|
||||
// 登录方式加载中:providers 返回前不渲染表单,避免「先见密码表单再消失」的闪烁与误提交
|
||||
const bootLoading = ref(true)
|
||||
|
||||
// 左侧品牌区功能徽章:各自不同周期/幅度/相位上下浮动(不规律观感)
|
||||
const featureChips = [
|
||||
@@ -47,6 +49,8 @@ onMounted(async () => {
|
||||
passwordLoginDisabled.value = r.passwordLoginDisabled && r.providers.length > 0
|
||||
} catch {
|
||||
/* 登录页容忍 provider 列表加载失败 */
|
||||
} finally {
|
||||
bootLoading.value = false
|
||||
}
|
||||
})
|
||||
|
||||
@@ -155,6 +159,11 @@ async function oauthLogin(provider: string) {
|
||||
<div class="rounded-[14px] border border-line bg-card px-[30px] pt-[30px] pb-7 shadow-[0_18px_50px_rgba(20,20,19,.10),0_2px_8px_rgba(20,20,19,.05)]">
|
||||
<div class="font-serif text-[19px] font-semibold">欢迎回来</div>
|
||||
|
||||
<div v-if="bootLoading" class="flex items-center justify-center py-14">
|
||||
<NSpin size="small" />
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<div
|
||||
v-if="errorMsg"
|
||||
class="mt-4 flex items-start gap-2 rounded-md border border-err/30 bg-err/10 px-3 py-2 text-[12.5px] text-err"
|
||||
@@ -227,6 +236,7 @@ async function oauthLogin(provider: string) {
|
||||
由管理员在 设置 · 账号安全 中管理
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user