mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 23:16:23 +02:00
Create white ips
This commit is contained in:
parent
254849494f
commit
8e37355e13
15 changed files with 246 additions and 3 deletions
|
@ -63,7 +63,7 @@
|
|||
.pull-left
|
||||
= t(:api_users)
|
||||
.pull-right
|
||||
= link_to(t(:create_new_api_user), new_admin_registrar_api_user_path(@registrar), class: 'btn btn-primary btn-xs')
|
||||
= link_to(t(:create_new_api_user), new_admin_registrar_api_user_path(@registrar), class: 'btn btn-default btn-xs')
|
||||
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
|
@ -76,3 +76,26 @@
|
|||
%tr
|
||||
%td= link_to(x, [:admin, x])
|
||||
%td= x.active
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
#epp-users.panel.panel-default
|
||||
.panel-heading.clearfix
|
||||
.pull-left
|
||||
= t(:white_ips)
|
||||
.pull-right
|
||||
= link_to(t(:create_new_white_ip), new_admin_registrar_white_ip_path(@registrar), class: 'btn btn-default btn-xs')
|
||||
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-4'}= t(:ipv4)
|
||||
%th{class: 'col-xs-6'}= t(:ipv6)
|
||||
%th{class: 'col-xs-2'}= t(:interface)
|
||||
%tbody
|
||||
- @registrar.white_ips.order(:interface).each do |x|
|
||||
%tr
|
||||
%td= link_to(x.ipv4, [:admin, @registrar, x])
|
||||
%td= link_to(x.ipv6, [:admin, @registrar, x])
|
||||
%td= x.interface.upcase
|
||||
|
|
30
app/views/admin/white_ips/_form.haml
Normal file
30
app/views/admin/white_ips/_form.haml
Normal file
|
@ -0,0 +1,30 @@
|
|||
= form_for([:admin, @registrar, @white_ip], html: {class: 'form-horizontal'}) do |f|
|
||||
= render 'shared/full_errors', object: @white_ip
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :registrar
|
||||
.col-md-7
|
||||
= f.text_field(:registrar, class: 'form-control', disabled: :disabled)
|
||||
= f.hidden_field(:registrar_id, class: 'js-registrar-id')
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :ipv4
|
||||
.col-md-7
|
||||
= f.text_field(:ipv4, class: 'form-control')
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :ipv6
|
||||
.col-md-7
|
||||
= f.text_field(:ipv6, class: 'form-control')
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :interface
|
||||
.col-md-7
|
||||
= f.select :interface, [[t(:choose), '']] + WhiteIp::INTERFACES.map {|x| [x.upcase, x]}, {}, class: 'form-control selectize', placeholder: t(:choose)
|
||||
%hr
|
||||
.row
|
||||
.col-md-8.text-right
|
||||
= button_tag(t(:save), class: 'btn btn-primary')
|
5
app/views/admin/white_ips/edit.haml
Normal file
5
app/views/admin/white_ips/edit.haml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- content_for :actions do
|
||||
= link_to(t(:back_to_registrar), admin_registrar_path(@registrar), class: 'btn btn-default')
|
||||
|
||||
= render 'shared/title', name: t(:edit_white_ip)
|
||||
= render 'form'
|
5
app/views/admin/white_ips/new.haml
Normal file
5
app/views/admin/white_ips/new.haml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- content_for :actions do
|
||||
= link_to(t(:back_to_registrar), admin_registrar_path(@registrar), class: 'btn btn-default')
|
||||
|
||||
= render 'shared/title', name: t(:create_new_white_ip)
|
||||
= render 'form'
|
24
app/views/admin/white_ips/show.haml
Normal file
24
app/views/admin/white_ips/show.haml
Normal file
|
@ -0,0 +1,24 @@
|
|||
- content_for :actions do
|
||||
= link_to(t(:edit), edit_admin_registrar_white_ip_path(@registrar, @white_ip), class: 'btn btn-primary')
|
||||
= link_to(t(:delete), admin_registrar_white_ip_path(@registrar, @white_ip),
|
||||
method: :delete, data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger')
|
||||
= render 'shared/title', name: t('white_ip')
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title= t(:general)
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t(:registrar)
|
||||
%dd= link_to(@registrar, [:admin, @registrar])
|
||||
|
||||
%dt= t(:ipv4)
|
||||
%dd= @white_ip.ipv4
|
||||
|
||||
%dt= t(:ipv6)
|
||||
%dd= @white_ip.ipv6
|
||||
|
||||
%dt= t(:interface)
|
||||
%dd= @white_ip.interface.upcase
|
Loading…
Add table
Add a link
Reference in a new issue