Skip to content

Commit

Permalink
Merge branch 'main' into hcode/add-luma
Browse files Browse the repository at this point in the history
  • Loading branch information
hyf-github-user authored Aug 16, 2024
2 parents 2e55c32 + ddfd1c8 commit aa2cadc
Show file tree
Hide file tree
Showing 364 changed files with 9,536 additions and 7,065 deletions.
90 changes: 90 additions & 0 deletions CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,96 @@
{
"name": "@acedatacloud/nexior",
"entries": [
{
"date": "Fri, 16 Aug 2024 08:07:12 GMT",
"version": "2.9.2",
"tag": "@acedatacloud/nexior_v2.9.2",
"comments": {
"patch": [
{
"author": "[email protected]",
"package": "@acedatacloud/nexior",
"commit": "49ab74e344d3c8165d8ede8ac97eed4ff1384643",
"comment": "fix application list apply"
}
]
}
},
{
"date": "Fri, 16 Aug 2024 07:42:29 GMT",
"version": "2.9.1",
"tag": "@acedatacloud/nexior_v2.9.1",
"comments": {
"patch": [
{
"author": "[email protected]",
"package": "@acedatacloud/nexior",
"commit": "acc99514ca9c6f30e24d549b3fdc47f8d59efa2b",
"comment": "fix retrieve task issue"
}
]
}
},
{
"date": "Thu, 15 Aug 2024 17:54:12 GMT",
"version": "2.9.0",
"tag": "@acedatacloud/nexior_v2.9.0",
"comments": {
"minor": [
{
"author": "[email protected]",
"package": "@acedatacloud/nexior",
"commit": "3fecca9369ee511d175963bbfb93a6f6f197b7de",
"comment": "fix chat restart"
}
]
}
},
{
"date": "Thu, 15 Aug 2024 16:33:11 GMT",
"version": "2.8.0",
"tag": "@acedatacloud/nexior_v2.8.0",
"comments": {
"minor": [
{
"author": "[email protected]",
"package": "@acedatacloud/nexior",
"commit": "14b04fe54f4260a580e1dcc912ee16eb2df33ed0",
"comment": "add subscriptions support"
}
]
}
},
{
"date": "Thu, 15 Aug 2024 16:11:49 GMT",
"version": "2.7.0",
"tag": "@acedatacloud/nexior_v2.7.0",
"comments": {
"minor": [
{
"author": "[email protected]",
"package": "@acedatacloud/nexior",
"commit": "1acebc565124e301ef249c03491b118d8f436d91",
"comment": "fix chat restart"
}
]
}
},
{
"date": "Wed, 14 Aug 2024 17:53:13 GMT",
"version": "2.6.1",
"tag": "@acedatacloud/nexior_v2.6.1",
"comments": {
"patch": [
{
"author": "[email protected]",
"package": "@acedatacloud/nexior",
"commit": "895f93d6366c026b78d920d91bb0eb2db4fbb8b7",
"comment": "fix edit message"
}
]
}
},
{
"date": "Wed, 14 Aug 2024 08:41:03 GMT",
"version": "2.6.0",
Expand Down
50 changes: 49 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,57 @@
# Change Log - @acedatacloud/nexior

This log was last generated on Wed, 14 Aug 2024 08:41:03 GMT and should not be manually modified.
This log was last generated on Fri, 16 Aug 2024 08:07:12 GMT and should not be manually modified.

<!-- Start content -->

## 2.9.2

Fri, 16 Aug 2024 08:07:12 GMT

### Patches

- fix application list apply ([email protected])

## 2.9.1

Fri, 16 Aug 2024 07:42:29 GMT

### Patches

- fix retrieve task issue ([email protected])

## 2.9.0

Thu, 15 Aug 2024 17:54:12 GMT

### Minor changes

- fix chat restart ([email protected])

## 2.8.0

Thu, 15 Aug 2024 16:33:11 GMT

### Minor changes

- add subscriptions support ([email protected])

## 2.7.0

Thu, 15 Aug 2024 16:11:49 GMT

### Minor changes

- fix chat restart ([email protected])

## 2.6.1

Wed, 14 Aug 2024 17:53:13 GMT

### Patches

- fix edit message ([email protected])

## 2.6.0

Wed, 14 Aug 2024 08:41:03 GMT
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acedatacloud/nexior",
"version": "2.6.0",
"version": "2.9.2",
"author": "Germey Technology <[email protected]>",
"repository": {
"type": "git",
Expand Down
1 change: 0 additions & 1 deletion src/components/application/Confirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import { getBaseUrlPlatform } from '@/utils';
interface IData {
checked: boolean;
showPolicy: boolean;
}
export default defineComponent({
Expand Down
10 changes: 7 additions & 3 deletions src/components/application/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
</el-skeleton>
</div>
<div v-else-if="application" class="status">
<span class="info">
<span v-if="application.type === 'Period'" class="info">
{{ $t('common.message.expiredAt') }}:
{{ $dayjs.format(application.expired_at) }}
</span>
<span v-if="application.type === 'Usage'" class="info">
{{ $t('common.message.remainingAmount') }}:
{{ application?.remaining_amount?.toFixed(6) }}
{{ $t(`service.unit.` + application?.service?.unit + 's') }}
Expand Down Expand Up @@ -49,7 +53,7 @@ import { ElButton, ElMessage, ElSkeleton, ElSkeletonItem } from 'element-plus';
import ApplicationConfirm from '@/components/application/Confirm.vue';
import { IApplicationType, IApplication, IApplicationDetailResponse, IService } from '@/models';
import { ERROR_CODE_DUPLICATION } from '@/constants/errorCode';
import { ROUTE_CONSOLE_APPLICATION_BUY } from '@/router';
import { ROUTE_CONSOLE_APPLICATION_SUBSCRIBE } from '@/router';
import ApiPrice from '@/components/api/Price.vue';
export interface IData {
Expand Down Expand Up @@ -117,7 +121,7 @@ export default defineComponent({
methods: {
onBuyMore(application: IApplication) {
this.$router.push({
name: ROUTE_CONSOLE_APPLICATION_BUY,
name: ROUTE_CONSOLE_APPLICATION_SUBSCRIBE,
params: {
id: application.id
}
Expand Down
67 changes: 41 additions & 26 deletions src/components/chat/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,29 @@
@keydown.enter.exact.prevent="sendEdit"
></el-input>
<div class="button-group">
<el-button size="small" class="cancel-button" @click="cancelEdit">取消</el-button>
<el-button type="primary" size="small" class="send-button" @click="sendEdit">发送</el-button>
<el-button size="small" round @click="cancelEdit">{{ $t('common.button.cancel') }}</el-button>
<el-button type="primary" size="small" round @click="sendEdit">{{ $t('common.button.confirm') }}</el-button>
</div>
</div>
<answering-mark v-if="message.state === messageState.PENDING" />
</div>

<div class="operations">
<copy-to-clipboard v-if="!Array.isArray(message.content)" :content="message.content!" class="btn-copy" />
<copy-to-clipboard
v-if="!Array.isArray(message.content) && message.state === messageState.FINISHED"
:content="message.content!"
class="btn-copy"
/>
<restart-to-generate
v-if="
!Array.isArray(message.content) &&
message.state === messageState.FINISHED &&
message.role === 'assistant' &&
message === messages[messages.length - 1]
"
class="btn-restart"
:messages="messages"
@restart="sendRestart"
/>
</div>
</div>
<el-alert v-else class="error" :title="errorText" type="error" :closable="false" />
Expand All @@ -74,7 +88,8 @@ import { ElAlert, ElButton, ElImage, ElTooltip, ElInput } from 'element-plus';
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { IApplication, IChatMessage, IChatMessageState } from '@/models';
import CopyToClipboard from '../common/CopyToClipboard.vue';
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
import RestartToGenerate from './RestartToGenerate.vue';
import {
ERROR_CODE_API_ERROR,
ERROR_CODE_BAD_REQUEST,
Expand All @@ -86,7 +101,7 @@ import {
ERROR_CODE_USED_UP,
ROLE_ASSISTANT
} from '@/constants';
import { ROUTE_CONSOLE_APPLICATION_BUY } from '@/router';
import { ROUTE_CONSOLE_APPLICATION_EXTRA } from '@/router';
interface IData {
copied: boolean;
Expand All @@ -99,6 +114,7 @@ export default defineComponent({
name: 'Message',
components: {
CopyToClipboard,
RestartToGenerate,
AnsweringMark,
MarkdownRenderer,
ElAlert,
Expand All @@ -109,6 +125,11 @@ export default defineComponent({
ElInput
},
props: {
messages: {
type: Array,
required: false,
default: () => []
},
message: {
type: Object as () => IChatMessage,
required: true
Expand All @@ -118,7 +139,7 @@ export default defineComponent({
required: true
}
},
emits: ['stop', 'update:messages', 'edit'],
emits: ['stop', 'edit', 'restart'],
data(): IData {
return {
copied: false,
Expand Down Expand Up @@ -166,6 +187,10 @@ export default defineComponent({
cancelEdit() {
this.isEditing = false;
},
sendRestart() {
// Implement the logic to save the edited content
this.$emit('restart', this.message);
},
sendEdit() {
// Implement the logic to save the edited content
this.isEditing = false;
Expand All @@ -185,7 +210,7 @@ export default defineComponent({
},
onBuyMore() {
this.$router.push({
name: ROUTE_CONSOLE_APPLICATION_BUY,
name: ROUTE_CONSOLE_APPLICATION_EXTRA,
params: {
id: this.application?.id
}
Expand Down Expand Up @@ -270,6 +295,7 @@ export default defineComponent({
// background-color: var(--el-bg-color-page);
// color: var(--el-text-color-primary);
padding: 10px;
min-width: 400px;
width: 100%;
height: 100%;
.chat-input {
Expand All @@ -282,23 +308,6 @@ export default defineComponent({
position: absolute;
bottom: 10px;
right: 10px;
.cancel-button {
// background-color: #333;
// color: white;
background-color: var(--el-bg-color-page);
color: var(--el-text-color-primary);
border-radius: 20px;
// border: none;
}
.send-button {
// background-color: white;
// color: black;
background-color: var(--el-bg-color-page);
color: var(--el-text-color-primary);
border-radius: 20px;
// border: none;
}
}
}
}
Expand Down Expand Up @@ -329,7 +338,13 @@ export default defineComponent({
}
.operations {
display: block;
display: flex; // Use flexbox for better alignment
gap: 10px; // Adjust the gap value as needed
margin-left: 5px; // Adjust the value as needed
.btn-restart {
color: var(--el-text-color-regular);
font-size: 14px;
}
.btn-copy {
color: var(--el-text-color-regular);
font-size: 14px;
Expand Down
45 changes: 45 additions & 0 deletions src/components/chat/RestartToGenerate.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<template>
<el-tooltip effect="dark" :content="$t('common.button.restart')" placement="top-start">
<font-awesome-icon icon="fa-solid fa-sync" class="icon-sync" @click="onRestart" />
</el-tooltip>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { ElTooltip } from 'element-plus';
export default defineComponent({
name: 'CopyToClipboard',
components: {
FontAwesomeIcon,
ElTooltip
},
props: {
messages: {
type: Array,
required: false,
default: () => []
}
},
emits: ['restart'],
data() {
return {
copied: false
};
},
methods: {
onRestart() {
this.$emit('restart');
}
}
});
</script>

<style lang="scss" scoped>
.icon-sync {
margin-left: 5px;
cursor: pointer;
color: inherit;
}
</style>
Loading

0 comments on commit aa2cadc

Please sign in to comment.