dashboard-view-plugin icon indicating copy to clipboard operation
dashboard-view-plugin copied to clipboard

[JENKINS-6214] Provide the current width of a portlet as a variable to a plug-in that provides a portlet

Open TobiX opened this issue 15 years ago • 5 comments

The analysis plug-ins provides several portlets with user configurable width and height. Since the width of a portlet depends on the screen resolution and the number of columns it would be nice if the default width for a portlet graph would be available as a variable in the jelly scripts (at least a default width for single or double column display would be nice).

(The same would be good for the height, too. Here at least a default height would be nice to have.)


Originally reported by drulli, imported from: Provide the current width of a portlet as a variable to a plug-in that provides a portlet
  • assignee: petehayes
  • status: Open
  • priority: Major
  • resolution: Unresolved
  • imported: 2022-10-30

TobiX avatar Apr 09 '10 03:04 TobiX

mambu:

To add some extra parameters to your DashboardPortlet you need to implement your own config.jelly (you can make a copy of one config.jelly in the dashboard-view plugin source code).
Then add your parameters to you ctor and that's it.
See issue 6811 and dashboard-view wiki (I have just updated it with the instructions).

TobiX avatar Jul 29 '10 09:07 TobiX

mambu:

Please use graphWidth and graphHeight as variable names for the 'graph', anyway do not use width and height, because looking at the several issues for the dashboard-view plugin maybe we will insert width (and height???) as the dimension of the portlet (the entire portlet, not only the graph inside). So we can avoid conflicts later. Thanks.

TobiX avatar Jul 29 '10 09:07 TobiX

drulli:

Updated the description since it was misleading. The width and height already is configurable, what is missing are defaults for width and height.

TobiX avatar Jul 29 '10 09:07 TobiX

mambu:

Do you mean that when a portlet is displayed it gets the width of the 'frame' which it is going to be shown in?
I don't know how to get this value (in pixels) because in the dashboard it is expressed in percentage (50% for 2 columns, 100% for 1 columns).

TobiX avatar Aug 22 '10 05:08 TobiX

drulli:

Yes, I mean the width of the frame. Couldn't that be done with some javascript?

Maybe the width of a portlet should be kind of 'auto-resizable', i.e. if the user changes the size of the frame (e.g., by shrinking the browser window), then the portlet automatically fills the available space. I don't know if that is possible, maybe someone on the dev list knows how to do that?

TobiX avatar Aug 23 '10 00:08 TobiX