10 changed files with 95 additions and 33 deletions
-
13app/controllers/dashboard_controller.rb
-
4app/models/certificate.rb
-
12app/models/host.rb
-
39app/models/lxd/api.rb
-
3app/models/lxd/api/exception.rb
-
6app/models/lxd/api/v1_0.rb
-
1app/models/lxd/certificate.rb
-
1app/models/lxd/config.rb
-
41app/views/dashboard/index.html.erb
-
8app/views/hosts/_form.html.erb
@ -0,0 +1,3 @@ |
|||
class Lxd::API::Exception < StandardError |
|||
end |
|||
# vim: set et ts=2 sw=2: |
|||
@ -1,12 +1,37 @@ |
|||
<h1>Dashboard#index</h1> |
|||
<% Certificate.all.each do |cert| -%> |
|||
<p>Fingerprint: <%= cert.cert_fpr %> |
|||
Serial: <%= cert.cert.serial %></p> |
|||
<% end -%> |
|||
<p> |
|||
<h2>Lex-deeit certificate</h2> |
|||
<h3>Fingerprint</h3> |
|||
<%= Certificate.get.cert_fpr %> |
|||
<h3>Serial</h3> |
|||
<%= Certificate.get.cert.serial %> |
|||
</p> |
|||
<hr/> |
|||
<% @hosts.each do |host| -%> |
|||
<p><%= host.lxd_config.inspect %></p> |
|||
<% host.lxd_certificates.each do |certificate| -%> |
|||
<p><%= certificate.fingerprint %></p> |
|||
<% end -%> |
|||
<p> |
|||
<h2><%= host.name %></h2> |
|||
<h3>Url:</h3> |
|||
<%= host.uri %> |
|||
<h3>Connection status:</h3> |
|||
<% case -%> |
|||
<% when host.authenticated -%> |
|||
authenticated |
|||
<% when host.connected -%> |
|||
connected |
|||
<% else -%> |
|||
not connected |
|||
<% end -%> |
|||
<% if host.authenticated -%> |
|||
<h3>Config:</h3> |
|||
<%= host.lxd_config.config %> |
|||
<h3>Host known certificates</h3> |
|||
<ul> |
|||
<% host.authenticated and host.lxd_certificates.each do |certificate| -%> |
|||
<li><%= certificate.fingerprint %></li> |
|||
<% end -%> |
|||
</ul> |
|||
<% end -%> |
|||
</p> |
|||
<hr/> |
|||
<% end -%> |
|||
<!-- vim: set ts=2 sw=2: --> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue