dashboard_controller.rb 459 Bytes
class DashboardController < ApplicationController
  def index
    check_cert
    @lxd_hosts = LxdHost.all

    @lxd_hosts.map { |host|
      host.cert = @cert
      if host.config.auth == 'untrusted'
        session[:return_to] = request.env["REQUEST_URI"]
        redirect_to controller: 'lxd_hosts', action: 'auth', id: host.id
        return
      end
    }

    @certificates = Lxd::Certificate.all @lxd_hosts.first.api
  end
end
# vim: set et ts=2 sw=2: