mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-02-02 02:58:13 -05:00
Add warning to host wildcard conditions containing some invalid host chars.
This commit is contained in:
parent
c2cc042de4
commit
0d9937963a
@ -145,6 +145,12 @@ angular.module('omega').controller 'SwitchProfileCtrl', ($scope, $location,
|
||||
return false
|
||||
return true
|
||||
|
||||
$scope.conditionHasWarning = (condition) ->
|
||||
if condition.conditionType == 'HostWildcardCondition'
|
||||
pattern = condition.pattern
|
||||
return pattern.indexOf(':') >= 0 || pattern.indexOf('/') >= 0
|
||||
return false
|
||||
|
||||
$scope.removeRule = (index) ->
|
||||
removeForReal = ->
|
||||
$scope.profile.rules.splice index, 1
|
||||
|
@ -38,7 +38,7 @@ div(ng-controller='SwitchProfileCtrl')
|
||||
td
|
||||
select.form-control(ng-model='rule.condition.conditionType'
|
||||
ng-options='type.type as ("condition_" + type.type | tr) group by (type.group | tr) for type in conditionTypes')
|
||||
td(ng-switch='rule.condition.conditionType')
|
||||
td(ng-switch='rule.condition.conditionType' ng-class='{"has-warning": conditionHasWarning(rule.condition)}')
|
||||
span(ng-switch-when='FalseCondition')
|
||||
span(ng-show='!!rule.condition.pattern')
|
||||
input.form-control(ng-model='rule.condition.pattern' disabled title="{{'condition_details_FalseCondition' | tr}}")
|
||||
|
Loading…
Reference in New Issue
Block a user