@@ -7,6 +7,8 @@ export default {
77 data () {
88 return {
99 key: ' plugin.overwall' ,
10+ labelCol: { span: 4 },
11+ wrapperCol: { span: 20 },
1012 targets: undefined ,
1113 servers: undefined ,
1214 overwallOptions: [
@@ -40,8 +42,8 @@ export default {
4042 this .initServer ()
4143 },
4244 async applyBefore () {
43- this .saveTarget ()
44- this .saveServer ()
45+ this .submitTarget ()
46+ this .submitServer ()
4547 },
4648 initTarget () {
4749 this .targets = []
@@ -54,17 +56,20 @@ export default {
5456 })
5557 }
5658 },
57- deleteTarget (item , index ) {
58- this .targets .splice (index, 1 )
59- },
6059 addTarget () {
6160 this .targets .unshift ({ key: ' ' , value: ' true' })
6261 },
63- saveTarget () {
62+ deleteTarget (item , index ) {
63+ this .targets .splice (index, 1 )
64+ },
65+ submitTarget () {
6466 const map = {}
6567 for (const item of this .targets ) {
6668 if (item .key ) {
67- map[item .key ] = item .value === ' true'
69+ const hostname = this .handleHostname (item .key )
70+ if (hostname) {
71+ map[hostname] = (item .value === ' true' )
72+ }
6873 }
6974 }
7075 this .config .plugin .overwall .targets = map
@@ -90,11 +95,14 @@ export default {
9095 addServer () {
9196 this .servers .unshift ({ key: ' ' , value: { type: ' path' } })
9297 },
93- saveServer () {
98+ submitServer () {
9499 const map = {}
95100 for (const item of this .servers ) {
96101 if (item .key ) {
97- map[item .key ] = item .value
102+ const hostname = this .handleHostname (item .key )
103+ if (hostname) {
104+ map[hostname] = item .value
105+ }
98106 }
99107 }
100108 this .config .plugin .overwall .server = map
@@ -107,9 +115,9 @@ export default {
107115 <ds-container >
108116 <template slot="header">
109117 梯子
110- < span >
111- < a-button type = " primary " @click = " openExternal('https://github.com/docmirror/dev-sidecar-doc/blob/main/ow.md') " >原理说明</ a-button >
112- </ span >
118+ </ template >
119+ < template slot="header-right" >
120+ <a-button type = " primary " @click = " openExternal('https://github.com/docmirror/dev-sidecar-doc/blob/main/ow.md') " >原理说明</ a-button >
113121 </template >
114122
115123 <div v-if =" config" >
@@ -142,7 +150,7 @@ export default {
142150 注:只要下载成功后,即使关闭自动更新功能,也会优先读取最近下载的文件!
143151 </div >
144152 </a-form-item >
145- <a-form-item label =" 远程PAC文件地址 " :label-col =" labelCol" :wrapper-col =" wrapperCol" >
153+ <a-form-item label =" 远程PAC文件 " :label-col =" labelCol" :wrapper-col =" wrapperCol" >
146154 <a-input v-model =" config.plugin.overwall.pac.pacFileUpdateUrl" :title =" config.plugin.overwall.pac.pacFileUpdateUrl" />
147155 <div class =" form-help" >
148156 远程PAC文件内容可以是<code >base64</code >编码格式,也可以是未经过编码的
0 commit comments