You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.8KB

  1. <div class="container">
  2. <div class="row">
  3. <div class="col-sm-11">
  4. <h1>
  5. Résultats pour <%= @host %> <span class="small">(<%= l @result.date %>)</span>
  6. <%= rank_label @result.score.rank %>
  7. </h1>
  8. </div>
  9. <% if Time.now - @result.date >= Rails.configuration.refresh_delay %>
  10. <div class="col-sm-1">
  11. <%= link_to 'Rafraîchir', {action: :refresh}, class: %i(btn btn-default) %>
  12. </div>
  13. <% end %>
  14. </div>
  15. <br/>
  16. <div class="row">
  17. <div class="col-sm-6">
  18. <% scores = @result.score.details %>
  19. <table class="table table-bordered table-condensed table-striped">
  20. <thead>
  21. <tr>
  22. <th colspan="2">
  23. Scores
  24. <%= rank_label @result.score.rank %>
  25. </th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <%
  30. { 'Protocole' => 'protocol',
  31. 'Échange de clef' => 'key_exchange',
  32. 'Chiffrement' => 'cipher_strengths',
  33. 'Total' => 'score'}.each do |name, v| %>
  34. <tr>
  35. <th class="col-sm-4"><%= name %></th>
  36. <td class="col-sm-8"><%= score_progress scores[v] %></td>
  37. </tr>
  38. <% end %>
  39. </tbody>
  40. </table>
  41. </div>
  42. <div class="col-sm-6">
  43. <table class="table table-bordered table-condensed table-striped">
  44. <tbody>
  45. <tr>
  46. <th class="col-sm-4">Protocoles</th>
  47. <td class="col-sm-8"><%= protocol_labels @result.protocols %></td>
  48. </tr>
  49. <tr>
  50. <th>Clefs</th>
  51. <td>
  52. <p>Certificat : <%= key_label @result[:key] %></p>
  53. <p>Diffie Hellman : <%= key_labels @result.dh %></p>
  54. </td>
  55. </tr>
  56. <% { 'Bonnes pratiques' => ['success', 'success'],
  57. 'Alertes' => ['warning', 'warning'],
  58. 'Erreurs' => ['error', 'danger'] }.each do |name, v| %>
  59. <tr>
  60. <th><%= name %></th>
  61. <td>
  62. <% item, color = v
  63. (@result.score[item] || []).each do |item| %>
  64. <span class="label label-<%= color %>"><%= item.upcase %></span>
  65. <% end %>
  66. </td>
  67. </tr>
  68. <% end %>
  69. </tbody>
  70. </table>
  71. </div>
  72. </div>
  73. <div class="row">
  74. <div class="col-sm-12">
  75. <table class="table table-bordered table-condensed table-striped">
  76. <thead>
  77. <tr>
  78. <th class="col-sm-3">Algorithme</th>
  79. <th class="col-sm-1">Clef</th>
  80. <th class="col-sm-1">DH</th>
  81. <th></th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. <% %w(TLSv1_2 TLSv1_1 TLSv1 SSLv3 SSLv2).each do |protocol|
  86. ciphers = @result.ciphers.select { |c| c.protocol == protocol }
  87. .sort { |a, b| -1 * (a['size'] <=> b['size']) }
  88. unless ciphers.empty? %>
  89. <tr>
  90. <th colspan="3"><%= protocol_label protocol %></th>
  91. </tr>
  92. <% ciphers.each do |cipher| %>
  93. <tr>
  94. <td><%= cipher.name %></td>
  95. <td><%= cipher_size_label cipher %></td>
  96. <td><%= key_label cipher.dh if cipher.dh %></td>
  97. <td><%= cipher_labels cipher %></td>
  98. </tr>
  99. <% end end end %>
  100. </tbody>
  101. </table>
  102. </div>
  103. </div>
  104. </div>