Code Monkey home page Code Monkey logo

Comments (6)

bogdanghervan avatar bogdanghervan commented on June 25, 2024

Just tried setting it up as an alias, and while I got the index page to show up, everything else is broken. I'll look into it.

Thank you for the report.

from cronkeep.

netbrothers-tr avatar netbrothers-tr commented on June 25, 2024

Hi @bogdanghervan, thank you for checking this out. For instance, take a look at https://github.com/cronkeep/cronkeep/blob/master/src/assets/js/crontab.js#L31. You can see that the URL in the AJAX call is relative ("/job/run", no domain name is there), but this only works, if your application sits right in the root path of the domain, i.e. is accessible via "/". One way to solve this issue is to generate the correct AJAX URL dynamically on the server side (maybe by using a base URL configuration option) and print it into the view (as a hidden field or an attribute of the button for example). The other way to solve this would be to have the responding script within the same path as the viewed page. But I'm not sure about which one of those two options is the easiest to implement with the Slim framework.

from cronkeep.

micschk avatar micschk commented on June 25, 2024

+1 The base URL not being configurable also prevents this tool from being included as part/module into existing projects.

from cronkeep.

micschk avatar micschk commented on June 25, 2024

It seems just changing all JS ajax URLs to be relative makes running in a subdirectory work. I'm working a SilverStripe module which includes a (modified) version of CronKeep in a subdir. If you'd like, I can PR my edits.

from cronkeep.

bogdanghervan avatar bogdanghervan commented on June 25, 2024

Fixed this issue by detecting the base URL and prepending it to all AJAX calls and static resources (tag v0.1.2).

For Apache users, RewriteBase should be updated accordingly in .htaccess. For instance, if you're running CronKeep at http://www.example.com/cronkeep, the configuration directive needs to look like this:

RewriteBase /cronkeep

I will update the docs to reflect this scenario as well, but in the meantime please let me know if this works for you.

from cronkeep.

micschk avatar micschk commented on June 25, 2024

Hi @bogdanghervan, thanks for fixing.
However, I wonder why you prefer this approach over simply making the ajax urls relative (which seems to work fine), perhaps combined with a base href tag if prefered.
The problem I see with having to edit the .htaccess, is that these changes will be overridden when you update from git/composer.

BTW; I've adapted CronKeep for inclusion in the SilverStripe framework as a dev-task: https://github.com/restruct/silverstripe-cronkeep

Thanks for this simple & great tool!

from cronkeep.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.