feat: basic proxy support #261

This commit is contained in:
Daan Wijns 2022-07-04 13:14:11 +02:00
parent 882c263b72
commit 71a09fc58a
2 changed files with 140 additions and 5 deletions

View file

@ -1,6 +1,8 @@
<template>
<v-card flat>
<v-subheader>{{ $t('modals.settings.pageConnection.subHeader') }}</v-subheader>
<v-subheader>
{{ $t("modals.settings.pageConnection.subHeader") }}
</v-subheader>
<v-list-item>
<v-text-field
v-model="settings.max_connec"
@ -45,6 +47,92 @@
:label="$t('modals.settings.pageConnection.perTorrentMaxUploadSlots')"
/>
</v-list-item>
<v-divider />
<v-subheader>
{{ $t("modals.settings.pageConnection.proxySubHeader") }}
</v-subheader>
<v-list-item>
<v-row class="ml-5 mr-5 pb-4">
<v-col cols="5" class="pa-0 pr-2">
<v-select
v-model="settings.proxy_type"
outlined
dense
hide-details
small-chips
:items="proxyTypes"
/>
</v-col>
<v-col cols="4" class="pa-0">
<v-text-field
v-model="settings.proxy_ip"
class="mr-1"
outlined
dense
hide-details
:label="$t('modals.settings.pageWebUI.ipAddress')"
/>
</v-col>
<v-col cols="3" class="pa-0">
<v-text-field
v-model="settings.proxy_port"
class="ml-1"
outlined
dense
type="number"
hide-details
:label="$t('modals.settings.pageWebUI.port')"
/>
</v-col>
</v-row>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="settings.proxy_peer_connections"
hide-details
class="ma-0 pa-0"
:label="$t('modals.settings.pageConnection.proxyPeerConnections')"
/>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="settings.proxy_torrents_only"
hide-details
class="ma-0 pa-0"
:label="$t('modals.settings.pageConnection.proxyTorrentOnly')"
/>
</v-list-item>
<v-divider />
<v-list-item>
<v-checkbox
v-model="settings.proxy_auth_enabled"
hide-details
class="ma-0 pa-0"
:label="$t('modals.settings.pageConnection.proxyAuth')"
/>
</v-list-item>
<v-list-item>
<v-text-field
v-model="settings.proxy_username"
class="mb-2"
outlined
dense
hide-details
:disabled="!settings.proxy_auth_enabled"
:label="$t('modals.settings.pageWebUI.username')"
/>
</v-list-item>
<v-list-item>
<v-text-field
v-model="settings.proxy_password"
class="mb-2"
outlined
dense
hide-details
:disabled="!settings.proxy_auth_enabled"
:label="$t('modals.settings.pageWebUI.password')"
/>
</v-list-item>
</v-card>
</template>
@ -53,6 +141,49 @@ import { SettingsTab, FullScreenModal } from '@/mixins'
export default {
name: 'Connection',
mixins: [SettingsTab, FullScreenModal]
mixins: [SettingsTab, FullScreenModal],
data() {
return {
proxyTypes: [
{
value: -1,
text: 'None'
},
{
value: 1,
text: 'HTTP proxy without authentication'
},
{
value: 2,
text: 'SOCKS5 proxy without authentication'
},
{
value: 3,
text: 'HTTP proxy with authentication'
},
{
value: 4,
text: 'SOCKS5 proxy with authentication'
},
{
value: 5,
text: 'SOCKS4 proxy without authentication'
}
]
}
},
computed: {
getProxyTypeName(value) {
return this.proxyTypes.filter(item => item.value !== value)[0]
}
}
}
</script>
</script>
//
<style lang="scss" scoped>
// ::v-deep .v-select .v-select__selection {
// padding: 0;
// }
//
</style>

View file

@ -185,7 +185,11 @@ const locale = {
globalMaxConnection: 'Global maximum number of connections',
perTorrentMaxConnection: 'Maximum number of connections per torrent',
globalMaxUploadSlots: 'Global maximum number of upload slots',
perTorrentMaxUploadSlots: 'Maximum number of upload slots per torrent'
perTorrentMaxUploadSlots: 'Maximum number of upload slots per torrent',
proxySubHeader: 'Proxy Server',
proxyPeerConnections: 'Use proxy for peer connections',
proxyTorrentOnly: 'Use proxy only for torrents',
proxyAuth: 'Authentication'
},
pageBittorrent: {
subHeaderPrivacy: 'Privacy',
@ -238,7 +242,7 @@ const locale = {
port: 'Port',
authentication: 'Authentication',
username: 'Username',
password: 'password',
password: 'Password',
maxAttempts: 'Max attempts',
banDuration: 'Ban Duration (seconds)',
sessionTimeout: 'Session timeout (seconds)',