<%= @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 %>

<% 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 %>
<% pull_commands = @record.configuration_files.map do |file| pull_command(file) end.join("\n") push_commands = @record.configuration_files.map do |file| push_command(file) end.join("\n") %>

Sync Server:

CHUB -> Your Server
<%= text_area_tag 'command_pull', pull_commands, readonly: true, class: 'form-control-sm click-to-select-all', size: "80x10" %>
Your Server -> CHUB
<%= text_area_tag 'command_push', push_commands, readonly: true, class: 'form-control-sm click-to-select-all', size: "80x10" %>
<% end %>