-
Notifications
You must be signed in to change notification settings - Fork 357
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
Limit number of objects on topology views #95
Conversation
@miq-bot add_label providers/containers, topology |
@zeari Cannot apply the following label because they are not recognized: topology |
Approach LGTM 👍. @dclarizio can you review the approach/screenshots? (Code can be improved when we'll move this out of WIP). @miq-bot assign dclarizio |
@simon3z I'm not sure I'm fully on board with the approach. I mean, in theory I like it, but I have some issues:
When I was thinking about this earlier, I had an idea that we could limit the maximum number of child nodes of any type (per parent), then show an extra "group" node, something like Another limit setting, at least for the initial display, could be In both cases, perhaps we could let the user then drill into (or turn on) missing nodes on demand if they really need to see them. Adding @serenamarie125 for more input. |
@dclarizio This is not the case. In this solution, all of a certain type are hidden (meaning all containers\ all pods\ all of type) by default and you can bring them all back using the filtering buttons on top. Those filter buttons are just on by default. Its indicated by the greyed out icons and the user can return to have all types shown. Node depth from provider(root node) might not be a better filtering method since there are many types that are 'the same depth' but are less granular or interesting than their counterparts. |
@zeari ahhh, I see . .. I misunderstood . . . so we eliminate (turn off) types, based on the furthest out nodes (i.e. granularity) until below the configured limit, but the user can turn them back on if they want, cool. I still think a max number of child nodes would be a good idea, such that if I know more than 50 nodes is impossible for me to see clearly, it would just show the 50 and then a |
That might be nice. Im not sure how we would decide which entity to hide (node?container?pod?) or how many of them to hide. |
@zeari this will help and can potentially be improved on later, I'm on board with moving forward . . . Thx, Dan |
1d5afba
to
0b0b9e9
Compare
@zeari Couple of questions ...
|
@serenamarie125 yes, you can bring back each hidden type separately (
Maybe not. Where would you put it? |
e1a0f07
to
c3aafb3
Compare
@@ -37,6 +37,20 @@ function ContainerTopologyCtrl($scope, $http, $interval, $location, topologyServ | |||
|
|||
if (currentSelectedKinds && (Object.keys(currentSelectedKinds).length != Object.keys($scope.kinds).length)) { | |||
$scope.kinds = currentSelectedKinds; | |||
} else { | |||
const remove_hierarchy = ['Container', 'ContainerGroup', 'ContainerReplicator', 'ContainerService', |
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.
can't use const
yet, sorry :)
const remove_hierarchy = ['Container', 'ContainerGroup', 'ContainerReplicator', 'ContainerService', | ||
'ContainerRoute', 'Host', 'Vm', 'ContainerNode', 'ContainerManager']; | ||
// Cant use Object.values... | ||
var tmp_list = Object.keys($scope.items).map(function(key) { return $scope.items[key] }); |
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.
Could be _.values
;)
var kind_index = 0; | ||
while ((tmp_list.length > data.data.size_limit) && kind_index < remove_hierarchy.length) { | ||
kind_to_hide = remove_hierarchy[kind_index]; | ||
tmp_list = tmp_list.filter(function(item) { |
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.
Not a good idea to change tmp_list
while iterating over it..
EDIT: ..unless you just care about the lenght :). We can keep this I think..
var tmp_list = Object.keys($scope.items).map(function(key) { return $scope.items[key] }); | ||
var kind_index = 0; | ||
while ((tmp_list.length > data.data.size_limit) && kind_index < remove_hierarchy.length) { | ||
kind_to_hide = remove_hierarchy[kind_index]; |
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.
missing var
[_("Tile View"), "perpage_tile", :tile], | ||
[_("List View"), "perpage_list", :list], | ||
[_("Reports"), "perpage_reports", :reports], | ||
[_("Topolgy View"), "perpage_topology", :topology]].each do |item_per_page| |
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.
Topolgy
!= Topology
;)
95c819d
to
74cc5e0
Compare
@miq-bot remove_label wip @simon3z Aside from the comment by @serenamarie125 this should be ready. |
@zeari i would suggest something more like this, where it's in a box on it's own. |
@@ -37,6 +37,20 @@ function ContainerTopologyCtrl($scope, $http, $interval, $location, topologyServ | |||
|
|||
if (currentSelectedKinds && (Object.keys(currentSelectedKinds).length != Object.keys($scope.kinds).length)) { | |||
$scope.kinds = currentSelectedKinds; | |||
} else { | |||
remove_hierarchy = ['Container', 'ContainerGroup', 'ContainerReplicator', 'ContainerService', |
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 guess this should be
var remove_hierarchy = [
'Container',
'ContainerGroup',
'ContainerManager',
'ContainerNode',
'ContainerReplicator',
'ContainerRoute',
'ContainerService',
'Host',
'Vm',
];
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.
(because missing var, improbable formatting, and easier to see if its one entry per line, sorted alphabetically)
"OpenshiftEnterprise":{"type":"image","icon":"...openshift_enterprise..."}}} | ||
"OpenshiftEnterprise":{"type":"image","icon":"...openshift_enterprise..."} | ||
}, | ||
"size_limit": 100 |
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 think this is no longer the right data, hence the spec failure ;)
Thanks @zeari that looks really nice, should make it much easier to add to another topologies :). I'd merge, except for the spec failure :) |
@himdel please note that above there's still a comment on the default value. |
Ah, yeah, sorry about that, the default value is up to you guys, if that's something for a longer discussion, changing it would be trivial so .. I don't really consider it a blocker :) (But the current default would seem to be Unlimited.) |
@zeari One more thing I notice .. if you enter the Settings screen with a clean (new) user, you'll get an exception...
Pretty sure it's that (Note I also have to change |
This pull request is not mergeable. Please rebase and repush. |
9e93b0b
to
b0862e5
Compare
Checked commit zeari@b0862e5 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/controllers/configuration_controller.rb
|
@himdel I made a new user but im not getting this exception.
How did you add your containers provider? this shouldnt happen anymore since the ui doesnt let you add a containers provider that doesnt have a bearer auth. |
You were right, sorry about that, it was indeed that restart thing :).
Well, I'm not seeing any migrations that would fix providers that were added before it couldn't happen ;). But yeah, my db is not new. |
Ok, this is working and looks good, merging. |
@miq-bot add_label topology |
@zeari Cannot apply the following label because they are not recognized: providers/containers |
Set object limit in settings:
Objects kinds are hidden by order of granularity. Since
containers
are the least major entity they will be hidden first, then pods, then similarly other types until we are below the set object limit.Edit: you can bring back each hidden type separately (containers, pods, etc.) using the filter buttons on top
@dclarizio @simon3z The code here is bad but in general, this is a possible approach towards scaling in topology. If this policy is good enough Ill go forward with it.