Closed Poil closed 2 years ago
Proper display of structured facts would be real nice alright. If you want to give it a go, I'll cheer :-)
That looks messy, I was thinking something like that.
I had a look at this yesterday and I believe this would also be a little messy. If I understand jqtTree correctly the structured facts need to be restructured to match the expected data format:
{
name: fact key
children: [{
name: sub key
children: [{...}]
]}
}
The .tree() calls would have to go into the draw handler of the DataTable, right?
But, do we have to do that with jQuery? I mean, currently the datatable is requesting the fact/table values from the fact_ajax
endpoint anyway. Can't we just send properly nested html instead of the raw link?
For instance, with our inventory system we're doing something like this:
This could look rather pretty with semantic's accordion I think: https://semantic-ui.com/modules/accordion.html#/examples
@octomike , it can be done with dataTables: https://github.com/voxpupuli/puppetboard/pull/452
I believe that's the superior approach. I did some testing with server-side html generation, but that was way too slow. Do you think you can emulate the nested indentation? At least 1 more level would be super useful in most cases I think.
@octomike, how did you initialize tree widget on json data?
I have tested on an empty page with json from mount points:
First, I can't make it show facts in a readable way. Second, it takes ages for the page to load - 8 seconds for script alone.
I think that this issue is outdated and the way structured facts are shown now could be improved but looks good enough:
Hi,
Today structured facts are not displayed fine in Puppetboard. I've test this python library http://json2html.varunmalhotra.xyz/ , it seems to do a pretty job to convert a json tu an html element, I've tried complex structures and it give me satisfaction.
I've checked the code it seems to be easy to add this.
An opinion ?