Skip to content

Commit c27d8f9

Browse files
committed
Improvements to Crowbar-UI for Rackscale
- Added text boxes to edit PSME server IP and port.
1 parent f3e290a commit c27d8f9

File tree

7 files changed

+47
-8
lines changed

7 files changed

+47
-8
lines changed

crowbar_framework/app/controllers/intelrsd_controller.rb

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,19 @@ class RsdController < ApplicationController
3636
attr_reader :redfish_client, :logger
3737

3838
# Client setup for the class
39-
host = ENV["CROWBAR_REDFISH_HOST"] || "localhost"
40-
port = ENV["CROWBAR_REDFISH_PORT"] || "8443"
41-
@redfish_client = RedfishHelper::RedfishClient.new(host, port)
42-
43-
def show
39+
@host = ENV["CROWBAR_REDFISH_HOST"] || "localhost"
40+
@port = ENV["CROWBAR_REDFISH_PORT"] || "8443"
41+
42+
def settings
43+
@host = @rsd_rest_server
44+
@port = @rsd_server_port
45+
Rails.logger.warn "RackScale Server: #{@host}, Port: #{@port}"
46+
#@redfish_client = RedfishHelper::RedfishClient.new(host, port)
47+
end
48+
49+
def display
50+
Rails.logger.warn "RackScale Server: #{@host}, Port: #{@port}"
51+
@redfish_client = RedfishHelper::RedfishClient.new(@host, @port)
4452
@title = "Welcome to RackScale Design"
4553
sys_list = get_all_systems
4654
@rsd_systems = "Systems not Available"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.row
2+
.col-xs-12
3+
%h1.page-header
4+
= t(".title")
5+
6+
.btn-group.pull-right
7+
= link_to t(".show"), rsd_display_path, :class => "btn btn-default"
8+
9+
= form_tag rsd_display_path, :role => "form" do |f|
10+
.panel.panel-default
11+
.panel-body
12+
.form-group
13+
%label{ :for => :rsd_rest_server }
14+
= t(".rsd_rest_server")
15+
= text_field_tag :rsd_rest_server, @rsd_rest_server, :class => "form-control", :disabled => nil
16+
17+
.form-group
18+
%label{ :for => :rsd_server_port }
19+
= t(".rsd_server_port")
20+
= text_field_tag :rsd_server_port, @rsd_server_port, :class => "form-control", :disabled => nil
21+
22+
.panel-footer.text-right
23+
.btn-group
24+
%input.btn.btn-default{ :type => "submit", :name => "show", :value => t(".show") }

crowbar_framework/config/locales/intel_rsd/en.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ en:
1919
utils:
2020
rsd: 'Intel RackScale'
2121
rsd:
22+
settings:
23+
title: 'Intel Rackscale Server Details'
24+
rsd_rest_server: 'PSME Rest Server IP'
25+
rsd_server_port: 'PSME Rest Server Port'
26+
show: 'Show'
2227
show:
2328
title: 'Intel Rackscale'
2429
rsd_header: 'Lists Systems available from Intel RackScale server by talking to the Redfish APIs'

crowbar_framework/config/navigation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
level2.item :repositories, t("nav.utils.repositories"), repositories_path
4040
level2.item :backup, t("nav.utils.backup"), backups_path
4141
level2.item :logs, t("nav.utils.logs"), utils_path
42-
level2.item :rsd, t("nav.utils.rsd"), rsd_show_path
42+
level2.item :rsd, t("nav.utils.rsd"), rsd_settings_path
4343
end
4444
end
4545
end

crowbar_framework/config/routes.d/intel-rsd.routes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@
1414
# limitations under the License.
1515
#
1616

17-
get 'rsd/show' => 'rsd#show', as: 'rsd_show'
17+
post 'rsd/display' => 'rsd#display', as: 'rsd_display'
18+
get 'rsd/settings' => 'rsd#settings', as: 'rsd_settings'
19+
post 'rsd/show' => 'rsd#show', as: 'rsd_show'
1820
post 'rsd/allocate' => 'rsd#allocate', as: 'rsd_allocate'

intelrsd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ nav:
3434
utils:
3535
rsd:
3636
order: 91
37-
route: 'rsd_edit_path'
37+
route: 'rsd_settings_path'

0 commit comments

Comments
 (0)