Add luigi module/class awareness for overnight tasks
This commit is contained in:
parent
922b550c17
commit
194f49c561
|
@ -37,6 +37,10 @@
|
||||||
label="Description">
|
label="Description">
|
||||||
{{ props.row.description }}
|
{{ props.row.description }}
|
||||||
</b-table-column>
|
</b-table-column>
|
||||||
|
<b-table-column field="class_name"
|
||||||
|
label="Class Name">
|
||||||
|
{{ props.row.class_name }}
|
||||||
|
</b-table-column>
|
||||||
<b-table-column field="script"
|
<b-table-column field="script"
|
||||||
label="Script">
|
label="Script">
|
||||||
{{ props.row.script }}
|
{{ props.row.script }}
|
||||||
|
@ -79,8 +83,15 @@
|
||||||
ref="overnightTaskDescription">
|
ref="overnightTaskDescription">
|
||||||
</b-input>
|
</b-input>
|
||||||
</b-field>
|
</b-field>
|
||||||
<b-field label="Script"
|
<b-field label="Module">
|
||||||
:type="overnightTaskScript ? null : 'is-danger'">
|
<b-input v-model.trim="overnightTaskModule">
|
||||||
|
</b-input>
|
||||||
|
</b-field>
|
||||||
|
<b-field label="Class Name">
|
||||||
|
<b-input v-model.trim="overnightTaskClass">
|
||||||
|
</b-input>
|
||||||
|
</b-field>
|
||||||
|
<b-field label="Script">
|
||||||
<b-input v-model.trim="overnightTaskScript">
|
<b-input v-model.trim="overnightTaskScript">
|
||||||
</b-input>
|
</b-input>
|
||||||
</b-field>
|
</b-field>
|
||||||
|
@ -96,7 +107,7 @@
|
||||||
icon-pack="fas"
|
icon-pack="fas"
|
||||||
icon-left="save"
|
icon-left="save"
|
||||||
@click="overnightTaskSave()"
|
@click="overnightTaskSave()"
|
||||||
:disabled="!overnightTaskKey || !overnightTaskDescription || !overnightTaskScript">
|
:disabled="!overnightTaskKey || !overnightTaskDescription">
|
||||||
Save
|
Save
|
||||||
</b-button>
|
</b-button>
|
||||||
<b-button @click="overnightTaskShowDialog = false">
|
<b-button @click="overnightTaskShowDialog = false">
|
||||||
|
@ -270,6 +281,8 @@
|
||||||
ThisPageData.overnightTaskCounter = 0
|
ThisPageData.overnightTaskCounter = 0
|
||||||
ThisPageData.overnightTaskKey = null
|
ThisPageData.overnightTaskKey = null
|
||||||
ThisPageData.overnightTaskDescription = null
|
ThisPageData.overnightTaskDescription = null
|
||||||
|
ThisPageData.overnightTaskModule = null
|
||||||
|
ThisPageData.overnightTaskClass = null
|
||||||
ThisPageData.overnightTaskScript = null
|
ThisPageData.overnightTaskScript = null
|
||||||
ThisPageData.overnightTaskNotes = null
|
ThisPageData.overnightTaskNotes = null
|
||||||
|
|
||||||
|
@ -277,6 +290,8 @@
|
||||||
this.overnightTask = {key: null, isNew: true}
|
this.overnightTask = {key: null, isNew: true}
|
||||||
this.overnightTaskKey = null
|
this.overnightTaskKey = null
|
||||||
this.overnightTaskDescription = null
|
this.overnightTaskDescription = null
|
||||||
|
this.overnightTaskModule = null
|
||||||
|
this.overnightTaskClass = null
|
||||||
this.overnightTaskScript = null
|
this.overnightTaskScript = null
|
||||||
this.overnightTaskNotes = null
|
this.overnightTaskNotes = null
|
||||||
this.overnightTaskShowDialog = true
|
this.overnightTaskShowDialog = true
|
||||||
|
@ -289,6 +304,8 @@
|
||||||
this.overnightTask = task
|
this.overnightTask = task
|
||||||
this.overnightTaskKey = task.key
|
this.overnightTaskKey = task.key
|
||||||
this.overnightTaskDescription = task.description
|
this.overnightTaskDescription = task.description
|
||||||
|
this.overnightTaskModule = task.module
|
||||||
|
this.overnightTaskClass = task.class_name
|
||||||
this.overnightTaskScript = task.script
|
this.overnightTaskScript = task.script
|
||||||
this.overnightTaskNotes = task.notes
|
this.overnightTaskNotes = task.notes
|
||||||
this.overnightTaskShowDialog = true
|
this.overnightTaskShowDialog = true
|
||||||
|
@ -297,6 +314,8 @@
|
||||||
ThisPage.methods.overnightTaskSave = function() {
|
ThisPage.methods.overnightTaskSave = function() {
|
||||||
this.overnightTask.key = this.overnightTaskKey
|
this.overnightTask.key = this.overnightTaskKey
|
||||||
this.overnightTask.description = this.overnightTaskDescription
|
this.overnightTask.description = this.overnightTaskDescription
|
||||||
|
this.overnightTask.module = this.overnightTaskModule
|
||||||
|
this.overnightTask.class_name = this.overnightTaskClass
|
||||||
this.overnightTask.script = this.overnightTaskScript
|
this.overnightTask.script = this.overnightTaskScript
|
||||||
this.overnightTask.notes = this.overnightTaskNotes
|
this.overnightTask.notes = this.overnightTaskNotes
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,9 @@ class LuigiTaskView(MasterView):
|
||||||
return self.json_response({'error': "Task not found"})
|
return self.json_response({'error': "Task not found"})
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.luigi_handler.launch_overnight_task(task, app.yesterday())
|
self.luigi_handler.launch_overnight_task(task, app.yesterday(),
|
||||||
|
email_if_empty=True,
|
||||||
|
wait=False)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
log.warning("failed to launch overnight task: %s", task,
|
log.warning("failed to launch overnight task: %s", task,
|
||||||
exc_info=True)
|
exc_info=True)
|
||||||
|
@ -171,6 +173,10 @@ class LuigiTaskView(MasterView):
|
||||||
settings.extend([
|
settings.extend([
|
||||||
{'name': 'rattail.luigi.overnight.task.{}.description'.format(key),
|
{'name': 'rattail.luigi.overnight.task.{}.description'.format(key),
|
||||||
'value': task['description']},
|
'value': task['description']},
|
||||||
|
{'name': 'rattail.luigi.overnight.task.{}.module'.format(key),
|
||||||
|
'value': task['module']},
|
||||||
|
{'name': 'rattail.luigi.overnight.task.{}.class_name'.format(key),
|
||||||
|
'value': task['class_name']},
|
||||||
{'name': 'rattail.luigi.overnight.task.{}.script'.format(key),
|
{'name': 'rattail.luigi.overnight.task.{}.script'.format(key),
|
||||||
'value': task['script']},
|
'value': task['script']},
|
||||||
{'name': 'rattail.luigi.overnight.task.{}.notes'.format(key),
|
{'name': 'rattail.luigi.overnight.task.{}.notes'.format(key),
|
||||||
|
@ -229,6 +235,8 @@ class LuigiTaskView(MasterView):
|
||||||
model.Setting.name.like('rattail.luigi.overnight.%.description'),
|
model.Setting.name.like('rattail.luigi.overnight.%.description'),
|
||||||
model.Setting.name.like('rattail.luigi.overnight.task.%.notes'),
|
model.Setting.name.like('rattail.luigi.overnight.task.%.notes'),
|
||||||
model.Setting.name.like('rattail.luigi.overnight.%.notes'),
|
model.Setting.name.like('rattail.luigi.overnight.%.notes'),
|
||||||
|
model.Setting.name.like('rattail.luigi.overnight.task.%.module'),
|
||||||
|
model.Setting.name.like('rattail.luigi.overnight.task.%.class_name'),
|
||||||
model.Setting.name.like('rattail.luigi.overnight.task.%.script'),
|
model.Setting.name.like('rattail.luigi.overnight.task.%.script'),
|
||||||
model.Setting.name.like('rattail.luigi.overnight.%.script')))\
|
model.Setting.name.like('rattail.luigi.overnight.%.script')))\
|
||||||
.all()
|
.all()
|
||||||
|
|
Loading…
Reference in a new issue