Comments (6)
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.
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.
+1 The base URL not being configurable also prevents this tool from being included as part/module into existing projects.
from cronkeep.
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.
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.
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)
- it's can support php 5.2 & 5.1? HOT 2
- Clear state of toggled buttons in the Add Job dialog
- There is no parameter named $inputFilter. Did you maybe mean $pickerInputFilter?
- @return annotation for constructors not meaningful
- Make running cron jobs on demand more reliable HOT 3
- /src/jobs/* directory missing from installation HOT 5
- www-data is not allowed to use this program (crontab) HOT 4
- See crontab(1) for more information HOT 1
- sh: 1: at: not found HOT 2
- Jobs are not working HOT 6
- Error on editing and can't add new job HOT 6
- cronkeep on nginx HOT 1
- CronKeep HOT 2
- Cron does not execute HOT 4
- /provision/prevent-running-cron-jobs.patch is a difference file, is it correct
- http://cronkeep.ubuntu/: Fatal error: Class 'Slim\Slim' not found in /var/www/cronkeep/src/index.php on line 26
- Pause Job with ### instead of # tag
- Does cronkeep run with PHP 8.x ? HOT 1
- Cronjob footprint
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cronkeep.