Fix experience bugs (#9)

This commit is contained in:
AceDataCloud committed 2024-03-24 23:27:13 +08:00
1 parent c300500135
commit b35d5a926a
260 files changed
+36865 -16290

No files matched your search

+1 -2
View File
@@ -296,7 +296,7 @@ export default defineComponent({
.dialogue {
flex: 1;
overflow-y: scroll;
margin: 20px 0;
padding: 20px 0;
position: relative;
.messages {
padding-top: 30px;
@@ -307,6 +307,5 @@ export default defineComponent({
}
.bottom {
width: 100%;
height: 90px;
}
</style>
+4 -4
View File
@@ -218,7 +218,7 @@ export default defineComponent({
data = JSON.parse(data);
}
if (this.messages && this.messages.length > 0) {
this.messages[this.messages.length - 1].error = data;
this.messages[this.messages.length - 1].error = data.error;
}
} else {
if (this.messages && this.messages.length > 0) {
@@ -256,10 +256,9 @@ export default defineComponent({
.dialogue {
flex: 1;
overflow-y: scroll;
margin: 20px 0;
padding: 20px 0;
position: relative;
.messages {
padding-top: 30px;
.message {
margin-bottom: 15px;
}
@@ -267,7 +266,8 @@ export default defineComponent({
}
.bottom {
width: 100%;
height: 90px;
display: flex;
flex-direction: column;
}
}
</style>
+34 -28
View File
@@ -133,6 +133,8 @@ export default defineComponent({
height: 100%;
padding: 20px;
background-color: #f2f3f5;
display: flex;
flex-direction: column;
}
.title {
@@ -152,39 +154,43 @@ export default defineComponent({
width: fit-content;
}
.repository {
width: 100%;
height: 150px;
margin-bottom: 20px;
cursor: pointer;
position: relative;
.repositories {
flex: 1;
overflow-y: scroll;
.repository {
width: 100%;
height: 150px;
margin-bottom: 20px;
cursor: pointer;
position: relative;
.el-dropdown {
position: absolute;
right: 20px;
top: 20px;
}
.el-dropdown {
position: absolute;
right: 20px;
top: 20px;
}
.operation {
font-size: 16px;
font-weight: bold;
margin-bottom: 10px;
}
.operation {
font-size: 16px;
font-weight: bold;
margin-bottom: 10px;
}
.name {
font-size: 16px;
font-weight: bold;
margin-bottom: 10px;
}
.name {
font-size: 16px;
font-weight: bold;
margin-bottom: 10px;
}
.id {
font-size: 12px;
color: #333;
}
.id {
font-size: 12px;
color: #333;
}
.description {
font-size: 12px;
color: #666;
.description {
font-size: 12px;
color: #666;
}
}
}
</style>
+11
View File
@@ -46,6 +46,7 @@
size="large"
class="btn-create"
:loading="creating"
round
@click="onCreateOrder"
>
{{ $t('application.button.createOrder') }}
@@ -206,6 +207,16 @@ export default defineComponent({
.el-card {
padding: 50px 0;
.price {
font-size: 20px;
font-weight: bold;
&.unfree {
color: #ff5441;
}
&.free {
color: #29c287;
}
}
}
}
+12 -2
View File
@@ -16,7 +16,7 @@
table-layout="fixed"
:empty-text="$t('common.message.noData')"
>
<el-table-column prop="id" :label="$t('application.field.id')" width="220px" class-name="text-center">
<el-table-column prop="id" :label="$t('application.field.id')" width="240px" class-name="text-center">
<template #default="scope">
<span>{{ scope.row.id }}</span>
<span class="copy">
@@ -49,6 +49,15 @@
<span>{{ getUsedAmount(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" width="360px">
<template #default="scope">
<div class="float-right">
<el-button type="primary" size="small" @click="onBuyMore(scope?.row)">
{{ $t('application.button.buyMore') }}
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
@@ -69,7 +78,7 @@ 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, ElCard } from 'element-plus';
import { ElTable, ElRow, ElCol, ElTableColumn, ElCard, ElButton } from 'element-plus';
import { ROUTE_CONSOLE_APPLICATION_BUY } from '@/router/constants';
import { IApplication, IApplicationListResponse, ICredentialType, IService } from '@/models';
@@ -96,6 +105,7 @@ export default defineComponent({
CopyToClipboard,
ElTable,
ElRow,
ElButton,
ElCol,
ElTableColumn,
ElCard
+13 -25
View File
@@ -10,62 +10,50 @@
<el-col :span="24">
<el-card shadow="hover">
<el-row>
<el-col :span="12" :offset="6">
<el-col :span="14" :offset="5">
<div v-if="loading" class="pt-5">
<el-skeleton animated />
</div>
<div v-else class="order">
<el-descriptions :column="1">
<el-descriptions-item :label="$t('order.field.id')">{{ order?.id }}</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.id')">
<span>{{ order?.id }} </span>
<copy-to-clipboard v-if="order?.id" :content="order?.id" class="inline-block" />
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.description')">
{{ order?.description }}
</el-descriptions-item>
<el-descriptions-item
v-if="order?.application?.type === applicationType.API"
:label="$t('order.field.api')"
>
{{ order?.application?.api?.title }}
<el-descriptions-item v-if="order?.application?.service" :label="$t('order.field.api')">
{{ order?.application?.service?.title }}
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.amount')">
<span v-if="order?.application?.type === applicationType.API">
{{ order?.amount }}{{ $t(`api.unit.${order?.application?.api?.unit}`) }}
</span>
{{ order?.amount }} {{ $t(`service.unit.${order?.application?.service?.unit}`) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.createdAt')">
{{ $dayjs.format(order?.created_at) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.price')">
<span v-if="order?.price && order?.price > 0" class="price unfree">
¥{{ order?.price?.toFixed(2) }}
${{ order?.price?.toFixed(2) }}
</span>
<span v-else class="price free"> {{ $t('order.message.free') }} </span>
</el-descriptions-item>
<el-descriptions-item v-if="order?.pay_way" :label="$t('order.field.payWay')">
<span v-if="order?.pay_way === PayWay.WechatPay">
{{ $t('order.title.wechatPay') }}
</span>
<span v-if="order?.pay_way === PayWay.AliPay">
{{ $t('order.title.aliPay') }}
</span>
<span v-if="order?.pay_way === PayWay.Stripe">
{{ $t('order.title.stripe') }}
</span>
</el-descriptions-item>
</el-descriptions>
</div>
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.PAID" class="mb-5">
<el-col :span="12" :offset="6">
<el-col :span="14" :offset="5">
<el-divider border-style="dashed" />
<el-alert :title="$t('order.message.paidSuccessfully')" type="success" show-icon :closable="false" />
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.PENDING || order?.state === OrderState.FAILED">
<el-col :span="12" :offset="6">
<el-col :span="14" :offset="5">
<el-divider border-style="dashed" />
<div v-if="order.price && order.price > 0 && !order.pay_way" class="payways mb-4">
<div
v-if="false"
:class="{
payway: true,
wechatpay: true,
@@ -180,7 +168,7 @@ export default defineComponent({
data(): IData {
return {
PayWay: PayWay,
payWay: PayWay.WechatPay,
payWay: PayWay.Stripe,
OrderState: OrderState,
order: undefined,
loading: false,
+2
View File
@@ -55,6 +55,7 @@
<el-button
v-if="scope.row.state !== OrderState.PAID"
type="primary"
size="small"
@click="
$router.push({
name: 'console-order-detail',
@@ -68,6 +69,7 @@
</el-button>
<el-button
v-else
size="small"
@click="
$router.push({
name: 'console-order-detail',
+7 -2
View File
@@ -138,7 +138,7 @@
{{ $t('distribution.title.distributionLink') }}
</h4>
<el-divider />
<div class="link-wrapper">
<div class="link-wrapper text-center">
<font-awesome-icon v-if="false" icon="fa-solid fa-link" class="icon" />
<a :href="distributionLink" class="link">
{{ distributionLink }}
@@ -146,7 +146,12 @@
<copy-to-clipboard :content="distributionLink" />
</div>
<div class="qr-wrapper ml-auto mr-auto">
<qr-code v-if="distributionLink" :value="distributionLink" :size="150" class="mb-2 ml-auto mr-auto" />
<qr-code
v-if="distributionLink"
:value="distributionLink"
:size="150"
class="block mb-2 ml-auto mr-auto"
/>
<p class="mt-0">
{{ $t('distribution.message.distributionQrDescription') }}
</p>
+4 -6
View File
@@ -11,7 +11,7 @@
:service="service"
:need-apply="needApply"
class="mb-4"
@refresh="onGetApplications"
@refresh="onGetApplication"
/>
<div class="pt-4">
<reference-image class="mb-4" @change="references = $event" />
@@ -46,7 +46,7 @@ import TaskBriefList from '@/components/midjourney/tasks/TaskBriefList.vue';
import FinalPrompt from '@/components/midjourney/FinalPrompt.vue';
import { ERROR_CODE_DUPLICATION } from '@/constants/errorCode';
import { MidjourneyImagineMode, Status } from '@/models';
import { IMidjourneyImagineRequest, IApplicationDetailResponse, IApplication, MidjourneyImagineAction } from '@/models';
import { IMidjourneyImagineRequest, IApplicationDetailResponse, MidjourneyImagineAction } from '@/models';
interface IData {
prompt: string;
@@ -143,9 +143,6 @@ export default defineComponent({
return this.prompt || this.references?.length > 0 ? content : '';
}
},
async mounted() {
await this.onGetApplications();
},
methods: {
onApply() {
applicationOperator
@@ -163,7 +160,7 @@ export default defineComponent({
}
});
},
async onGetApplications() {
async onGetApplication() {
await this.$store.dispatch('midjourney/getApplication');
},
async onStartTask(request: IMidjourneyImagineRequest) {
@@ -172,6 +169,7 @@ export default defineComponent({
console.error('no token specified');
return;
}
ElMessage.success(this.$t('midjourney.message.startingTask'));
midjourneyOperator
.imagine(request, {
token