app/views/naf/machines/show.html.erb in naf-1.1.4 vs app/views/naf/machines/show.html.erb in naf-2.0.0

- old
+ new

@@ -1,44 +1,16 @@ <% content_for :body do %> <div id="flash_message"> - <% unless notice.blank? %> - <script type='text/javascript'> - jQuery("<p id='notice'><%= notice %></p>") - .appendTo('#flash_message') - .slideDown().delay(5000).slideUp(); - </script> - <% end %> + <% unless notice.blank? %> + <script type='text/javascript'> + jQuery("<p id='notice'><%= notice %></p>") + .appendTo('#flash_message') + .slideDown().delay(5000).slideUp(); + </script> + <% end %> </div> - <% content_for :javascripts do %> - <script type='text/javascript'> - jQuery(document).ready(function () { - jQuery(document).delegate('.terminate', "click", function(){ - var answer = confirm("You are going to mark machine down. Are you sure you want to do this?"); - if (!answer) { - return false; - } - var id = <%= @machine.id %>; - var url = '/job_system/machines/' + id; - jQuery.ajax({ - url: url, - type: 'POST', - dataType: 'json', - data: { "machine[marked_down]": 1, "terminate": true, "_method": "put" }, - success:function (data) { - if (data.success) { - jQuery("<p id='notice'>Machine was marked down!</p>"). - appendTo('#flash_message').slideDown().delay(5000).slideUp(); - setTimeout('window.location.reload()', 5600); - } - } - }); - }); - }); - </script> - <% end %> - <div id="record"> <h2>Machine</h2> <%= link_to 'Back to Machines', machines_path %> &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp; <%= link_to 'Edit', edit_machine_path(@machine) %> @@ -80,13 +52,45 @@ <% end %> </tbody> </table> </br> - - <h2>Stdout</h2> - <iframe src="<%= naf_papertrail_link(@machine, true) %>" id="stdout" class="scrollable-output"> - Your browser doesn't support iframe! - </iframe> + <%= render partial: 'naf/log_viewer/log_layout', locals: { record_id: @machine.id, record_type: 'machine' } %> </div> <% end %> + <%= render partial: 'naf/shared/application' %> +<%= render partial: 'naf/shared/auto_resize_width', locals: { div_class: '.scrollable-output' } %> +<%= render partial: 'naf/log_viewer/log_display', + locals: { + logs_url: "#{http_protocol}#{::Logical::Naf::Machine.new(@machine).runner}#{naf.logs_log_parsers_path}", + record_id: @machine.id, + record_type: 'machine' + } %> + +<% content_for :javascripts do %> + <script type='text/javascript'> + jQuery(document).ready(function () { + jQuery(document).delegate('.terminate', "click", function(){ + var answer = confirm("You are going to mark machine down. Are you sure you want to do this?"); + if (!answer) { + return false; + } + var id = <%= @machine.id %>; + var url = '/job_system/machines/' + id; + jQuery.ajax({ + url: url, + type: 'POST', + dataType: 'json', + data: { "machine[marked_down]": 1, "terminate": true, "_method": "put" }, + success:function (data) { + if (data.success) { + jQuery("<p id='notice'>Machine was marked down!</p>"). + appendTo('#flash_message').slideDown().delay(5000).slideUp(); + setTimeout('window.location.reload()', 5600); + } + } + }); + }); + }); + </script> +<% end %>