Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ui/src/api/admin/system/api-key.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** 系统 API Key 接口。TODO:联调 /system/api_key 及 remark 字段。 */
import { del, get, post, put } from '../core/request'
import type { ParamsPage, ResponsePage } from '../core/types'
import type { ApiKeyPayload, ApiKeyRecord, Dict } from '@/api/types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** System 资源管理智能体 API Key 接口。TODO:接口待联调。 */
import { del, get, post, put } from '@/api/admin/core/request'
import type { ParamsPage, ResponsePage } from '@/api/admin/core/types'
import type { ApiKeyPayload, ApiKeyRecord, Dict } from '@/api/types'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ const putApplicationPortalDown = (applicationId: string) => put<Record<string, n
const getApplicationDetail = (applicationId: string) => get<ApplicationDetail>(`${prefix}/${applicationId}`)

/** 获取 System 资源管理智能体公开访问凭证与访问限制。 */
// TODO:访问限制接口待联调。
// TODO:社区版身份认证读写待后台联调。
const getAccessToken = (applicationId: string) => get<ApplicationAccessToken>(`${prefix}/${applicationId}/access_token`)

/** 修改 System 资源管理智能体访问配置或重置凭证,返回更新后的配置。 */
// TODO:身份认证、默认登录方式及账号锁定配置待后台联调。
// 身份认证、默认登录方式及账号锁定配置待后台联调。
const putAccessToken = (applicationId: string, payload: ApplicationAccessTokenPayload) =>
put<ApplicationAccessTokenPayload, ApplicationAccessToken>(`${prefix}/${applicationId}/access_token`, payload)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const getPrefix = () => '/system/resource/application'
const getMonitoring = (_workspaceId: string, range: HomeDateRange, applicationId: string) =>
get<HomeMonitoringDay[]>(`${getPrefix()}/${applicationId}/application_stats`, { ...range })

// TODO:后台按首页协议补齐用户排行分页、name 搜索、汇总和导出。
const rankingPaths = { userTokens: 'application_token_usage', questions: 'top_questions' }

/** 分页查询当前智能体的用户排行。 */
Expand Down
1 change: 0 additions & 1 deletion ui/src/api/admin/system/resource-management/chat-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type {
Dict,
} from '@/api/types'

// TODO:V3 联调确认授权前缀;当前沿用 V2 的 /system/resource/knowledge/{resource_type}。
const getPrefix = (resource: ChatUserAuthorizationResource) => `/system/resource/knowledge/${resource.resource_type}/${resource.resource_id}`

/** 获取资源的对话用户组及自动授权状态。 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const getPrefix = (knowledgeId: string) => `/system/resource/knowledge/${knowled

/**
* 获取知识库不分页的文档或图片选项。
* TODO:联调 resource_type=document/image 筛选及图片缩略图字段 meta.source_file_id。
*/
const getAllDocuments = (knowledgeId: string, query?: { resource_type: DocumentResourceType }) => get<DocumentItem[]>(getPrefix(knowledgeId), query)

Expand Down
1 change: 0 additions & 1 deletion ui/src/api/admin/system/shared-resources/chat-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type {
Dict,
} from '@/api/types'

// TODO:V3 联调确认授权前缀;当前沿用 V2 的 /system/shared/knowledge/{resource_type}。
const getPrefix = (resource: ChatUserAuthorizationResource) => `/system/shared/knowledge/${resource.resource_type}/${resource.resource_id}`

/** 获取资源的对话用户组及自动授权状态。 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const getPrefix = (knowledgeId: string) => `/system/shared/knowledge/${knowledge

/**
* 获取知识库不分页的文档或图片选项。
* TODO:联调 resource_type=document/image 筛选及图片缩略图字段 meta.source_file_id。
*/
const getAllDocuments = (knowledgeId: string, query?: { resource_type: DocumentResourceType }) => get<DocumentItem[]>(getPrefix(knowledgeId), query)

Expand Down
2 changes: 0 additions & 2 deletions ui/src/api/admin/workspace/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ const getApplicationDetail = (applicationId: string) => {
}

/** 获取智能体公开访问凭证与访问限制。 */
// TODO:社区版身份认证读写待后台联调。
const getAccessToken = (applicationId: string) => get<ApplicationAccessToken>(`${getPrefix()}/${applicationId}/access_token`)

/** 修改智能体访问配置或重置凭证,返回更新后的配置。 */
// TODO:身份认证、默认登录方式及账号锁定配置待后台联调。
const putAccessToken = (applicationId: string, payload: ApplicationAccessTokenPayload) =>
put<ApplicationAccessTokenPayload, ApplicationAccessToken>(`${getPrefix()}/${applicationId}/access_token`, payload)

Expand Down
1 change: 0 additions & 1 deletion ui/src/api/admin/workspace/application/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const getPrefix = (workspaceId = getWorkspaceId()) => `/workspace/${workspaceId}
const getMonitoring = (workspaceId: string, range: HomeDateRange, applicationId: string) =>
get<HomeMonitoringDay[]>(`${getPrefix(workspaceId)}/${applicationId}/application_stats`, { ...range })

// TODO:后台按首页协议补齐用户排行分页、name 搜索、汇总和导出。
const rankingPaths = { userTokens: 'application_token_usage', questions: 'top_questions' }

/** 分页查询当前智能体的用户排行。 */
Expand Down
1 change: 0 additions & 1 deletion ui/src/api/admin/workspace/knowledge/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const getPrefix = (knowledgeId: string) => `/workspace/${getWorkspaceId()}/knowl

/**
* 获取知识库不分页的文档或图片选项。
* TODO:联调 resource_type=document/image 筛选及图片缩略图字段 meta.source_file_id。
*/
const getAllDocuments = (knowledgeId: string, query?: { resource_type: DocumentResourceType }) => get<DocumentItem[]>(getPrefix(knowledgeId), query)

Expand Down
1 change: 0 additions & 1 deletion ui/src/api/admin/workspace/shared/chat-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { ParamsPage, ResponsePage } from '../../core/types'
import type { ChatUserAuthorization, ChatUserAuthorizationGroup, ChatUserAuthorizationResource, Dict } from '@/api/types'
import { getWorkspaceId } from '@/utils/resource-context'

// TODO:V3 联调确认共享授权路径;当前沿用 V2 的大写资源类型,已核对 KNOWLEDGE 查询。
const getPrefix = (resource: ChatUserAuthorizationResource) =>
`/system/shared/workspace/${getWorkspaceId()}/${resource.resource_type}/${resource.resource_id}`

Expand Down
1 change: 0 additions & 1 deletion ui/src/api/admin/workspace/shared/knowledge/termbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { getWorkspaceId } from '@/utils/resource-context'
const getPrefix = (knowledgeId: string) => `/system/shared/workspace/${getWorkspaceId()}/knowledge/${knowledgeId}/termbase`

/** 分页查询工作空间共享知识库的自定义分词条目,只提供只读访问。 */
// TODO:V3 后端需确认并提供工作空间共享知识库的 termbase 分页查询路由。
const getTermbasePage = (knowledgeId: string, page: ParamsPage, query?: { content?: string }) =>
get<ResponsePage<TermbaseItem>>(`${getPrefix(knowledgeId)}/${page.currentPage}/${page.pageSize}`, query)

Expand Down
1 change: 0 additions & 1 deletion ui/src/api/types/api-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export interface ApiKeyRecord {
is_permanent: boolean
expire_time: string | null
create_time?: string
// TODO:后端补充 remark 的返回与持久化。
remark?: string | null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ function handleClosed() {
<el-date-picker v-model="form.expire_time" class="w-full!" type="datetime" value-format="YYYY-MM-DDTHH:mm:ssZ" placeholder="请选择到期时间" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<!-- TODO:后端支持 remark 后移除联调提示。 -->
<el-input v-model="form.remark" type="textarea" :rows="3" maxlength="256" show-word-limit placeholder="请输入" />
</el-form-item>
<el-form-item label="跨域设置">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { ApplicationRankingKind, HomeRankingRecord } from '@/api/types'
import MkDateRange from '@/components/mk-date-range/index.vue'
import type { MkDateRangeValue } from '@/components/mk-date-range/types'
import { beforeDay } from '@/utils/time'
import { formatTokenNumber, numberFormat } from '@/utils/number'
import RankingCard from '@/views/home/components/ranking/RankingCard.vue'
import ApplicationRankingDrawer from './ApplicationRankingDrawer.vue'

Expand Down Expand Up @@ -101,7 +102,12 @@ onMounted(loadRankings)
:loading="loading"
:total="totals[option.kind]"
@detail="handleOpenRankingDetail(option.kind)"
/>
>
<template #description="{ record }">
<span v-if="option.kind === 'userTokens'">对话 {{ numberFormat(record.chat_record_count) }} 次</span>
<span v-else>{{ formatTokenNumber(record.total_tokens ?? 0) }}</span>
</template>
</RankingCard>
</div>
<ApplicationRankingDrawer
v-if="detailKind"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ defineExpose({ open })
<MkEmpty :type="paragraphSearchText ? 'search' : 'default'" description="暂无分段" />
</template>
</MkInfiniteScroll>
<el-empty v-else-if="!documentLoading" class="flex-1" description="暂无数据" />
</div>
</template>
</MkViewLayout>
Expand Down
Loading