Jump to content

adrian

PW-Moderators
  • Content Count

    9,489
  • Joined

  • Last visited

  • Days Won

    314

Everything posted by adrian

  1. For those not following the Rockfinder3 thread, the latest version of Tracy includes a new barEcho() / be() method that allows you to echo directly to the bar dumps panel without Tracy trying to dump it as variables / objects. You've always been able to do this directly in the Console panel with a normal echo, but now you can do the same to the bar dumps panel.
  2. @bernhard - the new barEcho() version of Tracy has been committed.
  3. @bernhard - I've added a new "Title Prefix" option for accomplishing that. I took a quick look but don't have an easy solution at the moment without hacking the Tracy core. The core actually already has a shift+click shortcut but it's for a weird popup browser window mode which I don't support - it became too painful with some of the more complex panels I've added and I didn't see the advantage. Maybe I'll take a look again later at trying to override this, but given that we have a "maximize" panel button already, I'm not too motivated on this one.
  4. One thing you should probably change is the calls to db(), bdb(), etc so \TD::dumpBig, \TD::barDumpBig, etc. Those shortcut functions are optional in Tracy and some users may have disabled them. Otherwise, looks great! I'll commit those required changes to Tracy shortly. BTW, I am making a proper barEcho() and be() shortcut method because I actually think it's quite useful in general to be able to echo / render HTML into the bar Dumps panel.
  5. Hey @bernhard - attached is a new version that loads Tabulator if someone wants to make a dump() call directly to the page within their template file. Basically it just duplicates the JSloader functionality within this module. I was also thinking about maybe making a barDump() version that would emulate bd() but with Tabulator output, but didn't get there yet. I decided to take a look at adding a barDump() option. To test you'll need the new Rockfinder and TD.php files attached. Now you can call the new barDump() method from anywhere (including template files, and the Console panel) and Tracy Dumps panel will receive the tabulated output, or the dumped object if you pass "true" for the title. Please test thoroughly and feel free to tweak behavior as needed. I should note that I changed the return for the dump method from $this to $out. I guess this will break chaining if someone wants to add another method after this. Maybe there is a better way to do this but was in a hurry. RockFinder3.module.php TD.php
  6. Yeah, I just saw your post - that's too bad - hopefully there is a solution!
  7. Yeah, please do - I think it's going to prove quite painful if we can't generate queries that work independently. I make use of the "Selector Queries" feature on the RequestInfo panel in Tracy a LOT and it's no longer as useful. Sounds like Ryan is keen to come up with a fix, but an extra voice might help motivate him ๐Ÿ™‚
  8. Remember you have some wording in the docs that needs changing, eg "The ProcessModule of RockFinder3 does use Tracy for dumping the results, so TracyDebugger is required for the ProcessModule to run."
  9. Assume you have read these: https://github.com/ryancramerdesign/ProcessWire/issues/710 https://github.com/ryancramerdesign/ProcessWire/issues/1757 He says that "whitespace is preferred in many cases", but I just don't get it - not sure how trailing whitespace has any advantage, but maybe I am missing something ๐Ÿ™‚
  10. Sorry you find it ugly - I know it doesn't look nice, but it's one of my favorite things in Tracy - so nice to know which browser tab has the dev version vs live version of a site.
  11. Just have VSCode set up to automatically remove trailing spaces at the end of lines. It's a pet peeve of mine and something I wish Ryan would do with the PW core. Nothing new - it's just a shame that we can no longer see the values in query - makes it impossible to easily copy / paste a query into Adminer etc to test directly. Are you going to completely remove the Process module now? Does it serve some other purpose?
  12. @bernhard - test out the attached version which avoids the need for the Process module by loading the tabulator files on demand. RockFinder3.module.php
  13. @bernhard - you might be interested in this: https://github.com/processwire/processwire-issues/issues/1173#issuecomment-632868896 and Ryan's reply. Once you upgrade to the latest PW dev and use your dumpSQL() method you'll see what I mean ๐Ÿ™‚
  14. I might give the FA icons a go. The reason I didn't initially is because they aren't loaded on the frontend of a site, but these days I do load them with Tracy for the custom links in the PW Info panel anyway, so it wouldn't be any extra load now, although I think someone mentioned they were having issues because they were using FA 5 on the frontend and there was some conflict. I'll think about it later.
  15. Hey - teamwork makes the dream work ๐Ÿ™‚ Totally OT, but damn I hate the look of that plus (New Snippet) icon in the console on Windows - sorry it's so ugly - I need to swap those all out for SVGs at some point.
  16. Well, it's not just the "created" field - the same error shows with the "name" field as well. Loving some of the options this has BTW - having those docs has really shown me what this can do! Just a thought about the Process module and the Tracy Console - I am not sure it's clear that the Process module is only needed to load Tabulator - otherwise loading the Console panel from any other page works for dumping the objects in the normal Tracy way. I do think it would be great to figure out a way to load the Tablulator script on demand in Tracy if a RF dump() is called.
  17. Hey @bernhard - looking awesome - I think it's time I took this for a proper test spin ๐Ÿ™‚ Just tested my first query and got this error:
  18. Keep in mind though - this may annoy some users because it will overwrite what they already have in the Console. Another thing I am wondering - why have a separate Process module for this - couldn't the required code be loaded by the main RF module so that users could do a $f->dump() on any page?
  19. The localStorage key for this is "tracyConsole"
  20. Look at the LocalStorage section in your browser dev console:
  21. Also, you might want to prepopulate the console panel by adding another localStorage entry for "tracyConsole" - take a look at an existing entry to see the required format.
  22. Great @bernhard - can you please try without the \TD::echo() method like in my second example above - just echo directly in your new dump() method. I made the change to the Tracy branch of your module and it worked fine - no need for that method as I noted in my second post above. The easiest way to open the Console panel automatically is to add this to the "return" of your executeConsole() method. <script> localStorage.setItem("tracy-debug-panel-ConsolePanel", "{}"); </script> Typically there would be width, height etc elements in there, but you are overriding these with CSS anywhere, so the empty {} is all that's needed. As for including tabulator in Tracy - I really like the idea but I am not yet sure how best to make it so it's easy to have data in the correct format for tabulator to work with - mostly issues with the column headings vs the data rows. Any thoughts?
  23. Actually, you don't even need the new TD::echo method. All your tabulator() method needs to do, is echo that HTML directly: function tabulator($str) { echo '<div id="tabletest"></div> <script> var table = new Tabulator("#tabletest", { height:205, data:[ {id:1, name:"Oli Bob", age:"12", col:"red", dob:""}, {id:2, name:"Mary May", age:"1", col:"blue", dob:"14/05/1982"}, {id:3, name:"Christine Lobowski", age:"42", col:"green", dob:"22/05/1982"}, {id:4, name:"Brendon Philips", age:"125", col:"orange", dob:"01/08/1980"}, {id:5, name:"Margret Marmajuke", age:"16", col:"yellow", dob:"31/01/1999"}, ], layout:"fitColumns", //fit columns to width of table (optional) columns:[ //Define Table Columns {title:"Name", field:"name", width:150}, {title:"Age", field:"age", hozAlign:"left", formatter:"progress"}, {title:"Favourite Color", field:"col"}, {title:"Date Of Birth", field:"dob", sorter:"date", hozAlign:"center"}, ], rowClick:function(e, row){ //trigger an alert message when the row is clicked alert("Row " + row.getData().id + " Clicked!!!!"); }, }); </script>'; } The only thing it misses this way is the helper for displaying the title bar at the top of each output, but all that really is, is <h2>title</h2> anyway, so easy to implement directly if you want. What do you think? Any need for the TD::echo() method at all?
  24. @bernhard Just a little rough experimentation - I've added a new echo() method to the TD class which outputs exactly what is sent to it. With this addition, I managed to do this: Obviously in this case I am not passing any data to the tabulator() method, but you can make this happen easily by modifying your new tabulator() function. In a process module I have a couple of things to make this all work: 1) Load the tabulator js and css files in the init() method: $this->wire('config')->scripts->add("https://unpkg.com/tabulator-tables@4.6.3/dist/js/tabulator.min.js"); $this->wire('config')->styles->add("https://unpkg.com/tabulator-tables@4.6.3/dist/css/tabulator.min.css"); 2) Define a new tabulator function - note that in this case this is a global function outside the process module class, but you could also make it a class function and call $rf->tabulator() function tabulator($str, $title = NULL) { \TD::echo('<div id="tabletest"></div> <script> var table = new Tabulator("#tabletest", { height:205, data:[ {id:1, name:"Oli Bob", age:"12", col:"red", dob:""}, {id:2, name:"Mary May", age:"1", col:"blue", dob:"14/05/1982"}, {id:3, name:"Christine Lobowski", age:"42", col:"green", dob:"22/05/1982"}, {id:4, name:"Brendon Philips", age:"125", col:"orange", dob:"01/08/1980"}, {id:5, name:"Margret Marmajuke", age:"16", col:"yellow", dob:"31/01/1999"}, ], layout:"fitColumns", //fit columns to width of table (optional) columns:[ //Define Table Columns {title:"Name", field:"name", width:150}, {title:"Age", field:"age", hozAlign:"left", formatter:"progress"}, {title:"Favourite Color", field:"col"}, {title:"Date Of Birth", field:"dob", sorter:"date", hozAlign:"center"}, ], rowClick:function(e, row){ //trigger an alert message when the row is clicked alert("Row " + row.getData().id + " Clicked!!!!"); }, }); </script>', $title); } You can try it out by replacing the attached TD.php for your Tracy install (in the includes subfolder). Note that you can supply two arguments to the \TD::echo method: $str and $title, just like with d() and bd() Does that work for you ok? TD.php
ร—
ร—
  • Create New...