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
6 changes: 4 additions & 2 deletions ui/src/api/admin/workspace/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ const exportApplication = (applicationId: string, applicationName: string) => {
const exportApplicationSkills = (applicationId: string, applicationName: string) =>
Promise.resolve({ application_id: applicationId, name: applicationName })

/** 模拟工作空间智能体门户上下架;TODO:接入真实接口,当前不持久化。 */
const putApplicationPortal = (applicationId: string, isPortal: boolean) => Promise.resolve({ id: applicationId, is_portal: isPortal })
/** 模拟工作空间智能体门户上下架。 */
const putApplicationPortal = (applicationId: string, isPortal: boolean) => {
return put<{ is_portal: boolean }, ApplicationDetail>(`${getPrefix()}/${applicationId}`, { is_portal: isPortal })
}

/** 导入智能体文件并创建工作空间智能体。 */
const postApplicationImport = (file: File, folderId: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const props = defineProps<{ api: typeof ApplicationApi | typeof SystemResourceAp
const loading = defineModel<boolean>('loading', { default: false })
const emit = defineEmits<{ change: [isPortal: boolean] }>()

// 模拟请求成功后由列表更新状态,后续替换真实接口时保留此流程。
function handlePortalApplication() {
if (loading.value) return
const isPortal = !props.application.is_portal
Expand All @@ -19,7 +18,7 @@ function handlePortalApplication() {
.putApplicationPortal(props.application.id, isPortal)
.then((application) => {
emit('change', application.is_portal)
MsgSuccess(isPortal ? '模拟上架成功' : '模拟下架成功')
MsgSuccess(isPortal ? '上架成功' : '下架成功')
})
.catch(() => {})
.finally(() => {
Expand Down
Loading