summaryrefslogtreecommitdiff
path: root/include/json_html_serializer.hpp
AgeCommit message (Collapse)AuthorFilesLines
2020-09-29Fix naming conventionsEd Tanous1-16/+16
Lots of code has been checked in that doesn't match the naming conventions. Lets fix that. Tested: Code compiles. Variable/function renames only. Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I6bd107811d0b724f1fad990016113cdf035b604b
2020-09-28Fix the buildEd Tanous1-0/+5
In between the json patch being written, and the json patch being merged, nlohmann library added binary types: https://nlohmann.github.io/json/features/binary_values/ Which is non standard, but used for things like cbor. Add a switch to handle them. Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I8599847a063a14c5f489e8347c2c440347d2544d
2020-09-24Improve JSON->HTML conversionEd Tanous1-0/+614
The existing JSON to html conversion is quite unfortunate, as it runs several very expensive regular expressions on an output to properly invoke the correct behavior, and to escape things like links. This patchset adjusts the behavior to directly dump the tree to HTML, skipping the json step entirely. Most of the code was pulled from the nlohmann::serializer class. Small side node: This also resolves the CSP issue with the inline CSS classes that are currently embedded in the json UI. Note, in terms of user facing behavior, this finally fixes the CSS issue, so the div is now centered as designed. Previously it was left justified. Tested: Ran several redfish schemas and compared to old ones. Output appears the same in the window, and content security policy warnings are gone. Verified several links works as expected, and verified the behavior of all base types, as well as empty arrays and empty objects. All appear to work correctly. Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: Id9bf6dc33acb1603f009de4cd322e81d83f334be