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
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,33 @@ defineExpose({ open })

<template>
<MkDialog v-model="dialogVisible" title="API Key" @closed="resetData">
<template #subtitle>每个用户仅一个 API Key,绑定当前对话用户、与其同权。重置后旧 Key 立即失效</template>
<div class="pb-5">
<div class="mb-4">
<div class="mb-2">API URL</div>
<el-input :model-value="apiUrl" readonly>
<template #suffix>
<!-- 复制 API URL -->
<el-button text class="-mr-1" @click="copyText(apiUrl)">
<MkIcon name="icon_copy_outlined" />
</el-button>
</template>
</el-input>
</div>
<div class="mb-2">API Key</div>
<el-input :model-value="maskedApiKey" readonly>
<template #suffix>
<!-- 复制完整 API Key -->
<el-button text :disabled="loading || !apiKey" @click="copyText(apiKey)">
<MkIcon name="icon_copy_outlined" />
<div class="mb-2">我的 API Key</div>
<el-input :model-value="maskedApiKey" readonly class="mb-4">
<template #suffix>
<!-- 复制 API URL -->
<el-button text @click="copyText(maskedApiKey)">
<MkIcon name="icon_copy_outlined" />
</el-button>
<MkTooltip content="重新生成" placement="top">
<!-- 重新生成 API Key -->
<el-button text class="-mr-1" :loading="loading" @click="loadApiKey(true)">
<MkIcon name="icon_refresh_outlined" />
</el-button>
<MkTooltip content="重新生成">
<!-- 重新生成 API Key -->
<el-button text class="-mr-1" :loading="loading" @click="loadApiKey(true)">
<MkIcon name="icon_refresh_outlined" />
</el-button>
</MkTooltip>
</template>
</el-input>
</MkTooltip>
</template>
</el-input>

<div class="mb-2">
<span class="mk-required mr-2">MCP 服务配置</span>
<span class="mk-N600">连接后由 tools/list 动态返回可调用的工具</span>
</div>

<div class="group relative pb-5">
<el-input :model-value="maskedApiKey" readonly :autosize="{ minRows: 8, maxRows: 24 }" type="textarea" />
<!-- 复制 MCP 配置 -->
<el-button class="group-hover-visible absolute right-3 top-3 z-10 shadow-md" circle @click="copyText(maskedApiKey)">
<MkIcon name="icon_copy_outlined" />
</el-button>
</div>
</MkDialog>
</template>
9 changes: 2 additions & 7 deletions ui/src/views/application-detail/overview/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ const route = useRoute()
const workspaceId = computed(() => String(route.params.workspaceId ?? ''))
const { application, applicationId, resourceApi } = useApplicationDetailContext()

type ApplicationOverviewPermissionMethod =
| 'overviewRead'
| 'overviewEmbed'
| 'overviewAccess'
| 'overviewDisplay'
| 'overviewApiKey'
function applicationOverviewPermission(method: ApplicationOverviewPermissionMethod): boolean{
type ApplicationOverviewPermissionMethod = 'overviewRead' | 'overviewEmbed' | 'overviewAccess' | 'overviewDisplay' | 'overviewApiKey'
function applicationOverviewPermission(method: ApplicationOverviewPermissionMethod): boolean {
if (isSystemResource()) return Boolean(perm.application.system[method]())
return Boolean(perm.application.workspace[method](applicationId.value))
}
Expand Down
Loading