@ -1,5 +1,5 @@
< template >
< template >
< el -drawer v-model ="open" :close-on-click-modal="false" size="40% " :before-close="handleClose">
< el -drawer v-model ="open" :close-on-click-modal="false" :size="size " :before-close="handleClose">
< template # header >
< template # header >
< DrawerHeader :header ="$t('website.proxyFile')" :back ="handleClose" / >
< DrawerHeader :header ="$t('website.proxyFile')" :back ="handleClose" / >
< / template >
< / template >
@ -35,13 +35,19 @@
import DrawerHeader from '@/components/drawer-header/index.vue' ;
import DrawerHeader from '@/components/drawer-header/index.vue' ;
import i18n from '@/lang' ;
import i18n from '@/lang' ;
import { FormInstance } from 'element-plus' ;
import { FormInstance } from 'element-plus' ;
import { reactive, ref } from 'vue' ;
import { computed, reactive, ref } from 'vue' ;
import { MsgSuccess } from '@/utils/message' ;
import { MsgSuccess } from '@/utils/message' ;
import { Codemirror } from 'vue-codemirror' ;
import { Codemirror } from 'vue-codemirror' ;
import { UpdateProxyConfigFile } from '@/api/modules/website' ;
import { UpdateProxyConfigFile } from '@/api/modules/website' ;
import { StreamLanguage } from '@codemirror/language' ;
import { StreamLanguage } from '@codemirror/language' ;
import { nginx } from '@codemirror/legacy-modes/mode/nginx' ;
import { nginx } from '@codemirror/legacy-modes/mode/nginx' ;
import { oneDark } from '@codemirror/theme-one-dark' ;
import { oneDark } from '@codemirror/theme-one-dark' ;
import { GlobalStore } from '@/store' ;
const globalStore = GlobalStore ( ) ;
const mobile = computed ( ( ) => {
return globalStore . isMobile ( ) ;
} ) ;
const extensions = [ StreamLanguage . define ( nginx ) , oneDark ] ;
const extensions = [ StreamLanguage . define ( nginx ) , oneDark ] ;
const proxyForm = ref < FormInstance > ( ) ;
const proxyForm = ref < FormInstance > ( ) ;
@ -58,12 +64,17 @@ const req = reactive({
websiteID : 0 ,
websiteID : 0 ,
content : '' ,
content : '' ,
} ) ;
} ) ;
const size = ref ( '50%' ) ;
const acceptParams = async ( proxyreq : any ) => {
const acceptParams = async ( proxyreq : any ) => {
req . name = proxyreq . name ;
req . name = proxyreq . name ;
req . websiteID = proxyreq . websiteID ;
req . websiteID = proxyreq . websiteID ;
req . content = proxyreq . content ;
req . content = proxyreq . content ;
open . value = true ;
open . value = true ;
if ( mobile . value ) {
size . value = '100%' ;
}
} ;
} ;
const submit = async ( ) => {
const submit = async ( ) => {