From 510a8a200d5fd40bc13cfd51e8aa7c138517f737 Mon Sep 17 00:00:00 2001 From: bee0005 Date: Wed, 28 Sep 2016 10:27:54 +0000 Subject: [PATCH] update peer status --- app/assets/javascripts/application.js | 3 +++ app/assets/stylesheets/application.scss | 1 + app/controllers/node_controller.rb | 12 ++++++++++ app/views/node/index.html.erb | 32 ++++++++++++++++++++++--- config/routes.rb | 15 ++++++------ 5 files changed, 53 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 570b261..310215f 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -52,3 +52,6 @@ //= require js/datatables/dataTables.responsive.min.js //= require js/datatables/responsive.bootstrap.min.js //= require js/datatables/dataTables.scroller.min.js + + +//= require js/switchery/switchery.min.js diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 474fd17..b79f29d 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -28,6 +28,7 @@ @import "css/ion.rangeSlider"; @import "css/ion.rangeSlider.skinFlat"; @import "css/colorpicker/bootstrap-colorpicker.min"; +@import "css/switchery/switchery.min"; @import "pace"; //DataTable diff --git a/app/controllers/node_controller.rb b/app/controllers/node_controller.rb index 02b4108..90fc615 100644 --- a/app/controllers/node_controller.rb +++ b/app/controllers/node_controller.rb @@ -29,4 +29,16 @@ class NodeController < ApplicationController one_node.destroy redirect_to '/node/index' end + + def node_prove + one_node = Node.find(params[:node_id]) + puts "gluster peer probe #{one_node.host_name}" + redirect_to '/node/index' + end + + def node_detach + one_node = Node.find(params[:node_id]) + puts "gluster peer detach #{one_node.host_name}" + redirect_to '/node/index' + end end diff --git a/app/views/node/index.html.erb b/app/views/node/index.html.erb index d1a3904..833ddb4 100644 --- a/app/views/node/index.html.erb +++ b/app/views/node/index.html.erb @@ -112,10 +112,10 @@ <%if ping_test?(t.host_ip)%> - Prove + Attached <%else%> - - + <%end%> <%=t.host_name%> <%=t.host_ip%> @@ -126,13 +126,39 @@ <%end%> + + + -