Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Physical server routing #1162

Merged
merged 1 commit into from May 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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