Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-fe
Commits
af23eba2
Commit
af23eba2
authored
Dec 30, 2024
by
nick zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 应用API配置重新生成及跳转接口文档
parent
c740ff5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
8 deletions
+40
-8
agent-application.ts
src/apis/agent-application.ts
+7
-0
api-call-drawer.vue
...g/components/agent-publish/components/api-call-drawer.vue
+33
-8
No files found.
src/apis/agent-application.ts
View file @
af23eba2
...
...
@@ -194,3 +194,10 @@ export function fetchUpdateAutoPlay<T>(agentId: string, autoPlay: 'Y' | 'N') {
export
function
fetchGetAPIProfile
<
T
>
()
{
return
request
.
post
<
T
>
(
'/agentApplicationRest/getApiProfile.json'
)
}
/**
* @returns 重新生成API配置
*/
export
function
fetchResetAPIProfile
<
T
>
()
{
return
request
.
post
<
T
>
(
'/agentApplicationRest/resetApiProfile.json'
)
}
src/views/personal-space/personal-app-setting/components/agent-publish/components/api-call-drawer.vue
View file @
af23eba2
...
...
@@ -5,7 +5,7 @@ import { createApiCallDetailColumns } from '../columns'
import
{
ApiCallDetailItem
,
ApiProfileInfo
}
from
'../type'
import
{
usePersonalAppConfigStore
}
from
'@/store/modules/personal-app-config'
import
{
copyToClip
}
from
'@/utils/copy'
import
{
fetchGetAPIProfile
}
from
'@/apis/agent-application'
import
{
fetchGetAPIProfile
,
fetchResetAPIProfile
}
from
'@/apis/agent-application'
import
{
fetchGetAPIChannelPointUsageCount
,
fetchReportAPIChannelPointUsage
}
from
'@/apis/agent-analyze'
enum
RangType
{
...
...
@@ -72,6 +72,13 @@ watch(
},
)
function
handleTurnToInterfaceDocument
()
{
window
.
open
(
'https://www.yuque.com/u21309325/qlruxb/vp47nefvokd23d58?singleDoc#%20%E3%80%8Amodel-link%20api%E6%96%87%E6%A1%A3%E3%80%8B'
,
'_blank'
,
)
}
async
function
handleGetAPIProfile
()
{
apiProfileLoading
.
value
=
true
...
...
@@ -83,6 +90,17 @@ async function handleGetAPIProfile() {
}
}
async
function
handleResetAPIProfile
()
{
apiProfileLoading
.
value
=
true
const
res
=
await
fetchResetAPIProfile
<
ApiProfileInfo
>
()
if
(
res
.
code
===
0
)
{
apiProfileInfo
.
value
=
res
.
data
apiProfileLoading
.
value
=
false
}
}
async
function
handleGetAPIChannelPointUsageCount
()
{
apiCallDetailLoading
.
value
=
true
...
...
@@ -171,7 +189,7 @@ async function handleExportAPIChannelPointUsageData() {
>
<div
class=
"flex min-h-[calc(100vh-56px-62px-20px)] flex-col rounded-[10px] bg-[#fafbfc] p-5"
>
<div
class=
"mb-5 flex justify-end pr-5"
>
<n-button
type=
"primary"
:bordered=
"false"
>
<n-button
type=
"primary"
:bordered=
"false"
@
click=
"handleTurnToInterfaceDocument"
>
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.interface_document'
)
}}
</n-button>
</div>
...
...
@@ -179,15 +197,22 @@ async function handleExportAPIChannelPointUsageData() {
<div
class=
"rounded-[10px] border border-[#e7e7e7] bg-white p-5"
>
<div
class=
"mb-[7px] flex items-center justify-between"
>
<p
class=
"font-600"
>
App Key
</p>
<span
class=
"text-theme-color cursor-pointer hover:opacity-80"
@
click=
"handleGetAPIProfile"
>
<span
v-show=
"!apiProfileInfo.apiKey"
class=
"text-theme-color cursor-pointer hover:opacity-80"
@
click=
"handleGetAPIProfile"
>
{{
apiProfileInfo
.
apiKey
?
t
(
'common_module.regenerate'
)
:
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.click_to_generate'
,
)
t
(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.click_to_generate'
)
}}
</span>
<span
v-show=
"apiProfileInfo.apiKey"
class=
"text-theme-color cursor-pointer hover:opacity-80"
@
click=
"handleResetAPIProfile"
>
{{
t
(
'common_module.regenerate'
)
}}
</span>
</div>
<div
class=
"rounded-theme h-9 w-full cursor-default border px-3"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment