Skip to content

Commit

Permalink
Improvements to Crowbar-UI for Rackscale
Browse files Browse the repository at this point in the history
 - Added text boxes to edit PSME server IP and port.
  • Loading branch information
mmnelemane committed Dec 19, 2016
1 parent f5d7988 commit 9a37d09
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 8 deletions.
18 changes: 13 additions & 5 deletions crowbar_framework/app/controllers/intelrsd_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,19 @@ class RsdController < ApplicationController
attr_reader :redfish_client, :logger

# Client setup for the class
host = ENV["CROWBAR_REDFISH_HOST"] || "localhost"
port = ENV["CROWBAR_REDFISH_PORT"] || "8443"
@redfish_client = RedfishHelper::RedfishClient.new(host, port)

def show
@host = ENV["CROWBAR_REDFISH_HOST"] || "localhost"
@port = ENV["CROWBAR_REDFISH_PORT"] || "8443"

def settings
@host = @rsd_rest_server
@port = @rsd_server_port
Rails.logger.warn "RackScale Server: #{@host}, Port: #{@port}"
#@redfish_client = RedfishHelper::RedfishClient.new(host, port)
end

def display
Rails.logger.warn "RackScale Server: #{@host}, Port: #{@port}"
@redfish_client = RedfishHelper::RedfishClient.new(@host, @port)
@title = "Welcome to RackScale Design"
sys_list = get_all_systems
@rsd_systems = "Systems not Available"
Expand Down
24 changes: 24 additions & 0 deletions crowbar_framework/app/views/rsd/settings.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.row
.col-xs-12
%h1.page-header
= t(".title")

.btn-group.pull-right
= link_to t(".show"), rsd_display_path, :class => "btn btn-default"

= form_tag rsd_display_path, :role => "form" do |f|
.panel.panel-default
.panel-body
.form-group
%label{ :for => :rsd_rest_server }
= t(".rsd_rest_server")
= text_field_tag :rsd_rest_server, @rsd_rest_server, :class => "form-control", :disabled => nil

.form-group
%label{ :for => :rsd_server_port }
= t(".rsd_server_port")
= text_field_tag :rsd_server_port, @rsd_server_port, :class => "form-control", :disabled => nil

.panel-footer.text-right
.btn-group
%input.btn.btn-default{ :type => "submit", :name => "show", :value => t(".show") }
5 changes: 5 additions & 0 deletions crowbar_framework/config/locales/intel_rsd/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ en:
utils:
rsd: 'Intel RackScale'
rsd:
settings:
title: 'Intel Rackscale Server Details'
rsd_rest_server: 'PSME Rest Server IP'
rsd_server_port: 'PSME Rest Server Port'
show: 'Show'
show:
title: 'Intel Rackscale'
rsd_header: 'Lists Systems available from Intel RackScale server by talking to the Redfish APIs'
Expand Down
2 changes: 1 addition & 1 deletion crowbar_framework/config/navigation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
level2.item :repositories, t("nav.utils.repositories"), repositories_path
level2.item :backup, t("nav.utils.backup"), backups_path
level2.item :logs, t("nav.utils.logs"), utils_path
level2.item :rsd, t("nav.utils.rsd"), rsd_show_path
level2.item :rsd, t("nav.utils.rsd"), rsd_settings_path
end
end
end
4 changes: 3 additions & 1 deletion crowbar_framework/config/routes.d/intel-rsd.routes
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
# limitations under the License.
#

get 'rsd/show' => 'rsd#show', as: 'rsd_show'
post 'rsd/display' => 'rsd#display', as: 'rsd_display'
get 'rsd/settings' => 'rsd#settings', as: 'rsd_settings'
post 'rsd/show' => 'rsd#show', as: 'rsd_show'
post 'rsd/allocate' => 'rsd#allocate', as: 'rsd_allocate'
2 changes: 1 addition & 1 deletion intelrsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ nav:
utils:
rsd:
order: 91
route: 'rsd_edit_path'
route: 'rsd_settings_path'

0 comments on commit 9a37d09

Please sign in to comment.