<%= @record.name %>

<%= @record.namehash %> - <%= @record.operating_system.name %>


<% if @record.configuration_files.blank? %>

There are no configuration files from this server in CHUB. You can create file now and pull it to the server later:

<%= button_to(new_configuration_file_path, method: :get, params: { server_id: @record.id}, class: "btn btn-success") do %> Create New Configuration File <% end %>

Or you can initialize server with chub and upload the existing files from server by pasting this into your server's terminal:

<% command = "sudo wget -O /usr/local/bin/chub http://chub.saburly.com/chub && sudo chub init #{@record.namehash}" %>

<%= text_field_tag 'command', command, readonly: true, class: 'form-control-sm', size: command.length %>

<% else %>

<%= button_to(new_configuration_file_path, method: :get, params: { server_id: @record.id}, class: "btn btn-success pull-center") do %> Create New Configuration File <% end %>

<% @record.configuration_files.each do |file| %> <% end %>
File Path Version Last Modified
<%= file.file_path %> v<%= file.last_version.number %> <%= distance_of_time_in_words(file.last_version.updated_at, Time.now) %> <%= button_to(edit_configuration_file_path(file), method: :get, class: "btn btn-default inline") do %> Edit <% end %> <%= button_to(configuration_file_path(file), method: :delete, class: "btn btn-danger inline") do %> Delete <% end %>
<% end %>