Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query parameter to set a prefilled cron expression #5

Open
AliAlmutawakel opened this issue Dec 28, 2020 · 4 comments
Open

Query parameter to set a prefilled cron expression #5

AliAlmutawakel opened this issue Dec 28, 2020 · 4 comments

Comments

@AliAlmutawakel
Copy link

So maybe something like https://crontab.cronhub.io/?cronExpression=*/5 * * * * would just prefill the input otherwise if empty, leave it at default.

@vdumasacosta
Copy link

@cwilby
Copy link

cwilby commented Jul 16, 2021

Yep I'd love this, will submit a PR.

@komayama
Copy link

Hi @cwilby,

How was this feature from client requests? We need to help that.

@valerio-bozzolan
Copy link

If I understand correctly, somebody could "just" update this value at startup accordingly to the current window.location.hash:

https://github.com/cronhub/crontab/blob/master/src/ui/containers/Home.tsx#L38

So maybe the patch is just this:

diff --git a/src/ui/containers/Home.tsx b/src/ui/containers/Home.tsx
index 9b31443..23a234a 100644
--- a/src/ui/containers/Home.tsx
+++ b/src/ui/containers/Home.tsx
@@ -35,7 +35,7 @@ const DecoratedHomeForm = reduxForm({
   destroyOnUnmount: false,
   validate,
   initialValues: {
-    cronExpression: "*/5 * * * *"
+    cronExpression: window.location.hash || "*/5 * * * *"
   }
 })(Home);

What do you think about?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants