dotnetic Posted January 15, 2019 Share Posted January 15, 2019 Right now I am working on filtering, but customers are nagging me about getting their sites done, so this module needs a little bit more time. Hope to find some time in the next days. 1 Link to comment Share on other sites More sharing options...
adrian Posted January 15, 2019 Author Share Posted January 15, 2019 BTW - Pete mentioned to me elsewhere that perhaps the modules directory should take care of caching a json file with the data for all modules - that was this module won't have to take care of it and the load on the PW server will be minimal because it will only be serving a fairly small json file with no database calls accept for when a module is updated/added. Of course we need to get Ryan on board with this approach. Link to comment Share on other sites More sharing options...
dotnetic Posted January 16, 2019 Share Posted January 16, 2019 Hey @adrian I have read that comment, and think this should be done. Waiting for feedback from @Pete and or @ryan if they can implement it soon. Link to comment Share on other sites More sharing options...
Pete Posted January 16, 2019 Share Posted January 16, 2019 I can take a look at it - what data does it need to pull? Just the same as is in the current feed? I think the only issue is that depending on the version of PW you run it dynamically filters the modules somehow on the PW server - I'll ask Ryan if it's okay to share the code so you can see what's going on and I'll get back to you. Link to comment Share on other sites More sharing options...
dotnetic Posted January 16, 2019 Share Posted January 16, 2019 Yeah, same data that it is now. Link to comment Share on other sites More sharing options...
bernhard Posted January 16, 2019 Share Posted January 16, 2019 If possible it would be nice if the feed had a structure like shown here: https://processwire.com/talk/topic/20649-revamped-modules-install-interface/?do=findComment&comment=178910 Then I could use it directly as datasource for my RockGrids without further manipulation of the data. Link to comment Share on other sites More sharing options...
dotnetic Posted January 16, 2019 Share Posted January 16, 2019 Hey Bernhard, that is how the data is output, however a little modification is needed, as there is some metadata. But if you use the items array, you have exactly what you want. Take a look at the data on http://modules.processwire.com/export-json/?apikey=pw223&limit=500 and throw the result into a json formatter like https://jsonformatter.curiousconcept.com/ 1 Link to comment Share on other sites More sharing options...
adrian Posted January 16, 2019 Author Share Posted January 16, 2019 1 Link to comment Share on other sites More sharing options...
adrian Posted January 16, 2019 Author Share Posted January 16, 2019 9 hours ago, jmartsch said: Hey Bernhard, that is how the data is output, however a little modification is needed, as there is some metadata. But if you use the items array, you have exactly what you want. Take a look at the data on http://modules.processwire.com/export-json/?apikey=pw223&limit=500 and throw the result into a json formatter like https://jsonformatter.curiousconcept.com/ BTW, if you try 500, then you'll only get 10 returned. 400 is the highest valid limit. See my revised screenshot in the last post where you can see the 400 items. Link to comment Share on other sites More sharing options...
adrian Posted January 16, 2019 Author Share Posted January 16, 2019 PS - you can also do this to get the second page of results. So 400 + 161 shows the total 561 modules currently in the directory. I still think we should be able to get all in one call, but this is still useful to know. 1 Link to comment Share on other sites More sharing options...
dotnetic Posted January 17, 2019 Share Posted January 17, 2019 @Pete It would also be nice to have a URL that just returns a timestamp/date when the static/cached module JSON file was last updated. If we have that, we could check if we have to download the module JSON again, or can use the locally cached version. And it should be separate from the module JSON, because the download would be much smaller. Link to comment Share on other sites More sharing options...
kongondo Posted January 17, 2019 Share Posted January 17, 2019 36 minutes ago, jmartsch said: If we have that, we could check if we have to download the module JSON again, or can use the locally cached version. I understand the need to conserve resources, smaller file sizes, etc. What I'm not getting is whether this is for the benefit of the ProcessWire server or this module. If the latter, then the question is how many times does the average site need to install modules? Usually, is it not a one-off thing? You set up a site, install needed modules and that's it? Or, is it the case that we want to be regularly browsing for new modules from within our sites? Sorry, I'm having a very slow week and I am perhaps missing the plot ?. Link to comment Share on other sites More sharing options...
dotnetic Posted January 18, 2019 Share Posted January 18, 2019 @kongondo Performance is important, even if you visit the modules section not very often. In my case I often need to install or uninstall modules during development of my sites. This might not apply to all sites or the average site, but hey, if we can be fast, why shouldn't we? Link to comment Share on other sites More sharing options...
dotnetic Posted January 18, 2019 Share Posted January 18, 2019 I am slowly progressing, because I struggled with loading the JSON via AJAX in conjunction with vue.js (which I sadly did not managed yet). And had to get used to vue.js a little bit more. There is a lot of old markup that needs to be refactored, but the module is already working. I optimized and prioritized which information should be shown, and what is additional information, which will be shown with a specific action like clicking a link or hovering over the card. Don't know it excactly yet. Here you can see which module is installed or not installed and have options to install it. Support for quick uninstalling/deactivating modules is coming soon. And in this screenshot you see how it looks if a module can be updated. The layout is still work in progress and not finished yet. Still deciding on icons, colors, etc. 4 Link to comment Share on other sites More sharing options...
adrian Posted January 18, 2019 Author Share Posted January 18, 2019 3 hours ago, jmartsch said: I struggled with loading the JSON via AJAX in conjunction with vue.js (which I sadly did not managed yet) Is it a Vue issue or CORS with AJAX in general? https://codepen.io/adrianbj/pen/QzXwGz?editors=0010 If it's just Vue related, I use AXIOS for this stuff: https://vuejs.org/v2/cookbook/using-axios-to-consume-apis.html PS, it's looking great! PPS - why AJAX - given how small the JSON for all the modules is, why not just load everything at once via PW's $http->getJSON() 3 Link to comment Share on other sites More sharing options...
dotnetic Posted January 18, 2019 Share Posted January 18, 2019 Hey @adrian. The first problem was with CORS as I tried to query the modules-export directly, as you did in your example. I am using something similar to $http->getJSON(). The disadvantage is that it is inserted into the HTML and not loaded dynamically which is harder to debug. AJAX requests can be shown in the console. As with everything each method has it advantages and disadvantages and is a matter of choice. Now I dropped the AJAX approach and list the modules JSON right in the HTML/JavaScript. Link to comment Share on other sites More sharing options...
kongondo Posted January 18, 2019 Share Posted January 18, 2019 9 hours ago, jmartsch said: Here you can see which module is installed or not installed and have options to install it. Looking good! Is it possible to also filter by installed/not installed? Would you consider a separate tab for core modules? Most of core modules will be already installed and probably most are required by ProcessWire so should not be uninstalled, hence, we don't really need to see them on the main screen. This would help focus on third-party modules, our primary concern. Link to comment Share on other sites More sharing options...
dotnetic Posted January 18, 2019 Share Posted January 18, 2019 @kongondo Yes, I am thinking about adding such a filter and maybe even a filter to show only updatable modules. The core modules can be filtered via the select, but are included if no filter is selected. Think of this module as a complete replacement of the actual ProcessModule so they need to be there, and some core modules are not even installed by default, like Forgot Password, so there needs to be a possibility to install or unistall them. Link to comment Share on other sites More sharing options...
dotnetic Posted January 18, 2019 Share Posted January 18, 2019 One thing I struggle with, is the wording. What does installed mean? Because there are some modules that are physically there on disk, but not "installed". I think "activate" and "deactivate" are better words for enabling or disabling a module. Installing and uninstalling for me means the action to download the file or delete it completely. What do you guys think of that? Link to comment Share on other sites More sharing options...
kongondo Posted January 18, 2019 Share Posted January 18, 2019 2 minutes ago, jmartsch said: What do you guys think of that? I think let's stick to convention. ProcessWire has always used installed ?. For me, it means the module is installed in the ProcessWire system. A module that is present on the disk but not yet installed just means it is not yet part of the ProcessWire system. 7 minutes ago, jmartsch said: Think of this module as a complete replacement of the actual ProcessModule so they need to be there, and some core modules are not even installed by default, like Forgot Password, so there needs to be a possibility to install or unistall them. Of course. My point was not that they should not be there, but they should probably be in their own tab, just to make things obvious ?. 9 minutes ago, jmartsch said: Yes, I am thinking about adding such a filter and maybe even a filter to show only updatable modules. ?? 1 Link to comment Share on other sites More sharing options...
Pete Posted January 18, 2019 Share Posted January 18, 2019 I'm sure we can get an "updated" JSON response set up no problem once we get the feed code altered on the modules directory as well. Not heard back from Ryan about that yet so will give him a gentle nudge ? Link to comment Share on other sites More sharing options...
dotnetic Posted January 31, 2019 Share Posted January 31, 2019 @Pete Nudge ? Any updates on this topic? 1 1 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