update styles
This commit is contained in:
1 parent
f6b119f34f
commit
80abc61b80
17 files changed
+91
-24
No files matched your search
@@ -35,6 +35,7 @@
|
||||
"element-plus": "^2.2.28",
|
||||
"github-markdown-css": "^5.1.0",
|
||||
"highlight.js": "^11.7.0",
|
||||
"mac-scrollbar": "^0.13.5",
|
||||
"markdown-it": "^13.0.1",
|
||||
"mustache": "^4.2.0",
|
||||
"programming-languages-logos": "^0.0.3",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<chaos-selector v-if="preset.advanced" v-model="preset.chaos" class="mb-4" />
|
||||
<image-weight-selector v-if="preset.advanced" v-model="preset.iw" class="mb-4" />
|
||||
<niji-selector v-if="false" v-model="preset.niji" class="mb-4" />
|
||||
<raw-selector v-if="preset.model == 'MJ' && preset.advanced" v-model="preset.raw" class="mb-4" />
|
||||
<raw-selector v-if="!preset.model && preset.advanced" v-model="preset.raw" class="mb-4" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -64,8 +64,13 @@ export default defineComponent({
|
||||
preset: {
|
||||
handler(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
console.debug('preset changed', val);
|
||||
this.$store.dispatch('setMidjourney', {
|
||||
preset: val
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<h2 class="title">{{ $t('midjourney.name.prompt') }}</h2>
|
||||
<el-input v-model="value" :rows="5" type="textarea" :placeholder="$t('midjourney.placeholder.prompt')" />
|
||||
<el-input v-model="value" :rows="3" type="textarea" :placeholder="$t('midjourney.placeholder.prompt')" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:on-error="onError"
|
||||
:headers="headers"
|
||||
>
|
||||
<el-button type="primary">
|
||||
<el-button type="primary" class="btn btn-upload">
|
||||
<font-awesome-icon icon="fa-solid fa-upload" class="icon mr-2" />
|
||||
{{ $t('midjourney.button.uploadReferences') }}
|
||||
</el-button>
|
||||
@@ -87,4 +87,8 @@ export default defineComponent({
|
||||
font-size: 16px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.btn.btn-upload {
|
||||
border-radius: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<h2 class="title">模型</h2>
|
||||
<h2 class="title">{{ $t('midjourney.name.model') }}</h2>
|
||||
<div class="items">
|
||||
<div
|
||||
v-for="(option, optionKey) in options"
|
||||
@@ -41,12 +41,12 @@ export default defineComponent({
|
||||
active: 0,
|
||||
options: [
|
||||
{
|
||||
value: 'MJ',
|
||||
value: '',
|
||||
label: '通用',
|
||||
image: 'https://cdn.zhishuyun.com/2023-10-06-174633.png'
|
||||
},
|
||||
{
|
||||
value: 'NIJI',
|
||||
value: 'niji',
|
||||
label: '动漫',
|
||||
image: 'https://cdn.zhishuyun.com/2023-10-06-174008.png'
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">画质</h2>
|
||||
<h2 class="title">{{ $t('midjourney.name.quality') }}</h2>
|
||||
<el-radio-group v-model="value">
|
||||
<el-radio-button v-for="item in options" :key="item.value" :label="item.value">
|
||||
{{ item.label }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<h2 class="title">图片比例</h2>
|
||||
<h2 class="title">{{ $t('midjourney.name.ratio') }}</h2>
|
||||
<div class="items">
|
||||
<div
|
||||
v-for="(option, optionKey) in options"
|
||||
@@ -39,7 +39,6 @@ export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue,
|
||||
active: 0,
|
||||
options: [
|
||||
{
|
||||
value: '1:1',
|
||||
@@ -74,6 +73,11 @@ export default defineComponent({
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
active() {
|
||||
return this.options.findIndex((option) => option.value === this.value);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
@@ -85,8 +89,10 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
if (!this.modelValue) {
|
||||
this.value = DEFAULT_RATIO;
|
||||
} else {
|
||||
this.value = this.modelValue;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">版本</h2>
|
||||
<h2 class="title">{{ $t('midjourney.name.version') }}</h2>
|
||||
<el-select v-model="value" class="value" placeholder="Select">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="10" :offset="14">
|
||||
<div class="pagination m-v-lg">
|
||||
<div class="pagination">
|
||||
<pagination :current-page="page" :page-size="limit" :total="total" @change="onPageChange" />
|
||||
</div>
|
||||
</el-col>
|
||||
@@ -177,5 +177,6 @@ export default defineComponent({
|
||||
|
||||
.pagination {
|
||||
height: 60px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -66,7 +66,7 @@
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-else-if="!modelValue?.response" :class="{ operations: true, full }">
|
||||
<div v-else-if="!modelValue?.response" v-show="full" :class="{ operations: true, full }">
|
||||
<el-skeleton :rows="1" />
|
||||
</div>
|
||||
<div v-else v-show="full" :class="{ operations: true, full }">
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
export default {
|
||||
model: '模型',
|
||||
aspect: '分辨率',
|
||||
ratio: '宽高比',
|
||||
chaos: '混乱度',
|
||||
fast: '快速模式',
|
||||
version: '版本',
|
||||
imageWeight: '图像权重',
|
||||
no: '否定提示',
|
||||
quality: '渲染质量',
|
||||
|
||||
@@ -5,6 +5,7 @@ import store from './store/index';
|
||||
import i18n from './i18n/index';
|
||||
import './assets/scss/style.scss';
|
||||
import './assets/css/tailwind.css';
|
||||
import 'mac-scrollbar/dist/mac-scrollbar.css';
|
||||
import dayjs from './plugins/dayjs';
|
||||
import './plugins/font-awesome';
|
||||
import { vLoading } from 'element-plus';
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<api-status :application="application" class="mb-4" />
|
||||
<task-full-list :applications="applications" @custom="onCustom" />
|
||||
<el-button type="primary" 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>
|
||||
</div>
|
||||
@@ -35,6 +36,7 @@ import {
|
||||
} from '@/operators';
|
||||
import TaskFullList from '@/components/midjourney/tasks/TaskFullList.vue';
|
||||
import { ROUTE_MIDJOURNEY_INDEX } from '@/router';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
|
||||
interface IData {
|
||||
channel: IMidjourneyChannel;
|
||||
@@ -57,13 +59,15 @@ export default defineComponent({
|
||||
PresetPanel,
|
||||
TaskFullList,
|
||||
ChannelSelector,
|
||||
ApiStatus
|
||||
ApiStatus,
|
||||
ElButton,
|
||||
FontAwesomeIcon
|
||||
},
|
||||
data(): IData {
|
||||
return {
|
||||
applications: [],
|
||||
channel: MIDJOURNEY_CHANNEL_FAST,
|
||||
preset: {},
|
||||
preset: this.$store.getters.midjourney.preset,
|
||||
prompt: '',
|
||||
elements: [],
|
||||
ignore: '',
|
||||
@@ -144,7 +148,7 @@ export default defineComponent({
|
||||
.presets {
|
||||
width: 260px;
|
||||
height: 100%;
|
||||
// background-color: var(--el-bg-color-page);
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.main {
|
||||
flex: 1;
|
||||
@@ -161,8 +165,9 @@ export default defineComponent({
|
||||
|
||||
.btn.btn-generate {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
left: 30px;
|
||||
top: 30px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,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" :disabled="!finalPrompt" @click="onGenerate">
|
||||
<el-button type="primary" class="btn btn-generate" :disabled="!finalPrompt" @click="onGenerate">
|
||||
{{ $t('midjourney.button.generate') }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -84,7 +84,7 @@ export default defineComponent({
|
||||
return {
|
||||
applications: [],
|
||||
channel: MIDJOURNEY_CHANNEL_FAST,
|
||||
preset: {},
|
||||
preset: this.$store.getters.midjourney.preset,
|
||||
prompt: '',
|
||||
elements: [],
|
||||
ignore: '',
|
||||
@@ -112,6 +112,9 @@ export default defineComponent({
|
||||
if (this.elements.length > 0) {
|
||||
content += ',' + this.elements.join(',');
|
||||
}
|
||||
if (this.preset.model) {
|
||||
content += ` --${this.preset.model}`;
|
||||
}
|
||||
if (this.preset.version) {
|
||||
content += ` --version ${this.preset.version}`;
|
||||
}
|
||||
@@ -200,7 +203,7 @@ export default defineComponent({
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -209,21 +212,26 @@ export default defineComponent({
|
||||
.presets {
|
||||
width: 260px;
|
||||
height: 100%;
|
||||
// background-color: var(--el-bg-color-page);
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.main {
|
||||
flex: 1;
|
||||
padding: 15px;
|
||||
height: 100%;
|
||||
overflow-x: scroll;
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.btn.btn-generate {
|
||||
width: 80px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
}
|
||||
.result {
|
||||
overflow-y: scroll;
|
||||
width: 400px;
|
||||
height: 100%;
|
||||
// background-color: var(--el-bg-color-page);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -8,7 +8,9 @@ import {
|
||||
faClock as faRegularClock
|
||||
} from '@fortawesome/free-regular-svg-icons';
|
||||
import {
|
||||
faChevronLeft as faSolidChevronLeft,
|
||||
faMicrophone as faSolidMicrophone,
|
||||
faArrowLeft as faSolidArrowLeft,
|
||||
faUpload as faSolidUpload,
|
||||
faMagic as faSolidMagic,
|
||||
faInfo as faSolidInfo,
|
||||
@@ -63,3 +65,5 @@ library.add(faSolidWandMagicSparkles);
|
||||
library.add(faSolidMugSaucer);
|
||||
library.add(faSolidInfo);
|
||||
library.add(faSolidMagic);
|
||||
library.add(faSolidArrowLeft);
|
||||
library.add(faSolidChevronLeft);
|
||||
@@ -45,6 +45,18 @@ const store = createStore({
|
||||
},
|
||||
setApplications(state: IState, payload: IApplication[]): void {
|
||||
state.applications = payload;
|
||||
},
|
||||
setMidjourney(state: IState, payload: any): void {
|
||||
state.apps.midjourney = {
|
||||
...state.apps.midjourney,
|
||||
...payload
|
||||
};
|
||||
},
|
||||
setChat(state: IState, payload: any): void {
|
||||
state.apps.chat = {
|
||||
...state.apps.chat,
|
||||
...payload
|
||||
};
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@@ -63,6 +75,12 @@ const store = createStore({
|
||||
},
|
||||
setApplications({ commit }: ActionContext<IState, IState>, payload: IApplication[]) {
|
||||
commit('setApplications', payload);
|
||||
},
|
||||
setMidjourney({ commit }: ActionContext<IState, IState>, payload: any) {
|
||||
commit('setMidjourney', payload);
|
||||
},
|
||||
setChat({ commit }: ActionContext<IState, IState>, payload: any) {
|
||||
commit('setChat', payload);
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
@@ -80,6 +98,12 @@ const store = createStore({
|
||||
},
|
||||
applications(state): IApplication[] | undefined {
|
||||
return state.applications;
|
||||
},
|
||||
midjourney(state): any {
|
||||
return state.apps.midjourney;
|
||||
},
|
||||
chat(state): any {
|
||||
return state.apps.chat;
|
||||
}
|
||||
},
|
||||
plugins: [createPersistedState()]
|
||||
|
||||
@@ -2502,6 +2502,11 @@ lru-cache@^6.0.0:
|
||||
dependencies:
|
||||
yallist "^4.0.0"
|
||||
|
||||
mac-scrollbar@^0.13.5:
|
||||
version "0.13.5"
|
||||
resolved "https://registry.yarnpkg.com/mac-scrollbar/-/mac-scrollbar-0.13.5.tgz#3ce705a39864e30088a51a5aa631e83625c79a72"
|
||||
integrity sha512-UeCVmDseY0wM67sncAowqHodgrJ3bgPI6nkBeG1eQWNZ3AunXK0zLjBslx2rHZqlVNq2TlNjaV1cIK0yYTrktQ==
|
||||
|
||||
magic-string@^0.25.7:
|
||||
version "0.25.7"
|
||||
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051"
|
||||
|
||||
Reference in new issue
Block a user