matjazp Posted February 4, 2020 Share Posted February 4, 2020 When you view log files in the admin (Setup->Logs), they are sorted by name. I would like them initially sorted by date, newest to oldest. WireLog::getLogs() method support that with $sortNewest parameter set to true but there is no option to pass that parameter to ProcessLogger::___execute() method. I could hook before and replace the whole ProcessLogger::___execute() but don't like that. Any other option? Link to comment Share on other sites More sharing options...
BitPoet Posted February 4, 2020 Share Posted February 4, 2020 2 hours ago, matjazp said: Any other option? That might actually be something @ryan could implement in the standard with a module config setting for ProcessLogger. So how about a pull request for that? ? Link to comment Share on other sites More sharing options...
matjazp Posted February 4, 2020 Author Share Posted February 4, 2020 This is certainly something Ryan would easililly implement as you suggested, but you know that he almost never accepts PRs. This is not an issue but rather feature request, but there are already so many of them ... I was playing with simulating click() on MODIFIED column but failed, my js/jquery knowledge is a bit limited :-) Link to comment Share on other sites More sharing options...
dragan Posted February 4, 2020 Share Posted February 4, 2020 Well, it's just this dinosaur JS plugin. Use a custom JS in admin or a hook: $("#AdminDataTable1").trigger( 'sorton', [ [[1,1]] ] ); // sort 2nd column in descending order 2 Link to comment Share on other sites More sharing options...
matjazp Posted February 5, 2020 Author Share Posted February 5, 2020 @dragan thank you. $wire->addHookAfter('ProcessLogger::execute', function(HookEvent $event) { $event->return .= '<script>jQuery(document).ready(function($){$("#AdminDataTable1").trigger("sorton",[[[1,1]]]);});</script>'; }); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now