2016-09-14 08:54:30 +00:00
|
|
|
class NodeController < ApplicationController
|
2016-09-28 09:55:02 +00:00
|
|
|
before_action :require_login
|
2016-10-02 04:19:10 +00:00
|
|
|
|
2016-10-03 04:20:11 +00:00
|
|
|
def index
|
2016-09-29 09:35:57 +00:00
|
|
|
end
|
2016-10-02 04:19:10 +00:00
|
|
|
|
|
|
|
def node_add
|
|
|
|
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]
|
|
|
|
new_node.user_password = params[:user_password]
|
|
|
|
new_node.save
|
|
|
|
redirect_to '/node/index'
|
2016-09-14 08:54:30 +00:00
|
|
|
end
|
|
|
|
|
2016-10-02 04:19:10 +00:00
|
|
|
def node_delete
|
|
|
|
one_node = Node.find(params[:node_id])
|
|
|
|
one_node.destroy
|
|
|
|
redirect_to '/node/index'
|
|
|
|
end
|
2016-09-24 09:00:27 +00:00
|
|
|
|
2016-10-02 12:38:57 +00:00
|
|
|
def node_probe
|
2016-10-02 04:19:10 +00:00
|
|
|
one_node = Node.find(params[:node_id])
|
|
|
|
puts "gluster peer probe #{one_node.host_name}"
|
|
|
|
redirect_to '/node/index'
|
|
|
|
end
|
2016-09-24 09:00:27 +00:00
|
|
|
|
2016-10-02 04:19:10 +00:00
|
|
|
def node_detach
|
|
|
|
one_node = Node.find(params[:node_id])
|
|
|
|
puts "gluster peer detach #{one_node.host_name}"
|
|
|
|
redirect_to '/node/index'
|
|
|
|
end
|
2016-09-14 08:54:30 +00:00
|
|
|
end
|