dashboard_controller.rb 459 Bytes
class DashboardController < ApplicationController
  def index
    @lxd_host = LxdHost.find(1)
    @cert = Certificate.find(1)
    @api = Lxd::API.get @lxd_host, @cert
    @lxd_config = Lxd::Config.get @api

    if @lxd_config.auth == 'untrusted'
      # Here the controller has to ask for the password
      cert = Lxd::Certificate.new api: @api
      cert.save 'xxxxxxxxxx'
      @lxd_config = Lxd::Config.get @api
    end
  end
end
# vim: set et ts=2 sw=2: