Make schemas selectableWhich schemas are installed should be selectable in both a meson config,and trivially by forks. This commit gets us closer to that idea.It does it in several ways, first,
Make schemas selectableWhich schemas are installed should be selectable in both a meson config,and trivially by forks. This commit gets us closer to that idea.It does it in several ways, first, the code for generatingJsonSchemaFile resources has been changed to be generated at runtime,based on files on disk. This is slightly slower, but allows installingschemas from anywhere, and matches the CSDL handling.Next, the schema folders are separated into two setscsdl -> This includes the complete schema pack from dmtfinstalled -> this includes only the schemas the bmc includesSimilar folders exist for json-schema and json-schema-installed.This allows any additional schemas to be a single symlink addition.Note, this also checks in all of the dmtf json schemas, not just theversions we use. This allows us to update the schema pack withoutneeding to break our versions we ship.Because the static files are now selectable, all files need to be in afolder. This forces the css and image for the redfish built-in gui tobe moved.Tested:/redfish/v1/JsonSchemas returns the correct result/redfish/v1/JsonSchemas/UpdateService returns a JsonSchemaFile instance/redfish/v1/JsonSchemas/UpdateService/UpdateService<version>json returnsthe JsonSchemaFile contents.Redfish service validator passes.Change-Id: Ie96b2e4b623788dc2ec94eb40fcfd80325f0d826Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
Remove default.css from the imageThis is primarily to save space, and remove cruft. As part of the "old"json->html parser, this file was used to do the syntax highlighting forthe hilight-js clas
Remove default.css from the imageThis is primarily to save space, and remove cruft. As part of the "old"json->html parser, this file was used to do the syntax highlighting forthe hilight-js class we used. That parser has been removed, so thiscode is now dead.Tested:Has no external impact to test. Code builds.Signed-off-by: Ed Tanous <edtanous@google.com>Change-Id: Iebbf97003d41818abc2a9eae68c23c636f13d2e6
Improve JSON->HTML conversionThe existing JSON to html conversion is quite unfortunate, as it runsseveral very expensive regular expressions on an output to properlyinvoke the correct behavior, a
Improve JSON->HTML conversionThe existing JSON to html conversion is quite unfortunate, as it runsseveral very expensive regular expressions on an output to properlyinvoke the correct behavior, and to escape things like links. Thispatchset 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 arecurrently embedded in the json UI.Note, in terms of user facing behavior, this finally fixes the CSSissue, so the div is now centered as designed. Previously it was leftjustified.Tested:Ran several redfish schemas and compared to old ones. Output appearsthe same in the window, and content security policy warnings are gone.Verified several links works as expected, and verified the behavior ofall base types, as well as empty arrays and empty objects. All appearto work correctly.Signed-off-by: Ed Tanous <ed@tanous.net>Change-Id: Id9bf6dc33acb1603f009de4cd322e81d83f334be
Implement pretty printing json to HTMLChange-Id: Ibe3cdc2cd53470ccd437b1b6e21bc7dd29c4b85eSigned-off-by: Ed Tanous <ed.tanous@intel.com>