-
Notifications
You must be signed in to change notification settings - Fork 900
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
Separate Storage Managers By Type in UI #12399
Changes from 1 commit
6a1ee1a
8208bbb
67fd132
f144318
4a2f7c1
4840990
d2c09a1
41f4cab
df6f056
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
1. Add the ability to show Storage Managers by the type of storage they support. 2. Add supports_block_storage? and supports_object_storage? methods and add them to the Cinder and Swift managers, respectively. 3. Change the UI so that it Shows Block and Object storage and the managers for each separately. 4. Make menu and headings for Storage Managers consistent (remove any indication that the Managers are "Providers").
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
class EmsBlockStorageController < ApplicationController | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. guess you need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @martinpovolny just curious - what is that supposed to do - the menu code clearly works for me without the line in both the EmsBlockStorageController and EmsObjectStorageController - neither of which have it. Also I've moved some of the menu sections around for these controllers and it appears that there may be other changes needed if this actually has an effect.Thanks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Never mind that - @h-kataria has explained it to me. I have made the required changes to each controller represented by a modified entry in the Menu::DefaultMenu. |
||
include EmsCommon | ||
include Mixins::EmsCommonAngular | ||
include Mixins::GenericSessionMixin | ||
|
||
before_action :check_privileges | ||
before_action :get_session_data | ||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
def self.model | ||
ManageIQ::Providers::StorageManager | ||
end | ||
|
||
def self.table_name | ||
@table_name ||= "ems_storage" | ||
end | ||
|
||
def ems_path(*args) | ||
path_hash = {:action => 'show', :id => args[0].id.to_s } | ||
path_hash.merge(args[1]) | ||
end | ||
|
||
def new_ems_path | ||
{:action => 'new'} | ||
end | ||
|
||
def ems_storage_form_fields | ||
ems_form_fields | ||
end | ||
|
||
# Show the main MS list view | ||
def show_list | ||
opts = {:supported_features_filter => "supports_block_storage?", | ||
:model => model} | ||
process_show_list(opts) | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
class EmsObjectStorageController < ApplicationController | ||
include EmsCommon | ||
include Mixins::EmsCommonAngular | ||
include Mixins::GenericSessionMixin | ||
|
||
before_action :check_privileges | ||
before_action :get_session_data | ||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
def self.model | ||
ManageIQ::Providers::StorageManager | ||
end | ||
|
||
def self.table_name | ||
@table_name ||= "ems_storage" | ||
end | ||
|
||
def ems_path(*args) | ||
path_hash = {:action => 'show', :id => args[0].id.to_s } | ||
path_hash.merge(args[1]) | ||
end | ||
|
||
def show_list | ||
opts = {:supported_features_filter => "supports_object_storage?", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am going to force the use of So I can fix this later on. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok thanks. |
||
:model => model} | ||
process_show_list(opts) | ||
end | ||
|
||
def new_ems_path | ||
{:action => 'new'} | ||
end | ||
|
||
def ems_storage_form_fields | ||
ems_form_fields | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
= render(:partial => "shared/views/ems_common/main") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- url = url_for(:controller => 'ems_block_storage', :action => 'update', :id => "#{@ems.id || 'new'}") | ||
= form_for(@ems, | ||
:url => url, | ||
:method => :post, | ||
:html => {"ng-controller" => "emsCommonFormController", | ||
"name" => "angularForm", | ||
"ng-show" => "afterGet", | ||
"update-url" => url, | ||
"form-fields-url" => "/#{controller_name}/ems_block_storage_form_fields/", | ||
"novalidate" => true}) do |f| | ||
%input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"} | ||
%input{:type => 'hidden', :id => "button_name", :name => "button", :value => "save"} | ||
%input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"} | ||
= render :partial => "shared/views/ems_common/angular/form" | ||
|
||
:javascript | ||
ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}'); | ||
miq_bootstrap($('#form_id').val()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
- url = url_for(:controller => 'ems_block_storage', :action => 'create', :id => "#{@ems.id || 'new'}") | ||
= form_for(@ems, | ||
:url => url, | ||
:method => :post, | ||
:html => {"ng-controller" => "emsCommonFormController", | ||
"name" => "angularForm", | ||
"ng-show" => "afterGet", | ||
"create-url" => url, | ||
"form-fields-url" => "/#{controller_name}/ems_block_storage_form_fields/", | ||
"novalidate" => true}) do |f| | ||
%input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"} | ||
%input{:type => 'hidden', :id => "button_name", :name => "button", :value => "add"} | ||
%input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"} | ||
|
||
= render :partial => "shared/views/ems_common/angular/form" | ||
|
||
:javascript | ||
ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}'); | ||
miq_bootstrap($('#form_id').val()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#main_div= render :partial => "layouts/gtl" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#main_div= render :partial => "layouts/tl_show" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
= render(:partial => "shared/views/ems_common/main") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- url = url_for(:controller => 'ems_object_storage', :action => 'update', :id => "#{@ems.id || 'new'}") | ||
= form_for(@ems, | ||
:url => url, | ||
:method => :post, | ||
:html => {"ng-controller" => "emsCommonFormController", | ||
"name" => "angularForm", | ||
"ng-show" => "afterGet", | ||
"update-url" => url, | ||
"form-fields-url" => "/#{controller_name}/ems_object_storage_form_fields/", | ||
"novalidate" => true}) do |f| | ||
%input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"} | ||
%input{:type => 'hidden', :id => "button_name", :name => "button", :value => "save"} | ||
%input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"} | ||
= render :partial => "shared/views/ems_common/angular/form" | ||
|
||
:javascript | ||
ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}'); | ||
miq_bootstrap($('#form_id').val()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
- url = url_for(:controller => 'ems_object_storage', :action => 'create', :id => "#{@ems.id || 'new'}") | ||
= form_for(@ems, | ||
:url => url, | ||
:method => :post, | ||
:html => {"ng-controller" => "emsCommonFormController", | ||
"name" => "angularForm", | ||
"ng-show" => "afterGet", | ||
"create-url" => url, | ||
"form-fields-url" => "/#{controller_name}/ems_object_storage_form_fields/", | ||
"novalidate" => true}) do |f| | ||
%input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"} | ||
%input{:type => 'hidden', :id => "button_name", :name => "button", :value => "add"} | ||
%input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"} | ||
|
||
= render :partial => "shared/views/ems_common/angular/form" | ||
|
||
:javascript | ||
ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}'); | ||
miq_bootstrap($('#form_id').val()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#main_div= render :partial => "layouts/gtl" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#main_div= render :partial => "layouts/tl_show" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could use the
GenericSessionMixin
here instead of having an own method (and altering the way@title
is calculated).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martinpovolny I didn't add this controller or even this method as part of this PR. I only changed the string value of the title.