Update
This commit is contained in:
@@ -31,8 +31,8 @@ class HomeController < ApplicationController
|
||||
puts "current_dir : " + @current_dir
|
||||
render :json => {
|
||||
:dir => @current_dir,
|
||||
:file_manager_table => file_manager_table(@current_dir),
|
||||
:disk_usage_table => disk_usage_table(@current_dir),
|
||||
:file_manager_table => html_file_manager_table(@current_dir),
|
||||
:disk_usage_table => html_disk_usage_table(@current_dir),
|
||||
:du => get_du(@current_dir),
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class NodeController < ApplicationController
|
||||
before_action :require_login
|
||||
def index
|
||||
@hosts = Array.new
|
||||
@nodes = Node.all.order("id asc")
|
||||
@node_connects = Array.new
|
||||
node_info = Hash.new
|
||||
@@ -32,12 +31,6 @@ class NodeController < ApplicationController
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
if get_hosts.blank?
|
||||
flash[:danger] = "Check Server"
|
||||
else
|
||||
@hosts = get_hosts
|
||||
end
|
||||
rescue => ex
|
||||
puts ex
|
||||
end
|
||||
@@ -59,7 +52,7 @@ class NodeController < ApplicationController
|
||||
redirect_to '/node/index'
|
||||
end
|
||||
|
||||
def node_prove
|
||||
def node_probe
|
||||
one_node = Node.find(params[:node_id])
|
||||
puts "gluster peer probe #{one_node.host_name}"
|
||||
redirect_to '/node/index'
|
||||
|
||||
@@ -10,7 +10,7 @@ class VolumeController < ApplicationController
|
||||
puts "current_dir : " + @current_dir
|
||||
render :json => {
|
||||
:dir => @current_dir,
|
||||
:mount_table => mount_table(@current_dir),
|
||||
:mount_table => html_mount_table(@current_dir),
|
||||
}
|
||||
end
|
||||
|
||||
@@ -49,7 +49,7 @@ class VolumeController < ApplicationController
|
||||
#redirect_to '/volume/index'
|
||||
|
||||
render :json => {
|
||||
:volume_info => volume_info(volume_name, index),
|
||||
:volume_info => html_volume_info(volume_name, index),
|
||||
}
|
||||
end
|
||||
|
||||
@@ -61,9 +61,9 @@ class VolumeController < ApplicationController
|
||||
command << "sudo umount #{node.host_ip}:/#{volume_name}"
|
||||
puts command
|
||||
`#{command}`
|
||||
volume = volumes.find{ |v| v['Volume Name'].delete(' ') == volume_name}
|
||||
volume = ssh_volume_info.find{ |v| v['Volume Name'].delete(' ') == volume_name}
|
||||
render :json => {
|
||||
:volume_info => volume_info(volume, 0),
|
||||
:volume_info => html_volume_info(volume, 0),
|
||||
}
|
||||
end
|
||||
|
||||
@@ -107,9 +107,9 @@ class VolumeController < ApplicationController
|
||||
command << "yes | sshpass -p#{node.user_password} ssh #{node.user_name}@#{node.host_ip} gluster volume stop #{volume_name}"
|
||||
puts command
|
||||
`#{command}`
|
||||
volume = volumes.find{ |v| v['Volume Name'].delete(' ') == volume_name}
|
||||
volume = ssh_volume_info.find{ |v| v['Volume Name'].delete(' ') == volume_name}
|
||||
render :json => {
|
||||
:volume_info => volume_info(volume, 0),
|
||||
:volume_info => html_volume_info(volume, 0),
|
||||
}
|
||||
end
|
||||
|
||||
@@ -121,9 +121,9 @@ class VolumeController < ApplicationController
|
||||
command << "sshpass -p#{node.user_password} ssh #{node.user_name}@#{node.host_ip} gluster volume start #{volume_name}"
|
||||
puts command
|
||||
`#{command}`
|
||||
volume = volumes.find{ |v| v['Volume Name'].delete(' ') == volume_name}
|
||||
volume = ssh_volume_info.find{ |v| v['Volume Name'].delete(' ') == volume_name}
|
||||
render :json => {
|
||||
:volume_info => volume_info(volume, 0),
|
||||
:volume_info => html_volume_info(volume, 0),
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user