Jump to content

adrian

PW-Moderators
  • Posts

    11,174
  • Joined

  • Last visited

  • Days Won

    371

Everything posted by adrian

  1. HI @bernhard and @teppo - The local root path was designed as a way to override the path to the remote server so that you could open the file locally even though you clicked from a remote server. I am certainly happy to add user specific paths for these if it helps. Let me know what you think the best approach would be. Can we go with: userid: path pairs on separates lines in a textarea? What about covering @teppo's point about when you're not logged in?
  2. It's not nonsense, but SVGs don't need to have width / height attributes. It's perfectly acceptable for these to be missing, but it can result in some display issues depending on how they are output. I don't think PW should automatically add these (at least without it being optional), but on some sites I do this via a hook because I do want to ensure those attributes are set. If they're not set, I get them from the viewbox and add them - similarly to the way @snck is showing above.
  3. Hi @snck - nice work. I really do think this should be incorporated into the core, although I am a bit confused by the calculation method you have for getting the width / height. I feel like the width and height should be take directly from [2] and [3]. Even if the min_x or min_y aren't set to 0, surely that doesn't change the width of the canvas area that the illustration is on which is what we want the width / height of. Do you agree, or am I missing something? We need to get Ryan's attention on this - maybe a Github issue?
  4. Interesting that it didn't work straight away. If you find similar issues again, please let me know - maybe I've overlooked something?
  5. Ok, please give the latest version a go. It should be much better in that you now get notification of new entries no matter when they happen relative to when you reload the page - they might even happen in another process. Thanks for prompting me to revisit this.
  6. It's a bit hacky - it looks for an entry within the last 5 seconds and color orange if there is one. I figured this was probably OK for manual reloads. It turns the icon red if the last entry (within those 5 seconds) is an error. I'll take a look at improving this - should be quite easy now that I am caching the results in a wirCache because I'll be able to tell if there is a new entry or not. This wasn't really possible until I introduced the caching.
  7. Thanks for taking a look @d'Hinnisdaël - I decided to go with a "template" panel type and build a custom chart, mostly because there was something amiss with using a time series with the way the module is configured and it was easier this way.
  8. I am not a regular ChartJS user so not sure of any breaking changes, although pointing the module's CDN link to the latest version does result in a JS error coming from the module's DashboardPanelChart.js file. I haven't looked into to see what fix is required though.
  9. Hi @d'Hinnisdaël - just wondering if you've had any thoughts about changing the charting library, or at least updating to v3 of ChartJS. The old 2.x branch has lots of limitations with the time axis type. Thanks!
  10. Does this relatively new feature help? https://processwire.com/blog/posts/pw-3.0.177/
  11. Hi @Mike Rockett - I know you're not around much these days, but I just had this exception: Obviously that's a weird request for mysite.com/? but it would still be nice if this was handled better. Not sure if you want to change the request_uri field to utf8mb4 so it can store these, or if you want to sanitize it somehow? Let me know if you need more details. Thanks.
  12. @gmclelland - it looks like the option to parse an array was only made available since PHP 7.2 - "This function now also accepts an array as string. Formerly, only strings have been supported." This is something I actually introduced back in December (I guess you haven't updated since then). Anyway, I've moved that call earlier onto the main string (before I break it into an array) which I think should have the same affect without breaking in older PHP versions. Can you please try the latest version and let me know?
  13. Thanks @kater - should be fixed in the latest version.
  14. @Pete - in case it helps, I had to do something with processing incoming emails recently and given the abandones status of the flourish library, I went with pure PHP. $inbox = imap_open('{imap.gmail.com:993/imap/ssl/novalidate-cert}', 'me@gmail.com', 'password'); $msgnos = imap_search($inbox, 'UNSEEN'); if($msgnos) { foreach($msgnos as $msgno) { imap_setflag_full($inbox, $msgno, "\\Seen \\Flagged", ST_UID); $header = imap_headerinfo($inbox, $msgno); $bodyText = imap_fetchbody($inbox, $msgno, 1.2); if(!strlen($bodyText) > 0) { $bodyText = imap_fetchbody($inbox, $msgno, 1); } $timestamp = strtotime($header->date); $toObj = $header->to[0]; $fromObj = $header->from[0]; $to = $toObj->mailbox.'@'.$toObj->host; $from = $fromObj->mailbox.'@'.$fromObj->host; $u = $users->get('email='.$from); if($u->id) { // process contents $bodyText here } } } I had this all ready to use and then decided to actually switch to using Mailgun's incoming callback feature - if you have access to it, I think it's much nicer because they will ping your site via a webhook callback, rather than you needing to regularly ping your email via imap.
  15. I want to love Nextcloud but I've always found it unusably slow once you have a lot of files and folders. I am running it on an system with several TB of data so maybe that's a bit high, but I still don't really understand why that's impacting its responsiveness, or even it's search for that matter. I used to use Pydio (and its previous incarnation as Ajaxplorer) and it had its problems with search but was generally but better performance. PS - I just updated to v21 and it does seem better - maybe they have improved things.
  16. I hope not - none of Tracy's panels should be loaded on the frontend of a site unless the debug bar is enabled (Tracy is in development mode) which should only happen for an authorized user (usually only superusers).
  17. Great to hear - sorry I didn't deal with this earlier.
  18. In case folks didn't see this post it is definitely worth upgrading to the latest version, especially if you have large PW or Tracy log files.
  19. Ok, new version removes the line number and I also implemented a faster way of getting the last lines from the log files. Should be a LOT faster now with large log files. @teppo - can you please confirm at your end?
  20. Yeah, good idea - leave the link, but without the line number.
  21. Another update - my new version is faster at parsing the log files and get the last number of lines required, but it turns out that the biggest slowdown in the entire process is generating the code editor link which is added to the "Text" column. The reason is that because we're only loading the last 10 lines of the file, I was having to get the total number of lines in the file to figure out what line number the entry is actually on. I think given the potential impact on performance I should remove the link. Any thoughts?
  22. I actually think I have a performant solution coming - I am testing with a 150MB log file and instead of 120ms, I am down to 2.5ms
  23. Superficially at least, it looks like PW is using something similar to the recommended method from that SO post, using fseek etc so I feel like it should be reasonably performant. Maybe I'll dig into it a bit deeper and see if there are key differences which are impacting performance.
  24. Hi @teppo - I have come across this a couple of times before so I would like to give it some attention. Tracy uses PW's $log->getEntries() method to get the last lines from each log file. I have been thinking about implementing a custom solution. There is an excellent writeup here: https://stackoverflow.com/questions/15025875/what-is-the-best-way-to-read-last-lines-i-e-tail-from-a-file-using-php I wonder if I should implement into Tracy or whether we should try to get a more performant solution in the PW core. Tracy caches log file entries, but if a file changes that benefit is lost and because the log files are loaded on every page load with Tracy, so it's obviously much more important than in the PW core. Any thoughts?
  25. I don't mind your wording in the way it suggests refreshing the session, but I am not really sure "refreshing cookies" really describes what is going on. Regarding the typo - I am a proponent of the Oxford Comma - https://www.colesandlopez.com/blog/what-is-the-oxford-comma - I wasn't taught it in school, but I do like the way it reduces ambiguity. Obviously not necessary here, but I just use it all the time these days :)
×
×
  • Create New...