Commit 1f07657e authored by nick zheng's avatar nick zheng

Merge branch 'beta' into 'master'

Beta

See merge request !126
parents baec2d48 11e15ca2
......@@ -8,7 +8,7 @@
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<link rel="stylesheet" href="//at.alicdn.com/t/c/font_4711453_n5pnpk71gp.css" />
<link rel="stylesheet" href="//at.alicdn.com/t/c/font_4711453_j7wtxbx0oer.css" />
<title>Model Link</title>
</head>
......
......@@ -43,3 +43,37 @@ export function fetchGetMonthSendMessageCount<T>(agentId: string, channel: strin
export function fetchGetMonthConsumePointCount<T>(agentId: string, channel: string[]) {
return request.post<T>(`/agentDataAnalyzeRest/getPointUsageCount.json?agentId=${agentId}&channel=${channel}`)
}
/**
* @params { agentId: 应用Id timeRange: { rangType: 类型, startTime: 开始时间, endTime: 结束时间 }}
* @returns API渠道积分使用情况
*/
export function fetchGetAPIChannelPointUsageCount<T>(payload: {
agentId: string
timeRange: {
rangType: 'today' | 'week' | 'month' | 'customize'
startTime: string
endTime: string
}
}) {
return request.post<T>('/agentDataAnalyzeRest/getApiChannelPointUsageCount.json', payload)
}
/**
* @params { reportRequestType:导出类型 agentId: 应用Id timeRange: { rangType: 类型, startTime: 开始时间, endTime: 结束时间 }}
* @returns API调用积分消耗报表导出
*/
export function fetchReportAPIChannelPointUsage<T>(payload: {
reportRequestType: string
agentId: string
timeRange: {
rangType: 'today' | 'week' | 'month' | 'customize'
startTime: string
endTime: string
}
}) {
return request.post<T>('/formReportingRest/report.json', payload, {
responseType: 'blob',
timeout: 0,
})
}
......@@ -187,3 +187,10 @@ export function fetchGetAutoPlayByAgentId<T>(agentId: string) {
export function fetchUpdateAutoPlay<T>(agentId: string, autoPlay: 'Y' | 'N') {
return request.post<T>(`/agentApplicationRest/enableAutoPlay.json?agentId=${agentId}&autoPlay=${autoPlay}`)
}
/**
* @returns 获取API配置
*/
export function fetchGetAPIProfile<T>() {
return request.post<T>('/agentApplicationRest/getApiProfile.json')
}
......@@ -112,6 +112,7 @@ common_module:
forever_effective: 'Forever Effective'
year: ' Year'
month: ' Month'
today: 'Today'
alipay: 'Alipay'
wechat: 'WeChat'
analysis: 'Analysis'
......@@ -128,6 +129,10 @@ common_module:
payment_success: 'Payment success'
back: 'Back'
time: 'Time(s)'
export_data: 'Export Data'
not_generated: 'Not generated'
export_successfully: 'Export successfully'
export_failed: 'Export failed'
dialogue_module:
continue_question_message: 'You can keep asking questions'
......@@ -376,6 +381,13 @@ personal_space_module:
removal_prompt_title: 'Are you sure you want to remove the app from the app plaza'
removal_prompt_content: 'After removal, platform users will not be able to experience this application through the app plaza. If you need to relist it, please reconfigure it'
successfully_configured_published: 'Configuration successful, published to App Store'
api_call: 'API call'
api_call_desc: 'You can use apis to connect to agents interfaces'
interface_document: 'Interface document'
click_to_generate: 'Click to generate'
agentId: 'AgentId'
api_call_details: 'API call details'
api_call_datetime: 'Call datetime'
agent_sale_module:
application_square_release_setting: 'The application plaza publishes the configuration'
......@@ -416,6 +428,8 @@ personal_space_module:
upload_knowledge_document_btn_text: 'Import file'
batch_delete_knowledge_document_btn_text: 'Batch deletion'
not_find_knowledge_document_message: 'No knowledge base file found'
not_all_files_train_complete_tip: 'Some of the files are not valid. Please remove the invalid files and try adding again.'
cannot_add_tip_when_file_is_training: 'Currently, the files are being trained and cannot be added'
create_knowledge_modal_title: 'Create a knowledge base'
edit_knowledge_modal_title: 'Edit knowledge base'
......
......@@ -111,6 +111,7 @@ common_module:
forever_effective: '永远有效'
year: '年'
month: '个月'
today: '今日'
alipay: '支付宝'
wechat: '微信'
analysis: '分析'
......@@ -127,6 +128,10 @@ common_module:
payment_success: '支付成功'
back: '返回'
time: '次'
export_data: '导出数据'
not_generated: '未生成'
export_successfully: '导出成功'
export_failed: '导出失败'
dialogue_module:
continue_question_message: '你可以继续提问'
......@@ -374,6 +379,13 @@ personal_space_module:
removal_prompt_title: '确定要下架在应用广场的应用?'
removal_prompt_content: '下架后,平台用户将无法通过应用广场体验本应用,如需再次上架请重新配置。'
successfully_configured_published: '配置成功,已发布至应用广场'
api_call: 'API调用'
api_call_desc: '可使用API对接应用接口'
interface_document: '接口文档'
click_to_generate: '点击生成'
agentId: '应用ID'
api_call_details: 'API调用明细'
api_call_datetime: '调用时间'
agent_sale_module:
application_square_release_setting: '应用广场发布配置'
......@@ -414,6 +426,8 @@ personal_space_module:
upload_knowledge_document_btn_text: '导入文件'
batch_delete_knowledge_document_btn_text: '批量删除'
not_find_knowledge_document_message: '未找到知识库文件'
not_all_files_train_complete_tip: '存在不可用文件,请删除文件后再添加'
cannot_add_tip_when_file_is_training: '文件正在学习中,不可添加'
create_knowledge_modal_title: '创建知识库'
edit_knowledge_modal_title: '编辑知识库'
......
......@@ -111,6 +111,7 @@ common_module:
forever_effective: '永遠有效'
year: '年'
month: '個月'
today: '今日'
alipay: '支付寶'
wechat: '微信'
analysis: '分析'
......@@ -127,6 +128,10 @@ common_module:
payment_success: '支付成功'
back: '返回'
time: '次'
export_data: '導出數據'
not_generated: '未生成'
export_successfully: '導出成功'
export_failed: '導出失敗'
dialogue_module:
continue_question_message: '你可以繼續提問'
......@@ -374,6 +379,13 @@ personal_space_module:
removal_prompt_title: '確定要下架在應用廣場的應用?'
removal_prompt_content: '下架後,平臺用戶將無法通過應用廣場體驗本應用,如需再次上架請重新配置。'
successfully_configured_published: '配置成功,已發布至應用廣場'
api_call: 'API調用'
api_call_desc: '可使用API對接應用接口'
interface_document: '接口文檔'
click_to_generate: '點擊生成'
agentId: '應用ID'
api_call_details: 'API調用明細'
api_call_datetime: '調用時間'
agent_sale_module:
application_square_release_setting: '應用廣場發佈配寘'
......@@ -414,6 +426,8 @@ personal_space_module:
upload_knowledge_document_btn_text: '導入文件'
batch_delete_knowledge_document_btn_text: '批量刪除'
not_find_knowledge_document_message: '未找到知識庫文件'
not_all_files_train_complete_tip: '存在不可用文件,請刪除文件後再添加'
cannot_add_tip_when_file_is_training: '文件正在學習中,不可添加'
create_knowledge_modal_title: '創建知識庫'
edit_knowledge_modal_title: '編輯知識庫'
......
<script lang="ts" setup>
import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { Computer, PreviewOpen, AllApplication, SettingOne } from '@icon-park/vue-next'
import { Computer, PreviewOpen, AllApplication, SettingOne, Api } from '@icon-park/vue-next'
import useTableScrollY from '@/composables/useTableScrollY'
import { copyToClip } from '@/utils/copy'
import { formatDateTime } from '@/utils/date-formatter'
......@@ -14,7 +14,8 @@ import {
fetchRemoveSalePublishApplication,
} from '@/apis/agent-application'
import { defaultPersonalAppConfigState, usePersonalAppConfigStore } from '@/store/modules/personal-app-config'
import { ApplicationMallInfo } from '../../personal-app/types'
import { ApplicationMallInfo } from '../../../personal-app/types'
import ApiCallDrawer from './components/api-call-drawer.vue'
const { t } = useI18n()
......@@ -34,6 +35,7 @@ const applicationMallInfo = ref<ApplicationMallInfo>({
isSale: '',
launchTime: '',
})
const isShowAPICallDrawer = ref(false)
watch(
() => saleApplicationsInfo.value,
......@@ -76,6 +78,9 @@ function handleClickChannelPublishTableAction(actionType: string) {
case 'unSaleApplication':
handleUnSaleApplication()
break
case 'APIConfiguration':
handleAPIConfiguration()
break
}
}
......@@ -139,10 +144,14 @@ function handleGetApplicationInfo() {
function handleToApplicationSquare() {
router.push({ name: 'ApplicationsSquare' })
}
function handleAPIConfiguration() {
isShowAPICallDrawer.value = true
}
</script>
<template>
<div ref="pageContentWrapRef" class="h-full w-full overflow-hidden p-5">
<div id="drawer-target" ref="pageContentWrapRef" class="relative h-full w-full overflow-hidden p-5">
<table class="w-full text-left" :max-height="tableContentY">
<thead>
<tr>
......@@ -279,25 +288,6 @@ function handleToApplicationSquare() {
</div>
</div>
<div v-show="applicationMallInfo?.isSale === 'Y'" class="flex">
<!-- <div
class="flex cursor-pointer items-center justify-start rounded-[5px] border-[1px] border-[#000DFF] bg-[#f7f7f9] px-[12px] py-[4px] text-[14px] text-[#000DFF] hover:opacity-80"
@click="handleClickChannelPublishTableAction('accessPage')"
>
<PreviewOpen theme="outline" size="16" fill="#000DFF" :stroke-width="4" class="mr-[6px]" />
<span>{{
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.access_page')
}}</span>
</div>
<div
class="hover:text-theme-color hover:border-theme-color ml-[16px] flex cursor-pointer items-center justify-start rounded-md border bg-[#f7f7f9] px-[12px] py-[4px] text-[14px]"
@click="handleClickChannelPublishTableAction('copyLink')"
>
<CustomIcon icon="pepicons-pop:share-android-circle" class="mr-[6px]" />
<span>{{
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.share_link')
}}</span>
</div> -->
<div
class="hover:text-theme-color hover:border-theme-color flex cursor-pointer items-center justify-start rounded-md border bg-[#f7f7f9] px-[12px] py-[4px] text-[14px]"
@click="handleClickChannelPublishTableAction('modifySetting')"
......@@ -321,9 +311,46 @@ function handleToApplicationSquare() {
</div>
</td>
</tr>
<tr>
<td class="border-[1px] border-[#efeff5]">
<div class="flex items-center justify-start p-[12px]">
<Api theme="filled" size="24" fill="#000dff" :stroke-width="3" />
<div class="ml-[12px]">
<div class="flex">
<span class="flex items-center gap-[4px]">
{{ t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.api_call') }}
</span>
</div>
<div class="text-[#84868c]">
{{ t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.api_call_desc') }}
</div>
</div>
</div>
</td>
<td class="border-[1px] border-[#efeff5] p-[12px]">
<span class="text-[#84868c]">---</span>
</td>
<td class="border-[1px] border-[#efeff5] p-[12px]">
<div class="flex">
<div
class="flex cursor-pointer items-center justify-start rounded-[5px] border-[1px] border-[#000DFF] bg-[#f7f7f9] px-[12px] py-[4px] text-[14px] text-[#000DFF] hover:opacity-80"
@click="handleClickChannelPublishTableAction('APIConfiguration')"
>
<SettingOne theme="outline" size="16" fill="#000dff" :stroke-width="3" class="mr-[3px]" />
<span>
{{ t('common_module.config') }}
</span>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<ApiCallDrawer v-model:is-show="isShowAPICallDrawer" />
<SaleApplicationsConfigurationModal
v-model="isShowSaleApplicationsConfigurationModal"
:sale-applications-data="saleApplicationsInfo"
......
import i18n from '@/locales'
import { ApiCallDetailItem } from './type'
const t = i18n.global.t
export function createApiCallDetailColumns() {
return [
{
title: () => (
<span>
{t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.api_call_datetime')}
</span>
),
key: 'dateTime',
align: 'center',
ellipsis: {
tooltip: true,
},
render(row: ApiCallDetailItem) {
return row.dateTime || '--'
},
},
{
title: () => <span>{t('analysis_module.consume_points')}</span>,
key: 'count',
align: 'center',
ellipsis: {
tooltip: true,
},
render(row: ApiCallDetailItem) {
return row.count.toFixed(2) || '--'
},
},
]
}
export interface ApiProfileInfo {
apiKey: string
apiSecret: string
}
export interface ApiCallDetailItem {
dateTime: Date
count: number
}
......@@ -5,7 +5,7 @@ import { Emitter } from 'mitt'
import { useI18n } from 'vue-i18n'
import PageNarBar from './components/page-narbar.vue'
import AgentConfig from './components/agent-config/agent-config.vue'
import AgentPublish from './components/agent-publish.vue'
import AgentPublish from './components/agent-publish/agent-publish.vue'
import AgentAnalysis from './components/agent-analysis/agent-analysis.vue'
import { usePersonalAppConfigStore } from '@/store/modules/personal-app-config'
import { PersonalAppConfigState } from '@/store/types/personal-app-config'
......
......@@ -112,6 +112,7 @@ declare namespace I18n {
forever_effective: string
year: string
month: string
today: string
alipay: string
wechat: string
analysis: string
......@@ -127,6 +128,10 @@ declare namespace I18n {
payment_success: string
back: string
time: string
export_data: string
not_generated: string
export_successfully: string
export_failed: string
dialogue_module: {
continue_question_message: string
......@@ -378,6 +383,13 @@ declare namespace I18n {
removal_prompt_title: string
removal_prompt_content: string
successfully_configured_published: string
api_call: string
api_call_desc: string
interface_document: string
click_to_generate: string
agentId: string
api_call_details: string
api_call_datetime: string
}
}
......@@ -422,6 +434,8 @@ declare namespace I18n {
upload_knowledge_document_btn_text: string
batch_delete_knowledge_document_btn_text: string
not_find_knowledge_document_message: string
not_all_files_train_complete_tip: string
cannot_add_tip_when_file_is_training: string
create_knowledge_modal_title: string
edit_knowledge_modal_title: string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment