fix
This commit is contained in:
1 parent
5400cc08de
commit
ca5f39b3fa
16 files changed
+244
-113
No files matched your search
@@ -13,6 +13,8 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="operators">
|
||||
<navigator-item icon="fa-solid fa-gear" :title="$t('common.nav.setting')" @click="setting = true" />
|
||||
<setting-panel :visible="setting" @close="setting = false" />
|
||||
<navigator-item
|
||||
v-show="!confirming"
|
||||
icon="fa-solid fa-trash"
|
||||
@@ -36,16 +38,19 @@ import { defineComponent } from 'vue';
|
||||
import NavigatorItem from './NavigatorItem.vue';
|
||||
import ConversationNavigatorItem from '../conversation/ConversationNavigatorItem.vue';
|
||||
import { IConversation } from '@/operators/conversation/models';
|
||||
import SettingPanel from './SettingPanel.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'LeftNavigator',
|
||||
components: {
|
||||
NavigatorItem,
|
||||
ConversationNavigatorItem
|
||||
ConversationNavigatorItem,
|
||||
SettingPanel
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
confirming: false
|
||||
confirming: false,
|
||||
setting: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<el-dialog :model-value="visible" @close="$emit('close')">
|
||||
<h2 class="title">{{ $t('common.nav.setting') }}</h2>
|
||||
<el-form label-width="120px">
|
||||
<el-form-item :label="$t('setting.field.stream')">
|
||||
<el-switch v-model="stream" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('setting.field.endpoint')">
|
||||
<el-select v-model="endpoint">
|
||||
<el-option v-for="(item, itemIndex) in endpoints" :key="itemIndex" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElDialog, ElForm, ElFormItem, ElOption, ElSelect, ElSwitch } from 'element-plus';
|
||||
import { ENDPOINT, ENDPOINT2 } from '@/constants/endpoint';
|
||||
export default defineComponent({
|
||||
name: 'SettingPanel',
|
||||
components: {
|
||||
ElDialog,
|
||||
ElForm,
|
||||
ElFormItem,
|
||||
ElOption,
|
||||
ElSelect,
|
||||
ElSwitch
|
||||
},
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
emits: ['close'],
|
||||
data() {
|
||||
return {
|
||||
endpoints: [ENDPOINT, ENDPOINT2]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
stream: {
|
||||
get() {
|
||||
return this.$store.getters.setting.stream;
|
||||
},
|
||||
set(value: boolean) {
|
||||
this.$store.dispatch('setSetting', {
|
||||
stream: value
|
||||
});
|
||||
}
|
||||
},
|
||||
endpoint: {
|
||||
get() {
|
||||
return this.$store.getters.setting.endpoint;
|
||||
},
|
||||
set(value: string) {
|
||||
this.$store.dispatch('setSetting', {
|
||||
endpoint: value
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -60,7 +60,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
},
|
||||
emits: ['stop'],
|
||||
emits: ['stop'],
|
||||
data(): IData {
|
||||
return {
|
||||
copied: false
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
v-model="value"
|
||||
type="textarea"
|
||||
resize="none"
|
||||
:disabled="!application || answering"
|
||||
:disabled="initializing || !application || answering"
|
||||
class="new-message-input"
|
||||
:placeholder="$t('conversation.message.newMessagePlaceholder')"
|
||||
@keydown.enter.exact.prevent="$emit('send')"
|
||||
@@ -15,19 +15,17 @@
|
||||
<voice-recognition v-if="false" class="mr-1" @finished="value = $event" />
|
||||
<font-awesome-icon icon="fa-regular fa-paper-plane" class="icon-send" @click="$emit('send')" />
|
||||
</div>
|
||||
<div v-if="!application" class="new-message-apply">
|
||||
<div v-if="!initializing">
|
||||
<span class="mr-2">{{ $t('conversation.message.apiInfo') }}</span>
|
||||
<span>
|
||||
<el-button type="primary" size="small" @click="confirming = true">
|
||||
{{ $t('common.button.apply') }}
|
||||
</el-button>
|
||||
</span>
|
||||
<span class="ml-1">{{ $t('conversation.message.tryForFree') }}</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
<span class="ml-1">{{ $t('conversation.message.initializing') }}</span>
|
||||
</div>
|
||||
<div v-if="initializing" class="new-message-apply">
|
||||
<span class="ml-1">{{ $t('conversation.message.initializing') }}</span>
|
||||
</div>
|
||||
<div v-else-if="!application" class="new-message-apply">
|
||||
<span class="mr-2">{{ $t('conversation.message.apiInfo') }}</span>
|
||||
<span>
|
||||
<el-button type="primary" size="small" @click="confirming = true">
|
||||
{{ $t('common.button.apply') }}
|
||||
</el-button>
|
||||
</span>
|
||||
<span class="ml-1">{{ $t('conversation.message.tryForFree') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<application-confirm
|
||||
@@ -41,7 +39,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElInput, ElButton, ElText } from 'element-plus';
|
||||
import { ElInput, ElButton } from 'element-plus';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import { IApi, IApplication } from '@/operators';
|
||||
import { IApplicationType } from '@/operators';
|
||||
|
||||
Reference in new issue
Block a user