This commit is contained in:
kyg516
2016-09-24 18:00:27 +09:00
parent fc39111d1a
commit bf7244b273
11 changed files with 335 additions and 256 deletions

View File

@@ -1,10 +1,9 @@
class NodeController < ApplicationController
before_action :require_login
def index
@hosts = Array.new
@nodes = Node.all.order("id asc")
if get_hosts.blank?
flash[:danger] = "Check Server"
else
@@ -15,9 +14,9 @@ class NodeController < ApplicationController
def get_hosts
return ['2', 'aaa', 'bbb', 'ccc']
end
def node_add
new_node = Node.new
new_node = Node.new
new_node.host_name = params[:host_name]
new_node.host_ip = params[:host_ip]
new_node.user_name = params[:user_name]
@@ -25,7 +24,7 @@ class NodeController < ApplicationController
new_node.save
redirect_to '/node/index'
end
def node_delete
one_node = Node.find(params[:node_id])
one_node.destroy