办学质量监测教学评价系统
shenrongliang
2025-06-13 11d86cc6c26bb4f709e407acadf4805c2024e79f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<script setup lang="ts">
import { NInput, NButton, useMessage,NSwitch} from "naive-ui"
 
import {gptServerStore} from '@/store'
import { mlog, myTrim,blurClean} from "@/api";
import { t } from '@/locales'
 
const emit= defineEmits(['close']);
const ms= useMessage();
const save = ()=>{
    gptServerStore.setMyData( gptServerStore.myData );
    ms.success( t('mjchat.success'));
    emit('close');
}
// const blurClean= ()=>{
//   mlog('blurClean');
//   gptServerStore.myData.OPENAI_API_BASE_URL =myTrim( myTrim(gptServerStore.myData.OPENAI_API_BASE_URL.trim(),'/'), '\\' );
//   gptServerStore.myData.OPENAI_API_KEY = gptServerStore.myData.OPENAI_API_KEY.trim();
//   gptServerStore.myData.MJ_SERVER =myTrim( myTrim( gptServerStore.myData.MJ_SERVER.trim(),'/'),'\\');
//   gptServerStore.myData.MJ_API_SECRET = gptServerStore.myData.MJ_API_SECRET.trim();
//   gptServerStore.myData.UPLOADER_URL=  myTrim( myTrim( gptServerStore.myData.UPLOADER_URL.trim(),'/'),'\\');
// }
</script>
<template>
<div id="setserver"> 
<div class="text-right">{{ $t('mj.setOpen') }}</div>
<section class="mb-4 flex justify-between items-center"  >
    <n-input @blur="blurClean"  :placeholder="$t('mj.setOpenPlaceholder') " v-model:value="gptServerStore.myData.OPENAI_API_BASE_URL" clearable>
      <template #prefix>
        <span class="text-[var(--n-tab-text-color-active)]">{{ $t('mj.setOpenUrl') }}:</span>
      </template>
    </n-input>
 </section>
 
<section class="mb-4 flex justify-between items-center"  >
    <n-input  @blur="blurClean" type="password"  :placeholder="$t('mj.setOpenKeyPlaceholder')" show-password-on="click" v-model:value="gptServerStore.myData.OPENAI_API_KEY" clearable>
      <template #prefix>
        <span class="text-[var(--n-tab-text-color-active)]">OpenAI Api Key:</span>
      </template>
    </n-input>
 </section>
 
 
<div  class="text-right" >{{$t('mj.setMj')}}</div>
<section class="mb-4 flex justify-between items-center"  >
    <n-input    :placeholder="$t('mj.setOpenPlaceholder') "  v-model:value="gptServerStore.myData.MJ_SERVER" clearable>
      <template #prefix>
        <span class="text-[var(--n-tab-text-color-active)]">{{$t('mj.setMjUrl')}}</span>
      </template>
    </n-input>
 </section>
 
<section class="mb-4 flex justify-between items-center"  >
    <n-input type="password"  :placeholder="$t('mj.setMjKeyPlaceholder') " show-password-on="click" v-model:value="gptServerStore.myData.MJ_API_SECRET" clearable>
      <template #prefix>
        <span class="text-[var(--n-tab-text-color-active)]">Midjourney Api Secret:</span>
      </template>
    </n-input>
 </section>
 <section class="mb-4 flex justify-start items-center">
   <n-switch v-model:value="gptServerStore.myData.MJ_CDN_WSRV" >
      <template #checked>  {{ $t('mj.wsrvClose') }} </template>
      <template #unchecked> {{ $t('mj.wsrvOpen') }} </template>
    </n-switch>
 </section>
 
 <div  class="text-right" > {{$t('mj.setUploader')}}</div>
<section class="mb-4 flex justify-between items-center"  >
    <n-input  :placeholder="$t('mj.setOpenPlaceholder')"  v-model:value="gptServerStore.myData.UPLOADER_URL" clearable>
      <template #prefix>
        <span class="text-[var(--n-tab-text-color-active)]">{{$t('mj.setUploaderUrl')}}</span>
      </template>
    </n-input>
 </section>
 
<section class=" text-right flex justify-end space-x-2"  >
    <NButton   @click="gptServerStore.setInit()">{{$t('mj.setBtBack')}}</NButton>
    <NButton type="primary" @click="save">{{$t('mj.setBtSave')}}</NButton>
 </section>
</div>
</template>
<style>
#setserver .n-input .n-input__input-el{
    text-align: right;
}
</style>