mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 01:03:35 +02:00
Create nameservers cache
This commit is contained in:
parent
4caa0ef903
commit
e695a6e628
8 changed files with 104 additions and 31 deletions
|
@ -2,7 +2,20 @@ class Admin::ZonefilesController < ApplicationController
|
|||
# TODO: Refactor this
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def index
|
||||
@zonefile = ActiveRecord::Base.connection.execute("select generate_zonefile('ee')")[0]['generate_zonefile']
|
||||
send_data @zonefile, filename: 'zonefile-1000.txt'
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
if ZonefileSetting.pluck(:origin).include?(params[:origin])
|
||||
|
||||
@zonefile = ActiveRecord::Base.connection.execute(
|
||||
"select generate_zonefile('#{params[:origin]}')"
|
||||
)[0]['generate_zonefile']
|
||||
|
||||
send_data @zonefile, filename: "#{params[:origin]}.txt"
|
||||
else
|
||||
flash[:alert] = 'Origin not supported'
|
||||
redirect_to :back
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue