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

Increase length of Graph Item 'value' field to support pango-markup better #2688

Closed
frontierliu opened this issue May 16, 2019 · 8 comments
Closed
Labels
enhancement General tag for an enhancement gui UI related issue resolved A fixed issue
Milestone

Comments

@frontierliu
Copy link
Contributor

frontierliu commented May 16, 2019

In case cacti 1.x support pango-markup text format, it is a good function to make cacti's graph text to have more color and other attributes.
But when I create a gprint_preset for input a pango-markup format string, eg. "<span foreground="blue" size="x-large">%8.2lf%s</span>", the text input box size limit to 40 chars, it is not enough for that pango-markup style string. I suggest increase the size limit to 100 chars, for better support pango-markup format string. 100 chars fit to the database gprint_preset table's field definition, no need to change database table. I found that text input box size limit was define in include/global_form.php, a minor modify shoud be ok.
Just a suggestion, thanks for the Cacti team's great work and I love it.

@netniV
Copy link
Member

netniV commented May 16, 2019

That does not sound like a massive increase but as it’s per field would lead to a longer maximum command line. Not sure if that is an issue more for Windows than Linux.

Unless one of the team can see a problem with it, I would suggest making that change in the 1.3 branch so it can be properly tested.

@cigamit cigamit added the enhancement General tag for an enhancement label May 18, 2019
@TheWitness TheWitness changed the title A suggestion for support pango-markup better Increate length of Graph Item 'value' field to support pango-markup better Mar 17, 2020
@TheWitness TheWitness changed the title Increate length of Graph Item 'value' field to support pango-markup better Increase length of Graph Item 'value' field to support pango-markup better Mar 17, 2020
TheWitness added a commit that referenced this issue Mar 17, 2020
Increase length of Graph Item 'value' field to support pango-markup better
@TheWitness TheWitness added the resolved A fixed issue label Mar 17, 2020
@TheWitness TheWitness added this to the 1.2.11 milestone Mar 17, 2020
@TheWitness
Copy link
Member

Turned out to be a simple thing. The database was already at 255 characters, so the only thing that needed to be changed was the form.

@TheWitness TheWitness added the gui UI related issue label Mar 17, 2020
@netniV
Copy link
Member

netniV commented Apr 1, 2020

The issue was more with the length of the built up command line, not the database field. By increasing to 255 per field, it can greatly increase the likelihood that the command line can exceed its limits.

@frontierliu
Copy link
Contributor Author

frontierliu commented Apr 3, 2020

Yes, in a graph that have many datasource items, It is possible to exceed the limit of Windows system command line 8191 chars. I think cacti can make a enchancement : when someone click "Turn on Graph Debug Mode" , the command line display text also print the command line text total chars count, if the count exceed 8191 in a windows system, show some warning messages. like below:
image
That would be helpful.

@netniV
Copy link
Member

netniV commented Apr 3, 2020

Please create that as an enhancement request, I think it's not a bad plan. 👍

@TheWitness
Copy link
Member

Yea, makes sense. The best plan is that if you are using Windows, you need to come to the light side and use a real operating system, on that is designed from the beginning for web hosting. I do like the idea of logging the command length (for windows users).

@frontierliu
Copy link
Contributor Author

ok, I will create an enchancement request for it.

@frontierliu
Copy link
Contributor Author

frontierliu commented Apr 4, 2020

Pull request have been created, only update rrd.php in lines 2256, please check it.
Now when someone "Turn on Graph Debug Mode", it will display like follow:
wx_20200404214103

If the Cacti OS is Windows and the lengths > 8191,it will display a warning message like follow:
wx_20200404213913

It will be helpful to debug some graph display issue about Windows system commandline lengths.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement General tag for an enhancement gui UI related issue resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

4 participants