Refine mi style and layout (#215)
This commit is contained in:
1 parent
cb89da89ea
commit
2fcd64509e
18 files changed
+104
-79
No files matched your search
@@ -17,6 +17,7 @@ html.dark,
|
||||
--el-color-primary-light-8: #d4e3e7;
|
||||
--el-color-primary-light-9: #e9f1f3;
|
||||
--el-color-primary-dark-2: #1f5a6b;
|
||||
--el-border-radius-base: 10px;
|
||||
}
|
||||
|
||||
* {
|
||||
@@ -42,6 +43,27 @@ html.dark,
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
.el-upload-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
overflow-x: auto;
|
||||
gap: 5px;
|
||||
overflow-y: scroll;
|
||||
flex-wrap: wrap;
|
||||
.el-upload-list__item {
|
||||
margin: 0;
|
||||
width: fit-content;
|
||||
height: 50px;
|
||||
padding: 0;
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.el-dropdown-menu {
|
||||
padding: 10px;
|
||||
.el-dropdown-menu__item {
|
||||
@@ -91,15 +113,15 @@ html.dark,
|
||||
}
|
||||
|
||||
.el-textarea {
|
||||
border-radius: 5px;
|
||||
textarea {
|
||||
border-radius: 5px;
|
||||
border-radius: 10px;
|
||||
.el-textarea__inner {
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-input {
|
||||
.el-input__wrapper {
|
||||
border-radius: 5px;
|
||||
border-radius: 10px;
|
||||
width: 100%;
|
||||
&.is-focus {
|
||||
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
||||
@@ -112,12 +134,16 @@ html.dark,
|
||||
}
|
||||
|
||||
.el-dialog {
|
||||
border-radius: 1rem;
|
||||
border-radius: 15px;
|
||||
.el-dialog__body {
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.el-radio-group {
|
||||
--el-border-radius-base: 10px;
|
||||
}
|
||||
|
||||
.v-codemirror {
|
||||
.cm-editor {
|
||||
border-radius: 10px;
|
||||
|
||||
@@ -81,8 +81,8 @@ import { ElMessage, ElTooltip, ElUpload, UploadFile, UploadFiles, UploadProgress
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import { IChatModel } from '@/models';
|
||||
import { getBaseUrlPlatform, isImageUrl } from '@/utils';
|
||||
import FilePreview from './FilePreview.vue';
|
||||
import ImagePreview from './ImagePreview.vue';
|
||||
import FilePreview from '@/components/common/FilePreview.vue';
|
||||
import ImagePreview from '@/components/common/ImagePreview.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Composer',
|
||||
|
||||
@@ -98,15 +98,13 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import AnsweringMark from './AnsweringMark.vue';
|
||||
import copy from 'copy-to-clipboard';
|
||||
import { ElAlert, ElButton, ElImage, ElTooltip, ElInput } from 'element-plus';
|
||||
import { ElAlert, ElButton, ElImage, ElInput } from 'element-plus';
|
||||
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import { IApplication, IChatMessage, IChatMessageState } from '@/models';
|
||||
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
||||
import RestartToGenerate from './RestartToGenerate.vue';
|
||||
import EditMessage from './EditMessage.vue';
|
||||
import FilePreview from './FilePreview.vue';
|
||||
import ImagePreview from './ImagePreview.vue';
|
||||
import FilePreview from '@/components/common/FilePreview.vue';
|
||||
import {
|
||||
ERROR_CODE_API_ERROR,
|
||||
ERROR_CODE_BAD_REQUEST,
|
||||
|
||||
File renamed without changes.
@@ -53,6 +53,8 @@ export default defineComponent({
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
position: relative;
|
||||
border-radius: var(--el-border-radius-base);
|
||||
overflow: hidden;
|
||||
.close {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
@@ -81,6 +83,8 @@ export default defineComponent({
|
||||
}
|
||||
img {
|
||||
object-fit: cover;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -8,11 +8,12 @@
|
||||
<version-selector class="mb-4" />
|
||||
<reference-image class="mb-2" />
|
||||
<elements-selector class="mb-2" />
|
||||
<stylize-selector class="mb-2" />
|
||||
<weird-selector class="mb-2" />
|
||||
<chaos-selector class="mb-2" />
|
||||
<image-weight-selector class="mb-2" />
|
||||
<style-selector class="mb-2" />
|
||||
<advanced-selector class="mb-2" />
|
||||
<stylize-selector v-show="config.advanced" class="mb-2" />
|
||||
<weird-selector v-show="config.advanced" class="mb-2" />
|
||||
<chaos-selector v-show="config.advanced" class="mb-2" />
|
||||
<image-weight-selector v-show="config.advanced" class="mb-2" />
|
||||
<style-selector v-show="config.advanced" class="mb-2" />
|
||||
</div>
|
||||
<div class="h-12 px-4">
|
||||
<div class="flex gap-1">
|
||||
@@ -28,6 +29,7 @@
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import RatioSelector from './config/RatioSelector.vue';
|
||||
import AdvancedSelector from './config/AdvancedSelector.vue';
|
||||
import VersionSelector from './config/VersionSelector.vue';
|
||||
import StylizeSelector from './config/StylizeSelector.vue';
|
||||
import ChaosSelector from './config/ChaosSelector.vue';
|
||||
@@ -55,6 +57,7 @@ export default defineComponent({
|
||||
RatioSelector,
|
||||
VersionSelector,
|
||||
StylizeSelector,
|
||||
AdvancedSelector,
|
||||
ChaosSelector,
|
||||
WeirdSelector,
|
||||
ImageWeightSelector,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<info-icon :content="$t('midjourney.description.chaos')" />
|
||||
</div>
|
||||
<div class="flex justify-end items-center">
|
||||
<el-input-number v-model="value" size="small" controls-position="right" />
|
||||
<el-input-number v-model="value" controls-position="right" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
|
||||
@@ -85,12 +85,13 @@ export default defineComponent({
|
||||
.item {
|
||||
width: 130px;
|
||||
height: 60px;
|
||||
border: 2px solid var(--el-border-color);
|
||||
border: 1px solid var(--el-border-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
border-radius: var(--el-border-radius-base);
|
||||
position: relative;
|
||||
|
||||
.image {
|
||||
|
||||
@@ -100,15 +100,16 @@ export default defineComponent({
|
||||
.item {
|
||||
width: 48px;
|
||||
height: 65px;
|
||||
border: 2px solid var(--el-border-color);
|
||||
border: 1px solid var(--el-border-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
border-radius: var(--el-border-radius-base);
|
||||
|
||||
.preview {
|
||||
margin-top: 8px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 3px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
@@ -117,7 +118,7 @@ export default defineComponent({
|
||||
justify-content: center;
|
||||
|
||||
.rect {
|
||||
border: 2px solid var(--el-border-color);
|
||||
border: 1px solid var(--el-border-color);
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 2px;
|
||||
|
||||
@@ -12,12 +12,20 @@
|
||||
:limit="5"
|
||||
class="upload-wrapper"
|
||||
:multiple="true"
|
||||
:action="uploadUrl"
|
||||
list-type="picture"
|
||||
:action="uploadUrl"
|
||||
:on-exceed="onExceed"
|
||||
:on-error="onError"
|
||||
:headers="headers"
|
||||
>
|
||||
<template #file="{ file }">
|
||||
<image-preview
|
||||
:url="file.url || file.response?.file_url"
|
||||
:name="file.name"
|
||||
:percentage="file.percentage"
|
||||
@remove="fileList.splice(fileList.indexOf(file), 1)"
|
||||
/>
|
||||
</template>
|
||||
<el-button round type="primary" size="small" class="btn btn-upload">
|
||||
<font-awesome-icon icon="fa-solid fa-upload" class="icon mr-1" />
|
||||
{{ $t('midjourney.button.uploadReferences') }}
|
||||
@@ -32,6 +40,7 @@ import { ElUpload, ElButton, UploadFiles, UploadFile, ElMessage } from 'element-
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import { getBaseUrlPlatform } from '@/utils';
|
||||
import InfoIcon from '@/components/common/InfoIcon.vue';
|
||||
import ImagePreview from '@/components/common/ImagePreview.vue';
|
||||
|
||||
interface IData {
|
||||
fileList: UploadFiles;
|
||||
@@ -44,7 +53,8 @@ export default defineComponent({
|
||||
ElUpload,
|
||||
ElButton,
|
||||
InfoIcon,
|
||||
FontAwesomeIcon
|
||||
FontAwesomeIcon,
|
||||
ImagePreview
|
||||
},
|
||||
emits: ['change'],
|
||||
data(): IData {
|
||||
@@ -68,6 +78,7 @@ export default defineComponent({
|
||||
return this.$store.state.midjourney.config.references || [];
|
||||
},
|
||||
set(val: string[]) {
|
||||
console.debug('Setting references:', val);
|
||||
this.$store.commit('midjourney/setConfig', {
|
||||
...this.$store.state.midjourney.config,
|
||||
references: val
|
||||
@@ -78,6 +89,7 @@ export default defineComponent({
|
||||
watch: {
|
||||
urls: {
|
||||
handler(val) {
|
||||
console.debug('URLs changed:', val);
|
||||
this.$emit('change', val);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<info-icon :content="$t('midjourney.description.stylize')" />
|
||||
</div>
|
||||
<div class="flex justify-end items-center">
|
||||
<el-input-number v-model="value" size="small" controls-position="right" />
|
||||
<el-input-number v-model="value" controls-position="right" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<info-icon :content="$t('midjourney.description.weird')" />
|
||||
</div>
|
||||
<div class="flex justify-end items-center">
|
||||
<el-input-number v-model="value" size="small" controls-position="right" />
|
||||
<el-input-number v-model="value" controls-position="right" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div v-if="modelValue?.type === 'imagine'" class="item">
|
||||
<div class="left">
|
||||
<el-image src="https://cdn.acedata.cloud/05daz4.png" class="avatar" />
|
||||
<el-image src="https://cdn.acedata.cloud/wto43b.png" class="avatar" />
|
||||
</div>
|
||||
<div class="preview">
|
||||
<div class="bot">
|
||||
@@ -270,12 +270,11 @@ $left-width: 70px;
|
||||
.left {
|
||||
width: $left-width;
|
||||
.avatar {
|
||||
background-color: white;
|
||||
padding: 8px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin: 10px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid var(--el-border-color);
|
||||
}
|
||||
}
|
||||
.preview {
|
||||
@@ -351,9 +350,11 @@ $left-width: 70px;
|
||||
width: fit-content;
|
||||
min-height: 50px;
|
||||
min-width: 100px;
|
||||
margin-bottom: 15px;
|
||||
.image {
|
||||
max-height: 400px;
|
||||
max-width: 300px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.btn-raw {
|
||||
position: absolute;
|
||||
@@ -405,18 +406,20 @@ $left-width: 70px;
|
||||
width: 100%;
|
||||
align-items: baseline;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 15px;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
color: var(--el-text-color-regular);
|
||||
font-size: 14px;
|
||||
overflow-y: scroll;
|
||||
gap: 10px;
|
||||
|
||||
&.full {
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
margin-bottom: 10px;
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import TaskItem from './TaskItem.vue';
|
||||
import { ElSkeleton, ElSkeletonItem } from 'element-plus';
|
||||
import { Status } from '@/models';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'TaskList',
|
||||
@@ -77,6 +76,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
.tasks {
|
||||
padding: 0 10px;
|
||||
overflow-y: scroll;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -271,6 +271,18 @@
|
||||
"message": "打开或关闭 Chat 功能模块。",
|
||||
"description": "Chat 功能的描述"
|
||||
},
|
||||
"message.featuresGrok": {
|
||||
"message": "打开或关闭 Grok 功能模块。",
|
||||
"description": "Grok 功能的描述"
|
||||
},
|
||||
"message.featuresDeepseek": {
|
||||
"message": "打开或关闭 Deepseek 功能模块。",
|
||||
"description": "Deepseek 功能的描述"
|
||||
},
|
||||
"message.featuresChatgpt": {
|
||||
"message": "打开或关闭 ChatGPT 功能模块。",
|
||||
"description": "ChatGPT 功能的描述"
|
||||
},
|
||||
"message.featuresMidjourney": {
|
||||
"message": "打开或关闭 Midjourney 功能模块。",
|
||||
"description": "Midjourney 功能的描述"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<div class="presets">
|
||||
<slot name="presets" />
|
||||
</div>
|
||||
<div class="operation">
|
||||
<slot name="operation" />
|
||||
<div class="results">
|
||||
<slot name="results" />
|
||||
</div>
|
||||
<el-button round class="menu" @click="drawer = true">
|
||||
<font-awesome-icon icon="fa-solid fa-gear" class="icon-menu" />
|
||||
@@ -66,11 +66,9 @@ export default defineComponent({
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.operation {
|
||||
.results {
|
||||
flex: 1;
|
||||
padding: 15px;
|
||||
height: 100%;
|
||||
overflow-x: scroll;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@@ -3,19 +3,8 @@
|
||||
<template #presets>
|
||||
<config-panel @generate="onGenerate" />
|
||||
</template>
|
||||
<template #operation>
|
||||
<div class="top">
|
||||
<application-status
|
||||
:initializing="initializing"
|
||||
:application="application"
|
||||
:applications="applications"
|
||||
:service="service"
|
||||
:need-apply="needApply"
|
||||
@refresh="onGetApplication"
|
||||
@select="$store.dispatch('midjourney/setApplication', $event)"
|
||||
/>
|
||||
<task-list @custom="onCustom" @reach-top="onReachTop" />
|
||||
</div>
|
||||
<template #results>
|
||||
<task-list @custom="onCustom" @reach-top="onReachTop" />
|
||||
</template>
|
||||
</layout>
|
||||
</template>
|
||||
@@ -26,7 +15,6 @@ import Layout from '@/layouts/Midjourney.vue';
|
||||
import ConfigPanel from '@/components/midjourney/ConfigPanel.vue';
|
||||
import { ElMessage, ElCard } from 'element-plus';
|
||||
import { applicationOperator, midjourneyOperator } from '@/operators';
|
||||
import ApplicationStatus from '@/components/application/Status.vue';
|
||||
import TaskList from '@/components/midjourney/tasks/TaskList.vue';
|
||||
import { ERROR_CODE_DUPLICATION, ERROR_CODE_FORBIDDEN, ERROR_CODE_USED_UP } from '@/constants/errorCode';
|
||||
import { Status } from '@/models';
|
||||
@@ -52,7 +40,6 @@ export default defineComponent({
|
||||
name: 'MidjourneyIndex',
|
||||
components: {
|
||||
ConfigPanel,
|
||||
ApplicationStatus,
|
||||
TaskList,
|
||||
Layout
|
||||
},
|
||||
@@ -308,30 +295,3 @@ export default defineComponent({
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.top {
|
||||
flex: 1;
|
||||
height: calc(100% - 50px);
|
||||
overflow-y: scroll;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.bottom {
|
||||
height: 50px;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
.btn {
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
}
|
||||
.operations {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
max-height: 650px;
|
||||
bottom: 60px;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user