biome format --write
This commit is contained in:
parent
8372348148
commit
9262e803ec
415 changed files with 54076 additions and 17419 deletions
|
|
@ -1,18 +1,19 @@
|
|||
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||
import Setting from './setting.js'
|
||||
|
||||
const getUrl = state => state?.tuple ? state.tuple[1] + ':' + state.tuple[2] : state
|
||||
const getSocks = state => state?.tuple
|
||||
const getUrl = (state) =>
|
||||
state?.tuple ? state.tuple[1] + ':' + state.tuple[2] : state
|
||||
const getSocks = (state) => state?.tuple
|
||||
|
||||
export default {
|
||||
...Setting,
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
urlField: '',
|
||||
socksField: false
|
||||
socksField: false,
|
||||
}
|
||||
},
|
||||
created () {
|
||||
created() {
|
||||
Setting.created()
|
||||
this.urlField = getUrl(this.realDraftMode ? this.draft : this.state)
|
||||
this.socksField = getSocks(this.realDraftMode ? this.draft : this.state)
|
||||
|
|
@ -20,23 +21,23 @@ export default {
|
|||
computed: {
|
||||
...Setting.computed,
|
||||
// state that we'll show in the UI, i.e. transforming map into list
|
||||
displayState () {
|
||||
displayState() {
|
||||
if (this.visibleState?.tuple) {
|
||||
return this.visibleState.tuple[1] + ':' + this.visibleState.tuple[2]
|
||||
}
|
||||
return this.visibleState
|
||||
},
|
||||
socksState () {
|
||||
socksState() {
|
||||
return getSocks(this.visibleState)
|
||||
}
|
||||
},
|
||||
},
|
||||
components: {
|
||||
...Setting.components,
|
||||
Checkbox
|
||||
Checkbox,
|
||||
},
|
||||
methods: {
|
||||
...Setting.methods,
|
||||
getValue ({ event, isProxy}) {
|
||||
getValue({ event, isProxy }) {
|
||||
if (isProxy) {
|
||||
this.socksField = event
|
||||
} else {
|
||||
|
|
@ -44,10 +45,10 @@ export default {
|
|||
}
|
||||
|
||||
if (this.socksField) {
|
||||
return { tuple: [ ':socks5', ...this.urlField.split(':') ] }
|
||||
return { tuple: [':socks5', ...this.urlField.split(':')] }
|
||||
} else {
|
||||
return this.urlField
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue