Job Submit Templates

I modified the job submit template on OpenLava Web to enable custom job submission forms, it is simple to implement, simply subclass OLWSubmit and include the fields you actually need.

Job Submission Template for Consume Resources
Job Submission Template for Consume Resources

If you want to have custom fields, then you can create them, but you must override _get_args() and return a dictionary of arguments to pass to Submit. You may want to do this generally if you need to build a complex command to pass to Submit from the various fields.

The form will automatically show up in the Submit drop down list, you can defined friendly_name as a class attribute, this will be the text displayed in the drop down. The form’s submit() method is passed any JSON data that was posted, and can be overidden if you need to manipulate it. If you don’t the default for a json request is to pass it directly to the submit function.

Leave a Reply

Your email address will not be published. Required fields are marked *