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

host-controller use GenericSessionMixin #472

Merged
merged 6 commits into from
Apr 10, 2017
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions app/controllers/host_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class HostController < ApplicationController
after_action :cleanup_action
after_action :set_session_data

include Mixins::GenericSessionMixin
include Mixins::GenericListMixin
include Mixins::MoreShowActions

Expand Down Expand Up @@ -645,20 +646,18 @@ def get_hosts
@host_pages, @hosts = paginate(:hosts, :per_page => @items_per_page, :order => @col_names[get_sort_col] + " " + @sortdir)
end

def title
_("Host")
end

def get_session_data
@title = _("Hosts")
@layout = "host"
super
@drift_db = "Host"
@lastaction = session[:host_lastaction]
@display = session[:host_display]
@filters = session[:host_filters]
@catinfo = session[:host_catinfo]
end

def set_session_data
super
session[:host_lastaction] = @lastaction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, one more thing, can you also remove this (lastaction) line? That one is handled by the mixin too.

Also, the same for catinfo.

session[:host_display] = @display unless @display.nil?
session[:host_filters] = @filters
session[:host_catinfo] = @catinfo
session[:miq_compressed] = @compressed unless @compressed.nil?
session[:miq_exists_mode] = @exists_mode unless @exists_mode.nil?
Expand Down