diff --git a/omega-web/src/omega/controllers/fixed_profile.coffee b/omega-web/src/omega/controllers/fixed_profile.coffee index 17ba6dd..74cd8cf 100644 --- a/omega-web/src/omega/controllers/fixed_profile.coffee +++ b/omega-web/src/omega/controllers/fixed_profile.coffee @@ -1,4 +1,5 @@ -angular.module('omega').controller 'FixedProfileCtrl', ($scope, $modal) -> +angular.module('omega').controller 'FixedProfileCtrl', ($scope, $modal, + trFilter) -> $scope.urlSchemes = ['', 'http', 'https', 'ftp'] $scope.urlSchemeDefault = 'fallbackProxy' proxyProperties = @@ -20,6 +21,21 @@ angular.module('omega').controller 'FixedProfileCtrl', ($scope, $modal) -> $scope.showAdvanced = false + $scope.optionsForScheme = {} + for scheme in $scope.urlSchemes + defaultLabel = + if scheme + trFilter('options_protocol_useDefault') + else + trFilter('options_protocol_direct') + $scope.optionsForScheme[scheme] = [ + {label: defaultLabel, value: undefined}, + {label: 'HTTP', value: 'http'}, + {label: 'HTTPS', value: 'https'}, + {label: 'SOCKS4', value: 'socks4'}, + {label: 'SOCKS5', value: 'socks5'}, + ] + $scope.proxyEditors = {} $scope.authSupported = {"http": true, "https": true} diff --git a/omega-web/src/partials/profile_fixed.jade b/omega-web/src/partials/profile_fixed.jade index 3fdbc0f..b30608e 100644 --- a/omega-web/src/partials/profile_fixed.jade +++ b/omega-web/src/partials/profile_fixed.jade @@ -14,13 +14,8 @@ div(ng-controller='FixedProfileCtrl') tr(ng-repeat='scheme in urlSchemes' ng-show='scheme == "" || showAdvanced') td {{schemeDisp[scheme] || ('options_scheme_default' | tr)}} td - select.form-control(ng-model='proxyEditors[scheme].scheme') - option(value='') - | {{(scheme ? 'options_protocol_useDefault' : 'options_protocol_direct') | tr}} - option(value='http') HTTP - option(value='https') HTTPS - option(value='socks4') SOCKS4 - option(value='socks5') SOCKS5 + select.form-control(ng-model='proxyEditors[scheme].scheme' + ng-options='opt.value as opt.label for opt in optionsForScheme[scheme]') td(ng-if='proxyEditors[scheme].scheme') input.form-control(type='text' ng-model='proxyEditors[scheme].host' required) td(ng-if='!proxyEditors[scheme].scheme')