Migrate new service (#1)

This commit is contained in:
AceDataCloud committed 2024-03-07 01:09:03 +08:00
1 parent f13ca37d63
commit 28da0263dc
109 files changed
+1160 -1053

No files matched your search

+115
View File
@@ -0,0 +1,115 @@
<template>
<div class="channel-selector">
<el-button
v-for="(option, optionKey) in options"
:key="optionKey"
:class="{ button: true, active: option.name === mode.name }"
@click="onSelect(option)"
>
<font-awesome-icon :class="{ icon: true, [option.name]: true }" :icon="option.icon" />
<span>
{{ option.displayName }}
</span>
</el-button>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { ElButton } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { MIDJOURNEY_MODE_FAST, MIDJOURNEY_MODE_RELAX, MIDJOURNEY_MODE_TURBO } from '@/constants';
import { IMidjourneyMode } from '@/models';
export default defineComponent({
name: 'ModelSelector',
components: {
ElButton,
FontAwesomeIcon
},
emits: ['update:modelValue', 'select'],
data() {
return {
options: [MIDJOURNEY_MODE_FAST, MIDJOURNEY_MODE_RELAX, MIDJOURNEY_MODE_TURBO]
};
},
computed: {
mode() {
return this.$store.state.midjourney.mode;
}
},
methods: {
onSelect(option: IMidjourneyMode) {
this.$store.dispatch('midjourney/setMode', option);
}
}
});
</script>
<style lang="scss" scoped>
.channel-selector {
background-color: #ececf1;
padding: 7px 6px;
border-radius: 15px;
margin-bottom: 5px;
width: fit-content;
margin-left: auto;
margin-right: auto;
.button {
padding: 20px 30px;
color: black;
border: none;
border-radius: 10px;
margin: 0 3px;
background-color: inherit;
&:hover,
&:focus {
background-color: inherit;
}
&.active {
background-color: white;
}
.icon {
display: inline-block;
margin-right: 5px;
&.turbo {
color: #ff9900;
}
&.fast {
color: #2dc49c;
}
&.relax {
color: #ce65e6;
}
}
.fa-chevron-down {
margin-left: 5px;
font-weight: 100;
color: #999;
transform: scale(0.8);
}
}
}
.menu {
.option {
.icon {
display: inline-block;
margin-right: 5px;
&.base {
color: #ff9900;
}
&.plus {
color: #ce65e6;
}
}
}
}
@media (max-width: 767px) {
.channel-selector {
.button {
padding: 20px 10px;
}
}
}
</style>