MT#10169 - add "enabled" feature for rewrite rules, peering hosts/rules

Change-Id: Ie018146d5074f9af821bb8acc95546b026914b0f
changes/76/676/3
Kirill Solomko 11 years ago
parent f69adbfbbb
commit 06c058caa6

@ -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') },
]);

@ -179,6 +179,7 @@ sub set_clone :Chained('set_base') :PathPart('clone') {
direction => $rule->direction,
field => $rule->field,
priority => $rule->priority,
enabled => $rule->enabled,
});
}
});

@ -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' => (

@ -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' => (

@ -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' => (

@ -29,6 +29,7 @@
<th>[% c.loc('Match Pattern') %]</th>
<th>[% c.loc('Replacement Pattern') %]</th>
<th>[% c.loc('Description') %]</th>
<th>[% c.loc('Enabled') %]</th>
<th class="ngcp-actions-column"></th>
</tr>
</thead>
@ -46,6 +47,7 @@
<td>[% r.match_pattern %]</td>
<td>[% r.replace_pattern %]</td>
<td>[% r.description %]</td>
<td>[% r.enabled ? c.loc('yes') : c.loc('no') %]</td>
<td class="ngcp-actions-column">
[% UNLESS c.user.read_only -%]
<div class="sw_actions pull-right">

Loading…
Cancel
Save