Fix QR art issues (#35)
This commit is contained in:
1 parent
bbf40bee27
commit
cac7c91c02
50 files changed
+540
-340
No files matched your search
@@ -21,5 +21,3 @@ export default defineComponent({
|
||||
computed: {}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -7,6 +7,9 @@
|
||||
class="preview"
|
||||
@click="onSelectTask(task)"
|
||||
/>
|
||||
<p v-if="tasks?.items?.length === 0">
|
||||
{{ $t('qrart.message.noTasks') }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -28,10 +31,10 @@ export default defineComponent({
|
||||
},
|
||||
computed: {
|
||||
loading() {
|
||||
return this.$store.state.qrart.status.getApplication === Status.Request;
|
||||
return this.$store.state.qrart?.status?.getApplication === Status.Request;
|
||||
},
|
||||
tasks() {
|
||||
return this.$store.state.qrart.tasks;
|
||||
return this.$store.state.qrart?.tasks;
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { MIDJOURNEY_DEFAULT_RATIO } from '@/constants';
|
||||
import { QRART_DEFAULT_RATIO } from '@/constants';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'AspectRatioSelector',
|
||||
@@ -67,12 +67,12 @@ export default defineComponent({
|
||||
},
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart.config?.aspect_ratio;
|
||||
return this.$store.state.qrart?.config?.aspect_ratio;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set aspect ratio', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart.config,
|
||||
...this.$store.state.qrart?.config,
|
||||
aspect_ratio: val
|
||||
});
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export default defineComponent({
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = MIDJOURNEY_DEFAULT_RATIO;
|
||||
this.value = QRART_DEFAULT_RATIO;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,12 +22,12 @@ export default defineComponent({
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart.config?.content;
|
||||
return this.$store.state.qrart?.config?.content;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set content', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart.config,
|
||||
...this.$store.state.qrart?.config,
|
||||
content: val
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.preset') }}</h2>
|
||||
<el-select v-model="value" class="value" :placeholder="$t('qrart.placeholder.select')">
|
||||
<el-select v-model="value" clearable class="value" :placeholder="$t('qrart.placeholder.preset')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ElSlider } from 'element-plus';
|
||||
import InfoIcon from '@/components/common/InfoIcon.vue';
|
||||
import { QRART_DEFAULT_PRESET } from '@/constants';
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
@@ -125,12 +123,12 @@ export default defineComponent({
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart.config?.preset;
|
||||
return this.$store.state.qrart?.config?.preset;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set qrw', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart.config,
|
||||
...this.$store.state.qrart?.config,
|
||||
preset: val
|
||||
});
|
||||
}
|
||||
@@ -138,7 +136,7 @@ export default defineComponent({
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = QRART_DEFAULT_STEPS;
|
||||
this.value = QRART_DEFAULT_PRESET;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,12 +22,12 @@ export default defineComponent({
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart.config?.prompt;
|
||||
return this.$store.state.qrart?.config?.prompt;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set prompt', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart.config,
|
||||
...this.$store.state.qrart?.config,
|
||||
prompt: val
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,12 +21,12 @@ export default defineComponent({
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart.config?.qrw;
|
||||
return this.$store.state.qrart?.config?.qrw || QRART_DEFAULT_QRW;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set qrw', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart.config,
|
||||
...this.$store.state.qrart?.config,
|
||||
qrw: val
|
||||
});
|
||||
}
|
||||
@@ -34,6 +34,7 @@ export default defineComponent({
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
console.log('set default qrw');
|
||||
this.value = QRART_DEFAULT_QRW;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,12 +21,12 @@ export default defineComponent({
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart.config?.steps;
|
||||
return this.$store.state.qrart?.config?.steps || QRART_DEFAULT_STEPS;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set qrw', val);
|
||||
console.debug('set steps', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart.config,
|
||||
...this.$store.state.qrart?.config,
|
||||
steps: val
|
||||
});
|
||||
}
|
||||
@@ -34,6 +34,7 @@ export default defineComponent({
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
console.log('set default steps', QRART_DEFAULT_STEPS);
|
||||
this.value = QRART_DEFAULT_STEPS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
|
||||
const DEFAULT_TYPE = 'Link';
|
||||
import { QRART_DEFAULT_TYPE } from '@/constants';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'VersionSelector',
|
||||
@@ -43,12 +42,12 @@ export default defineComponent({
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart.config?.type;
|
||||
return this.$store.state.qrart?.config?.type;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set type', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart.config,
|
||||
...this.$store.state.qrart?.config,
|
||||
type: val
|
||||
});
|
||||
}
|
||||
@@ -56,7 +55,8 @@ export default defineComponent({
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = DEFAULT_TYPE;
|
||||
console.debug('set default type', QRART_DEFAULT_TYPE);
|
||||
this.value = QRART_DEFAULT_TYPE;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="detail">
|
||||
<div v-if="task" class="detail">
|
||||
<el-row class="h-full">
|
||||
<el-col :span="24" class="h-full">
|
||||
<el-row class="h-full main">
|
||||
@@ -33,7 +33,7 @@
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('qrart.name.prompt')">
|
||||
{{ task?.request?.prompt }}
|
||||
<copy-to-clipboard :content="task?.request?.prompt" class="btn-copy" />
|
||||
<copy-to-clipboard v-if="task?.request?.prompt" :content="task?.request?.prompt" class="btn-copy" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('qrart.name.size')">
|
||||
{{ task?.response?.image_width }} x {{ task?.response?.image_height }}
|
||||
@@ -43,7 +43,11 @@
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('qrart.name.seed')">
|
||||
{{ task?.request?.seed || task?.response?.seed }}
|
||||
<copy-to-clipboard :content="task?.request?.seed || task?.response?.seed" class="btn-copy" />
|
||||
<copy-to-clipboard
|
||||
v-if="task?.request?.seed || task?.response?.seed"
|
||||
:content="task?.request?.seed || task?.response?.seed"
|
||||
class="btn-copy"
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('qrart.name.steps')">
|
||||
{{ task?.request?.steps }}
|
||||
@@ -97,7 +101,7 @@ export default defineComponent({
|
||||
return this.$store.state.qrart?.application;
|
||||
},
|
||||
task() {
|
||||
return this.$store.state.qrart.tasks?.active;
|
||||
return this.$store.state.qrart?.tasks?.active;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -39,7 +39,7 @@ export default defineComponent({
|
||||
},
|
||||
computed: {
|
||||
application() {
|
||||
return this.$store.state.midjourney.application;
|
||||
return this.$store.state.qrart?.application;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in new issue
Block a user