mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
Prefer dynamic virtual profile icons.
This commit is contained in:
parent
054be60531
commit
79eb0b53fe
@ -299,11 +299,6 @@ module.exports = exports =
|
|||||||
create: (profile) ->
|
create: (profile) ->
|
||||||
profile.defaultProfileName ?= 'direct'
|
profile.defaultProfileName ?= 'direct'
|
||||||
profile.rules ?= []
|
profile.rules ?= []
|
||||||
if profile.profileType == 'VirtualProfile' and not profile.virtualType?
|
|
||||||
target = exports.byName(profile.defaultProfileName, {})
|
|
||||||
if target
|
|
||||||
profile.virtualType = target.profileType
|
|
||||||
profile.color = target.color
|
|
||||||
directReferenceSet: (profile) ->
|
directReferenceSet: (profile) ->
|
||||||
refs = {}
|
refs = {}
|
||||||
refs[exports.nameAsKey(profile.defaultProfileName)] =
|
refs[exports.nameAsKey(profile.defaultProfileName)] =
|
||||||
|
@ -289,8 +289,7 @@ class Options
|
|||||||
profileType: p.profileType
|
profileType: p.profileType
|
||||||
color: p.color
|
color: p.color
|
||||||
builtin: if p.builtin then true
|
builtin: if p.builtin then true
|
||||||
if p.virtualType
|
if p.profileType == 'VirtualProfile'
|
||||||
profiles[key].virtualType = p.virtualType
|
|
||||||
profiles[key].defaultProfileName = p.defaultProfileName
|
profiles[key].defaultProfileName = p.defaultProfileName
|
||||||
if not allReferenceSet?
|
if not allReferenceSet?
|
||||||
allReferenceSet = OmegaPac.Profiles.allReferenceSet profile, @_options
|
allReferenceSet = OmegaPac.Profiles.allReferenceSet profile, @_options
|
||||||
@ -330,7 +329,8 @@ class Options
|
|||||||
@_state.set({
|
@_state.set({
|
||||||
'currentProfileName': @_currentProfileName
|
'currentProfileName': @_currentProfileName
|
||||||
'isSystemProfile': @_isSystem
|
'isSystemProfile': @_isSystem
|
||||||
'currentProfileCanAddRule': profile.rules? and not profile.virtualType
|
'currentProfileCanAddRule':
|
||||||
|
profile.rules? and profile.profileType != 'VirtualProfile'
|
||||||
})
|
})
|
||||||
@_setAvailableProfiles()
|
@_setAvailableProfiles()
|
||||||
|
|
||||||
@ -656,9 +656,6 @@ class Options
|
|||||||
return Promise.reject new ProfileNotExistError(defaultProfileName)
|
return Promise.reject new ProfileNotExistError(defaultProfileName)
|
||||||
|
|
||||||
profile.defaultProfileName = defaultProfileName
|
profile.defaultProfileName = defaultProfileName
|
||||||
if profile.virtualType
|
|
||||||
profile.color = target.color
|
|
||||||
profile.virtualType = target.profileType
|
|
||||||
OmegaPac.Profiles.updateRevision(profile)
|
OmegaPac.Profiles.updateRevision(profile)
|
||||||
changes = {}
|
changes = {}
|
||||||
changes[OmegaPac.Profiles.nameAsKey(profile)] = profile
|
changes[OmegaPac.Profiles.nameAsKey(profile)] = profile
|
||||||
|
@ -23,40 +23,55 @@ angular.module('omegaDecoration', []).value('profileIcons', {
|
|||||||
-1
|
-1
|
||||||
else
|
else
|
||||||
1
|
1
|
||||||
).directive('omegaProfileIcon', (profileIcons) ->
|
).constant('getVirtualTarget', (profile, options) ->
|
||||||
|
if profile?.profileType == 'VirtualProfile'
|
||||||
|
options?['+' + profile.defaultProfileName]
|
||||||
|
).directive('omegaProfileIcon', (profileIcons, getVirtualTarget) ->
|
||||||
restrict: 'A'
|
restrict: 'A'
|
||||||
template: '''
|
template: '''
|
||||||
<span ng-style="{color: color || profile.color}"
|
<span ng-style="{color: color || getColor(profile)}"
|
||||||
ng-class="{'virtual-profile-icon': profile.virtualType}"
|
ng-class="{'virtual-profile-icon': isVirtual(profile)}"
|
||||||
class="glyphicon {{getIcon(profile)}}">
|
class="glyphicon {{icon || getIcon(profile)}}">
|
||||||
</span>
|
</span>
|
||||||
'''
|
'''
|
||||||
scope:
|
scope:
|
||||||
'profile': '=?omegaProfileIcon'
|
'profile': '=?omegaProfileIcon'
|
||||||
'icon': '=?icon'
|
'icon': '=?icon'
|
||||||
'color': '=?color'
|
'color': '=?color'
|
||||||
|
'options': '=options'
|
||||||
link: (scope, element, attrs, ngModel) ->
|
link: (scope, element, attrs, ngModel) ->
|
||||||
scope.profileIcons = profileIcons
|
scope.profileIcons = profileIcons
|
||||||
|
scope.isVirtual = (profile) ->
|
||||||
|
profile?.profileType == 'VirtualProfile'
|
||||||
scope.getIcon = (profile) ->
|
scope.getIcon = (profile) ->
|
||||||
(scope.icon || scope.profileIcons[profile.virtualType] ||
|
type = profile?.profileType
|
||||||
profileIcons[profile.profileType])
|
type = getVirtualTarget(profile, scope.options)?.profileType ? type
|
||||||
|
profileIcons[type]
|
||||||
|
scope.getColor = (profile) ->
|
||||||
|
color = undefined
|
||||||
|
while profile
|
||||||
|
color = profile.color
|
||||||
|
profile = getVirtualTarget(profile, scope.options)
|
||||||
|
color
|
||||||
).directive('omegaProfileInline', ->
|
).directive('omegaProfileInline', ->
|
||||||
restrict: 'A'
|
restrict: 'A'
|
||||||
template: '''
|
template: '''
|
||||||
<span omega-profile-icon="profile"></span>
|
<span omega-profile-icon="profile" options="options"></span>
|
||||||
{{dispName ? dispName(profile) : profile.name}}
|
{{dispName ? dispName(profile) : profile.name}}
|
||||||
'''
|
'''
|
||||||
scope:
|
scope:
|
||||||
'profile': '=omegaProfileInline'
|
'profile': '=omegaProfileInline'
|
||||||
'dispName': '=?dispName'
|
'dispName': '=?dispName'
|
||||||
|
'options': '=options'
|
||||||
).directive('omegaHtml', ($compile) ->
|
).directive('omegaHtml', ($compile) ->
|
||||||
restrict: 'A'
|
restrict: 'A'
|
||||||
link: (scope, element, attrs, ngModel) ->
|
link: (scope, element, attrs, ngModel) ->
|
||||||
locals =
|
locals =
|
||||||
$profile: (profile = 'profile', dispName = 'dispNameFilter') ->
|
$profile: (profile = 'profile', dispName = 'dispNameFilter',
|
||||||
|
options = 'options') ->
|
||||||
"""
|
"""
|
||||||
<span class="profile-inline" omega-profile-inline="#{profile}"
|
<span class="profile-inline" omega-profile-inline="#{profile}"
|
||||||
disp-name="#{dispName}"></span>
|
disp-name="#{dispName}" options="#{options}"></span>
|
||||||
"""
|
"""
|
||||||
getHtml = -> scope.$eval(attrs.omegaHtml, locals)
|
getHtml = -> scope.$eval(attrs.omegaHtml, locals)
|
||||||
scope.$watch getHtml, (html) ->
|
scope.$watch getHtml, (html) ->
|
||||||
@ -70,6 +85,7 @@ angular.module('omegaDecoration', []).value('profileIcons', {
|
|||||||
'profiles': '&omegaProfileSelect'
|
'profiles': '&omegaProfileSelect'
|
||||||
'defaultText': '@?defaultText'
|
'defaultText': '@?defaultText'
|
||||||
'dispName': '=?dispName'
|
'dispName': '=?dispName'
|
||||||
|
'options': '=options'
|
||||||
link: (scope, element, attrs, ngModel) ->
|
link: (scope, element, attrs, ngModel) ->
|
||||||
scope.profileIcons = profileIcons
|
scope.profileIcons = profileIcons
|
||||||
scope.currentProfiles = []
|
scope.currentProfiles = []
|
||||||
|
@ -222,10 +222,11 @@ main {
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sp-preview {
|
.sp-preview, .profile-color-editor-fake {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
|
border: solid 1px #222;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sp-dd {
|
.sp-dd {
|
||||||
|
@ -103,6 +103,8 @@ angular.module('omega').controller 'MasterCtrl', ($scope, $rootScope, $window,
|
|||||||
conflict: '!$value || !profileByName($value)'
|
conflict: '!$value || !profileByName($value)'
|
||||||
reserved: '!$value || !isProfileNameReserved($value)'
|
reserved: '!$value || !isProfileNameReserved($value)'
|
||||||
scope.profileIcons = profileIcons
|
scope.profileIcons = profileIcons
|
||||||
|
scope.dispNameFilter = dispNameFilter
|
||||||
|
scope.options = $scope.options
|
||||||
$modal.open(
|
$modal.open(
|
||||||
templateUrl: 'partials/new_profile.html'
|
templateUrl: 'partials/new_profile.html'
|
||||||
scope: scope
|
scope: scope
|
||||||
@ -122,10 +124,11 @@ angular.module('omega').controller 'MasterCtrl', ($scope, $rootScope, $window,
|
|||||||
scope.toName = toName
|
scope.toName = toName
|
||||||
scope.profileByName = $rootScope.profileByName
|
scope.profileByName = $rootScope.profileByName
|
||||||
scope.dispNameFilter = dispNameFilter
|
scope.dispNameFilter = dispNameFilter
|
||||||
|
scope.options = $scope.options
|
||||||
scope.profileSelect = (model) ->
|
scope.profileSelect = (model) ->
|
||||||
"""
|
"""
|
||||||
<div omega-profile-select="options | profiles:profile"
|
<div omega-profile-select="options | profiles:profile"
|
||||||
ng-model="#{model}"
|
ng-model="#{model}" options="options"
|
||||||
disp-name="dispNameFilter" style="display: inline-block;">
|
disp-name="dispNameFilter" style="display: inline-block;">
|
||||||
</div>
|
</div>
|
||||||
"""
|
"""
|
||||||
@ -157,7 +160,8 @@ angular.module('omega').controller 'MasterCtrl', ($scope, $rootScope, $window,
|
|||||||
scope.validateProfileName =
|
scope.validateProfileName =
|
||||||
conflict: '!$value || $value == fromName || !profileByName($value)'
|
conflict: '!$value || $value == fromName || !profileByName($value)'
|
||||||
reserved: '!$value || !isProfileNameReserved($value)'
|
reserved: '!$value || !isProfileNameReserved($value)'
|
||||||
scope.profileIcons = profileIcons
|
scope.dispNameFilter = $scope.dispNameFilter
|
||||||
|
scope.options = $scope.options
|
||||||
$modal.open(
|
$modal.open(
|
||||||
templateUrl: 'partials/rename_profile.html'
|
templateUrl: 'partials/rename_profile.html'
|
||||||
scope: scope
|
scope: scope
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
angular.module('omega').controller 'ProfileCtrl', ($scope, $stateParams,
|
angular.module('omega').controller 'ProfileCtrl', ($scope, $stateParams,
|
||||||
$location, $rootScope, $timeout, $state, $modal, profileColorPalette,
|
$location, $rootScope, $timeout, $state, $modal, profileColorPalette,
|
||||||
getAttachedName, getParentName) ->
|
getAttachedName, getParentName, getVirtualTarget) ->
|
||||||
name = $stateParams.name
|
name = $stateParams.name
|
||||||
profileTemplates =
|
profileTemplates =
|
||||||
'FixedProfile': 'profile_fixed.html'
|
'FixedProfile': 'profile_fixed.html'
|
||||||
@ -18,13 +18,22 @@ angular.module('omega').controller 'ProfileCtrl', ($scope, $stateParams,
|
|||||||
showPalette: true
|
showPalette: true
|
||||||
showSelectionPalette: true
|
showSelectionPalette: true
|
||||||
|
|
||||||
|
$scope.getProfileColor = ->
|
||||||
|
color = undefined
|
||||||
|
profile = $scope.profile
|
||||||
|
while profile
|
||||||
|
color = profile.color
|
||||||
|
profile = getVirtualTarget(profile, $scope.options)
|
||||||
|
color
|
||||||
|
|
||||||
$scope.deleteProfile = ->
|
$scope.deleteProfile = ->
|
||||||
profileName = $scope.profile.name
|
profileName = $scope.profile.name
|
||||||
refs = OmegaPac.Profiles.referencedBySet(profileName, $rootScope.options)
|
refs = OmegaPac.Profiles.referencedBySet(profileName, $rootScope.options)
|
||||||
|
|
||||||
scope = $rootScope.$new('isolate')
|
scope = $rootScope.$new('isolate')
|
||||||
scope.profile = $scope.profile
|
scope.profile = $scope.profile
|
||||||
scope.profileIcons = $scope.profileIcons
|
scope.dispNameFilter = $scope.dispNameFilter
|
||||||
|
scope.options = $scope.options
|
||||||
|
|
||||||
if Object.keys(refs).length > 0
|
if Object.keys(refs).length > 0
|
||||||
refSet = {}
|
refSet = {}
|
||||||
@ -94,15 +103,4 @@ angular.module('omega').controller 'ProfileCtrl', ($scope, $stateParams,
|
|||||||
revisionChanged = true
|
revisionChanged = true
|
||||||
$scope.$watch expression, onChange, true
|
$scope.$watch expression, onChange, true
|
||||||
|
|
||||||
onProfileChange = (profile, oldProfile) ->
|
|
||||||
return if profile == oldProfile
|
|
||||||
if profile.virtualType
|
|
||||||
target = $scope.profileByName(profile.defaultProfileName)
|
|
||||||
profile.color = target.color
|
|
||||||
profile.virtualType = target.profileType
|
|
||||||
OmegaPac.Profiles.each $scope.options, (key, p) ->
|
|
||||||
if p.virtualType and p.defaultProfileName == profile.name
|
|
||||||
onProfileChange(p, null)
|
|
||||||
|
|
||||||
$scope.watchAndUpdateRevision 'profile'
|
$scope.watchAndUpdateRevision 'profile'
|
||||||
$scope.$watch 'profile', onProfileChange, true
|
|
||||||
|
@ -118,7 +118,8 @@ angular.module('omega').controller 'SwitchProfileCtrl', ($scope, $location,
|
|||||||
scope = $scope.$new('isolate')
|
scope = $scope.$new('isolate')
|
||||||
scope.rule = $scope.profile.rules[index]
|
scope.rule = $scope.profile.rules[index]
|
||||||
scope.ruleProfile = $scope.profileByName(scope.rule.profileName)
|
scope.ruleProfile = $scope.profileByName(scope.rule.profileName)
|
||||||
scope.profileIcons = $scope.profileIcons
|
scope.dispNameFilter = $scope.dispNameFilter
|
||||||
|
scope.options = $scope.options
|
||||||
$modal.open(
|
$modal.open(
|
||||||
templateUrl: 'partials/rule_remove_confirm.html'
|
templateUrl: 'partials/rule_remove_confirm.html'
|
||||||
scope: scope
|
scope: scope
|
||||||
@ -128,14 +129,15 @@ angular.module('omega').controller 'SwitchProfileCtrl', ($scope, $location,
|
|||||||
|
|
||||||
$scope.resetRules = ->
|
$scope.resetRules = ->
|
||||||
scope = $scope.$new('isolate')
|
scope = $scope.$new('isolate')
|
||||||
scope.ruleProfile = $scope.profileByName($scope.profile.defaultProfileName)
|
scope.ruleProfile = $scope.profileByName($scope.defaultProfileName)
|
||||||
scope.profileIcons = $scope.profileIcons
|
scope.dispNameFilter = $scope.dispNameFilter
|
||||||
|
scope.options = $scope.options
|
||||||
$modal.open(
|
$modal.open(
|
||||||
templateUrl: 'partials/rule_reset_confirm.html'
|
templateUrl: 'partials/rule_reset_confirm.html'
|
||||||
scope: scope
|
scope: scope
|
||||||
).result.then ->
|
).result.then ->
|
||||||
for rule in $scope.profile.rules
|
for rule in $scope.profile.rules
|
||||||
rule.profileName = $scope.profile.defaultProfileName
|
rule.profileName = $scope.defaultProfileName
|
||||||
|
|
||||||
$scope.sortableOptions =
|
$scope.sortableOptions =
|
||||||
handle: '.sort-bar'
|
handle: '.sort-bar'
|
||||||
@ -202,7 +204,8 @@ angular.module('omega').controller 'SwitchProfileCtrl', ($scope, $location,
|
|||||||
return unless $scope.attached
|
return unless $scope.attached
|
||||||
scope = $scope.$new('isolate')
|
scope = $scope.$new('isolate')
|
||||||
scope.attached = $scope.attached
|
scope.attached = $scope.attached
|
||||||
scope.profileIcons = profileIcons
|
scope.dispNameFilter = $scope.dispNameFilter
|
||||||
|
scope.options = $scope.options
|
||||||
$modal.open(
|
$modal.open(
|
||||||
templateUrl: 'partials/delete_attached.html'
|
templateUrl: 'partials/delete_attached.html'
|
||||||
scope: scope
|
scope: scope
|
||||||
|
@ -30,9 +30,7 @@ html(lang='en' ng-controller='MasterCtrl' ng-csp)
|
|||||||
li.nav-header {{'options_navHeader_profiles' | tr}}
|
li.nav-header {{'options_navHeader_profiles' | tr}}
|
||||||
li(ng-repeat='profile in options | profiles:"sorted"' ui-sref-active='active')
|
li(ng-repeat='profile in options | profiles:"sorted"' ui-sref-active='active')
|
||||||
a(ui-sref='profile({name: profile.name})')
|
a(ui-sref='profile({name: profile.name})')
|
||||||
span(omega-profile-icon='profile')
|
span(omega-profile-inline='profile' options='options')
|
||||||
= ' '
|
|
||||||
| {{profile.name}}
|
|
||||||
li
|
li
|
||||||
a(role='button' ng-click='newProfile()')
|
a(role='button' ng-click='newProfile()')
|
||||||
span.glyphicon.glyphicon-plus
|
span.glyphicon.glyphicon-plus
|
||||||
|
@ -8,9 +8,7 @@
|
|||||||
.well
|
.well
|
||||||
ul.list-style-none
|
ul.list-style-none
|
||||||
li(ng-repeat='p in refs')
|
li(ng-repeat='p in refs')
|
||||||
span(omega-profile-icon='p')
|
span(omega-profile-inline='p' options='options' disp-name='dispNameFilter')
|
||||||
= ' '
|
|
||||||
| {{p.name | dispName}}
|
|
||||||
p {{'options_modifyReferringProfiles' | tr}}
|
p {{'options_modifyReferringProfiles' | tr}}
|
||||||
.modal-footer
|
.modal-footer
|
||||||
button.btn.btn-default(ng-click='$dismiss()') {{'dialog_cancel' | tr}}
|
button.btn.btn-default(ng-click='$dismiss()') {{'dialog_cancel' | tr}}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.modal-body
|
.modal-body
|
||||||
p {{'options_deleteAttachedConfirm' | tr}}
|
p {{'options_deleteAttachedConfirm' | tr}}
|
||||||
.well
|
.well
|
||||||
span(omega-profile-icon='attached')
|
span(omega-profile-icon='attached' options='options')
|
||||||
= ' '
|
= ' '
|
||||||
| {{attached.sourceUrl || ('options_ruleListLineCount' | tr:[attached.ruleList.split('\n').length])}}
|
| {{attached.sourceUrl || ('options_ruleListLineCount' | tr:[attached.ruleList.split('\n').length])}}
|
||||||
.modal-footer
|
.modal-footer
|
||||||
|
@ -6,9 +6,7 @@
|
|||||||
.modal-body
|
.modal-body
|
||||||
p {{'options_deleteProfileConfirm' | tr}}
|
p {{'options_deleteProfileConfirm' | tr}}
|
||||||
.well
|
.well
|
||||||
span(omega-profile-icon='profile')
|
span(omega-profile-inline='profile' options='options' disp-name='dispNameFilter')
|
||||||
= ' '
|
|
||||||
| {{profile.name}}
|
|
||||||
.modal-footer
|
.modal-footer
|
||||||
button.btn.btn-default(ng-click='$dismiss()') {{'dialog_cancel' | tr}}
|
button.btn.btn-default(ng-click='$dismiss()') {{'dialog_cancel' | tr}}
|
||||||
button.btn.btn-danger(type='button' ng-click='$close("ok")') {{'options_deleteProfile' | tr}}
|
button.btn.btn-danger(type='button' ng-click='$close("ok")') {{'options_deleteProfile' | tr}}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
.btn-group.omega-profile-select(dropdown on-toggle="toggled(open)")
|
.btn-group.omega-profile-select(dropdown on-toggle="toggled(open)")
|
||||||
button.btn.btn-default.dropdown-toggle(type='button' aria-expanded='false'
|
button.btn.btn-default.dropdown-toggle(type='button' aria-expanded='false'
|
||||||
role='listbox' aria-haspopup='true')
|
role='listbox' aria-haspopup='true')
|
||||||
span(omega-profile-icon='selectedProfile' icon='selectedProfile ? undefined : "glyphicon-time"')
|
span(omega-profile-icon='selectedProfile' options='options' icon='selectedProfile ? undefined : "glyphicon-time"')
|
||||||
= ' '
|
= ' '
|
||||||
span(ng-show='!!profileName') {{getName(selectedProfile)}}
|
span(ng-show='!!profileName') {{getName(selectedProfile)}}
|
||||||
span(ng-show='!profileName') {{defaultText}}
|
span(ng-show='!profileName') {{defaultText}}
|
||||||
@ -14,5 +14,5 @@
|
|||||||
= ' {{defaultText}}'
|
= ' {{defaultText}}'
|
||||||
li(role='option' ng-repeat='profile in dispProfiles' ng-class='{active: profileName == profile.name}')
|
li(role='option' ng-repeat='profile in dispProfiles' ng-class='{active: profileName == profile.name}')
|
||||||
a(ng-click='setProfileName(profile.name)')
|
a(ng-click='setProfileName(profile.name)')
|
||||||
span(omega-profile-icon='profile')
|
span(omega-profile-icon='profile' options='options')
|
||||||
= ' {{getName(profile)}}'
|
= ' {{getName(profile)}}'
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
= ' '
|
= ' '
|
||||||
| {{'options_deleteProfile' | tr}}
|
| {{'options_deleteProfile' | tr}}
|
||||||
span.profile-color-editor
|
span.profile-color-editor
|
||||||
x-spectrum-colorpicker(ng-model='profile.color' options='spectrumOptions')
|
.profile-color-editor-fake(ng-if='profile.profileType == "VirtualProfile"'
|
||||||
|
ng-style="{'background-color': getProfileColor()}")
|
||||||
|
x-spectrum-colorpicker(ng-model='profile.color' options='spectrumOptions'
|
||||||
|
ng-if='profile.profileType != "VirtualProfile"')
|
||||||
h2.profile-name {{'options_profileTabPrefix' | tr}}{{profile.name}}
|
h2.profile-name {{'options_profileTabPrefix' | tr}}{{profile.name}}
|
||||||
div(ng-include='profileTemplate')
|
div(ng-include='profileTemplate')
|
||||||
|
@ -5,12 +5,12 @@ div(ng-controller='RuleListProfileCtrl')
|
|||||||
label {{'options_ruleListMatchProfile' | tr}}
|
label {{'options_ruleListMatchProfile' | tr}}
|
||||||
= ' '
|
= ' '
|
||||||
div(omega-profile-select='options | profiles:profile' ng-model='profile.matchProfileName'
|
div(omega-profile-select='options | profiles:profile' ng-model='profile.matchProfileName'
|
||||||
disp-name='dispNameFilter' style='display: inline-block;')
|
disp-name='dispNameFilter' options='options' style='display: inline-block;')
|
||||||
.form-group
|
.form-group
|
||||||
label {{'options_ruleListDefaultProfile' | tr}}
|
label {{'options_ruleListDefaultProfile' | tr}}
|
||||||
= ' '
|
= ' '
|
||||||
div(omega-profile-select='options | profiles:profile' ng-model='profile.defaultProfileName'
|
div(omega-profile-select='options | profiles:profile' ng-model='profile.defaultProfileName'
|
||||||
disp-name='dispNameFilter' style='display: inline-block;')
|
disp-name='dispNameFilter' options='options' style='display: inline-block;')
|
||||||
form.form-group
|
form.form-group
|
||||||
label {{'options_ruleListFormat' | tr}}
|
label {{'options_ruleListFormat' | tr}}
|
||||||
.radio.inline-form-control.no-min-width(ng-repeat='format in ruleListFormats')
|
.radio.inline-form-control.no-min-width(ng-repeat='format in ruleListFormats')
|
||||||
|
@ -52,7 +52,8 @@ div(ng-controller='SwitchProfileCtrl')
|
|||||||
ui-validate='{pattern: "validateCondition(rule.condition, $value)"}')
|
ui-validate='{pattern: "validateCondition(rule.condition, $value)"}')
|
||||||
td
|
td
|
||||||
div(omega-profile-select='options | profiles:profile' ng-model='rule.profileName'
|
div(omega-profile-select='options | profiles:profile' ng-model='rule.profileName'
|
||||||
disp-name='dispNameFilter' ng-class='{disabled: rule.condition.conditionType == "NeverCondition"}')
|
disp-name='dispNameFilter' options='options'
|
||||||
|
ng-class='{disabled: rule.condition.conditionType == "NeverCondition"}')
|
||||||
td
|
td
|
||||||
button.btn.btn-danger.btn-sm(title="{{'options_deleteRule' | tr}}" ng-click='removeRule($index)')
|
button.btn.btn-danger.btn-sm(title="{{'options_deleteRule' | tr}}" ng-click='removeRule($index)')
|
||||||
span.glyphicon.glyphicon-trash
|
span.glyphicon.glyphicon-trash
|
||||||
@ -80,7 +81,7 @@ div(ng-controller='SwitchProfileCtrl')
|
|||||||
| {{'options_switchAttachedProfileInConditionDisabled' | tr}}
|
| {{'options_switchAttachedProfileInConditionDisabled' | tr}}
|
||||||
td
|
td
|
||||||
div(omega-profile-select='options | profiles:profile' ng-model='attached.matchProfileName'
|
div(omega-profile-select='options | profiles:profile' ng-model='attached.matchProfileName'
|
||||||
disp-name='dispNameFilter' ng-class='{disabled: !attachedOptions.enabled}')
|
disp-name='dispNameFilter' options='options' ng-class='{disabled: !attachedOptions.enabled}')
|
||||||
td
|
td
|
||||||
button.btn.btn-danger.btn-sm(title="{{'options_deleteAttached' | tr}}" ng-click='removeAttached()')
|
button.btn.btn-danger.btn-sm(title="{{'options_deleteAttached' | tr}}" ng-click='removeAttached()')
|
||||||
span.glyphicon.glyphicon-trash
|
span.glyphicon.glyphicon-trash
|
||||||
@ -90,7 +91,7 @@ div(ng-controller='SwitchProfileCtrl')
|
|||||||
td(colspan='2') {{'options_switchDefaultProfile' | tr}}
|
td(colspan='2') {{'options_switchDefaultProfile' | tr}}
|
||||||
td
|
td
|
||||||
div(omega-profile-select='options | profiles:profile' ng-model='defaultProfileName'
|
div(omega-profile-select='options | profiles:profile' ng-model='defaultProfileName'
|
||||||
disp-name='dispNameFilter')
|
disp-name='dispNameFilter' options='options')
|
||||||
td
|
td
|
||||||
button.btn.btn-info.btn-sm(title="{{'options_resetRules_help' | tr}}" ng-click='resetRules()')
|
button.btn.btn-info.btn-sm(title="{{'options_resetRules_help' | tr}}" ng-click='resetRules()')
|
||||||
span.glyphicon.glyphicon-chevron-up
|
span.glyphicon.glyphicon-chevron-up
|
||||||
|
@ -7,7 +7,7 @@ div
|
|||||||
label {{'options_virtualProfileTarget' | tr}}
|
label {{'options_virtualProfileTarget' | tr}}
|
||||||
= ' '
|
= ' '
|
||||||
div(omega-profile-select='options | profiles:profile' ng-model='profile.defaultProfileName'
|
div(omega-profile-select='options | profiles:profile' ng-model='profile.defaultProfileName'
|
||||||
disp-name='dispNameFilter' style='display: inline-block;')
|
disp-name='dispNameFilter' style='display: inline-block;' options='options')
|
||||||
section.settings-group
|
section.settings-group
|
||||||
h3 {{'options_group_virtualProfileReplace' | tr}}
|
h3 {{'options_group_virtualProfileReplace' | tr}}
|
||||||
p.help-block(omega-html='"options_virtualProfileReplaceHelp" | tr:[$profile("profileByName(profile.defaultProfileName)")]')
|
p.help-block(omega-html='"options_virtualProfileReplaceHelp" | tr:[$profile("profileByName(profile.defaultProfileName)")]')
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
.modal-body
|
.modal-body
|
||||||
p(omega-html='"options_replaceProfileConfirm" | tr:[profileSelect("fromName"), profileSelect("toName")]')
|
p(omega-html='"options_replaceProfileConfirm" | tr:[profileSelect("fromName"), profileSelect("toName")]')
|
||||||
.well
|
.well
|
||||||
span(omega-profile-inline='profileByName(fromName)')
|
span(omega-profile-inline='profileByName(fromName)' options='options' disp-name='dispNameFilter')
|
||||||
= ' '
|
= ' '
|
||||||
span.glyphicon.glyphicon-chevron-right
|
span.glyphicon.glyphicon-chevron-right
|
||||||
= ' '
|
= ' '
|
||||||
span(omega-profile-inline='profileByName(toName)')
|
span(omega-profile-inline='profileByName(toName)' options='options' disp-name='dispNameFilter')
|
||||||
.help-block(omega-html="'options_replaceProfileHelp' | tr:[$profile('profileByName(fromName)'), $profile('profileByName(toName)')]")
|
.help-block(omega-html="'options_replaceProfileHelp' | tr:[$profile('profileByName(fromName)'), $profile('profileByName(toName)')]")
|
||||||
.modal-footer
|
.modal-footer
|
||||||
button.btn.btn-default(ng-click='$dismiss()') {{'dialog_cancel' | tr}}
|
button.btn.btn-default(ng-click='$dismiss()') {{'dialog_cancel' | tr}}
|
||||||
|
@ -10,9 +10,7 @@
|
|||||||
= ' '
|
= ' '
|
||||||
| {{rule.condition.pattern}}
|
| {{rule.condition.pattern}}
|
||||||
span.pull-right
|
span.pull-right
|
||||||
span(omega-profile-icon='ruleProfile')
|
span(omega-profile-inline='ruleProfile' disp-name='dispNameFilter' options='options')
|
||||||
= ' '
|
|
||||||
| {{ruleProfile.name | dispName}}
|
|
||||||
.modal-footer
|
.modal-footer
|
||||||
button.btn.btn-default(ng-click='$dismiss()') {{'dialog_cancel' | tr}}
|
button.btn.btn-default(ng-click='$dismiss()') {{'dialog_cancel' | tr}}
|
||||||
button.btn.btn-danger(type='button' ng-click='$close("ok")') {{'options_deleteRule' | tr}}
|
button.btn.btn-danger(type='button' ng-click='$close("ok")') {{'options_deleteRule' | tr}}
|
||||||
|
@ -6,9 +6,7 @@
|
|||||||
.modal-body
|
.modal-body
|
||||||
p {{'options_resetRulesConfirm' | tr}}
|
p {{'options_resetRulesConfirm' | tr}}
|
||||||
.well
|
.well
|
||||||
span(omega-profile-icon='ruleProfile')
|
span(omega-profile-inline='ruleProfile' disp-name='dispNameFilter' options='options')
|
||||||
= ' '
|
|
||||||
| {{ruleProfile.name | dispName}}
|
|
||||||
.modal-footer
|
.modal-footer
|
||||||
button.btn.btn-default(ng-click='$dismiss()') {{'dialog_cancel' | tr}}
|
button.btn.btn-default(ng-click='$dismiss()') {{'dialog_cancel' | tr}}
|
||||||
button.btn.btn-warning(type='button' ng-click='$close("ok")') {{'options_resetRules' | tr}}
|
button.btn.btn-warning(type='button' ng-click='$close("ok")') {{'options_resetRules' | tr}}
|
||||||
|
@ -17,7 +17,7 @@ section.settings-group
|
|||||||
= ' '
|
= ' '
|
||||||
div(omega-profile-select='options | profiles:"all"' ng-model='options["-startupProfileName"]'
|
div(omega-profile-select='options | profiles:"all"' ng-model='options["-startupProfileName"]'
|
||||||
default-text="{{'options_startupProfile_none' | tr}}" disp-name='dispNameFilter'
|
default-text="{{'options_startupProfile_none' | tr}}" disp-name='dispNameFilter'
|
||||||
style='display: inline-block;')
|
style='display: inline-block;' options='options')
|
||||||
div.checkbox
|
div.checkbox
|
||||||
label
|
label
|
||||||
input(type='checkbox' ng-model='options["-showConditionTypes"]' ng-true-value='1' ng-false-value='0' omega-int2str)
|
input(type='checkbox' ng-model='options["-showConditionTypes"]' ng-true-value='1' ng-false-value='0' omega-int2str)
|
||||||
@ -36,12 +36,8 @@ section.settings-group
|
|||||||
ul.cycle-profile-container.cycle-enabled(ui-sortable="sortableOptions"
|
ul.cycle-profile-container.cycle-enabled(ui-sortable="sortableOptions"
|
||||||
ng-model='options["-quickSwitchProfiles"]')
|
ng-model='options["-quickSwitchProfiles"]')
|
||||||
li(ng-repeat='name in options["-quickSwitchProfiles"]')
|
li(ng-repeat='name in options["-quickSwitchProfiles"]')
|
||||||
span(omega-profile-icon='profileByName(name)')
|
span(omega-profile-inline='profileByName(name)' options='options' disp-name='dispNameFilter')
|
||||||
= ' '
|
|
||||||
| {{name | dispName}}
|
|
||||||
h4 {{'options_notCycledProfiles' | tr}}
|
h4 {{'options_notCycledProfiles' | tr}}
|
||||||
ul.cycle-profile-container(ui-sortable="sortableOptions" ng-model='notCycledProfiles')
|
ul.cycle-profile-container(ui-sortable="sortableOptions" ng-model='notCycledProfiles')
|
||||||
li.bg-success(ng-repeat='name in notCycledProfiles')
|
li.bg-success(ng-repeat='name in notCycledProfiles')
|
||||||
span(omega-profile-icon='profileByName(name)')
|
span(omega-profile-inline='profileByName(name)' options='options' disp-name='dispNameFilter')
|
||||||
= ' '
|
|
||||||
| {{name | dispName}}
|
|
||||||
|
@ -27,13 +27,11 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp)
|
|||||||
ul.nav.nav-pills.nav-stacked(ng-hide='showConditionForm || proxyNotControllable')
|
ul.nav.nav-pills.nav-stacked(ng-hide='showConditionForm || proxyNotControllable')
|
||||||
li.profile(ng-repeat='profile in builtinProfiles' ng-class='{active: isActive(profile.name), "bg-info": isEffective(profile.name)}')
|
li.profile(ng-repeat='profile in builtinProfiles' ng-class='{active: isActive(profile.name), "bg-info": isEffective(profile.name)}')
|
||||||
a(ng-click='applyProfile(profile)')
|
a(ng-click='applyProfile(profile)')
|
||||||
span(omega-profile-icon='profile' icon='getIcon(profile)')
|
span(omega-profile-inline='profile' icon='getIcon(profile)' options='availableProfiles' disp-name='dispNameFilter')
|
||||||
= ' '
|
|
||||||
| {{profile.name | dispName}}
|
|
||||||
li.profile.external-profile(ng-show='!!externalProfile' ng-class='{active: isActive(""), "bg-info": isEffective("")}')
|
li.profile.external-profile(ng-show='!!externalProfile' ng-class='{active: isActive(""), "bg-info": isEffective("")}')
|
||||||
a(ng-click='nameExternal.open = true')
|
a(ng-click='nameExternal.open = true')
|
||||||
form(name='nameExternalForm' ng-submit='nameExternalForm.$valid && saveExternal()')
|
form(name='nameExternalForm' ng-submit='nameExternalForm.$valid && saveExternal()')
|
||||||
span(omega-profile-icon='externalProfile' icon='getIcon(externalProfile, "normal")')
|
span(omega-profile-icon='externalProfile' icon='getIcon(externalProfile, "normal")' options='availableProfiles' disp-name='dispNameFilter')
|
||||||
= ' '
|
= ' '
|
||||||
span(ng-show='!nameExternal.open') {{'popup_externalProfile' | tr}}
|
span(ng-show='!nameExternal.open') {{'popup_externalProfile' | tr}}
|
||||||
input.form-control(ng-show='!!nameExternal.open' ng-model='externalProfile.name' ng-blur='nameExternalForm.submit()'
|
input.form-control(ng-show='!!nameExternal.open' ng-model='externalProfile.name' ng-blur='nameExternalForm.submit()'
|
||||||
@ -42,21 +40,17 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp)
|
|||||||
li.profile(ng-repeat='profile in customProfiles' ng-class='{active: isActive(profile.name), "bg-info": isEffective(profile.name)}'
|
li.profile(ng-repeat='profile in customProfiles' ng-class='{active: isActive(profile.name), "bg-info": isEffective(profile.name)}'
|
||||||
dropdown)
|
dropdown)
|
||||||
a(ng-click='applyProfile(profile)' ng-if='!profile.validResultProfiles')
|
a(ng-click='applyProfile(profile)' ng-if='!profile.validResultProfiles')
|
||||||
span(omega-profile-icon='profile' icon='getIcon(profile)')
|
span(omega-profile-inline='profile' icon='getIcon(profile)' options='availableProfiles' disp-name='dispNameFilter')
|
||||||
= ' '
|
|
||||||
| {{profile.name | dispName}}
|
|
||||||
a.profile-with-default-edit(ng-click='applyProfile(profile)' ng-if='!!profile.validResultProfiles')
|
a.profile-with-default-edit(ng-click='applyProfile(profile)' ng-if='!!profile.validResultProfiles')
|
||||||
span(omega-profile-icon='profile' icon='getIcon(profile)')
|
span(omega-profile-inline='profile' icon='getIcon(profile)' options='availableProfiles' disp-name='dispNameFilter')
|
||||||
= ' {{profile.name | dispName}} '
|
= ' '
|
||||||
| [{{profile.defaultProfileName}}]
|
| [{{profile.defaultProfileName}}]
|
||||||
button.dropdown-toggle.btn.btn-default(ng-click='$event.stopPropagation()')
|
button.dropdown-toggle.btn.btn-default(ng-click='$event.stopPropagation()')
|
||||||
span.glyphicon.glyphicon-chevron-down
|
span.glyphicon.glyphicon-chevron-down
|
||||||
ul.dropdown-menu(ng-if='!!profile.validResultProfiles')
|
ul.dropdown-menu(ng-if='!!profile.validResultProfiles')
|
||||||
li(ng-repeat='p in profile.validResultProfiles' ng-class='{active: p.name == profile.defaultProfileName}')
|
li(ng-repeat='p in profile.validResultProfiles' ng-class='{active: p.name == profile.defaultProfileName}')
|
||||||
a(ng-click='setDefaultProfile(profile.name, p.name)')
|
a(ng-click='setDefaultProfile(profile.name, p.name)')
|
||||||
span(omega-profile-icon='p')
|
span(omega-profile-inline='p' options='availableProfiles' disp-name='dispNameFilter')
|
||||||
= ' '
|
|
||||||
| {{p.name | dispName}}
|
|
||||||
li.divider(ng-show='!!currentDomain && validResultProfiles.length')
|
li.divider(ng-show='!!currentDomain && validResultProfiles.length')
|
||||||
li(ng-show='!!currentProfileCanAddRule')
|
li(ng-show='!!currentProfileCanAddRule')
|
||||||
a(ng-click='showConditionForm = true')
|
a(ng-click='showConditionForm = true')
|
||||||
@ -73,9 +67,7 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp)
|
|||||||
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')
|
ng-show='!!currentTempRuleProfile || validResultProfiles.length == 1 || profile.name != currentProfileName')
|
||||||
a(ng-click='addTempRule(currentDomain, profile.name)')
|
a(ng-click='addTempRule(currentDomain, profile.name)')
|
||||||
span(omega-profile-icon='profile')
|
span(omega-profile-inline='profile' options='availableProfiles' disp-name='dispNameFilter')
|
||||||
= ' '
|
|
||||||
| {{profile.name | dispName}}
|
|
||||||
li.divider
|
li.divider
|
||||||
li
|
li
|
||||||
a(ng-click='openOptions()')
|
a(ng-click='openOptions()')
|
||||||
@ -100,9 +92,7 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp)
|
|||||||
| {{'popup_addConditionTo' | tr}}
|
| {{'popup_addConditionTo' | tr}}
|
||||||
= ' '
|
= ' '
|
||||||
span.profile-inline
|
span.profile-inline
|
||||||
span(omega-profile-icon='currentProfile')
|
span(omega-profile-inline='currentProfile' options='availableProfiles' disp-name='dispNameFilter')
|
||||||
= ' '
|
|
||||||
| {{currentProfileName | dispName}}
|
|
||||||
div.form-group
|
div.form-group
|
||||||
label
|
label
|
||||||
| {{'options_conditionType' | tr}}
|
| {{'options_conditionType' | tr}}
|
||||||
@ -123,7 +113,7 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp)
|
|||||||
div.form-group
|
div.form-group
|
||||||
label {{'options_resultProfile' | tr}}
|
label {{'options_resultProfile' | tr}}
|
||||||
div(omega-profile-select='validResultProfiles' ng-model='rule.profileName'
|
div(omega-profile-select='validResultProfiles' ng-model='rule.profileName'
|
||||||
disp-name='dispNameFilter')
|
disp-name='dispNameFilter' options='availableProfiles')
|
||||||
div.condition-controls
|
div.condition-controls
|
||||||
button.btn.btn-default(type='button' ng-click='showConditionForm = false')
|
button.btn.btn-default(type='button' ng-click='showConditionForm = false')
|
||||||
| {{'dialog_cancel' | tr}}
|
| {{'dialog_cancel' | tr}}
|
||||||
|
Loading…
Reference in New Issue
Block a user