Change rendering/behavior of ILO/Mgmt IPs in Traffic Portal Servers list#5332
Change rendering/behavior of ILO/Mgmt IPs in Traffic Portal Servers list#5332MylesBock wants to merge 2 commits intoapache:masterfrom
Conversation
- added new cell renderer (ILOCellRenderer) - added new click handler for SSHCellRenderers and ILOCellRenderers
- both ssh/ilo cell renderers are now divs instead of a elements - a value associated with the cell has been added to both indicating what href to open - openCellInNewWindow() updated to use this value - onRowClick updated to not navigate if column's cells have either of these renderers
|
thanks @MylesBock - maybe @shamrickus can review? |
|
no problem, I would say so ag-grid is not my forte for sure |
| onRowClicked: function(params) { | ||
| const selection = window.getSelection().toString(); | ||
| if(selection === "" || selection === $scope.mouseDownSelectionText) { | ||
| const overrideCells = [ |
There was a problem hiding this comment.
I'd move this to a field on the controller since it never changes.
There was a problem hiding this comment.
10-4, this was added mostly last minute to ensure that the default behavior for the row wasn't applied
| this.eGui.setAttribute("target", "_blank"); | ||
| this.eGui = document.createElement("div"); | ||
| this.eGui.textContent = params.value; | ||
| this.data.cellHrefValue = "ssh://" + userModel.user.username + "@" + params.value; |
There was a problem hiding this comment.
Getting this.data is undefined on page load
Uncaught TypeError: this.data is undefined
init https://localhost/resources/assets/js/app.js?built=1606856003402:24254
initComponent https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
createAndInitUserComponent https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
newCellRenderer https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
createCellRendererFunc https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
executeFrame https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
requestFrame https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
app.js:24254:3```
There was a problem hiding this comment.
This literally crossed my mind Saturday afternoon 🙃
I need to figure out where it's approps to stash this, the context presently isn't correct of course
| "ipGateway", | ||
| "ipAddress" | ||
| ]; | ||
| let columnId = params.column.getColId(); |
There was a problem hiding this comment.
Getting params.column is undefined
|
|
||
| function ILOCellRenderer() {} | ||
| ILOCellRenderer.prototype.init = function(params) { | ||
| this.eGui = document.createElement("div"); |
There was a problem hiding this comment.
ILOCellRenderer never gets initialized. I believe it's because all of the columns it's on are hidden by default (the SSHCellRenderer has one that is not, so it does get initialized).
There was a problem hiding this comment.
🤔 I'll dig into this one tomorrow
What does this PR (Pull Request) do?
Updates
TableServersControllerto change the behavior for the ag-grid.A new renderer is introduced and the previous SSHCellRenderer has been updated to use a
divinstead of anatagThe corresponding
onRowClickbehavior was also updated to ignore navigation when these columns are clickedWhich Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Fire up TP with this branch, ensure ILO columns open to the iLO interface via HTTPS and the 'normal' mgmt IPs open a tab with an SSH target. Also ensure that when either of these are clicked the page remains the same.
If this is a bug fix, what versions of Traffic Control are affected?
The following criteria are ALL met by this PR