Peer
Hover rows Try hovering over the rows
+ + +# | +Host Name | +IP Address | +Status | +UUID | +
---|---|---|---|---|
1 | +Mark | +Otto | +@mdo | +
diff --git a/app/assets/javascripts/peer.coffee b/app/assets/javascripts/peer.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/peer.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/peer.scss b/app/assets/stylesheets/peer.scss new file mode 100644 index 0000000..89ca5e6 --- /dev/null +++ b/app/assets/stylesheets/peer.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the peer controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/peer_controller.rb b/app/controllers/peer_controller.rb new file mode 100644 index 0000000..dbc890a --- /dev/null +++ b/app/controllers/peer_controller.rb @@ -0,0 +1,20 @@ +class PeerController < ApplicationController + def index + @hosts = Array.new + + if get_hosts.blank? + flash[:danger] = "Check Server" + else + @hosts = get_hosts + + end + end + + def get_hosts + file_str = `cat ` + @hostfile_path + hosts_str = file_str.split("hosts:")[1] + return hosts_str.split("\n") + end + + @hostfile_path = "../../../configure.conf" +end diff --git a/app/helpers/peer_helper.rb b/app/helpers/peer_helper.rb new file mode 100644 index 0000000..a94fc53 --- /dev/null +++ b/app/helpers/peer_helper.rb @@ -0,0 +1,2 @@ +module PeerHelper +end diff --git a/app/views/partials/_sidenav.html.erb b/app/views/partials/_sidenav.html.erb index fcf7fbc..401e4ea 100644 --- a/app/views/partials/_sidenav.html.erb +++ b/app/views/partials/_sidenav.html.erb @@ -84,7 +84,7 @@