diff --git a/lib/NGCP/Panel/Controller/Peering.pm b/lib/NGCP/Panel/Controller/Peering.pm index 81eb842a35..604e35d1b7 100644 --- a/lib/NGCP/Panel/Controller/Peering.pm +++ b/lib/NGCP/Panel/Controller/Peering.pm @@ -81,6 +81,7 @@ sub base :Chained('group_list') :PathPart('') :CaptureArgs(1) { { name => 'transport', search => 1, title => $c->loc('Protocol') }, { name => 'weight', search => 1, title => $c->loc('Weight') }, { name => 'via_route', search => 1, title => $c->loc('Via Route Set') }, + { name => 'enabled', search => 1, title => $c->loc('Enabled') }, ]); $c->stash->{rules_dt_columns} = NGCP::Panel::Utils::Datatables::set_columns($c, [ { name => 'id', search => 1, title => $c->loc('#') }, @@ -88,6 +89,7 @@ sub base :Chained('group_list') :PathPart('') :CaptureArgs(1) { { name => 'callee_pattern', search => 1, title => $c->loc('Callee Pattern') }, { name => 'caller_pattern', search => 1, title => $c->loc('Caller Pattern') }, { name => 'description', search => 1, title => $c->loc('Description') }, + { name => 'enabled', search => 1, title => $c->loc('Enabled') }, ]); diff --git a/lib/NGCP/Panel/Controller/Rewrite.pm b/lib/NGCP/Panel/Controller/Rewrite.pm index 98107c6ff1..0e120c540c 100644 --- a/lib/NGCP/Panel/Controller/Rewrite.pm +++ b/lib/NGCP/Panel/Controller/Rewrite.pm @@ -179,6 +179,7 @@ sub set_clone :Chained('set_base') :PathPart('clone') { direction => $rule->direction, field => $rule->field, priority => $rule->priority, + enabled => $rule->enabled, }); } }); diff --git a/lib/NGCP/Panel/Form/PeeringRule.pm b/lib/NGCP/Panel/Form/PeeringRule.pm index d87d7ba165..b1b6e88277 100644 --- a/lib/NGCP/Panel/Form/PeeringRule.pm +++ b/lib/NGCP/Panel/Form/PeeringRule.pm @@ -45,6 +45,16 @@ has_field 'description' => ( }, ); +has_field 'enabled' => ( + type => 'Boolean', + label => 'Enabled', + default => 1, + element_attr => { + rel => ['tooltip'], + title => ['Rule enabled state.'], + }, +); + has_field 'save' => ( type => 'Submit', value => 'Save', @@ -55,7 +65,7 @@ has_field 'save' => ( has_block 'fields' => ( tag => 'div', class => [qw/modal-body/], - render_list => [qw/ callee_prefix callee_pattern caller_pattern description /], + render_list => [qw/ callee_prefix callee_pattern caller_pattern description enabled /], ); has_block 'actions' => ( diff --git a/lib/NGCP/Panel/Form/PeeringServer.pm b/lib/NGCP/Panel/Form/PeeringServer.pm index 8a68b894f2..5a38f8911d 100644 --- a/lib/NGCP/Panel/Form/PeeringServer.pm +++ b/lib/NGCP/Panel/Form/PeeringServer.pm @@ -80,6 +80,16 @@ sub build_via_routes { return \@options; } +has_field 'enabled' => ( + type => 'Boolean', + label => 'Enabled', + default => 1, + element_attr => { + rel => ['tooltip'], + title => ['Server enabled state.'], + }, +); + has_field 'save' => ( type => 'Submit', value => 'Save', @@ -90,7 +100,7 @@ has_field 'save' => ( has_block 'fields' => ( tag => 'div', class => [qw/modal-body/], - render_list => [qw/ name ip host port transport weight via_route /], + render_list => [qw/ name ip host port transport weight via_route enabled /], ); has_block 'actions' => ( diff --git a/lib/NGCP/Panel/Form/RewriteRule/Rule.pm b/lib/NGCP/Panel/Form/RewriteRule/Rule.pm index 40b4b4be75..4a025ce9ef 100644 --- a/lib/NGCP/Panel/Form/RewriteRule/Rule.pm +++ b/lib/NGCP/Panel/Form/RewriteRule/Rule.pm @@ -53,6 +53,16 @@ has_field 'direction' => ( }, ); +has_field 'enabled' => ( + type => 'Boolean', + label => 'Enabled', + default => 1, + element_attr => { + rel => ['tooltip'], + title => ['Rule enabled state.'], + }, +); + has_field 'field' => ( type => 'Select', options => [ @@ -75,7 +85,7 @@ has_field 'save' => ( has_block 'fields' => ( tag => 'div', class => [qw/modal-body/], - render_list => [qw/match_pattern replace_pattern description direction field/], + render_list => [qw/match_pattern replace_pattern description direction enabled field/], ); has_block 'actions' => ( diff --git a/share/templates/rewrite/rules_list.tt b/share/templates/rewrite/rules_list.tt index 5f9a44f447..30015c177e 100644 --- a/share/templates/rewrite/rules_list.tt +++ b/share/templates/rewrite/rules_list.tt @@ -29,6 +29,7 @@ [% c.loc('Match Pattern') %] [% c.loc('Replacement Pattern') %] [% c.loc('Description') %] + [% c.loc('Enabled') %] @@ -46,6 +47,7 @@ [% r.match_pattern %] [% r.replace_pattern %] [% r.description %] + [% r.enabled ? c.loc('yes') : c.loc('no') %] [% UNLESS c.user.read_only -%]