Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add round style for button and fix model name #17

Merged
merged 3 commits into from
Apr 5, 2024
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
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix wrong model name",
"packageName": "@acedatacloud/hub",
"email": "germey@acedata.cloud",
"dependentChangeType": "patch"
}
10 changes: 9 additions & 1 deletion src/components/chat/ModelSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,15 @@ export default defineComponent({
},
computed: {
model() {
return this.$store.state.chat.model;
const modelName = this.$store.state.chat.model.name;
const model = [
CHAT_MODEL_GPT_3_5,
CHAT_MODEL_GPT_3_5_BROWSING,
CHAT_MODEL_GPT_4,
CHAT_MODEL_GPT_4_BROWSING,
CHAT_MODEL_GPT_4_VISION
].find((model) => model.name === modelName);
return model;
}
},
methods: {
Expand Down
9 changes: 1 addition & 8 deletions src/pages/chat/Conversation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,7 @@ import axios from 'axios';
import { defineComponent } from 'vue';
import Message from '@/components/chat/Message.vue';
import { ROLE_ASSISTANT, ROLE_USER } from '@/constants';
import {
IChatModel,
IApplication,
IChatMessageState,
IChatConversationResponse,
IChatConversation,
IChatMessage
} from '@/models';
import { IChatModel, IChatMessageState, IChatConversationResponse, IChatConversation, IChatMessage } from '@/models';
import InputBox from '@/components/chat/InputBox.vue';
import ModelSelector from '@/components/chat/ModelSelector.vue';
import { ERROR_CODE_CANCELED, ERROR_CODE_NOT_APPLIED, ERROR_CODE_UNKNOWN } from '@/constants/errorCode';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/console/application/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<el-table-column fixed="right" width="120px">
<template #default="scope">
<div class="float-right">
<el-button type="primary" size="small" @click="onBuyMore(scope?.row)">
<el-button type="primary" round size="small" @click="onBuyMore(scope?.row)">
{{ $t('application.button.buyMore') }}
</el-button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/console/order/Detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@
</div>
</div>
<div v-if="!order?.pay_way">
<el-button :loading="prepaying" type="primary" size="large" class="btn-pay" @click="onPay">{{
<el-button :loading="prepaying" round type="primary" size="large" class="btn-pay" @click="onPay">{{
$t('common.button.pay')
}}</el-button>
</div>
<div v-else>
<el-button type="primary" size="large" class="btn-repay" @click="onRepay">{{
<el-button type="primary" round size="large" class="btn-repay" @click="onRepay">{{
$t('common.button.repay')
}}</el-button>
</div>
Expand Down
26 changes: 14 additions & 12 deletions src/pages/console/order/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@
<span class="price">¥{{ scope.row?.price?.toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('order.field.createdAt')" width="180px">
<template #default="scope">
<span class="created-at">{{ $dayjs.format(scope.row.created_at) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('order.field.description')" width="300px">
<template #default="scope">
<span class="description">{{ scope.row.description }}</span>
</template>
</el-table-column>
<el-table-column prop="state" :label="$t('order.field.state')" class-name="text-center">
<el-table-column prop="state" :label="$t('order.field.state')" class-name="text-center" width="120px">
<template #default="scope">
<span v-if="scope.row.state === OrderState?.PENDING">
<el-tag type="info" class="mx-1" effect="dark">{{ $t('order.state.pending') }}</el-tag>
Expand All @@ -49,13 +39,24 @@
</span>
</template>
</el-table-column>
<el-table-column min-width="120px">
<el-table-column :label="$t('order.field.description')" width="300px">
<template #default="scope">
<span class="description">{{ scope.row.description }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('order.field.createdAt')" width="180px">
<template #default="scope">
<span class="created-at">{{ $dayjs.format(scope.row.created_at) }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" min-width="120px">
<template #default="scope">
<div class="float-right">
<el-button
v-if="scope.row.state !== OrderState.PAID"
type="primary"
size="small"
round
@click="
$router.push({
name: 'console-order-detail',
Expand All @@ -70,6 +71,7 @@
<el-button
v-else
size="small"
round
@click="
$router.push({
name: 'console-order-detail',
Expand Down
10 changes: 5 additions & 5 deletions src/pages/distribution/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<p class="description">{{ $t('distribution.title.price') }}</p>
<p class="value">${{ distributionStatus?.price?.toFixed(2) }}</p>
</div>
<el-button type="primary" size="small" class="btn" @click="goHistory"
<el-button type="primary" round size="small" class="btn" @click="goHistory"
>{{ $t('distribution.button.detail') }}
</el-button>
</div>
Expand All @@ -36,7 +36,7 @@
<p class="value">${{ distributionStatus?.reward?.toFixed(2) }}</p>
</div>
<el-tooltip effect="dark" :content="$t('distribution.message.developingWithDrawal')" placement="top">
<el-button type="primary" size="small" class="btn"
<el-button type="primary" round size="small" class="btn"
>{{ $t('distribution.button.withdrawal') }}
</el-button>
</el-tooltip>
Expand Down Expand Up @@ -68,7 +68,7 @@
<p class="description">{{ $t('distribution.title.inviteesCount') }}</p>
<p class="value">{{ inviteesCount }}</p>
</div>
<el-button type="primary" size="small" class="btn" @click="goInvitees"
<el-button type="primary" round size="small" class="btn" @click="goInvitees"
>{{ $t('distribution.button.detail') }}
</el-button>
</div>
Expand Down Expand Up @@ -364,7 +364,7 @@ export default defineComponent({
margin: 0;
}
.description {
color: var(--el-text-color-secondary);
color: var(--el-text-color-regular);
font-size: 14px;
margin-bottom: 5px;
}
Expand Down Expand Up @@ -406,7 +406,7 @@ export default defineComponent({
font-size: 14px;
margin-bottom: 10px;
.more {
color: var(--el-color-primary);
color: var(--el-color-regular);
cursor: pointer;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/midjourney/History.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@refresh="onGetApplications"
/>
<task-full-list @custom="onCustom" />
<el-button type="primary" class="btn btn-generate" @click="onGenerateNew">
<el-button type="primary" round class="btn btn-generate" @click="onGenerateNew">
<font-awesome-icon icon="fa-solid fa-chevron-left" class="icon icon-rotate mr-1" />
{{ $t('midjourney.button.generateNew') }}
</el-button>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/midjourney/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<elements-selector v-model="elements" :advanced="preset?.advanced" class="mb-4" />
<ignore-selector v-if="preset?.advanced" v-model="ignore" class="mb-4" />
<final-prompt v-if="finalPrompt" :model-value="finalPrompt" />
<el-button type="primary" class="btn btn-generate" :disabled="!finalPrompt" @click="onGenerate">
<el-button type="primary" round class="btn btn-generate" :disabled="!finalPrompt" @click="onGenerate">
{{ $t('midjourney.button.generate') }}
</el-button>
</div>
Expand Down
Loading