DanDiplo / Diplo.LinkChecker

Link Checker for Umbraco 7
3 stars 7 forks source link

New Feature: Status Codes Summary #4

Closed hfloyd closed 6 years ago

hfloyd commented 6 years ago

Hi @DanDiplo , I was thinking it would be cool to have a "summary" displayed of counts by Status Code - since having to click into each links list can be tedious... I was able to update the CheckedPage model with a Dictionary listing the Status codes and counts, but my Angular skills are rudimentary and I can't seem to get it to display on the checker.html page.

Ideally there would be a summary at the top across all the checked pages rather than on a per-page basis, but, once again, I wasn't sure how to accomplish that.

Anyway, this may or may not be something you think would be a good addition... take a look and let me know your thoughts.

https://github.com/hfloyd/Diplo.LinkChecker/commit/9af564446dc0c772b273b421ff74353cc875e0e6

DanDiplo commented 6 years ago

Hi @hfloyd That sounds like a good idea! Should definitely be possible. Main thing would be where to display it in the UI. Maybe it could be an accordion panel that can be opened up to display the full details?

Again, definitely something I'll look into for the next full release. Cheers for suggestion!

hfloyd commented 6 years ago

Hi @DanDiplo I think a list right at the top showing the stats for all the pages summarized together was my original vision - something pretty simple in terms of the content, just a little table like: Summary | Code | Links | | 200 | 345 | | 500 | 3 | | ERROR | 2 |

It could be inside an accordion panel or not...

The reason for this suggestion as well as the PR (https://github.com/DanDiplo/Diplo.LinkChecker/pull/3) was that I am doing some model refactoring on an existing site, and wanted a quick way to see if any of the Views were broken, so I was only looking for server (500) errors on internal pages. Since I am working on a dev copy, I didn't want to see all the 404s for missing media items, or be concerned about the errors thrown by external links, or even internal 404s since I am not responsible for the site content.

It did occur to me, however, that content editors might want a quick way to zero-in on certain types of errors that they ARE able to fix, but might not be as conversant with error codes, so allowing a full check to run, then showing what sorts of codes are being returned across the entire site would be helpful. Right now to "scan" the error codes you have to manually click on every accordion.

DanDiplo commented 6 years ago

I've made some progress on this. I can generate the table client side so don't need to modify much server-side code.

image

hfloyd commented 6 years ago

Nice! That is just what I had in mind :-)

DanDiplo commented 6 years ago

@hfloyd OK, been through all the code and generally tidied it up. I've been able to simplify the extra features you added, as I can do the grouping of status codes on the client side. I've also defaulted the config back to checking all status codes so as to keep compatible with previous versions.

To keep the checking simple I've made it so the list of error status codes uses the full code ie. if you pass in 404, 301 and 500 then it just checks those exact codes (but not 403). This makes it more flexible. In practice, there aren't many codes most people would actually see.

All the revisions are checked in - please feel free to look through and make any comments etc. If you are happy I'll look to releasing a new package soon. Cheers for your input!

jerumschlasses commented 6 years ago

Hi @DanDiplo, I'm wondering if this revision will satisfy the need some of our users have to filter out certain status codes in the checker.html results table. Namely, we have consistent 403 errors on every page due to blocked pages on our network. We sometimes just want to see the 404s.

If not, I would like to take a crack at it, using the source from your most recent revision.

Best Regards.

DanDiplo commented 6 years ago

@jerumschlasses Yes, It should. Basically you can enter (either in the JS config file or via the UI) a list of one or more status codes to limit the results to. So, for example if you entered "404,500" it would limit results to those statuses. It's a whitelist, rather than a blacklist.

You should be able to build the source and then replace the DLL and /App_Plugins/ folder with your site to test. Remember to clear cache and delete client dependency.

Let me know how you get on. Otherwise I'll realise a new package soon.

DanDiplo commented 6 years ago

I've now released this as a v1.3 as an Umbraco package - https://our.umbraco.com/projects/backoffice-extensions/diplo-link-checker/

jerumschlasses commented 6 years ago

@DanDiplo, thank you for the new version! It's working fabulously. New feature(s) are extremely helpful.