Skip to content

Commit

Permalink
Fix experience bugs (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Germey authored Mar 24, 2024
1 parent bb5b422 commit 7e012aa
Show file tree
Hide file tree
Showing 260 changed files with 37,395 additions and 16,820 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix experience bugs",
"packageName": "@acedatacloud/hub",
"email": "[email protected]",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions src/assets/scss/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ body {
margin: 0;
height: 100%;
width: 100%;
overflow: hidden;
}

* {
Expand Down
2 changes: 1 addition & 1 deletion src/components/application/Confirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
>
<application-policy v-model.visible="showPolicy" />
</div>
<el-button type="primary" @click="onApply">{{ $t('common.button.apply') }}</el-button>
<el-button round type="primary" @click="onApply">{{ $t('common.button.apply') }}</el-button>
</div>
</el-dialog>
</template>
Expand Down
25 changes: 17 additions & 8 deletions src/components/application/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
{{ $t(`service.unit.` + application?.service?.unit + 's') }}
</span>
<span class="actions">
<el-button size="small" type="primary" @click="onBuyMore(application)">{{
<el-button round size="small" type="primary" @click="onBuyMore(application)">{{
$t('common.button.buyMore')
}}</el-button>
</span>
</div>
<div v-if="needApply && service" class="text-center info">
<span class="mr-2">{{ $t('chat.message.notApplied') }}</span>
<span>
<el-button type="primary" class="btn btn-apply" size="small" @click="confirming = true">
<el-button round type="primary" class="btn btn-apply" size="small" @click="confirming = true">
{{ $t('common.button.apply') }}
</el-button>
</span>
Expand All @@ -34,7 +34,7 @@

<script lang="ts">
import { defineComponent } from 'vue';
import { applicationOperator } from '@/operators';
import { applicationOperator, credentialOperator } from '@/operators';
import { ElButton, ElMessage, ElSkeleton, ElSkeletonItem } from 'element-plus';
import ApplicationConfirm from '@/components/application/Confirm.vue';
import { IApplicationType, IApplication, IApplicationDetailResponse, IService } from '@/models';
Expand Down Expand Up @@ -67,7 +67,7 @@ export default defineComponent({
default: false
}
},
emits: ['apply', 'refresh'],
emits: ['apply', 'refresh', 'applied', 'update:application'],
data(): IData {
return {
confirming: this.needApply,
Expand Down Expand Up @@ -106,10 +106,19 @@ export default defineComponent({
})
.then(({ data: data }: { data: IApplicationDetailResponse }) => {
ElMessage.success(this.$t('application.message.applySuccessfully'));
setTimeout(() => {
this.$emit('refresh');
}, 2000);
this.confirming = false;
credentialOperator
.create({
application_id: data.id
})
.then(() => {
setTimeout(() => {
this.$emit('refresh');
}, 2000);
this.confirming = false;
})
.finally(() => {
this.$emit('applied');
});
})
.catch((error) => {
if (error?.response?.data?.code === ERROR_CODE_DUPLICATION) {
Expand Down
25 changes: 12 additions & 13 deletions src/components/chat/InputBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
</span>
<el-input
v-model="questionValue"
:rows="1"
:rows="3"
:disabled="disabled"
class="input"
type="textarea"
:placeholder="$t('chat.message.newMessagePlaceholder')"
@keydown.enter.exact.prevent="onSubmit"
>
</el-input>
<p class="info">{{ $t('chat.message.howToUse') }}</p>
</div>
<p class="info">{{ $t('chat.message.howToUse') }}</p>
</template>

<script lang="ts">
Expand Down Expand Up @@ -140,14 +140,14 @@ export default defineComponent({

<style lang="scss">
.input-box {
position: relative;
.input {
textarea {
border: none;
background: none;
box-shadow: none;
resize: none;
line-height: 30px;
height: 40px;
}
}
.el-upload-list {
Expand All @@ -164,13 +164,11 @@ export default defineComponent({

<style lang="scss" scoped>
.input-box {
position: relative;
width: 100%;
border: 1px solid #eee;
border-radius: 10px;
background: none;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
top: 30px;
.upload {
display: inline-block;
&.disabled {
Expand All @@ -187,14 +185,6 @@ export default defineComponent({
width: calc(100% - 80px);
margin-left: 30px;
}
.info {
display: block;
position: absolute;
font-size: 12px;
color: #666;
margin-top: 5px;
margin-left: 3px;
}
.btn {
display: block;
z-index: 100;
Expand Down Expand Up @@ -223,4 +213,13 @@ export default defineComponent({
}
}
}
.info {
display: block;
font-size: 12px;
color: #666;
margin-top: 5px;
margin-left: 3px;
margin-bottom: 0;
}
</style>
1 change: 1 addition & 0 deletions src/components/chat/Introduction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export default defineComponent({
.subtitle {
text-align: center;
font-size: 18px;
margin-top: 10px;
margin-bottom: 40px;
}
.introduction-item {
Expand Down
2 changes: 1 addition & 1 deletion src/components/chat/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</div>
</div>
<el-alert v-if="errorText" class="error" :title="errorText" type="error" :closable="false" />
<el-button v-if="showBuyMore" type="primary" class="btn btn-buy" size="small" @click="onBuyMore">
<el-button v-if="showBuyMore" round type="primary" class="btn btn-buy" size="small" @click="onBuyMore">
{{ $t('common.button.buyMore') }}
</el-button>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/chatdoc/Conversations.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="panel">
<el-skeleton v-if="loading && conversations === undefined" />
<el-skeleton v-if="conversations === undefined" />
<div v-else class="conversations">
<div class="conversation" @click="onNewConversation">
<div class="icons">
Expand Down
2 changes: 1 addition & 1 deletion src/components/chatdoc/CreateRepository.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<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>
<el-button type="primary" round @click="onSubmit">{{ $t('common.button.create') }}</el-button>
</el-form-item>
</el-form>
</el-dialog>
Expand Down
24 changes: 12 additions & 12 deletions src/components/chatdoc/InputBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
</span>
<el-input
v-model="questionValue"
:rows="1"
:rows="3"
:disabled="disabled"
class="input"
type="textarea"
:placeholder="$t('chat.message.newMessagePlaceholder')"
@keydown.enter.exact.prevent="onSubmit"
>
</el-input>
<p class="info">{{ $t('chat.message.howToUse') }}</p>
</div>
<p class="info">{{ $t('chat.message.howToUse') }}</p>
</template>

<script lang="ts">
Expand Down Expand Up @@ -94,7 +94,6 @@ export default defineComponent({
box-shadow: none;
resize: none;
line-height: 30px;
height: 40px;
}
}
.el-upload-list {
Expand All @@ -117,20 +116,12 @@ export default defineComponent({
border-radius: 10px;
background: none;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
top: 30px;
.input {
border: none;
width: calc(100% - 80px);
margin-left: 5px;
}
.info {
display: block;
position: absolute;
font-size: 12px;
color: #666;
margin-top: 5px;
margin-left: 3px;
}
.btn {
display: block;
z-index: 100;
Expand All @@ -152,4 +143,13 @@ export default defineComponent({
}
}
}
.info {
display: block;
font-size: 12px;
color: #666;
margin-top: 5px;
margin-left: 3px;
margin-bottom: 0;
}
</style>
2 changes: 1 addition & 1 deletion src/components/chatdoc/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</div>
</div>
<el-alert v-if="errorText" class="error" :title="errorText" type="error" :closable="false" />
<el-button v-if="showBuyMore" type="primary" class="btn btn-buy" size="small" @click="onBuyMore">
<el-button v-if="showBuyMore" round type="primary" class="btn btn-buy" size="small" @click="onBuyMore">
{{ $t('common.button.buyMore') }}
</el-button>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/chatdoc/UploadDocument.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div v-if="learning">{{ $t('chatdoc.message.learningDocument') }}</div>
</el-upload>
</el-dialog>
<el-button type="primary" @click="dialogVisible = true">{{ $t('chatdoc.button.uploadDocuments') }}</el-button>
<el-button type="primary" round @click="dialogVisible = true">{{ $t('chatdoc.button.uploadDocuments') }}</el-button>
</template>

<script lang="ts">
Expand Down
8 changes: 4 additions & 4 deletions src/components/midjourney/ElementsSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2133,11 +2133,11 @@ export default defineComponent({
$height: 100px;
$width: 100px;
position: relative;
width: $height;
height: $width;
width: $width;
height: $height;
margin-right: 8px;
margin-bottom: 8px;
border-width: 2px;
border-width: 3px;
border-style: solid;
border-color: #eee;
border-radius: 5px;
Expand All @@ -2161,12 +2161,12 @@ export default defineComponent({
bottom: 0;
left: 0;
right: 0;
height: 20px;
width: $width;
background-color: rgba(0, 0, 0, 0.5);
color: white;
font-size: 10px;
text-align: center;
padding: 0 5px;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/components/midjourney/tasks/TaskBriefList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default defineComponent({
},
async mounted() {
await this.$store.dispatch('midjourney/setImagineTasks', undefined);
this.getImagineTasks();
// @ts-ignore
this.job = setInterval(() => {
this.getImagineTasks();
Expand Down
1 change: 1 addition & 0 deletions src/components/midjourney/tasks/TaskFullList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export default defineComponent({
},
async mounted() {
await this.$store.dispatch('midjourney/setImagineTasks', undefined);
this.getImagineTasks();
// @ts-ignore
this.job = setInterval(() => {
this.getImagineTasks();
Expand Down
10 changes: 5 additions & 5 deletions src/components/order/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<el-form label-width="100px">
<el-form-item :label="$t('application.field.service')">
<span v-if="application.type === applicationType.API">
{{ application?.api?.title }}
{{ application?.service?.title }}
</span>
</el-form-item>
<el-form-item :label="$t('application.field.package')">
<el-radio-group v-if="application.type === applicationType.API" v-model="form.packageId">
<el-radio-button v-for="(pkg, pkgIndex) in application?.api?.packages" :key="pkgIndex" :label="pkg.id">
{{ pkg.amount }}{{ $t(`api.unit.${application?.api?.unit}`) }}
<el-radio-button v-for="(pkg, pkgIndex) in application?.service?.packages" :key="pkgIndex" :label="pkg.id">
{{ pkg.amount }}{{ $t(`api.unit.${application?.service?.unit}`) }}
</el-radio-button>
<el-radio-button label="custom">
{{ $t('application.button.custom') }}
Expand All @@ -22,8 +22,8 @@
<div v-if="application.type === applicationType.API">
<price
v-if="form.packageId === 'custom'"
:price="application?.api?.price"
:unit="$t(`api.unit.${application?.api?.unit}`)"
:price="application?.service?.price"
:unit="$t(`api.unit.${application?.service?.unit}`)"
/>
<price v-else :price="package?.price" />
</div>
Expand Down
Loading

0 comments on commit 7e012aa

Please sign in to comment.