Jump to content
adrian

Tracy Debugger

Recommended Posts

3 hours ago, jmartsch said:

Could you please also add it to the user switcher panel?

I expect it would work ok, but I am wondering if you actually have that many users you need to switch to. Have you considered making use of the Restricted Roles option in the User Switcher settings? If that doesn't suit your needs and filterbox really is needed, let me know and I'll take a look at implementing it.

  • Like 1

Share this post


Link to post
Share on other sites

@adrian FYI it is possible to load filterbox only if some criteria is meet, eg. the number of data to filter is greater than 20.

  • Like 1

Share this post


Link to post
Share on other sites
56 minutes ago, adrian said:

if you actually have that many users you need to switch to

Yes, I have some hundred users (800 atm) and I need to switch to all of them

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, tpr said:

@adrian FYI it is possible to load filterbox only if some criteria is meet, eg. the number of data to filter is greater than 20.

Is this a built-in FB option, or do I need to base its loading on countTotal(), or perhaps even conditionally load the filterbox files based on a PHP count of items?

Share this post


Link to post
Share on other sites

It's the onInit callback where you can return false, eg. based on the number of DOM elements.

2 hours ago, jmartsch said:

Yes, I have some hundred users (800 atm)

That's nice 🙂 

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, jmartsch said:

Yes, I have some hundred users (800 atm) and I need to switch to all of them

That's a lot of users to want to switch to. On sites that have large numbers of users I usually exclude that role, or if I need to be able to test someone with the same permissions, I create another role (with same permissions) and assign that to one test user. Sounds like that won't be useful in your case though.

I am curious - that's a lot of <option> entries for that <select> field. Is it fairly performant? I worry about when you have 10K or 100K users though.

@tpr and I have been looking into adding filterbox to this and it will probably work, but I do wonder whether some sort of autocomplete option would be better. @tpr suggested Select2 - they support ajax loading, so that might work. There is of course also selectize, but both of these require jQuery so I think I would probable just end up homebrewing something for this. I think I would automatically switch the input based on the number of available users.

Any thoughts?

Share this post


Link to post
Share on other sites
2 hours ago, adrian said:

Is it fairly performant?

Yes, there is a minimal noticable delay I think, but it loads very quickly.

image.png.9331be9d966040d8326022ae6d4e916e.png

As far as I know Select2 is good but depends on jQuery.

Some vanilla JavaScript alternatives are

 

  • Like 1

Share this post


Link to post
Share on other sites

@jmartsch - @tpr has just added support for the UserSwitcher panel to filterbox and made lots of other improvements. We all owe him a huge debt of gratitude for his work on this lately - maybe even send him a donation for his hard work on this: https://www.paypal.me/rolandtothpal/5 - it's such a huge improvement especially for the API Explorer and Captain Hook panels!

Let us know how you find it with your 800 users - hopefully this will work well and there won't be a need for an ajax approach to loading users just yet, although if I do that, I think I'll probably just code something up myself - no real need for a library for this.

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@adrian @tpr 

Just made a donation. Thanks again.

image.png.84c293ca7f2951514ef1bf8ce35e6c61.png

However, the filterbox seems to not work correctly, see my screenshot

image.png.2d2411b047c7e04985f258b9f75dad5f.png

I entered "sb-1.1" as my search value, but users starting with "sb-1.x" and others are also found.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks @jmartsch!

It seems that a regex in FilterBox allows only specific characters to use for filtering. I don't remember why I did this but I think it's too restrictive. Could you try replacing the line at 552 with this?

var i, aStr = str.match(/[^\s]+|"[^"]+"/g);

I think I'll need to revisit this sometime but in my quick tests it works better then the previous.

  • Like 2

Share this post


Link to post
Share on other sites
7 minutes ago, tpr said:

Thanks @jmartsch!

It seems that a regex in FilterBox allows only specific characters to use for filtering. I don't remember why I did this but I think it's too restrictive. Could you try replacing the line at 552 with this?


var i, aStr = str.match(/[^\s]+|"[^"]+"/g);

I think I'll need to revisit this sometime but in my quick tests it works better then the previous.

That seems to work well for me also.

Are you happy for me to commit that change to Tracy yet, or do you want to wait?

Share this post


Link to post
Share on other sites

Just do it, I don't think I can devote time for a while to check.

  • Like 3

Share this post


Link to post
Share on other sites
3 minutes ago, tpr said:

Just do it, I don't think I can devote time for a while to check.

Ok, change is committed - @jmartsch let us know how it goes for you also please.

  • Like 1

Share this post


Link to post
Share on other sites

Hey @bernhard - no rush, but @matjazp took care of some Windows / UTF8 issues which I have committed.

I still can't replicate your layout problems, but when you get a minute it would be great if you could help to narrow down what might be causing the issues at your end. Thanks!

Also, did my explanation help to alleviate your security concerns? If not, let me know what still concerns you and I'll address it.

Share this post


Link to post
Share on other sites

Hello Adrain,

Updating from 4.18.15 to 4.19.6 I've found that .tracyHidden { display: none; } is applied to <body> of the admin so yeah, when Tracy is hidden the whole admin is hidden too... Is that just me having this issue? (I did perform "Empty Cache and Hard Reload".)

Also, two permanent issues have been bugging me for a while but I did not bother to report, and I guess now is the right time to force myself to do it 🙂

1. Hide icon + browser's scrollbar issue:

As you can see, the browser's scrollbar covers the hide icon, making it impossible to click it. I have to be very fast in order to be able to click it or else Chrome kicks in, so I find myself spending a lot of time playing this reflex game. Also, I've been wondering if it is possible to have the dabugbar on the left? When a site has an off-canvas on the right, then having the debugbar also on the right is very problematic. Currently I'm working on such a site, so I keep the debugbar hidden most of the time when possible.  

debugbar-n-browser-scroll.png.e09169f0e4c2abcb2ebbfa80bc87c448.png

2. Icons without right dimensions

Since I often have to keep the debugbar hidden because of the off-canvas element on the right, I often have to reload the page one extra time because these SVG icons do not have the correct dimensions right after "unhiding" the debugbar:

debugbar-n-icons.png.66ddbe96713727fc75b32f802ca3e743.png

I hope all this explanation makes sense 🙂 

Edited by szabesz
display: none; is applied to the admin only, frontend is not affected

Share this post


Link to post
Share on other sites

I got an "Error in ProcessWireLogsPanel":

Spoiler

ProcessWire\WireException: Unable to encode array data for cache: TracyLogData.ProcessWire in D:\Projects\www\aos\wire\core\WireCache.php:443
Stack trace:
#0 D:\Projects\www\aos\site\assets\cache\FileCompiler\site\modules\TracyDebugger\panels\ProcesswireLogsPanel.php(44): ProcessWire\WireCache->save('TracyLogData.Pr...', false, '2010-04-08 03:1...')
#1 D:\Projects\www\aos\site\assets\cache\FileCompiler\site\modules\TracyDebugger\tracy-2.6.x\src\Tracy\Bar\Bar.php(147): ProcesswireLogsPanel->getTab()
#2 D:\Projects\www\aos\site\assets\cache\FileCompiler\site\modules\TracyDebugger\tracy-2.6.x\src\Tracy\Bar\Bar.php(121): Tracy\Bar->renderPanels('')
#3 D:\Projects\www\aos\site\assets\cache\FileCompiler\site\modules\TracyDebugger\tracy-2.6.x\src\Tracy\Bar\Bar.php(97): Tracy\Bar->renderHtml('main')
#4 D:\Projects\www\aos\site\assets\cache\FileCompiler\site\modules\TracyDebugger\tracy-2.6.x\src\Tracy\Debugger\Debugger.php(287): Tracy\Bar->render()
#5 [internal function]: Tracy\Debugger::shutdownHandler()
#6 {main}

Let me know how to get more info if you need.

Btw it's unbelievable that there are soo many panels in Tracy - you may need to add a filterbox just here too 🙂

image.thumb.png.a5589a0a26e705f547a11acb0372f008.png

  • Haha 3

Share this post


Link to post
Share on other sites

It looks familiar with the issue I had with the terminal panel. Would you mind var_dump($data) in WireCache.php at line 442, just before json_encode($data). Examine the $data to ensure it doesn't contain non UTF-8 characters.

  • Like 1

Share this post


Link to post
Share on other sites

You mean like this for example?

Error: \tException: SQLSTATE[HY000] [2002] Nem hozhat\xf3 l\xe9tre kapcsolat

image.png.9aed5952ce557b7d150d6342c4aacd8d.png

Share this post


Link to post
Share on other sites

Yep, that's it. That error contains non UTF-8 characters, I assume they are in Windows-1250 character set. The best option is to configure MySQL to return errors in English. Your my.ini will most likely be found in %programdata%\MySQL folder, in [mysqld] section add lc_messages=en_US. Restart mysqld service for changes to take effect. I guess this commit is the culprit for the PW error (SQL error is, of course, another thing).

  • Like 2

Share this post


Link to post
Share on other sites

@matjazp - thanks for helping to figure that out. I think this error was introduced when I added caching to the two logs panels - wireCache json encodes content for storing. Do you think the fix you provided for the Terminal panel for converting unknown characters to "?" would also work in this case? Obviously the mysql error change would also work, but I don't want everyone to have to do that.

@szabesz - I haven't seen any of these issues. Is it browser specific, or any chance the scrollbar issue could be related to this: https://processwire.com/talk/topic/13389-adminonsteroids/?do=findComment&comment=179123 or something else in AOS?

 

Share this post


Link to post
Share on other sites

The fix would work, but you would have to call it before using wireCache obviously. Don't know if this would impact performance if it would run on a large array. 

Share this post


Link to post
Share on other sites
53 minutes ago, matjazp said:

The fix would work, but you would have to call it before using wireCache obviously. Don't know if this would impact performance if it would run on a large array. 

What do you think about doing  a 

mb_convert_encoding($str, "UTF-8", "Windows-1252");

before the json_encode. I guess we can't be certain it's Windows-1252 but it seems most likely and would maybe be a cleaner solution?

Actually is it more likely 1252 or 1250 - most of my quick reading seems to refer to 1252.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Macrura
      PrevNextTabs Module
      Github: https://github.com/outflux3/PrevNextTabs
      Processwire helper modules for adding page navigation within the editor.
      Overview
      This is a very simple module that adds Previous and Next links inline with the tabs on the page editor. Hovering over the tab shows the title of the previous or next page (using the admin's built in jqueryUI tooltips.)
      Usage
      This module is typically used during development where you or your editors need to traverse through pages for the purpose of proofing, flagging and/or commenting. Rather than returning to the page tree or lister, they can navigate with these links.
      Warnings
      If you are using PW version 2.6.1 or later, the system will prevent you from leaving the page if you have unsaved edits.
      For earlier versions, to avoid accidentally losing changes made to a page that might occur if a user accidentally clicks on one of these, make sure to have the Form Save Reminder module installed.
      http://modules.processwire.com/modules/prev-next-tabs/
    • By Gadgetto
      SnipWire - Snipcart integration for ProcessWire
      Snipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
      With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.
      SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

      Status update links (inside this thread) for SnipWire development
      2020-03-21 -- SnipWire 0.8.5 (beta) released! Improves SnipWires webhooks interface and provides some other fixes and additions 2020-03-03 -- SnipWire 0.8.4 (beta) released! Improves compatibility for Windows based Systems. 2020-03-01 -- SnipWire 0.8.3 (beta) released! The installation and uninstallation process has been heavily revised. 2020-02-08 -- SnipWire 0.8.2 (beta) released! Added a feature to change the cart and catalogue currency by GET, POST or SESSION param 2020-02-03 -- SnipWire 0.8.1 (beta) released! All custom classes moved into their own namespaces. 2020-02-01 -- SnipWire is now available via ProcessWire's module directory! 2020-01-30 -- SnipWire 0.8.0 (beta) first public release! (module just submitted to the PW modules directory) 2020-01-28 -- added Custom Order Fields feature (first SnipWire release version is near!) 2020-01-21 -- Snipcart v3 - when will the new cart system be implemented? 2020-01-19 -- integrated taxes provider finished (+ very flexible shipping taxes handling) 2020-01-14 -- new date range picker, discount editor, order notifiactions, order statuses, and more ... 2019-11-15 -- orders filter, order details, download + resend invoices, refunds 2019-10-18 -- list filters, REST API improvements, new docs platform, and more ... 2019-08-08 -- dashboard interface, currency selector, managing Orders, Customers and Products, Added a WireTabs, refinded caching behavior 2019-06-15 -- taxes provider, shop templates update, multiCURL implementation, and more ... 2019-06-02 -- FieldtypeSnipWireTaxSelector 2019-05-25 -- SnipWire will be free and open source Plugin Key Features
      Fast and simple store setup Full integration of the Snipcart dashboard into the ProcessWire backend (no need to leave the ProcessWire admin area) Browse and manage orders, customers, discounts, abandoned carts, and more Multi currency support Custom order and cart fields Process refunds and send customer notifications from within the ProcessWire backend Process Abandoned Carts + sending messages to customers from within the ProcessWire backend Complete Snipcart webhooks integration (all events are hookable via ProcessWire hooks) Integrated taxes provider (which is more flexible then Snipcart own provider) Useful Links
      SnipWire in PW modules directory SnipWire Docs (please note that the documentation is a work in progress) SnipWire @GitHub (feature requests and suggestions for improvement are welcome - I also accept pull requests) Snipcart Website  
      ---- INITIAL POST FROM 2019-05-25 ----
       
    • By horst
      Croppable Image 3
      for PW 3.0.20+
      Module Version 1.2.0
      Sponsored by http://dreikon.de/, many thanks Timo & Niko!
      You can get it in the modules directory!
      Please refer to the readme on github for instructions.
       
      - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - 
      There is a new Version in the pipe, that supports WebP too: 
       
      - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - 
       
       
      -------------------------------------------------------------------------
       
      Updating from prior versions:
       
      Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step:
      In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates.
      -------------------------------------------------------------------------
       
      For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here.
       
      -------------------------------------------------------------------------
       
    • By Robin S
      Inspired by a recent question.
      Image Crop Ratios
      Allows preset aspect ratios to be defined per image field for the ProcessWire image crop tool.
      The module adds a select dropdown to the crop tool. Choose an aspect ratio and the crop area will be fixed to that ratio.
      Screencast

      Installation
      Install the Image Crop Ratios module.
      Configuration
      Default aspect ratios for all image fields can be defined in the module config. Aspect ratios for specific image fields can be defined on the Input tab of the field settings. You can override the ratio settings in template context if needed. Insert a hyphen as the first item in the ratio settings unless you want to force a ratio to be applied to the crop tool. The hyphen represents a blank option that allows a free crop area to be drawn. Usage
      Click the "Crop" link on the details view of an image thumbnail. Click the "Crop" icon at the top of the editor window. Choose an option from the "Ratio" select dropdown.  
      https://github.com/Toutouwai/ImageCropRatios
      https://modules.processwire.com/modules/image-crop-ratios/
×
×
  • Create New...