Update
This commit is contained in:
@@ -2,7 +2,6 @@ class ApplicationController < ActionController::Base
|
||||
# Prevent CSRF attacks by raising an exception.
|
||||
# For APIs, you may want to use :null_session instead.
|
||||
# protect_from_forgery with: :exception
|
||||
helper_method :volume_mount, :volume_unmount, :volume_create, :volume_delete, :volume_start, :volume_stop
|
||||
|
||||
def get_conf
|
||||
@config = Hash.new
|
||||
|
||||
15
app/controllers/node_controller.rb
Normal file
15
app/controllers/node_controller.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class NodeController < ApplicationController
|
||||
def index
|
||||
@hosts = Array.new
|
||||
|
||||
if get_hosts.blank?
|
||||
flash[:danger] = "Check Server"
|
||||
else
|
||||
@hosts = get_hosts
|
||||
end
|
||||
end
|
||||
|
||||
def get_hosts
|
||||
return ['2', 'aaa', 'bbb', 'ccc']
|
||||
end
|
||||
end
|
||||
@@ -1,20 +0,0 @@
|
||||
class PeerController < ApplicationController
|
||||
def index
|
||||
@hosts = Array.new
|
||||
|
||||
if get_hosts.blank?
|
||||
flash[:danger] = "Check Server"
|
||||
else
|
||||
@hosts = get_hosts
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def get_hosts
|
||||
file_str = `cat ` + @hostfile_path
|
||||
hosts_str = file_str.split("hosts:")[1]
|
||||
return hosts_str.split("\n")
|
||||
end
|
||||
|
||||
@hostfile_path = "../../../configure.conf"
|
||||
end
|
||||
Reference in New Issue
Block a user