update quart style (#272)
Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
1 parent
3297e7a768
commit
874c634d96
10 files changed
+157
-212
No files matched your search
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"type": "patch",
|
||||
"comment": "fix qrart style",
|
||||
"packageName": "@acedatacloud/nexior",
|
||||
"email": "office@acedata.cloud",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
||||
@@ -1,18 +1,19 @@
|
||||
<template>
|
||||
<div class="panel">
|
||||
<div class="config">
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="flex-1 overflow-y-auto p-[15px]">
|
||||
<prompt-input class="mb-4" />
|
||||
<model-selector class="mb-4" />
|
||||
<ingredients-selector class="mb-4" />
|
||||
<effect-selector class="mb-4" />
|
||||
<image-url-input v-if="config?.ingredients" class="mb-4" />
|
||||
<ingredients-model-selector v-if="config?.ingredients" class="mb-4" />
|
||||
<div class="actions">
|
||||
<el-button type="primary" class="btn w-full" round @click="onGenerate">
|
||||
<font-awesome-icon icon="fa-solid fa-magic" class="mr-2" />
|
||||
{{ $t('pika.button.generate') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col items-center justify-center px-[15px] pb-[15px]">
|
||||
<consumption :value="consumption" :service="service" />
|
||||
<el-button type="primary" class="btn w-full" round @click="onGenerate">
|
||||
<font-awesome-icon icon="fa-solid fa-magic" class="mr-2" />
|
||||
{{ $t('pika.button.generate') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -27,12 +28,15 @@ import IngredientsModelSelector from './config/IngredientsModelSelector.vue';
|
||||
import ModelSelector from './config/ModelSelector.vue';
|
||||
import ImageUrlInput from './config/ImageUrlInput.vue';
|
||||
import PromptInput from './config/PromptInput.vue';
|
||||
import Consumption from '../common/Consumption.vue';
|
||||
import { getConsumption } from '@/utils';
|
||||
export default defineComponent({
|
||||
name: 'PresetPanel',
|
||||
components: {
|
||||
ImageUrlInput,
|
||||
ElButton,
|
||||
FontAwesomeIcon,
|
||||
Consumption,
|
||||
PromptInput,
|
||||
IngredientsSelector,
|
||||
IngredientsModelSelector,
|
||||
@@ -43,6 +47,12 @@ export default defineComponent({
|
||||
computed: {
|
||||
config() {
|
||||
return this.$store.state.pika?.config;
|
||||
},
|
||||
consumption() {
|
||||
return getConsumption(this.config, this.service?.metadata?.price);
|
||||
},
|
||||
service() {
|
||||
return this.$store.state.pika?.service;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -52,28 +62,3 @@ export default defineComponent({
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.panel {
|
||||
height: 100%;
|
||||
padding: 15px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
height: calc(100% - 40px);
|
||||
.config {
|
||||
width: 100%;
|
||||
height: calc(100% - 50px);
|
||||
flex: 1;
|
||||
}
|
||||
.actions {
|
||||
height: 50px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.btn {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,44 +1,27 @@
|
||||
<template>
|
||||
<div ref="panel" class="panel recent" @scroll="onHandleScroll">
|
||||
<div v-if="tasks?.items === undefined" class="tasks">
|
||||
<div v-for="_ in 3" :key="_" class="task placeholder">
|
||||
<div class="left">
|
||||
<el-skeleton animated>
|
||||
<template #template>
|
||||
<el-skeleton-item variant="image" class="avatar" />
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
<div class="main">
|
||||
<el-skeleton animated>
|
||||
<template #template>
|
||||
<el-skeleton-item variant="p" class="title" />
|
||||
<el-skeleton-item variant="image" class="icon" />
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="tasks?.items?.length && tasks?.items?.length > 0" class="tasks">
|
||||
<task-preview v-for="(task, taskIndex) in tasks?.items" :key="taskIndex" :model-value="task" class="preview" />
|
||||
</div>
|
||||
<p v-if="tasks?.items?.length === 0" class="w-full h-full flex items-center justify-center">
|
||||
{{ $t('pika.message.noTasks') }}
|
||||
</p>
|
||||
<div v-if="tasks?.items === undefined">
|
||||
<bot-placeholder />
|
||||
</div>
|
||||
<div v-else-if="tasks?.items?.length && tasks?.items?.length > 0" class="tasks h-full w-full overflow-y-auto">
|
||||
<task-preview v-for="(task, taskIndex) in tasks?.items" :key="taskIndex" :model-value="task" />
|
||||
</div>
|
||||
<div v-if="tasks?.items?.length === 0" class="w-full h-full flex items-center justify-center">
|
||||
<no-tasks />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import TaskPreview from './task/Preview.vue';
|
||||
import { ElSkeleton, ElSkeletonItem } from 'element-plus';
|
||||
import BotPlaceholder from '@/components/common/BotPlaceholder.vue';
|
||||
import NoTasks from '@/components/common/NoTasks.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'RecentPanel',
|
||||
components: {
|
||||
TaskPreview,
|
||||
ElSkeleton,
|
||||
ElSkeletonItem
|
||||
BotPlaceholder,
|
||||
NoTasks
|
||||
},
|
||||
emits: ['reach-top'],
|
||||
data() {
|
||||
@@ -66,76 +49,3 @@ export default defineComponent({
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
&.recent {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
overflow-y: auto;
|
||||
flex-direction: column;
|
||||
.preview {
|
||||
margin-right: 15px;
|
||||
}
|
||||
.description {
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
.tasks {
|
||||
width: 100%;
|
||||
.task {
|
||||
margin-bottom: 15px;
|
||||
width: 100%;
|
||||
height: fit-content;
|
||||
text-align: left;
|
||||
|
||||
&.placeholder {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.left {
|
||||
width: 70px;
|
||||
padding: 10px;
|
||||
|
||||
.avatar {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.main {
|
||||
width: calc(100% - 70px);
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.icon {
|
||||
display: flex;
|
||||
height: 200px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: block;
|
||||
width: 200px;
|
||||
height: 20px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.operations {
|
||||
height: fit-content !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -14,7 +14,7 @@
|
||||
<p v-if="modelValue?.request?.prompt" class="prompt mt-2">
|
||||
{{ modelValue?.request?.prompt }}
|
||||
<span v-if="!modelValue?.response"> - ({{ $t('pika.status.pending') }}) </span>
|
||||
<span v-if="video?.state === 'processing' || video?.state === 'pending' || video?.state === 'completed'">
|
||||
<span v-if="video?.state === 'processing' || video?.state === 'pending'">
|
||||
- ({{ $t('pika.status.processing') }})
|
||||
</span>
|
||||
</p>
|
||||
@@ -38,6 +38,11 @@
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<el-alert :closable="false" class="mt-2 success">
|
||||
<p v-if="modelValue?.request?.model" class="description">
|
||||
<font-awesome-icon icon="fa-solid fa-hashtag" class="mr-1" />
|
||||
{{ $t('pika.name.model') }}:
|
||||
{{ modelValue?.request?.model }}
|
||||
</p>
|
||||
<p class="description">
|
||||
<font-awesome-icon icon="fa-solid fa-magic" class="mr-1" />
|
||||
{{ $t('pika.name.taskId') }}:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="panel flex flex-col h-full">
|
||||
<div class="flex-1 overflow-y-scroll p-4">
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="flex-1 overflow-y-auto p-[15px]">
|
||||
<type-selector class="mb-4" />
|
||||
<content-input class="mb-4" />
|
||||
<prompt-input class="mb-4" />
|
||||
@@ -19,7 +19,8 @@
|
||||
<padding-level-selector v-if="config?.advanced" class="mb-4" />
|
||||
<padding-noise-selector v-if="config?.advanced" class="mb-4" />
|
||||
</div>
|
||||
<div class="h-12 px-4">
|
||||
<div class="flex flex-col items-center justify-center px-[15px] pb-[15px]">
|
||||
<consumption :value="consumption" :service="service" />
|
||||
<el-button type="primary" class="btn w-full" round @click="$emit('generate')">
|
||||
<font-awesome-icon icon="fa-solid fa-magic" class="mr-2" />
|
||||
{{ $t('qrart.button.generate') }}
|
||||
@@ -49,12 +50,15 @@ import ContentInput from './config/ContentInput.vue';
|
||||
import PromptInput from './config/PromptInput.vue';
|
||||
import { ElButton } from 'element-plus';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import Consumption from '../common/Consumption.vue';
|
||||
import { getConsumption } from '@/utils';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ConfigPanel',
|
||||
components: {
|
||||
ElButton,
|
||||
FontAwesomeIcon,
|
||||
Consumption,
|
||||
TypeSelector,
|
||||
PositionSelector,
|
||||
PixelStyleSelector,
|
||||
@@ -77,13 +81,13 @@ export default defineComponent({
|
||||
computed: {
|
||||
config() {
|
||||
return this.$store.state.qrart?.config;
|
||||
},
|
||||
consumption() {
|
||||
return getConsumption(this.config, this.service?.metadata?.price);
|
||||
},
|
||||
service() {
|
||||
return this.$store.state.qrart?.service;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.panel {
|
||||
border-right: 1px solid var(--el-border-color);
|
||||
}
|
||||
</style>
|
||||
@@ -1,56 +1,27 @@
|
||||
<template>
|
||||
<div
|
||||
ref="panel"
|
||||
class="panel recent flex flex-col items-center justify-center h-full w-full overflow-y-auto"
|
||||
@scroll="onHandleScroll"
|
||||
>
|
||||
<div v-if="tasks?.items === undefined" class="tasks w-full">
|
||||
<div v-for="_ in 3" :key="_" class="task placeholder flex flex-row w-full text-left mb-[15px]">
|
||||
<div class="left w-[70px] p-[10px]">
|
||||
<el-skeleton animated>
|
||||
<template #template>
|
||||
<el-skeleton-item variant="image" class="avatar w-[50px] h-[50px] rounded-full" />
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
<div class="main flex-1 p-[10px] mb-[10px]">
|
||||
<el-skeleton animated>
|
||||
<template #template>
|
||||
<el-skeleton-item variant="p" class="title block w-[200px] h-[20px] mb-[15px]" />
|
||||
<el-skeleton-item variant="image" class="icon flex h-[200px] w-[300px]" />
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="tasks?.items?.length && tasks?.items?.length > 0" class="tasks w-full">
|
||||
<task-preview
|
||||
v-for="(task, taskIndex) in tasks?.items"
|
||||
:key="taskIndex"
|
||||
:model-value="task"
|
||||
class="preview mr-[15px]"
|
||||
/>
|
||||
</div>
|
||||
<p
|
||||
v-if="tasks?.items?.length === 0"
|
||||
class="description text-left text-[14px] text-[var(--el-text-color-secondary)]"
|
||||
>
|
||||
{{ $t('qrart.message.noTasks') }}
|
||||
</p>
|
||||
<div v-if="tasks?.items === undefined">
|
||||
<bot-placeholder />
|
||||
</div>
|
||||
<div v-else-if="tasks?.items?.length && tasks?.items?.length > 0" class="tasks h-full w-full overflow-y-auto">
|
||||
<task-preview v-for="(task, taskIndex) in tasks?.items" :key="taskIndex" :model-value="task" />
|
||||
</div>
|
||||
<div v-if="tasks?.items?.length === 0" class="w-full h-full flex items-center justify-center">
|
||||
<no-tasks />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import TaskPreview from './task/Preview.vue';
|
||||
import { ElSkeleton, ElSkeletonItem } from 'element-plus';
|
||||
import BotPlaceholder from '@/components/common/BotPlaceholder.vue';
|
||||
import NoTasks from '@/components/common/NoTasks.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'RecentPanel',
|
||||
components: {
|
||||
TaskPreview,
|
||||
ElSkeleton,
|
||||
ElSkeletonItem
|
||||
BotPlaceholder,
|
||||
NoTasks
|
||||
},
|
||||
emits: ['reach-top'],
|
||||
data() {
|
||||
|
||||
@@ -23,24 +23,12 @@
|
||||
</p>
|
||||
</div>
|
||||
<div v-if="modelValue?.response?.success === true" :class="{ content: true, failed: true }">
|
||||
<div class="image-wrapper group relative w-fit min-h-[50px] min-w-[100px]">
|
||||
<img
|
||||
v-if="modelValue?.response?.image_url"
|
||||
v-loading="!modelValue?.response?.image_url"
|
||||
:src="modelValue?.response?.image_url"
|
||||
class="image mb-3 max-h-[400px] max-w-[300px] block w-fit group-hover:brightness-[0.6]"
|
||||
/>
|
||||
<el-button
|
||||
v-if="modelValue?.response?.image_url"
|
||||
type="info"
|
||||
round
|
||||
class="btn-raw absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-[1000] hidden group-hover:block"
|
||||
@click="onOpenUrl(modelValue?.response?.image_url)"
|
||||
>
|
||||
{{ $t('common.button.seeRawImage') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-alert :closable="false" class="mt-2 success border-l-[2px] border-solid border-[var(--el-color-success)]">
|
||||
<image-wrapper
|
||||
v-if="modelValue?.response?.image_url"
|
||||
:src="modelValue?.response?.image_url"
|
||||
:raw-src="modelValue?.response?.image_url"
|
||||
/>
|
||||
<el-alert :closable="false" class="mt-2 success">
|
||||
<p class="description">
|
||||
<font-awesome-icon icon="fa-solid fa-magic" class="mr-1" />
|
||||
{{ $t('qrart.name.taskId') }}:
|
||||
@@ -80,7 +68,7 @@
|
||||
</el-alert>
|
||||
</div>
|
||||
<div v-if="modelValue?.response?.success === false" :class="{ content: true }">
|
||||
<el-alert :closable="false" class="failure border-l-[2px] border-solid border-[var(--el-color-danger)]">
|
||||
<el-alert :closable="false" class="failure">
|
||||
<template #template>
|
||||
<font-awesome-icon icon="fa-solid fa-exclamation-triangle" class="mr-1" />
|
||||
{{ $t('qrart.name.failure') }}
|
||||
@@ -106,7 +94,7 @@
|
||||
</el-alert>
|
||||
</div>
|
||||
<div v-if="!modelValue?.response" :class="{ content: true }">
|
||||
<el-alert :closable="false" class="info border-l-[2px] border-solid border-[var(--el-color-info)]">
|
||||
<el-alert :closable="false" class="info">
|
||||
<template #template>
|
||||
<font-awesome-icon icon="fa-solid fa-exclamation-triangle" class="mr-1" />
|
||||
{{ $t('qrart.name.failure') }}
|
||||
@@ -129,6 +117,7 @@ import { ElImage, ElAlert, ElButton } from 'element-plus';
|
||||
import { IQrartTask } from '@/models';
|
||||
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import ImageWrapper from '@/components/common/ImageWrapper.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'TaskPreview',
|
||||
@@ -137,7 +126,7 @@ export default defineComponent({
|
||||
CopyToClipboard,
|
||||
FontAwesomeIcon,
|
||||
ElAlert,
|
||||
ElButton
|
||||
ImageWrapper
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
@@ -189,3 +178,77 @@ export default defineComponent({
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$left-width: 70px;
|
||||
.preview {
|
||||
width: 100%;
|
||||
height: fit-content;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: 15px;
|
||||
.left {
|
||||
width: $left-width;
|
||||
.avatar {
|
||||
background-color: white;
|
||||
padding: 2px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin: 10px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.main {
|
||||
flex: 1;
|
||||
width: calc(100% - $left-width);
|
||||
padding: 10px 10px 0 10px;
|
||||
|
||||
.bot {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: rgb(46, 204, 113);
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
.datetime {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
color: var(--el-text-color-secondary);
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
.prompt {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: var(--el-text-color-regular);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
.el-alert {
|
||||
border-left-width: 2px;
|
||||
border-left-style: solid;
|
||||
&.failure {
|
||||
border-color: var(--el-color-danger);
|
||||
}
|
||||
&.success {
|
||||
border-color: var(--el-color-success);
|
||||
}
|
||||
&.info {
|
||||
border-color: var(--el-color-info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.description {
|
||||
color: var(--el-text-color-regular);
|
||||
font-size: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -9,7 +9,7 @@
|
||||
<el-button circle class="menu" @click="drawer = true">
|
||||
<font-awesome-icon icon="fa-solid fa-magic" />
|
||||
</el-button>
|
||||
<el-drawer v-model="drawer" :with-header="false" size="350px">
|
||||
<el-drawer v-model="drawer" direction="ltr" :with-header="false" size="350px">
|
||||
<slot name="config" />
|
||||
</el-drawer>
|
||||
</div>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<div class="main flex flex-row flex-1">
|
||||
<div class="config w-[300px] h-full">
|
||||
<div class="config w-[300px] h-full overflow-y-scroll border-r border-[var(--el-border-color)]">
|
||||
<slot name="config" />
|
||||
</div>
|
||||
<div class="result h-full p-[15px] flex-1 flex flex-col">
|
||||
<slot name="result" />
|
||||
</div>
|
||||
<el-button circle class="menu" @click="drawer = true">
|
||||
<font-awesome-icon icon="fa-solid fa-gear" />
|
||||
<font-awesome-icon icon="fa-solid fa-magic" />
|
||||
</el-button>
|
||||
<el-drawer v-model="drawer" :with-header="false" size="340px" class="drawer">
|
||||
<el-drawer v-model="drawer" direction="ltr" :with-header="false" size="350px">
|
||||
<slot name="config" />
|
||||
</el-drawer>
|
||||
</div>
|
||||
|
||||
@@ -1 +1 @@
|
||||
export default ['qrart.credential', 'qrart.application', 'qrart.applications'];
|
||||
export default ['qrart.credential', 'qrart.application', 'qrart.applications', 'qrart.tasks'];
|
||||
Reference in new issue
Block a user