diff --git a/Gemfile b/Gemfile index 5538447..153be72 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ source 'https://rubygems.org' gem 'carrierwave' gem 'devise' +gem 'net-ping' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.4' # Use sqlite3 as the database for Active Record diff --git a/Gemfile.lock b/Gemfile.lock index 12bf38b..51f55de 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,6 +96,7 @@ GEM mini_portile2 (2.0.0) minitest (5.8.4) multi_json (1.11.2) + net-ping (2.0.1) nokogiri (1.6.7.2) mini_portile2 (~> 2.0.0.rc2) orm_adapter (0.5.0) @@ -183,6 +184,7 @@ DEPENDENCIES font-awesome-rails jbuilder (~> 2.0) jquery-rails + net-ping rails (= 4.2.4) sass-rails (~> 5.0) sdoc (~> 0.4.0) 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 d870f47..90fc615 100644 --- a/app/controllers/node_controller.rb +++ b/app/controllers/node_controller.rb @@ -1,6 +1,5 @@ class NodeController < ApplicationController - before_action :require_login - + before_action :require_login def index @hosts = Array.new @nodes = Node.all.order("id asc") @@ -30,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/helpers/node_helper.rb b/app/helpers/node_helper.rb index ff049b0..a0b203f 100644 --- a/app/helpers/node_helper.rb +++ b/app/helpers/node_helper.rb @@ -1,2 +1,7 @@ module NodeHelper + require 'net/ping' + def ping_test?(host) + check = Net::Ping::External.new(host) + check.ping? + end end diff --git a/app/views/node/index.html.erb b/app/views/node/index.html.erb index 44cadcd..833ddb4 100644 --- a/app/views/node/index.html.erb +++ b/app/views/node/index.html.erb @@ -9,7 +9,7 @@
# | -First Name | -Last Name | -Username | -
---|---|---|---|
1 | -Mark | -Otto | -@mdo | -
2 | -Jacob | -Thornton | -@fat | -
3 | -Larry | -the Bird | -
Collapsible Item 2 data -
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, -