Skip to content

Commit

Permalink
- Add routing to server.
Browse files Browse the repository at this point in the history
- Add physical server controller.

  - app/controllers/physical_server_controller.rb

- Implement show_list view and basic toolbar

- Implements show view for specific physical server
  • Loading branch information
gabrielsvinha committed May 3, 2017
1 parent 5f643d8 commit c0f9dbe
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 0 deletions.
34 changes: 34 additions & 0 deletions app/controllers/physical_server_controller.rb
@@ -0,0 +1,34 @@
class PhysicalServerController < ApplicationController
include Mixins::GenericListMixin
include Mixins::GenericShowMixin

before_action :check_privileges
before_action :session_data
after_action :cleanup_action
after_action :set_session_data

def self.table_name
@table_name ||= "physical_servers"
end

def session_data
@title = _("Physical Servers")
@layout = "physical_server"
@lastaction = session[:physical_server_lastaction]
end

def set_session_data
session[:layout] = @layout
session[:physical_server_lastaction] = @lastaction
end

def show_list
# Disable the cache to prevent a caching problem that occurs when
# pressing the browser's back arrow button to return to the show_list
# page while on the Physical Server's show page. Disabling the cache
# causes the page and its session variables to actually be reloaded.
disable_client_cache

process_show_list
end
end
1 change: 1 addition & 0 deletions app/helpers/application_helper.rb
Expand Up @@ -1221,6 +1221,7 @@ def pdf_page_size_style
offline
orchestration_stack
physical_infra_topology
physical_server
persistent_volume
policy
policy_group
Expand Down
4 changes: 4 additions & 0 deletions app/views/physical_server/_main.html.haml
@@ -0,0 +1,4 @@
= render :partial => "layouts/flash_msg"
.row
.col-md-12.col-lg-6
TODO: add groups
6 changes: 6 additions & 0 deletions app/views/physical_server/show.html.haml
@@ -0,0 +1,6 @@
#main_div
- arr = %w(physical_server physical_servers)
- if arr.include?(@display) && @showtype != "compare"
= render(:partial => "layouts/gtl", :locals => {:action_url => "show/#{@ph_server.id}"})
- else
= render(:partial => @showtype)
2 changes: 2 additions & 0 deletions app/views/physical_server/show_list.html.haml
@@ -0,0 +1,2 @@
#main_div
= render :partial => 'layouts/gtl'
17 changes: 17 additions & 0 deletions config/routes.rb
Expand Up @@ -1269,6 +1269,23 @@
save_post
},

:physical_server => {
:get => %w(
download_data
perf_top_chart
protect
show_list
show
) + compare_get,

:post => %w(
button
show_list
create
update
)
},

:ems_physical_infra_dashboard => {
:get => %w(
show
Expand Down

0 comments on commit c0f9dbe

Please sign in to comment.