amnuts / opcache-gui

A clean, effective and responsive interface for Zend OPcache
1.21k stars 197 forks source link

Feature: Sorting scripts #60

Closed Jackysi closed 3 years ago

Jackysi commented 3 years ago

I really love the OpCache GUI since it came out. It has helped me a lot searching and cleaning out only changed files. So thank you for that!!!

I was wondering, is it possible to add sorting to the scripts? I would really like to see which scripts are largest in cache. It may help me find "infected" files and huge files that could potentially be removed from caching system.

amnuts commented 3 years ago

Thanks for the feedback @Jackysi! I can certainly have a look into doing that. 😄

Jackysi commented 3 years ago

Thank you! I did a very very quick and dirty change and it already sort of works.

$sortBy = ( !empty( $_GET[ 's' ] ) ) ? $_GET[ 's' ] : 'hits'; uasort( $status[ 'scripts' ], function( $a, $b ) use ( $sortBy ) { return $a[ $sortBy ] <=> $b[ $sortBy ]; } );

And in Axiox call i added window.location.search || '?',

But this is really really quick thing and it sorts by smallest to largest :D just for now.

amnuts commented 3 years ago

@Jackysi, I've just pushed an update to allow filtering on the cached file list. I opted to do this through the frontend rather than the backend, so a slightly different approach to what you set up. But hopefully this should suit your requirements.

Jackysi commented 3 years ago

Thank you very much for your time! =)