phpinsights icon indicating copy to clipboard operation
phpinsights copied to clipboard

Improvement: add serve dashboard command / static page

Open cbraillon opened this issue 6 years ago • 18 comments

Q A
Bug report? no
Feature request? yes
Library version latest

It would be great to see results in a dashboard. I know that Symfony Insight has one and it's awesome.

It will increase the readability of issues.

cbraillon avatar Jul 25 '19 10:07 cbraillon

I wouldn't mind to tackle this… 🔥 🔥 🔥

caneco avatar Jul 25 '19 10:07 caneco

We have a PR for adding formatters #201, which will make doing this a lot easier.

I see two ways of implementing this. Either create a new formatter called html, which generates a site from the output. Or create a site which can load the data from the json format.

olivernybroe avatar Jul 25 '19 11:07 olivernybroe

@olivernybroe in each run we could add a new JSON file to a specific folder that a HTML would read an present the key figures and charts.

Feels like the best approach, and also to show the progress of the insights results.

caneco avatar Jul 25 '19 11:07 caneco

@caneco Sounds like a good idea. I think the JSON way is more robust and extendable in the future.

Would also do so you could compare your results for each run 👍

Maybe this dashboard should be a package for itself that you can just composer require in?

olivernybroe avatar Jul 25 '19 12:07 olivernybroe

Could be something installed if needed with npm run install && npm run build/serve?

caneco avatar Jul 25 '19 12:07 caneco

@caneco Yeah, it makes a ton of sense to use npm instead as it is front end stuff.

olivernybroe avatar Jul 25 '19 13:07 olivernybroe

Another question…

Should the dashboard be:

  • only available by running a local server (npm run serve)
  • available as a "static" website in the repo (npm run build)
  • or… both

caneco avatar Jul 25 '19 13:07 caneco

I think a static site might be the best choice, if that is not too much work. Else just do what you find easiest.

olivernybroe avatar Jul 26 '19 05:07 olivernybroe

Love the idea of a static site !

cbraillon avatar Jul 26 '19 06:07 cbraillon

Thanks to @olivernybroe, we can know get json format from phpinsights.

nunomaduro avatar Aug 15 '19 10:08 nunomaduro

I also would like static html files more. And at the end it's just adding tag wrappers around the already present text format? <dl>, <ul> and this kind of stuff should do the trick?

Gummibeer avatar Aug 28 '19 10:08 Gummibeer

Will try to add a HTML formatter which generates a static file.

Gummibeer avatar Aug 28 '19 10:08 Gummibeer

I'm 💯 % not in design! But this is my first/working result. I've tried to rebuild the console output - because I'm a lazy-bitch I use bootstrap. 🙈 My idea is that anyone else can make it pretty if wanted, but for the moment it should be fine!?

screencapture-localhost-63342-phpinsights-dashboard-html-2019-08-28-14_58_11

Gummibeer avatar Aug 28 '19 13:08 Gummibeer

@caneco

nunomaduro avatar Aug 28 '19 13:08 nunomaduro

I'm 100 % not in design! But this is my first/working result. I've tried to rebuild the console output - because I'm a lazy-bitch I use bootstrap. see_no_evil My idea is that anyone else can make it pretty if wanted, but for the moment it should be fine!?

screencapture-localhost-63342-phpinsights-dashboard-html-2019-08-28-14_58_11

love this one, can we have that one?

lloricode avatar Oct 22 '21 02:10 lloricode

@Gummibeer what's the present status of your html output/format? And, just as importantly, where is it? :)

emjayess avatar Oct 28 '21 18:10 emjayess

It's there https://github.com/nunomaduro/phpinsights/pull/258/files and the PR status says it all. 😉

Gummibeer avatar Oct 29 '21 02:10 Gummibeer

I am not sure if this is already present. I can't see it in the docs.

Wulfheart avatar Jan 06 '23 18:01 Wulfheart