Fix result profiles state calculation in OmegaTarget.

This commit is contained in:
FelisCatus 2014-10-13 21:23:41 +08:00
parent 1e744c286b
commit 73eed609b3
2 changed files with 6 additions and 5 deletions

View File

@ -288,8 +288,8 @@ class Options
profileType: profile.profileType
color: profile.color
builtin: !!profile.builtin
if results? and currentIncludable
results.push(profile.name)
if currentIncludable and OmegaPac.Profiles.isIncludable(profile)
results?.push(profile.name)
if profile and OmegaPac.Profiles.isInclusive(profile)
results = OmegaPac.Profiles.validResultProfilesFor(profile, @_options)
results = results.map (profile) -> profile.name

View File

@ -51,20 +51,21 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp)
span {{'popup_externalProfile' | tr}}
input.external-profile-name.input-small(type='text' style='display: none'
placeholder='{{"popup_externalProfileName" | tr}}')
li.divider(ng-show='!!currentDomain')
li.divider(ng-show='!!currentDomain && validResultProfiles.length')
li(ng-show='!!currentProfileCanAddRule')
a(ng-click='showConditionForm = true')
span.glyphicon.glyphicon-plus
= ' '
span {{'popup_addCondition' | tr}}
li(ng-show='!!currentDomain' dropdown is-open="tempRuleMenu.open")
li(ng-show='!!currentDomain && validResultProfiles.length' dropdown is-open="tempRuleMenu.open")
a.dropdown-toggle
span.glyphicon.glyphicon-filter
= ' '
span.current-domain {{currentDomain}}
span.caret
ul.dropdown-menu
li(ng-repeat='profile in validResultProfiles' ng-class='{active: profile.name == currentTempRuleProfile}')
li(ng-repeat='profile in validResultProfiles' ng-class='{active: profile.name == currentTempRuleProfile}'
ng-show='!!currentTempRuleProfile || validResultProfiles.length == 1 || profile.name != currentProfileName')
a(ng-click='addTempRule(currentDomain, profile.name)')
span.glyphicon(ng-style='{color: profile.color}'
class='{{profileIcons[profile.profileType]}}')