jamesrwhite / minicron

🕰️ Monitor your cron jobs
GNU General Public License v3.0
2.34k stars 154 forks source link

fix(jobs): change job command input field to textarea #241

Closed dmlittle closed 7 years ago

dmlittle commented 8 years ago

What

This PR changes the edit job view to make use of a textarea tag instead of an input tag for the job command field.

Why

The command doesn't have any HTML escaping and therefore might cut short the value displayed in the input tag. For example, if the command of a job was command "some text", the displayed HTML command would be command as the value property of the input tag was closed by the double quote in the command value, causing the rest of the command to be added as attributes to the input field. I considered escaping the HTML and displaying the entire command in an input field but that meant that when saving the command all HTML entities would now be stored as escaped HTML rather than their characters. A textarea seemed better suited for the job and provided the additional benefit of the command input being re-sizeable.

Overall this change has two benefits: 1) the cron job command is now fully displayed and is able to be edited by the user without having to re-enter the entire command and 2) users can make use of the resize textbox feature built-in by browsers to increase the textarea size if the command doesn't fit in the default textarea size.

Screenshots

jamesrwhite commented 7 years ago

Looks good, thank you!