From b8425f5453eab4a0fe475952af89d55ace45878e Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Sun, 3 Mar 2013 04:03:24 -0500 Subject: firewall restart after intruder changes --- app/views/intruders/_form_core.html.haml | 4 +++- app/views/intruders/_index_core.html.haml | 12 ++---------- app/views/intruders/index.html.haml | 9 ++++++--- 3 files changed, 11 insertions(+), 14 deletions(-) (limited to 'app/views/intruders') diff --git a/app/views/intruders/_form_core.html.haml b/app/views/intruders/_form_core.html.haml index 780d8cd..a0c2eb0 100644 --- a/app/views/intruders/_form_core.html.haml +++ b/app/views/intruders/_form_core.html.haml @@ -1,5 +1,7 @@ .inputs = f.input :list_type, :collection => Intruder::LIST_TYPES, :label => t('intruders.form.list_type.label'), :hint => conditional_hint('intruders.form.list_type.hint'), :include_blank => false = f.input :contact_ip, :label => t('intruders.form.contact_ip.label'), :hint => conditional_hint('intruders.form.contact_ip.hint') - = f.input :ban_end, :label => t('intruders.form.ban_end.label'), :hint => conditional_hint('intruders.form.ban_end.hint') + = f.input :points, :label => t('intruders.form.points.label'), :hint => conditional_hint('intruders.form.points.hint') + = f.input :bans, :label => t('intruders.form.bans.label'), :hint => conditional_hint('intruders.form.bans.hint'), as: :boolean + = f.input :comment, :label => t('intruders.form.comment.label'), :hint => conditional_hint('intruders.form.comment.hint') diff --git a/app/views/intruders/_index_core.html.haml b/app/views/intruders/_index_core.html.haml index 63f2253..b9c5a76 100644 --- a/app/views/intruders/_index_core.html.haml +++ b/app/views/intruders/_index_core.html.haml @@ -2,11 +2,8 @@ %tr %th %th= t('intruders.index.contact_ip') - %th= t('intruders.index.contact_port') %th= t('intruders.index.points') - %th= t('intruders.index.bans') %th= t('intruders.index.ban_last') - %th= t('intruders.index.ban_end') %th= t('intruders.index.contact_count') %th= t('intruders.index.contact_last') %th= t('intruders.index.contacts_per_second') @@ -19,21 +16,16 @@ %td - if intruder.list_type == 'whitelist' %i.icon-ok - - elsif intruder.bans > 0 + - elsif intruder.bans.to_i > 0 %i.icon-fire - - elsif intruder.points > 0 + - elsif intruder.points.to_i > 0 %i.icon-warning-sign %td= intruder.contact_ip - %td= intruder.contact_port %td= intruder.points - %td= intruder.bans %td - if intruder.ban_last = l intruder.ban_last, :format => :short - %td - - if intruder.ban_end - = l intruder.ban_end, :format => :short %td= intruder.contact_count %td diff --git a/app/views/intruders/index.html.haml b/app/views/intruders/index.html.haml index 72b8882..79b4ceb 100644 --- a/app/views/intruders/index.html.haml +++ b/app/views/intruders/index.html.haml @@ -1,6 +1,9 @@ - content_for :title, t("intruders.index.page_title") -- if @intruders && @intruders.count > 0 - = render "index_core", :intruders => @intruders +- if @intruders && @intruders.count > 0 && @list_types && @list_types.count > 0 + - @list_types.each do |list_type| + %h3= list_type + %table.table.table-striped + = render "index_core", :intruders => @intruders.where(:list_type => list_type) -= render :partial => 'shared/create_link', :locals => {:child_class => Intruder} \ No newline at end of file += render :partial => 'shared/create_link', :locals => {:child_class => Intruder} -- cgit v1.2.3