Jobs Table¶
Last Updated: August 10, 2015
- class tethys_sdk.gizmos.JobsTable(jobs, column_fields, show_status=True, show_actions=True, monitor_url='', results_url='', hover=False, striped=False, bordered=False, condensed=False, attributes=None, classes='', refresh_interval=5000, delay_loading_status=True, show_detailed_status=False, actions=None, enable_data_table=False, data_table_options=None, status_actions=None, show_resubmit_btn=None, run_btn=None, delete_btn=None, show_log_btn=None)¶
A jobs table can be used to display users' jobs. The JobsTable gizmo takes the same formatting options as the table view gizmo, but does not allow the columns to be edited. Additional attributes for the jobs table allows for a dynamically updating status field, and action buttons.
- jobs¶
A list/tuple of TethysJob objects.
- Type
tuple or list, required
- column_fields¶
A tuple or list of strings that represent TethysJob object attributes to show in the columns.
- Type
tuple or list, required
- show_status¶
Add a column to the table to show dynamically updating job status. Default is True.
- Type
bool
- show_actions¶
Add a column to the table to show a dynamically updating dropdown list of actions that can be done on the job. The available actions are determined by actions option. Actions are enabled/disabled based on the job status. If this is False then then actions option ignored.
- Type
bool
- actions¶
A list of actions that can be done on a job. Available actions are ['run', 'resubmit', 'logs', 'terminate', 'delete']. If monitor_url and results_url are supplied then 'monitor' and 'results' respectively will be added. If None then all actions will be used. Default is None.
- Type
list
- monitor_url¶
A string representing the namespaced path to a controller to that displays monitoring information about a running job (e.g. app_name:monitoring_controller)
- Type
str
- results_url¶
A string representing the namespaced path to a controller to that displays job results (e.g. app_name:results_controller)
- Type
str
- hover¶
Illuminate rows on hover (does not work on striped tables)
- Type
bool
- striped¶
Stripe rows
- Type
bool
- bordered¶
Add borders and rounded corners
- Type
bool
- condensed¶
A more tightly packed table
- Type
bool
- attributes¶
A dictionary representing additional HTML attributes to add to the primary element (e.g. {"onclick": "run_me();"}).
- Type
dict
- classes¶
Additional classes to add to the primary HTML element (e.g. "example-class another-class").
- Type
str
- refresh_interval¶
The refresh interval for the runtime and status fields in milliseconds. Default is 5000.
- Type
int
- show_detailed_status¶
Show status of each node in CondorWorkflow jobs when True. Defaults to False.
- Type
bool
- Deprecated Attributes:
status_actions(bool): Add a column to the table to show dynamically updating status, and action buttons. If this is false then the values for run_btn, delete_btn, monitor_url, and results_url will be ignored. Default is True. run_btn(bool): Add a button to run the job when job status is "Pending". Default is True. delete_btn(bool): Add a button to delete jobs. Default is True. show_resubmit_btn(bool): Add a button to resubmit jobs. Default is False. show_log_btn(bool): Add a button to see log for submitted job. Default is False.
Controller Example
from tethys_apps.sdk.gizmos import JobsTable jobs_table_options = JobsTable( jobs=jobs, column_fields=('id', 'name', 'description', 'creation_time', 'execute_time'), actions=['run', 'resubmit', 'logs', 'terminate', 'delete'], hover=True, striped=False, bordered=False, condensed=False, results_url='app_name:results_controller', ) context = { 'jobs_table_options': jobs_table_options, }
Template Example
{% load tethys_gizmos %} {% gizmo jobs_table_options %}