luci-mod-system: give crontab (aka scheduled tasks) some helpers
- [x] This PR is not from my main or master branch :poop:, but a separate branch :white_check_mark:
- [x] Each commit has a valid :black_nib:
Signed-off-by: <[email protected]>row (viagit commit --signoff) - [x] Each commit and PR title has a valid :memo:
<package name>: titlefirst line subject for packages - [x] Tested on: 23.05.5, Firefox :white_check_mark:
- [x] ( Preferred ) Screenshot or mp4 of changes:
- [x] Description: (describe the changes proposed in this PR)
Any input from @dannil @stokito @Ramon00 @hnyman @rdmitry0911 ?
Gave crontab a small makeover. It's raw and rudimentary but it is already an improvement over editing the raw crontab.
Good if others can take it for a spin or suggest improvements. ( inter-row and element styling )
I do not recommend putting any safeguards in for the command field, since we were already editing the crontab directly.
Interesting how many people and how use the cron. The UI improvements also increase a size but it looks like that's not a problem anymore. From the screenshot I can tell that:
- The original editor needs to be preserved so if if someone just copy-paste from instructions.
- The command field needs to be wider.
- We may use the same visual language of a table/sections
As for inspiration we may check how this implemented in other web admin panels like cPanel and Webmin https://webmin.com/docs/modules/scheduled-cron-jobs/
Interesting how many people and how use the cron. The UI improvements also increase a size but it looks like that's not a problem anymore. From the screenshot I can tell that:
Not many users? Possibly because it remains cryptic.
1. The original editor needs to be preserved so if if someone just copy-paste from instructions.
Fair point. I thought retaining both original window would be possible. Requires two save buttons and routines.
2. The command field needs to be wider.
Fixable. But it then affects whichever column it appears in.
3. We may use the same visual language of a table/sections
Also thought about this. Probably more maintainable.
Take it for a test-drive and see how it works for you.
Maybe it would be enough to add a link to a wiki https://openwrt.org/docs/guide-user/base-system/cron.
The layout needs some work, especially if the table is empty. See e.g.:
Looks like you need to fill in an hour value in the empty box instead of the command. Is it supposed to work already because if I hit save then I just get the rotating circle thing (on 23.05.5).
The layout needs some work, especially if the table is empty. See e.g.:
Looks like you need to fill in an hour value in the empty box instead of the command. Is it supposed to work already because if I hit save then I just get the rotating circle thing (on 23.05.5).
Yeah, that’s the command value. The minute column could occupy six columns to ensure the command column is placed correctly. But then which column is minute?
It should work. Check the console.
To me the proposed editor looks confusing compared to the direct crontab file editing.
It might be better to just provide more help text about the fields with the old crontab editor.
Probably. I think this can be provided side-by-side instead of replacing the existing crontab editor.
yes side-by-side would be perfect, i.e. show and allow editing of the resulting cron rules. Maybe also good to add a comment field?
yes side-by-side would be perfect, i.e. show and allow editing of the resulting cron rules. Maybe also good to add a comment field?
Side-by-side it is. A comment field only has a place if the crontab itself also permits it. Otherwise it's a code comment at the end of the command. e.g. command.sh param # comment
Fixed.
Maybe also good to add a comment field?
Added.
Maybe it would be enough to add a link to a wiki https://openwrt.org/docs/guide-user/base-system/cron.
Added.
Fixed
I just tested it and indeed now it is functional.
Cosmetic remark, maybe add some pixels space here between the two boxes?
One more remark, if I click on the pulldown select "every Xth" it then changes to:
If i then hit save, i get a
*/5 undefined undefined undefined undefined
in the file.
Good find. Fixed now. That'll get converted so that next page load it's no longer an alias but a normal task format.
Anyway, the pretty layout needs some love.
maybe @dannil or @stokito know some good CSS to center the table as a whole instead of all the rows stretching off to the right of the window?
Looks like you need to fill in an hour value in the empty box instead of the command. Is it supposed to work already because if I hit save then I just get the rotating circle thing (on 23.05.5).