mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Refactor zones
- Rename "zonefile_setting" to "zone" - Remove version #475
This commit is contained in:
parent
f1d7e53734
commit
bff7437277
51 changed files with 425 additions and 389 deletions
79
app/views/admin/dns/zones/_form.haml
Normal file
79
app/views/admin/dns/zones/_form.haml
Normal file
|
@ -0,0 +1,79 @@
|
|||
= form_for [:admin, zone], html: { class: 'form-horizontal' } do |f|
|
||||
.row
|
||||
.col-md-8
|
||||
#domain-statuses
|
||||
= render 'shared/full_errors', object: f.object
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :origin
|
||||
.col-md-8
|
||||
- if zone.persisted?
|
||||
= f.text_field :origin, class: 'form-control', disabled: true
|
||||
- else
|
||||
= f.text_field :origin, class: 'form-control'
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :ttl
|
||||
.col-md-8
|
||||
= f.text_field :ttl, class: 'form-control'
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :refresh
|
||||
.col-md-8
|
||||
= f.text_field :refresh, class: 'form-control'
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :retry
|
||||
.col-md-8
|
||||
= f.text_field :retry, class: 'form-control'
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :expire
|
||||
.col-md-8
|
||||
= f.text_field :expire, class: 'form-control'
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :minimum_ttl
|
||||
.col-md-8
|
||||
= f.text_field :minimum_ttl, class: 'form-control'
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :email
|
||||
.col-md-8
|
||||
= f.text_field :email, class: 'form-control'
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :master_nameserver
|
||||
.col-md-8
|
||||
= f.text_field :master_nameserver, class: 'form-control'
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :ns_records
|
||||
.col-md-8
|
||||
= f.text_area :ns_records, class: 'form-control', rows: 8
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :a_records
|
||||
.col-md-8
|
||||
= f.text_area :a_records, class: 'form-control', rows: 8
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :a4_records, t(:a4_records)
|
||||
.col-md-8
|
||||
= f.text_area :a4_records, class: 'form-control', rows: 8
|
||||
|
||||
%hr
|
||||
.row
|
||||
.col-md-8.text-right
|
||||
%button.btn.btn-success= t(".#{zone.new_record? ? 'create' : 'update'}_btn")
|
9
app/views/admin/dns/zones/_zone.html.erb
Normal file
9
app/views/admin/dns/zones/_zone.html.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<tr>
|
||||
<td><%= zone.origin %></td>
|
||||
<td>
|
||||
<%= link_to t('.edit_btn'), edit_admin_zone_path(zone), class: 'btn btn-xs btn-primary' %>
|
||||
<%= link_to t('.generate_zone_file_btn'),
|
||||
admin_zonefiles_path(origin: zone.origin),
|
||||
method: 'post', class: 'btn btn-xs btn-primary' %>
|
||||
</td>
|
||||
</tr>
|
20
app/views/admin/dns/zones/edit.html.erb
Normal file
20
app/views/admin/dns/zones/edit.html.erb
Normal file
|
@ -0,0 +1,20 @@
|
|||
<ol class="breadcrumb">
|
||||
<li><%= link_to t('admin.dns.zones.index.title'), admin_zones_path %></li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<h1><%= t '.title' %></h1>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 text-right">
|
||||
<%= link_to(t('.delete_btn'), admin_zone_path(@zone),
|
||||
method: :delete,
|
||||
data: { confirm: t('.delete_btn_confirm') },
|
||||
class: 'btn btn-danger') %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render 'form', zone: @zone %>
|
28
app/views/admin/dns/zones/index.html.erb
Normal file
28
app/views/admin/dns/zones/index.html.erb
Normal file
|
@ -0,0 +1,28 @@
|
|||
<div class="page-header">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<h1><%= t '.title' %></h1>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 text-right">
|
||||
<%= link_to t('.new_btn'), new_admin_zone_path, class: 'btn btn-primary' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if @zones.present? %>
|
||||
<table class="table table-hover table-bordered table-wrapped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= DNS::Zone.human_attribute_name :origin %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<%= render @zones %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<div class="alert alert-info"><%= t '.not_found' %></div>
|
||||
<% end %>
|
9
app/views/admin/dns/zones/new.html.erb
Normal file
9
app/views/admin/dns/zones/new.html.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<ol class="breadcrumb">
|
||||
<li><%= link_to t('admin.dns.zones.index.title'), admin_zones_path %></li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<h1><%= t '.title' %></h1>
|
||||
</div>
|
||||
|
||||
<%= render 'form', zone: @zone %>
|
Loading…
Add table
Add a link
Reference in a new issue