Add conditions only for checked domains in failed resources. Fix #343.

This commit is contained in:
FelisCatus 2015-03-11 20:48:28 +08:00
parent 382a5ecde5
commit 1f177ab5de

View File

@ -166,10 +166,12 @@ module.controller 'PopupCtrl', ($scope, $window, $q, omegaTarget,
refresh()
$scope.addConditionForDomains = (domains, profileName) ->
conditions = Object.keys(domains).map (domain) -> {
conditionType: 'HostWildcardCondition'
pattern: domain
}
conditions = []
for own domain, enabled of domains when enabled
conditions.push({
conditionType: 'HostWildcardCondition'
pattern: domain
})
omegaTarget.addCondition(conditions, profileName).then ->
omegaTarget.state('lastProfileNameForCondition', profileName)
refresh()