Improve experience for Chatdoc (#4)
This commit is contained in:
1 parent
13e6918fa9
commit
0de86f2e09
68 files changed
+821
-117
No files matched your search
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"type": "minor",
|
||||
"comment": "add localization support",
|
||||
"packageName": "@acedatacloud/hub",
|
||||
"email": "cqc@cuiqingcai.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" width="500px">
|
||||
<el-dialog v-model="dialogVisible" width="400px">
|
||||
<el-form ref="form" label-width="60px">
|
||||
<el-form-item :label="$t('chatdoc.field.name')" :prop="form.name">
|
||||
<el-input v-model="form.name" />
|
||||
<el-input v-model="form.name" :placeholder="$t('chatdoc.message.inputRepositoryName')" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('chatdoc.field.description')" :prop="form.description">
|
||||
<el-input v-model="form.description" />
|
||||
<el-input v-model="form.description" :placeholder="$t('chatdoc.message.inputRepositoryDescription')" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">{{ $t('common.button.create') }}</el-button>
|
||||
@@ -32,7 +32,7 @@ interface IData {
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'UploadDocument',
|
||||
name: 'CreateRepository',
|
||||
components: {
|
||||
ElButton,
|
||||
ElDialog,
|
||||
@@ -66,7 +66,7 @@ export default defineComponent({
|
||||
})
|
||||
.then(() => {
|
||||
this.creating = false;
|
||||
ElMessage.success(this.$t('chatdoc.message.createDocumentSuccess'));
|
||||
ElMessage.success(this.$t('chatdoc.message.createRepositorySuccess'));
|
||||
this.dialogVisible = false;
|
||||
this.$store.dispatch('chatdoc/getRepositories');
|
||||
})
|
||||
|
||||
@@ -18,7 +18,10 @@
|
||||
:headers="headers"
|
||||
>
|
||||
<el-icon v-if="!learning" class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div v-if="!learning" class="el-upload__text">{{ $t('chatdoc.message.dragOrClickToUpload') }}</div>
|
||||
<div v-if="!learning" class="el-upload__text">
|
||||
<p>{{ $t('chatdoc.message.dragOrClickToUpload') }}</p>
|
||||
<p>{{ $t('chatdoc.message.supportedFiles') }}</p>
|
||||
</div>
|
||||
<div v-if="learning">{{ $t('chatdoc.message.learningDocument') }}</div>
|
||||
</el-upload>
|
||||
</el-dialog>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
export default {
|
||||
requestQueries: 'Request Queries',
|
||||
requestBody: 'Request Body',
|
||||
responseBody: 'Response Body',
|
||||
requestHeaders: 'Request Headers',
|
||||
requestHeader: 'Request Header',
|
||||
responseHeaders: 'Response Headers',
|
||||
response: 'Response',
|
||||
success: 'Success',
|
||||
failure: 'Failure',
|
||||
responseExample: 'Example',
|
||||
authentication: 'Authentication',
|
||||
arrayOf: 'Array of',
|
||||
apiKey: 'API Key'
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import entity from './entity';
|
||||
import unit from './unit';
|
||||
import message from './message';
|
||||
|
||||
export default {
|
||||
entity,
|
||||
unit,
|
||||
message
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
export default {
|
||||
free: 'Free',
|
||||
appliedCount: 'Applied Times',
|
||||
firstFree: 'First Free',
|
||||
custom: 'Specified Times',
|
||||
present: 'Gift',
|
||||
around: 'Approximately'
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
credit: 'Credit',
|
||||
Credit: 'Credit',
|
||||
credits: 'Credits',
|
||||
Credits: 'Credits',
|
||||
call: 'Call',
|
||||
Call: 'Call',
|
||||
calls: 'Calls',
|
||||
Calls: 'Calls',
|
||||
MB: 'MB',
|
||||
GB: 'GB'
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
export default {
|
||||
goDocument: 'View Document',
|
||||
buyMore: 'Buy More',
|
||||
createOrder: 'Create Order',
|
||||
custom: 'Custom',
|
||||
query: 'Query'
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
export default {
|
||||
id: 'Application ID',
|
||||
remainingAmount: 'Remaining Amount',
|
||||
usedAmount: 'Used Amount',
|
||||
apiKey: 'API Key',
|
||||
service: 'Service',
|
||||
operation: 'Operation',
|
||||
amount: 'Amount',
|
||||
shouldPayPrice: 'Payable Amount',
|
||||
api: 'API',
|
||||
proxy: 'Proxy',
|
||||
credential: 'Credential',
|
||||
name: 'Name',
|
||||
package: 'Package',
|
||||
price: 'Price',
|
||||
type: 'Type',
|
||||
freeAmount: 'Free Gift',
|
||||
extraPrice: 'Extra Price'
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import field from './field';
|
||||
import button from './button';
|
||||
import message from './message';
|
||||
import title from './title';
|
||||
|
||||
export default {
|
||||
field,
|
||||
button,
|
||||
message,
|
||||
title
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
export default {
|
||||
alreadyApplied: 'You have already applied for this service',
|
||||
applySuccessfully: 'Application successful',
|
||||
notApplied: 'You have not applied for this service yet, please apply for this service before using',
|
||||
yourApplication: 'Your application',
|
||||
unverified: 'You need to complete real-name authentication before you can apply for this service',
|
||||
goVerify: 'Go to real-name authentication',
|
||||
requiredParameter: 'Required parameter',
|
||||
example: 'Example',
|
||||
readPolicy: 'I have read and agree to',
|
||||
policy: 'Data Technology Service Use Agreement',
|
||||
notAgreePolicy: 'You have not agreed to the Data Technology Service Use Agreement',
|
||||
confirmApplying: 'Confirm service application',
|
||||
rotateCredential: 'Reset key',
|
||||
rotateCredentialConfirm: 'Are you sure you want to reset the key? It cannot be recovered after resetting',
|
||||
idDoesNotExist: 'Application does not exist',
|
||||
rotateCredentialSuccessfully: 'Key reset successful',
|
||||
rotateCredentialFailed: 'Key reset failed, please contact customer service',
|
||||
updateFailed: 'Modification failed',
|
||||
updateSuccessfully: 'Modification successful',
|
||||
applyDescription:
|
||||
'You can use it immediately after applying, and you will also receive a certain number of free times.'
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
buyService: 'Buy Service',
|
||||
applicationRemainingCount: 'Modify Count',
|
||||
manageApplication: 'Application Management'
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
import message from './message';
|
||||
import title from './title';
|
||||
|
||||
export default { message, title };
|
||||
@@ -0,0 +1,31 @@
|
||||
export default {
|
||||
startNewChat: 'Start a new conversation',
|
||||
uploadFile: 'Upload file',
|
||||
noToken: 'Please apply for the corresponding service first',
|
||||
newMessagePlaceholder: 'Please enter your question...',
|
||||
noInput: 'Question cannot be empty',
|
||||
uploadReferencesExceed: 'You can only upload 1 file at most',
|
||||
uploadReferencesError: 'File upload failed, please try again later',
|
||||
notApplied: 'You have not applied for this service yet, please apply first',
|
||||
tryForFree: 'Try for free',
|
||||
question1: 'Write a piece of JavaScript code that outputs Hello World',
|
||||
question2: 'Write an email to Xiaowei, telling him that I just moved',
|
||||
question3: 'Explain the basic principles of quantum computing in simple terms',
|
||||
question4: 'What impact has virtual reality had on artistic creation?',
|
||||
question5: 'How do privacy protection and data security affect legal practice?',
|
||||
question6: 'How to deal with the complex changes in tax laws in todays world?',
|
||||
question7: 'How to create unique cuisine by combining different regional cultural backgrounds?',
|
||||
question8: 'How to draw literary creation inspiration from travel experiences?',
|
||||
question9: 'How to get business ideas from successful cases in different industries?',
|
||||
errorApiError: 'Answer failed, please try again later',
|
||||
errorBadRequest: 'The request content is not standardized, please ask again',
|
||||
errorNoConversation: 'The conversation does not exist or has expired, please start a new conversation',
|
||||
errorContentTooLarge: 'The content of the question is too long, please shorten it and try again',
|
||||
errorTooManyRequests: 'Your operations are too frequent, please try again later',
|
||||
errorUsedUp: 'You have used up your package times, please buy more times to continue using',
|
||||
errorUnknown: 'An unknown error occurred on the server, please try again later or contact customer service',
|
||||
errorTimeout: 'Answering the question timed out, please try again later',
|
||||
errorNotApplied: 'You have not applied for this service yet, please apply first before continuing to ask questions',
|
||||
confirmDelete: 'Confirm deletion',
|
||||
howToUse: 'Press Shift+Enter to start a new line'
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
export default {
|
||||
chat: 'AI Chat',
|
||||
example: 'Example',
|
||||
capabilities: 'Capabilities',
|
||||
limitations: 'Limitations',
|
||||
complexQuestion: 'Answer complex questions',
|
||||
professionalQuestion: 'Consult professional questions',
|
||||
getTips: 'Get inspiration and creativity'
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
uploadDocuments: 'Upload Documents'
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
export default {
|
||||
fileName: 'File Name',
|
||||
createdAt: 'Creation Time',
|
||||
fileExtension: 'File Type',
|
||||
fileUrl: 'File Link',
|
||||
fileSize: 'File Size',
|
||||
state: 'Status',
|
||||
stateProcessing: 'Learning',
|
||||
stateCompleted: 'Learning Completed',
|
||||
stateFailed: 'Learning Failed',
|
||||
name: 'Name',
|
||||
description: 'Description'
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
import message from './message';
|
||||
import title from './title';
|
||||
import nav from './nav';
|
||||
import field from './field';
|
||||
import button from './button';
|
||||
|
||||
export default { message, title, nav, field, button };
|
||||
@@ -0,0 +1,33 @@
|
||||
export default {
|
||||
introductionForKnowledge: '知识库中可添加文档,在机器人回答时,可运用库中的知识进行回复。',
|
||||
introductionForRepository:
|
||||
'知识库是一组文档的集合,您可以在知识库中添加文档,机器人在回答时,会从知识库中的文档中进行回复。',
|
||||
uploadDocumentsExceed: '上传文档数量超过限制',
|
||||
uploadDocumentsError: '上传文档失败',
|
||||
uploadDocumentsSuccess: '上传文档成功',
|
||||
createDocumentSuccess: '学习文档成功',
|
||||
startCreateDocument: '开始学习文档...',
|
||||
createDocumentError: '学习文档失败',
|
||||
dragOrClickToUpload: '拖拽或点击上传文档',
|
||||
learningDocument: '学习中,请稍后...',
|
||||
startNewChat: '开始新会话',
|
||||
errorApiError: '回答失败,请稍后重试',
|
||||
errorBadRequest: '请求内容不规范,请重新提问',
|
||||
errorNoConversation: '对话内容不存在或者已经过期,请发起新的会话',
|
||||
errorContentTooLarge: '问题内容过长,请缩短后重试',
|
||||
errorTooManyRequests: '您的操作过于频繁,请稍后重试',
|
||||
errorUsedUp: '您的套餐次数已经用完,请购买更多次数继续使用',
|
||||
errorUnknown: '服务器出现未知错误,请稍后重试或联系客服',
|
||||
errorTimeout: '回答问题超时,请稍后重试',
|
||||
errorNotApplied: '您尚未申请该服务,请先申请再继续提问',
|
||||
confirmDelete: '确定删除',
|
||||
howToUse: '按 Shift+Enter 键可以换行',
|
||||
createRepositorySuccess: '创建知识库成功',
|
||||
createRepositoryFailed: '创建知识库失败',
|
||||
deleteRepositorySuccess: '删除知识库成功',
|
||||
deleteDocumentSuccess: '删除文档成功',
|
||||
currentRepository: '当前知识库',
|
||||
nameRequired: '名称不能为空',
|
||||
inputRepositoryName: '知识库名称',
|
||||
inputRepositoryDescription: '一句话描述你的知识库'
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
chat: '对话',
|
||||
setting: '设置',
|
||||
manage: '管理'
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
manage: '管理知识库',
|
||||
createRepository: '创建知识库',
|
||||
repositories: '知识库列表'
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
export default {
|
||||
setup: '配置',
|
||||
edit: '编辑',
|
||||
login: '登录',
|
||||
new: '新建',
|
||||
logout: '退出登录',
|
||||
delete: '删除',
|
||||
confirm: '确定',
|
||||
cancel: '取消',
|
||||
alert: '警告',
|
||||
info: '提示',
|
||||
publish: '发布',
|
||||
watch: '观看',
|
||||
verify: '实名认证',
|
||||
profile: '个人信息',
|
||||
console: '控制台',
|
||||
learn: '学习',
|
||||
buy: '购买',
|
||||
try: '测试',
|
||||
startForFree: '免费体验',
|
||||
applyForFree: '免费申请',
|
||||
apply: '申请',
|
||||
refresh: '刷新',
|
||||
pay: '支付',
|
||||
repay: '继续支付',
|
||||
applied: '已申请',
|
||||
acquire: '获取',
|
||||
fillExample: '填写样例',
|
||||
buyMore: '购买更多',
|
||||
update: '更新',
|
||||
copy: '复制',
|
||||
stop: '停止',
|
||||
create: '创建'
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
export default {
|
||||
website: '知数云',
|
||||
copyright: '版权所有',
|
||||
platform: '平台',
|
||||
title: '标题',
|
||||
icon: '图标',
|
||||
status: '状态',
|
||||
operation: '操作',
|
||||
description: '描述',
|
||||
createdAt: '创建时间',
|
||||
publishedAt: '发布时间',
|
||||
publishAt: '开始发布时间',
|
||||
updatedAt: '更新时间',
|
||||
article: '文章',
|
||||
course: '课程',
|
||||
minute: '分钟',
|
||||
order: '订单',
|
||||
episode: '小节',
|
||||
episodes: '小节'
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import button from './button';
|
||||
import message from './message';
|
||||
import nav from './nav';
|
||||
import entity from './entity';
|
||||
import title from './title';
|
||||
|
||||
export default {
|
||||
nav,
|
||||
button,
|
||||
message,
|
||||
entity,
|
||||
title
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
copied: '复制成功',
|
||||
confirmDelete: '确认删除吗?',
|
||||
alert: '警告',
|
||||
info: '温馨提示',
|
||||
free: '免费',
|
||||
startPrice: '起',
|
||||
helpWechat: '技术客服微信',
|
||||
helpWechat2: '业务客服微信',
|
||||
remainingAmount: '剩余积分',
|
||||
usedAmount: '使用积分'
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
export default {
|
||||
chat: 'AI 问答',
|
||||
midjourney: 'AI 绘画',
|
||||
editor: '编辑器',
|
||||
setting: '设置',
|
||||
home: '首页',
|
||||
content: '内容',
|
||||
platform: '平台',
|
||||
article: '文章',
|
||||
publication: '发布',
|
||||
course: '课程',
|
||||
category: '分类',
|
||||
service: '服务',
|
||||
document: '文档',
|
||||
console: '控制台',
|
||||
newChat: '新建对话',
|
||||
logOut: '退出登录',
|
||||
distribution: '分销赚钱',
|
||||
chatdoc: 'AI 知识库'
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
export default {
|
||||
documentIntroduction: '文档介绍',
|
||||
placeholderOfSelect: '请选择',
|
||||
placeholderOfInput: '请填写',
|
||||
allApplications: '所有申请',
|
||||
allOrders: '所有订单',
|
||||
orderInfo: '订单信息',
|
||||
buyMore: '购买更多',
|
||||
distribution: '分销赚钱',
|
||||
distributionHistory: '分销历史',
|
||||
invitee: '邀请人',
|
||||
allUsages: '调用记录'
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
import menu from './menu';
|
||||
|
||||
export default {
|
||||
menu
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
export default {
|
||||
orderList: '订单列表',
|
||||
applicationList: '申请列表',
|
||||
userProfile: '个人信息',
|
||||
idVerify: '实名认证',
|
||||
manageApplication: '申请管理',
|
||||
distributionIndex: '分销赚钱',
|
||||
usageList: '调用记录',
|
||||
platformTokenIndex: '平台令牌',
|
||||
manageOrder: '订单管理'
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export default {
|
||||
detail: 'View details',
|
||||
withdrawal: 'Withdraw'
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
id: 'Distribution ID',
|
||||
percentage: 'Distribution ratio',
|
||||
price: 'Order amount',
|
||||
reward: 'Distribution reward',
|
||||
createdAt: 'Distribution time',
|
||||
level: 'Level',
|
||||
threshold: 'Distribution threshold',
|
||||
inviteeId: 'Inviter ID',
|
||||
isVerified: 'Is verified',
|
||||
userId: 'User ID'
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import field from './field';
|
||||
import title from './title';
|
||||
import message from './message';
|
||||
import button from './button';
|
||||
|
||||
export default {
|
||||
field,
|
||||
title,
|
||||
message,
|
||||
button
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
export default {
|
||||
deltaPriceForNextLevel: 'Difference to the next level',
|
||||
howToWithdrawal:
|
||||
'Please add customer service to handle withdrawals, a 6% income tax will be deducted from withdrawals, providing an invoice can be used for deduction',
|
||||
technicalDetail: 'Technical details',
|
||||
distributionQrDescription: 'Distribution QR code (same content as the link)',
|
||||
distributionDescription:
|
||||
'You can invite new customers to register through the link, and these customers will be permanently bound as your sub-level customers. All consumption orders of these customers on this platform will be returned to your account according to the current distribution ratio, and you can withdraw at any time.',
|
||||
distributionLinkDescription:
|
||||
'If customers register this platform through this link or QR code, these customers will be permanently bound as your sub-level customers. All consumption orders of these customers on this platform will be returned to your account according to the current distribution ratio.',
|
||||
distributionLinkDescription2:
|
||||
'This link contains your user ID. After the customer opens the link, your user ID will be recorded in the customer`s browser in the form of Cookies, which is valid for seven days. Within seven days, if the customer registers this platform by scanning the code, your user ID will be uploaded to the registration server with Cookies, and the customer can be bound as your downstream customer.'
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
export default {
|
||||
price: 'Total amount of distribution orders',
|
||||
reward: 'Total distribution reward',
|
||||
level: 'Distribution level',
|
||||
percentage: 'Distribution ratio',
|
||||
currentLevel: 'Current level',
|
||||
nextLevel: 'Next level',
|
||||
currentPercentage: 'Current distribution ratio',
|
||||
nextPercentage: 'Sub-level distribution ratio',
|
||||
levelInfo: 'Level information',
|
||||
distributionLink: 'Distribution link',
|
||||
inviteesCount: 'Total number of invitees'
|
||||
};
|
||||
+25
-14
@@ -1,16 +1,27 @@
|
||||
import common from './common';
|
||||
import application from './application';
|
||||
import api from './api';
|
||||
import setting from './setting';
|
||||
import midjourney from './midjourney';
|
||||
import chat from './chat';
|
||||
import console from './console';
|
||||
import order from './order';
|
||||
import distribution from './distribution';
|
||||
import user from './user';
|
||||
import chatdoc from './chatdoc';
|
||||
import service from './service';
|
||||
|
||||
export default {
|
||||
message: {
|
||||
copied: 'Copied'
|
||||
},
|
||||
menu: {
|
||||
home: 'Home',
|
||||
editor: 'Editor'
|
||||
},
|
||||
option: {
|
||||
theme: 'Theme',
|
||||
highlight: 'Code Highlight Theme',
|
||||
bold: 'Bold',
|
||||
italic: 'Italic',
|
||||
strikeout: 'Strikeout'
|
||||
}
|
||||
chat,
|
||||
service,
|
||||
chatdoc,
|
||||
user,
|
||||
order,
|
||||
console,
|
||||
common,
|
||||
application,
|
||||
api,
|
||||
setting,
|
||||
midjourney,
|
||||
distribution
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
export default {
|
||||
buyMore: 'Buy More',
|
||||
uploadReferences: 'Upload References',
|
||||
success: 'Success',
|
||||
generating: 'Generating',
|
||||
failed: 'Failed',
|
||||
download: 'Download',
|
||||
fast: 'Fast',
|
||||
relax: 'Slow',
|
||||
turbo: 'Turbo',
|
||||
more: 'More',
|
||||
generate: 'Generate',
|
||||
history: 'History',
|
||||
generateNew: 'Draw New Picture'
|
||||
};
|
||||
@@ -0,0 +1,52 @@
|
||||
export default {
|
||||
aspect: '改变生成图像的宽高比例,默认值取决于模型和模式',
|
||||
chaos: '--chaos, 用于调整生成图像的变异程度,数字越大,生成的图像越独特和意想不到,范围为 0-100,默认为 1',
|
||||
fast: '忽略当前的设置,以快速模式运行单个生成任务,没有默认值',
|
||||
iw: '设置图像提示在生成过程中相对于文本提示的重要性,范围为 0-2,默认为 1',
|
||||
no: '指示生成系统尝试排除某些元素,例如 "--no plants" 将尝试生成不包含植物的图像,没有默认值',
|
||||
quality: '设定渲染图像的质量和所需时间,范围为 .25, .5, 或 1,默认为 1',
|
||||
random:
|
||||
'给提示添加一个随机的基础风格代码,可以使用 "--style random-16", "--style random-64" 或 "--style random-128" 来获取不同长度的随机风格效果,没有默认值',
|
||||
relax: '覆盖当前设置,让系统在放松模式下运行单个任务,没有默认值',
|
||||
repeat: '从一个提示创建多个任务,范围为 1-40,默认为 1',
|
||||
seed: '--seed, 生成图像的起始视觉噪点,范围为 0-4294967295,默认为随机生成',
|
||||
stop: '在生成过程的任意阶段停止任务,范围为 10-100,默认为 100(即完全生成)',
|
||||
style:
|
||||
'--style, 切换 Midjourney 或 Niji 模型的不同版本或风格,例如 "raw", "cute", "expressive", "original", "scenic",默认值取决于模型和模式',
|
||||
stylize: '--stylize, 调整 Midjourney 默认美学风格在生成任务中的应用强度,范围为 0-1000,默认为 100',
|
||||
tile: '生成可以作为重复平铺使用的图像,以创建无缝的图案,没有默认值',
|
||||
turbo: '覆盖当前设置,以涡轮模式快速运行单个任务,没有默认值',
|
||||
weird: '--weird, 探索带有实验性质的不常见美学风格,范围为 0-3000,默认为 0',
|
||||
translation: '在生成过程中启用自动翻译,输入为非中文内容时会自动翻译为英文输入给 Midjourney',
|
||||
imageWeight: '--iw, 调整图像提示相对于文本提示的权重,范围为 0-2,默认为 1',
|
||||
niji: '启用此开关后,生成的图像将使用 Niji 模型,生成动漫风格的图片',
|
||||
uploadReferences: '上传图片作为生成的参考,支持最多 5 张图片。如果上传的图片数量超过 1 张,将会自动融合',
|
||||
raw: '启用此开关后,生成的图像将使用 Midjourney 模型,生成原始风格的图片',
|
||||
generate: '点击此按钮开始生成图片',
|
||||
upscale1: '放大第一张图片',
|
||||
upscale2: '放大第二张图片',
|
||||
upscale3: '放大第三张图片',
|
||||
upscale4: '放大第四张图片',
|
||||
variation1: '微调第一张图片',
|
||||
variation2: '微调第二张图片',
|
||||
variation3: '微调第三张图片',
|
||||
variation4: '微调第四张图片',
|
||||
reroll: '重新生成',
|
||||
high_variation: '高变异',
|
||||
low_variation: '低变异',
|
||||
zoom_out_2x: '缩小 2 倍',
|
||||
zoom_out_1_5x: '缩小 1.5 倍',
|
||||
square: '正方形',
|
||||
pan_left: '向左平移',
|
||||
pan_up: '向上平移',
|
||||
pan_down: '向下平移',
|
||||
pan_right: '向右平移',
|
||||
zoom_in_2x: '放大 2 倍',
|
||||
zoom_in_1_5x: '放大 1.5 倍',
|
||||
upscale_2x: '放大 2 倍',
|
||||
upscale_4x: '放大 4 倍',
|
||||
redo_upscale_2x: '重新放大 2 倍',
|
||||
redo_upscale_4x: '重新放大 4 倍',
|
||||
download: '下载',
|
||||
prompt: '输入指令如果添加额外参数,其会覆盖默认预设参数,如添加 --stylize 200,最终指令会强制使用 --stylize 200'
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
export default {
|
||||
taskId: 'Task ID',
|
||||
finalPrompt: 'Final Drawing Instruction',
|
||||
elements: 'Drawing Style',
|
||||
failureReason: 'Failure Reason',
|
||||
traceId: 'Trace ID'
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import description from './description';
|
||||
import name from './name';
|
||||
import message from './message';
|
||||
import placeholder from './placeholder';
|
||||
import button from './button';
|
||||
import field from './field';
|
||||
import model from './model';
|
||||
|
||||
export default { description, name, message, placeholder, button, field, model };
|
||||
@@ -0,0 +1,10 @@
|
||||
export default {
|
||||
promptPlaceholder: '请输入一句话来描述你想要生成的图片,例如:一只好看的猫。额外的参数会覆盖默认预设参数',
|
||||
uploadReferencesExceed: '最多只能上传 5 张图片',
|
||||
uploadReferencesError: '上传图片失败,请稍后重试',
|
||||
startTaskSuccess: '发起绘图任务成功',
|
||||
startTaskFailed: '发起绘图任务失败',
|
||||
generating: '生成中...',
|
||||
noOperations: '没有可用操作',
|
||||
noTasks: '没有历史任务,请先发起一个新的任务'
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export default {
|
||||
general: '通用',
|
||||
niji: '动漫'
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
export default {
|
||||
model: '模型',
|
||||
aspect: '分辨率',
|
||||
ratio: '宽高比',
|
||||
chaos: '混乱度',
|
||||
fast: '快速模式',
|
||||
nijiStyle: '动漫风格',
|
||||
version: '版本',
|
||||
imageWeight: '图像权重',
|
||||
no: '否定提示',
|
||||
quality: '渲染质量',
|
||||
random: '随机风格',
|
||||
relax: '放松模式',
|
||||
repeat: '重复生成',
|
||||
seed: '种子数',
|
||||
stop: '提前停止',
|
||||
style: '风格',
|
||||
stylize: '风格化度',
|
||||
tile: '平铺模式',
|
||||
turbo: '涡轮模式',
|
||||
weird: '怪异度',
|
||||
translation: '自动翻译',
|
||||
advanced: '专业模式',
|
||||
niji: '动漫风格',
|
||||
ignore: '忽略内容',
|
||||
prompt: '绘图指令',
|
||||
raw: '原生风格'
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
prompt: '请输入一句话来描述你想要生成的图片,例如:一只好看的猫',
|
||||
ignore: '不想让图像中出现的内容,例如生成一幅街景,但不要有汽车,你可以填写:汽车',
|
||||
select: '选择'
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
export default {
|
||||
pay: '支付',
|
||||
continuePay: '继续支付',
|
||||
checkDetail: '查看详情',
|
||||
query: '查询',
|
||||
finish: '手动完成',
|
||||
update: '更新'
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
id: '订单号',
|
||||
amount: '数量',
|
||||
price: '金额',
|
||||
description: '订单描述',
|
||||
state: '状态',
|
||||
createdAt: '创建时间',
|
||||
service: '服务名称',
|
||||
payWay: '支付方式',
|
||||
api: 'API',
|
||||
proxy: '代理'
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import field from './field';
|
||||
import button from './button';
|
||||
import message from './message';
|
||||
import state from './state';
|
||||
import title from './title';
|
||||
|
||||
export default {
|
||||
field,
|
||||
button,
|
||||
message,
|
||||
state,
|
||||
title
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
export default {
|
||||
paidSuccessfully: '支付成功',
|
||||
createFailed: '创建失败',
|
||||
wechatPayHelp: '请打开手机微信,扫一扫完成支付',
|
||||
free: '免费',
|
||||
buyInExternalUrl: '请在外部链接完成付款',
|
||||
updateFailed: '修改失败',
|
||||
updateSuccessfully: '修改成功'
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
export default {
|
||||
pending: '待支付',
|
||||
paid: '已支付',
|
||||
expired: '支付超时',
|
||||
failed: '支付失败'
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
export default {
|
||||
info: '订单信息',
|
||||
wechatPay: '微信支付',
|
||||
aliPay: '支付宝',
|
||||
stripe: 'Stripe',
|
||||
manageOrder: '管理订单'
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
export default {
|
||||
learnMore: 'Learn More',
|
||||
apply: 'Apply Now',
|
||||
introduction: 'Service Introduction',
|
||||
apis: 'API Description',
|
||||
pricing: 'Pricing'
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
export default {
|
||||
price: 'Price',
|
||||
introduction: 'Introduction',
|
||||
apis: 'API',
|
||||
proxies: 'Proxy'
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import message from './message';
|
||||
import unit from './unit';
|
||||
import button from './button';
|
||||
import field from './field';
|
||||
import title from './title';
|
||||
|
||||
export default {
|
||||
message,
|
||||
unit,
|
||||
button,
|
||||
field,
|
||||
title
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
free: 'Free',
|
||||
around: 'Around',
|
||||
welcomeCredits: 'Welcome Credits',
|
||||
appliedCount: 'Number of Applications',
|
||||
indexTitle: 'Your smart choice for digital services',
|
||||
indexSubtitle: 'Empower your work and life with standardized excellence in services.',
|
||||
fromPrice: 'From ',
|
||||
packages: 'We offer a variety of packages for credits, the more packages you buy, the more discounts you get.',
|
||||
offer: 'Offer',
|
||||
partnersTitle: 'Trusted by leading partners'
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
apis: 'API',
|
||||
proxies: 'Proxy',
|
||||
packages: 'Packages'
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
credit: 'Credit',
|
||||
Credit: 'Credit',
|
||||
credits: 'Credits',
|
||||
Credits: 'Credits',
|
||||
call: 'Call',
|
||||
Call: 'Call',
|
||||
calls: 'Calls',
|
||||
Calls: 'Calls',
|
||||
MB: 'MB',
|
||||
GB: 'GB'
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export default {
|
||||
stream: '流式传输',
|
||||
endpoint: '服务端点'
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
import field from './field';
|
||||
|
||||
export default { field };
|
||||
@@ -0,0 +1,7 @@
|
||||
export default {
|
||||
id: '用户ID',
|
||||
isVerified: '是否实名',
|
||||
nickname: '昵称',
|
||||
username: '用户名',
|
||||
dateJoined: '注册时间'
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
import field from './field';
|
||||
|
||||
export default {
|
||||
field
|
||||
};
|
||||
@@ -27,5 +27,7 @@ export default {
|
||||
deleteRepositorySuccess: '删除知识库成功',
|
||||
deleteDocumentSuccess: '删除文档成功',
|
||||
currentRepository: '当前知识库',
|
||||
nameRequired: '名称不能为空'
|
||||
nameRequired: '名称不能为空',
|
||||
supportedFiles:
|
||||
'支持 .docx, .doc, .pdf, .txt, .csv, .enex, .epub, .eml, .html, .htm, .shtml, .md, .odt, .ppt, .pptx, .txt'
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios, { AxiosProgressEvent, AxiosResponse } from 'axios';
|
||||
import {
|
||||
IChatdocChatResponse,
|
||||
IChatdocConversation,
|
||||
IChatdocConversationResponse,
|
||||
IChatdocConversationsResponse,
|
||||
IChatdocDocumentResponse,
|
||||
IChatdocDocumentsResponse,
|
||||
@@ -279,8 +279,8 @@ class ChatdocOperator {
|
||||
|
||||
async chatConversation(
|
||||
payload: { repositoryId: string; question: string; id?: string; knowledgeFallback?: boolean },
|
||||
options: { token: string; stream: (response: IChatdocChatResponse) => void }
|
||||
): Promise<AxiosResponse<IChatdocChatResponse>> {
|
||||
options: { token: string; stream: (response: IChatdocConversationResponse) => void }
|
||||
): Promise<AxiosResponse<IChatdocConversationResponse>> {
|
||||
return await axios.post(
|
||||
`/chatdoc/conversations`,
|
||||
{
|
||||
@@ -304,7 +304,7 @@ class ChatdocOperator {
|
||||
if (lastLine) {
|
||||
const jsonData = JSON.parse(lastLine);
|
||||
if (options?.stream) {
|
||||
options?.stream(jsonData as IChatdocChatResponse);
|
||||
options?.stream(jsonData as IChatdocConversationResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,8 @@ export default defineComponent({
|
||||
this.messages[this.messages.length - 1].state = IChatdocMessageState.FINISHED;
|
||||
await this.$store.dispatch('chatdoc/setConversation', {
|
||||
id: conversationId,
|
||||
messages: this.messages
|
||||
messages: this.messages,
|
||||
repositoryId: this.repositoryId
|
||||
});
|
||||
this.answering = false;
|
||||
if (!this.conversationId) {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<upload-document />
|
||||
</div>
|
||||
<div class="documents">
|
||||
<el-table :data="documents" border>
|
||||
<el-table v-loading="loading" :data="documents" border>
|
||||
<el-table-column prop="id" label="ID" />
|
||||
<el-table-column prop="file_name" :label="$t('chatdoc.field.fileName')" />
|
||||
<el-table-column :label="$t('chatdoc.field.fileExtension')">
|
||||
@@ -49,7 +49,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column>
|
||||
<template #default="scope">
|
||||
<el-button type="danger" @click="onDelete(scope.row.id)">
|
||||
<el-button type="danger" size="small" @click="onDelete(scope.row.id)">
|
||||
{{ $t('common.button.delete') }}
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -64,7 +64,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import Layout from '@/layouts/Chatdoc.vue';
|
||||
import { IApplication, IChatdocRepository } from '@/models';
|
||||
import { IChatdocRepository } from '@/models';
|
||||
import { ElButton, ElTag, ElTable, ElTableColumn, ElMessage } from 'element-plus';
|
||||
import UploadDocument from '@/components/chatdoc/UploadDocument.vue';
|
||||
import { Status } from '@/models';
|
||||
|
||||
@@ -63,13 +63,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import {
|
||||
applicationOperator,
|
||||
IApplication,
|
||||
IApplicationDetailResponse,
|
||||
IOrderDetailResponse,
|
||||
orderOperator
|
||||
} from '@/operators';
|
||||
import { IApplication, IApplicationDetailResponse, IOrderDetailResponse } from '@/models';
|
||||
import {
|
||||
ElRow,
|
||||
ElCol,
|
||||
@@ -85,6 +79,7 @@ import {
|
||||
} from 'element-plus';
|
||||
import { ROUTE_CONSOLE_ORDER_DETAIL } from '@/router';
|
||||
import Price from '@/components/common/Price.vue';
|
||||
import { applicationOperator, orderOperator } from '@/operators';
|
||||
|
||||
interface IData {
|
||||
application: IApplication | undefined;
|
||||
|
||||
@@ -69,9 +69,9 @@ import { defineComponent } from 'vue';
|
||||
import { applicationOperator } from '@/operators';
|
||||
import Pagination from '@/components/common/Pagination.vue';
|
||||
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
||||
import { ElTable, ElRow, ElCol, ElTableColumn } from 'element-plus';
|
||||
import { ElTable, ElRow, ElCol, ElTableColumn, ElCard } from 'element-plus';
|
||||
import { ROUTE_CONSOLE_APPLICATION_BUY } from '@/router/constants';
|
||||
import { IApplication, IApplicationListResponse, IService } from '@/models';
|
||||
import { IApplication, IApplicationListResponse, ICredentialType, IService } from '@/models';
|
||||
|
||||
interface IData {
|
||||
applications: IApplication[];
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<h2 class="title">{{ $t('common.title.distribution') }}</h2>
|
||||
<p class="message mb-4">
|
||||
{{ $t('distribution.message.distributionDescription') }}
|
||||
</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
@@ -19,9 +16,9 @@
|
||||
</div>
|
||||
<div class="text-left">
|
||||
<p class="description">{{ $t('distribution.title.price') }}</p>
|
||||
<p class="value">¥{{ distributionStatus?.price?.toFixed(2) }}</p>
|
||||
<p class="value">${{ distributionStatus?.price?.toFixed(2) }}</p>
|
||||
</div>
|
||||
<el-button type="primary" class="btn" @click="goHistory"
|
||||
<el-button type="primary" size="small" class="btn" @click="goHistory"
|
||||
>{{ $t('distribution.button.detail') }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -36,10 +33,12 @@
|
||||
</div>
|
||||
<div class="text-left">
|
||||
<p class="description">{{ $t('distribution.title.reward') }}</p>
|
||||
<p class="value">¥{{ distributionStatus?.reward?.toFixed(2) }}</p>
|
||||
<p class="value">${{ distributionStatus?.reward?.toFixed(2) }}</p>
|
||||
</div>
|
||||
<el-tooltip effect="dark" :content="$t('distribution.message.howToWithdrawal')" placement="top">
|
||||
<el-button type="primary" class="btn">{{ $t('distribution.button.withdrawal') }} </el-button>
|
||||
<el-tooltip effect="dark" :content="$t('distribution.message.developingWithDrawal')" placement="top">
|
||||
<el-button type="primary" size="small" class="btn"
|
||||
>{{ $t('distribution.button.withdrawal') }}
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -69,7 +68,7 @@
|
||||
<p class="description">{{ $t('distribution.title.inviteesCount') }}</p>
|
||||
<p class="value">{{ inviteesCount }}</p>
|
||||
</div>
|
||||
<el-button type="primary" class="btn" @click="goInvitees"
|
||||
<el-button type="primary" size="small" class="btn" @click="goInvitees"
|
||||
>{{ $t('distribution.button.detail') }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -77,6 +76,60 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :md="12" :xs="24">
|
||||
<el-card shadow="hover" class="level-info mb-4">
|
||||
<el-skeleton v-if="loading" />
|
||||
<div v-else>
|
||||
<h4 class="title">
|
||||
{{ $t('distribution.title.levelInfo') }}
|
||||
</h4>
|
||||
<div class="clear-both overflow-hidden">
|
||||
<div class="float-left description">
|
||||
<p>{{ $t('distribution.title.currentLevel') }}: L{{ distributionStatus?.level?.level }}</p>
|
||||
<p>
|
||||
{{ $t('distribution.title.currentPercentage') }}:
|
||||
{{ distributionLevelMap[distributionStatus?.level?.level!]?.percentage }}%
|
||||
</p>
|
||||
</div>
|
||||
<div class="float-right description">
|
||||
<p>{{ $t('distribution.title.nextLevel') }}: L{{ distributionStatus?.level?.level! + 1 }}</p>
|
||||
<p>
|
||||
{{ $t('distribution.title.nextPercentage') }}:
|
||||
{{ distributionLevelMap[distributionStatus?.level?.level! + 1]?.percentage }}%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-progress
|
||||
:text-inside="true"
|
||||
:stroke-width="20"
|
||||
:percentage="getPercentageForNextLevel()"
|
||||
class="mb-2"
|
||||
>
|
||||
</el-progress>
|
||||
<p class="description">
|
||||
{{ $t('distribution.message.deltaPriceForNextLevel') }}: ${{ getDeltaForNextLevel() }}
|
||||
</p>
|
||||
<el-divider />
|
||||
<el-table v-if="distributionLevels" :data="distributionLevels" stripe>
|
||||
<el-table-column :label="$t('distribution.field.level')">
|
||||
<template #default="scope">
|
||||
<span class="level">L{{ scope.row?.level }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('distribution.field.threshold')">
|
||||
<template #default="scope">
|
||||
<span class="level">${{ scope.row?.threshold }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('distribution.field.percentage')">
|
||||
<template #default="scope">
|
||||
<span class="level">{{ scope.row?.percentage }}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :md="12" :xs="24">
|
||||
<el-card shadow="hover" class="distribution-info mb-4">
|
||||
<el-skeleton v-if="loading" />
|
||||
@@ -84,7 +137,7 @@
|
||||
<h4 class="title">
|
||||
{{ $t('distribution.title.distributionLink') }}
|
||||
</h4>
|
||||
<el-divider class="mt-4 mb-4" />
|
||||
<el-divider />
|
||||
<div class="link-wrapper">
|
||||
<font-awesome-icon v-if="false" icon="fa-solid fa-link" class="icon" />
|
||||
<a :href="distributionLink" class="link">
|
||||
@@ -92,14 +145,9 @@
|
||||
</a>
|
||||
<copy-to-clipboard :content="distributionLink" />
|
||||
</div>
|
||||
<div class="qr-wrapper">
|
||||
<qr-code
|
||||
v-if="distributionLink"
|
||||
:value="distributionLink"
|
||||
:size="150"
|
||||
class="block mb-2 ml-auto mr-auto"
|
||||
/>
|
||||
<p>
|
||||
<div class="qr-wrapper ml-auto mr-auto">
|
||||
<qr-code v-if="distributionLink" :value="distributionLink" :size="150" class="mb-2 ml-auto mr-auto" />
|
||||
<p class="mt-0">
|
||||
{{ $t('distribution.message.distributionQrDescription') }}
|
||||
</p>
|
||||
</div>
|
||||
@@ -118,65 +166,6 @@
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :md="12" :xs="24">
|
||||
<el-card shadow="hover" class="level-info mb-4">
|
||||
<el-skeleton v-if="loading" />
|
||||
<div v-else>
|
||||
<h4 class="title">
|
||||
{{ $t('distribution.title.levelInfo') }}
|
||||
</h4>
|
||||
<el-divider class="mt-4 mb-4" />
|
||||
<div class="clear-both overflow-hidden">
|
||||
<div class="float-left description">
|
||||
<p class="mt-0">
|
||||
{{ $t('distribution.title.currentLevel') }}: L{{ distributionStatus?.level?.level }}
|
||||
</p>
|
||||
<p class="mt-0">
|
||||
{{ $t('distribution.title.currentPercentage') }}:
|
||||
{{ distributionLevelMap[distributionStatus?.level?.level!]?.percentage }}%
|
||||
</p>
|
||||
</div>
|
||||
<div class="float-right description">
|
||||
<p class="mt-0">
|
||||
{{ $t('distribution.title.nextLevel') }}: L{{ distributionStatus?.level?.level! + 1 }}
|
||||
</p>
|
||||
<p class="mt-0">
|
||||
{{ $t('distribution.title.nextPercentage') }}:
|
||||
{{ distributionLevelMap[distributionStatus?.level?.level! + 1]?.percentage }}%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-progress
|
||||
:text-inside="true"
|
||||
:stroke-width="20"
|
||||
:percentage="getPercentageForNextLevel()"
|
||||
class="mb-2"
|
||||
>
|
||||
</el-progress>
|
||||
<p class="description">
|
||||
{{ $t('distribution.message.deltaPriceForNextLevel') }}: ¥{{ getDeltaForNextLevel() }}
|
||||
</p>
|
||||
<el-divider />
|
||||
<el-table v-if="distributionLevels" :data="distributionLevels" stripe>
|
||||
<el-table-column :label="$t('distribution.field.level')">
|
||||
<template #default="scope">
|
||||
<span class="level">L{{ scope.row?.level }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('distribution.field.threshold')">
|
||||
<template #default="scope">
|
||||
<span class="level">¥{{ scope.row?.threshold }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('distribution.field.percentage')">
|
||||
<template #default="scope">
|
||||
<span class="level">{{ scope.row?.percentage }}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -110,7 +110,10 @@ export const getConversations = async ({
|
||||
.then((response) => {
|
||||
log(getConversations, 'get conversations success', response.data?.items);
|
||||
commit('setConversations', response.data.items);
|
||||
resolve(response.data.items);
|
||||
const conversations = response.data.items;
|
||||
// reverse the order of conversations
|
||||
conversations.reverse();
|
||||
resolve(conversations);
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
|
||||
@@ -2,7 +2,15 @@ import { IRootState } from '../common/models';
|
||||
import { ActionContext } from 'vuex';
|
||||
import { log } from '@/utils/log';
|
||||
import { IChatdocState } from './models';
|
||||
import { IApplication, IChatdocConversation, IChatdocDocument, IChatdocRepository, IService, Status } from '@/models';
|
||||
import {
|
||||
IApplication,
|
||||
IChatdocConversation,
|
||||
IChatdocDocument,
|
||||
IChatdocMessage,
|
||||
IChatdocRepository,
|
||||
IService,
|
||||
Status
|
||||
} from '@/models';
|
||||
import { chatdocOperator, applicationOperator, serviceOperator } from '@/operators';
|
||||
import { CHATDOC_SERVICE_ID } from '@/constants';
|
||||
|
||||
@@ -168,6 +176,29 @@ export const createDocument = async (
|
||||
return document;
|
||||
};
|
||||
|
||||
export const setConversation = async (
|
||||
{ commit, state }: any,
|
||||
payload: {
|
||||
id: string;
|
||||
messages: IChatdocMessage[];
|
||||
repositoryId: string;
|
||||
}
|
||||
): Promise<void> => {
|
||||
log(setConversation, 'set conversation', payload);
|
||||
const repository: IChatdocRepository | undefined = state.repositories.find(
|
||||
(repository: IChatdocRepository) => repository.id === payload.repositoryId
|
||||
);
|
||||
const conversations = repository?.conversations;
|
||||
if (!conversations) {
|
||||
return Promise.reject('no conversations');
|
||||
}
|
||||
const index = conversations?.findIndex((conversation: IChatdocConversation) => conversation.id === payload.id);
|
||||
if (index > -1) {
|
||||
conversations[index].messages = payload.messages;
|
||||
}
|
||||
log(setConversation, 'set conversation success', conversations);
|
||||
};
|
||||
|
||||
export const getDocuments = async (
|
||||
{ commit, state }: ActionContext<IChatdocState, IRootState>,
|
||||
payload: { repositoryId: string }
|
||||
@@ -216,6 +247,8 @@ export const getConversations = async (
|
||||
token
|
||||
})
|
||||
).data.items;
|
||||
// reverse the order of conversations
|
||||
conversations.reverse();
|
||||
log(getConversations, 'get conversations success', conversations);
|
||||
commit('setRepository', {
|
||||
id: payload.repositoryId,
|
||||
@@ -247,6 +280,7 @@ export const getRepository = async (
|
||||
|
||||
export default {
|
||||
setService,
|
||||
setConversation,
|
||||
getService,
|
||||
createRepository,
|
||||
setApplication,
|
||||
|
||||
Reference in new issue
Block a user