This commit is contained in:
kyg516
2016-09-14 17:54:30 +09:00
parent b97c484ff8
commit 40682aaec4
9 changed files with 86 additions and 119 deletions

View File

@@ -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

View 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

View File

@@ -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