|
@@ -1,53 +1,96 @@
|
|
|
-section.settings-group(ng-controller='SwitchProfileCtrl')
|
|
|
- h3 {{'options_group_switchRules' | tr}}
|
|
|
- .table-responsive
|
|
|
- table.switch-rules.table.table-bordered.table-condensed.width-limit-xl
|
|
|
- thead
|
|
|
- tr
|
|
|
- th(style='white-space: nowrap') {{'options_sort' | tr}}
|
|
|
- th {{'options_conditionType' | tr}}
|
|
|
- th {{'options_conditionDetails' | tr}}
|
|
|
- th {{'options_resultProfile' | tr}}
|
|
|
- th {{'options_conditionActions' | tr}}
|
|
|
- tbody(ui-sortable='sortableOptions' ng-model='profile.rules')
|
|
|
- tr(ng-repeat='rule in profile.rules')
|
|
|
- td.sort-bar
|
|
|
- span.glyphicon.glyphicon-sort
|
|
|
- td
|
|
|
- select.form-control(ng-model='rule.condition.conditionType'
|
|
|
- ng-options='cond as (i18n | tr) for (cond, i18n) in conditionI18n')
|
|
|
- td(ng-switch='rule.condition.conditionType')
|
|
|
- span(ng-switch-when='AlwaysCondition') {{'condition_always_details' | tr}}
|
|
|
- span(ng-switch-when='NeverCondition') {{'condition_never_details' | tr}}
|
|
|
- span.host-levels-details(ng-switch-when='HostLevelsCondition')
|
|
|
- input.form-control(type='number' min='1' max='99' ng-model='rule.condition.minValue' required)
|
|
|
- = ' '
|
|
|
- span {{'options_hostLevelsBetween' | tr}}
|
|
|
- = ' '
|
|
|
- input.form-control(type='number' max='99' min='1' ng-model='rule.condition.maxValue' required)
|
|
|
- input.form-control(ng-model='rule.condition.pattern' ng-switch-default required
|
|
|
- ui-validate='{pattern: "validateCondition(rule.condition, $value)"}')
|
|
|
- td
|
|
|
- div.form-control(omega-profile-select='options | profiles:profile' ng-model='rule.profileName'
|
|
|
- disp-name='$profile.name | dispName')
|
|
|
- td
|
|
|
- button.btn.btn-danger.btn-sm(title="{{'options_deleteRule' | tr}}" ng-click='removeRule($index)')
|
|
|
- span.glyphicon.glyphicon-trash
|
|
|
- tbody
|
|
|
- tr
|
|
|
- td(style='border-right: none;')
|
|
|
- td(style='border-left: none;', colspan='4')
|
|
|
- button.btn.btn-default.btn-sm(ng-click='addRule()')
|
|
|
- span.glyphicon.glyphicon-plus
|
|
|
- = ' '
|
|
|
- span {{'options_addCondition' | tr}}
|
|
|
- tbody
|
|
|
- tr
|
|
|
- td
|
|
|
- td(colspan='2') {{'options_switchDefaultProfile' | tr}}
|
|
|
- td
|
|
|
- div.form-control(omega-profile-select='options | profiles:profile' ng-model='profile.defaultProfileName'
|
|
|
- disp-name='$profile.name | dispName')
|
|
|
- td
|
|
|
- button.btn.btn-info.btn-sm(title="{{'options_resetRules_help' | tr}}" ng-click='resetRules()')
|
|
|
- span.glyphicon.glyphicon-chevron-up
|
|
|
+div(ng-controller='SwitchProfileCtrl')
|
|
|
+ section.settings-group
|
|
|
+ h3 {{'options_group_switchRules' | tr}}
|
|
|
+ .table-responsive
|
|
|
+ table.switch-rules.table.table-bordered.table-condensed.width-limit-xl
|
|
|
+ thead
|
|
|
+ tr
|
|
|
+ th(style='white-space: nowrap') {{'options_sort' | tr}}
|
|
|
+ th {{'options_conditionType' | tr}}
|
|
|
+ th {{'options_conditionDetails' | tr}}
|
|
|
+ th {{'options_resultProfile' | tr}}
|
|
|
+ th {{'options_conditionActions' | tr}}
|
|
|
+ tbody(ui-sortable='sortableOptions' ng-model='profile.rules')
|
|
|
+ tr(ng-repeat='rule in profile.rules')
|
|
|
+ td.sort-bar
|
|
|
+ span.glyphicon.glyphicon-sort
|
|
|
+ td
|
|
|
+ select.form-control(ng-model='rule.condition.conditionType'
|
|
|
+ ng-options='cond as (i18n | tr) for (cond, i18n) in conditionI18n')
|
|
|
+ td(ng-switch='rule.condition.conditionType')
|
|
|
+ span(ng-switch-when='AlwaysCondition') {{'condition_always_details' | tr}}
|
|
|
+ span(ng-switch-when='NeverCondition') {{'condition_never_details' | tr}}
|
|
|
+ span.host-levels-details(ng-switch-when='HostLevelsCondition')
|
|
|
+ input.form-control(type='number' min='1' max='99' ng-model='rule.condition.minValue' required)
|
|
|
+ = ' '
|
|
|
+ span {{'options_hostLevelsBetween' | tr}}
|
|
|
+ = ' '
|
|
|
+ input.form-control(type='number' max='99' min='1' ng-model='rule.condition.maxValue' required)
|
|
|
+ input.form-control(ng-model='rule.condition.pattern' ng-switch-default required
|
|
|
+ ui-validate='{pattern: "validateCondition(rule.condition, $value)"}')
|
|
|
+ td
|
|
|
+ div.form-control(omega-profile-select='options | profiles:profile' ng-model='rule.profileName'
|
|
|
+ disp-name='$profile.name | dispName')
|
|
|
+ td
|
|
|
+ button.btn.btn-danger.btn-sm(title="{{'options_deleteRule' | tr}}" ng-click='removeRule($index)')
|
|
|
+ span.glyphicon.glyphicon-trash
|
|
|
+ tbody
|
|
|
+ tr
|
|
|
+ td(style='border-right: none;')
|
|
|
+ td(style='border-left: none;', colspan='4')
|
|
|
+ button.btn.btn-default.btn-sm(ng-click='addRule()')
|
|
|
+ span.glyphicon.glyphicon-plus
|
|
|
+ = ' '
|
|
|
+ span {{'options_addCondition' | tr}}
|
|
|
+ tbody.switch-attached(ng-if='attached')
|
|
|
+ tr
|
|
|
+ td(style='border-right: none;')
|
|
|
+ span.glyphicon(class='{{profileIcons["RuleListProfile"]}}')
|
|
|
+ td(style='border-left: none;') {{'options_switchAttachedProfileInCondition' | tr}}
|
|
|
+ td
|
|
|
+ span {{'options_switchAttachedProfileInConditionDetails' | tr}}
|
|
|
+ td
|
|
|
+ div.form-control(omega-profile-select='options | profiles:profile' ng-model='attached.matchProfileName'
|
|
|
+ disp-name='$profile.name | dispName')
|
|
|
+ td
|
|
|
+ button.btn.btn-danger.btn-sm(title="{{'options_deleteAttached' | tr}}" ng-click='removeAttached()')
|
|
|
+ span.glyphicon.glyphicon-trash
|
|
|
+ tbody
|
|
|
+ tr
|
|
|
+ td
|
|
|
+ td(colspan='2') {{'options_switchDefaultProfile' | tr}}
|
|
|
+ td
|
|
|
+ div.form-control(omega-profile-select='options | profiles:profile' ng-model='defaultProfileName'
|
|
|
+ disp-name='$profile.name | dispName')
|
|
|
+ td
|
|
|
+ button.btn.btn-info.btn-sm(title="{{'options_resetRules_help' | tr}}" ng-click='resetRules()')
|
|
|
+ span.glyphicon.glyphicon-chevron-up
|
|
|
+ section.settings-group(ng-if='!attached')
|
|
|
+ h3 {{'options_group_attachProfile' | tr}}
|
|
|
+ p.help-block {{'options_attachProfileHelp' | tr}}
|
|
|
+ button.btn.btn-default(ng-click='attachNew()')
|
|
|
+ span.glyphicon.glyphicon-plus
|
|
|
+ = ' '
|
|
|
+ | {{'options_attachProfile' | tr}}
|
|
|
+ section.settings-group(ng-if='attached')
|
|
|
+ h3 {{'options_group_ruleListConfig' | tr}}
|
|
|
+ form
|
|
|
+ .form-group
|
|
|
+ label {{'options_ruleListFormat' | tr}}
|
|
|
+ .radio.inline-form-control.no-min-width(ng-repeat='format in ruleListFormats')
|
|
|
+ label
|
|
|
+ input(type='radio' name='formatInput' value='{{format}}' ng-model='attached.format')
|
|
|
+ | {{'ruleListFormat_' + format | tr}}
|
|
|
+ .form-group
|
|
|
+ label {{'options_group_ruleListUrl' | tr}}
|
|
|
+ .width-limit.inline-form-control(input-group-clear type='url' model='attached.sourceUrl'
|
|
|
+ style='vertical-align: middle')
|
|
|
+ p.help-block {{'options_ruleListUrlHelp' | tr}}
|
|
|
+ section.settings-group(ng-if='attached')
|
|
|
+ h3 {{'options_group_ruleListText' | tr}}
|
|
|
+ p
|
|
|
+ button.btn.btn-default(ng-disabled='!attached.sourceUrl' ng-click='updateProfile(attached.name)'
|
|
|
+ ladda='updatingProfile[attached.name]' data-spinner-color="#000000")
|
|
|
+ | #[span.glyphicon.glyphicon-download-alt] {{'options_downloadProfileNow' | tr}}
|
|
|
+ textarea.form-control.width-limit(ng-model='attached.ruleList' rows=20
|
|
|
+ ng-disabled='!!attached.sourceUrl')
|