summaryrefslogtreecommitdiff
path: root/static/redfish.css
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2019-05-21 23:00:34 +0300
committerEd Tanous <ed@tanous.net>2020-09-24 05:01:21 +0300
commit57fce80e24cfe08e530e0697d6c70bba14076d1c (patch)
tree0b28771a7c7cd609d85008a223d20f66fe376b55 /static/redfish.css
parentbbf1a93eb6935c426deb0ecbcf3d8611b17aeb30 (diff)
downloadbmcweb-57fce80e24cfe08e530e0697d6c70bba14076d1c.tar.xz
Improve JSON->HTML conversion
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
Diffstat (limited to 'static/redfish.css')
-rw-r--r--static/redfish.css19
1 files changed, 19 insertions, 0 deletions
diff --git a/static/redfish.css b/static/redfish.css
new file mode 100644
index 0000000000..4e851ebedd
--- /dev/null
+++ b/static/redfish.css
@@ -0,0 +1,19 @@
+img {
+ max-width: 30em;
+ margin: 0 auto;
+}
+
+.container {
+ width: 30em;
+ top: 50%;
+ left: 50%;
+ margin: 0 auto;
+}
+
+.content {
+ font-family: monospace;
+}
+
+.tab {
+ margin-left: 2em;
+}