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

Convert device/VM component templates to tables #4786

Closed
jeremystretch opened this issue Jun 24, 2020 · 5 comments
Closed

Convert device/VM component templates to tables #4786

jeremystretch opened this issue Jun 24, 2020 · 5 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Milestone

Comments

@jeremystretch
Copy link
Member

Proposed Changes

When viewing a device, its associated components (console ports, power outlets, interfaces, etc.) are displayed in tables, however each row is rendered using a static template (e.g. dcim/inc/interface.html). The same goes for virtual machine interfaces. This issue proposes replacing these static templates with Table objects, similar to how the global component lists are rendered.

Justification

This change would have several benefits:

  • Reduce template footprint
  • Enable ordering components by field
  • Enable toggling the display of certain fields (user preference)
  • Potentially support pagination
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user labels Jun 24, 2020
@DanSheps
Copy link
Member

Would this be a good time to look at something like datatables for this?

@jeremystretch
Copy link
Member Author

I opened this primarily as a reminder to myself, but recall that #4193 was opened a while back and as you mention datatables was suggested. However, that was before we introduced the ability to toggle and order table columns. I'm not necessarily opposed to implementing datatables, but I'd prefer to avoid the dependency and UI overhead if we can. I also don't want to risk putting too much effort into a frontend component that will potentially be replaced in a v3.0 world anyway.

It should be fairly straightforward to convert the existing templates to Table objects. Let me dig into it a bit more and if it seems to be a reasonable amount of effort for a few quick wins (enumerated above) I'd be happy with that for now.

@whitej6
Copy link

whitej6 commented Jul 20, 2020

@jeremystretch please assign to me

@jeremystretch
Copy link
Member Author

jeremystretch commented Jul 20, 2020

@whitej6 Are you sure? This is going to be fairly involved: each of the device component tables employed under the component list views (e.g. dcim.tables.ConsolePortTable) needs to be extended so that it can be used under individual devices views as well, to replace the inclusion templates. It will also be necessary to convert the display of IP addresses attached to interfaces to table columns (rather than subtables as they currently exist). These changes need to be made while ensuring none of the existing functionality is lost.

As we're getting ready to make the jump to v2.9, these changes will need to be made against the develop-2.9 branch. However, as it should be a fairly transparent opaque change to the user, it doesn't necessarily need to be done in time for the v2.9.0 release.

@jeremystretch
Copy link
Member Author

@whitej6 Can you share what progress you've made on this?

@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: accepted This issue has been accepted for implementation labels Sep 22, 2020
@jeremystretch jeremystretch added needs milestone Awaiting prioritization for inclusion with a future NetBox release status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Oct 14, 2020
@jeremystretch jeremystretch self-assigned this Oct 16, 2020
@jeremystretch jeremystretch added this to the v2.10 milestone Oct 16, 2020
jeremystretch added a commit that referenced this issue Oct 19, 2020
…tables

#4786: Convert device component templates to tables
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

3 participants