diff --git a/src/components/modals/tasks/AddAutomatedTask.vue b/src/components/modals/tasks/AddAutomatedTask.vue
index 370b279..7caed63 100644
--- a/src/components/modals/tasks/AddAutomatedTask.vue
+++ b/src/components/modals/tasks/AddAutomatedTask.vue
@@ -85,7 +85,7 @@
map-options
emit-value
options-dense
- hint="The return value of script will be saved to custom field selected"
+ hint="The last line of script output will be saved to custom field selected"
/>
diff --git a/src/components/modals/tasks/EditAutomatedTask.vue b/src/components/modals/tasks/EditAutomatedTask.vue
index 74c421e..aac4561 100644
--- a/src/components/modals/tasks/EditAutomatedTask.vue
+++ b/src/components/modals/tasks/EditAutomatedTask.vue
@@ -15,11 +15,12 @@
dense
options-dense
outlined
- v-model="localTask.script"
+ v-model="autotask.script"
:options="scriptOptions"
label="Select script"
map-options
emit-value
+ @input="setScriptDefaults"
>
@@ -38,14 +39,13 @@
dense
label="Script Arguments (press Enter after typing each argument)"
filled
- v-model="localTask.script_args"
+ v-model="autotask.script_args"
use-input
use-chips
multiple
hide-dropdown-icon
input-debounce="0"
new-value-mode="add"
- @input="setScriptDefaults"
/>
@@ -53,14 +53,14 @@
:rules="[val => !!val || '*Required']"
outlined
dense
- v-model="localTask.name"
+ v-model="autotask.name"
label="Descriptive name of task"
class="q-pb-none"
/>
+
+
+
+
{
this.$q.loading.hide();
this.onOk();
@@ -160,13 +184,20 @@ export default {
mounted() {
this.scriptOptions = this.getScriptOptions(this.showCommunityScripts);
+ this.getCustomFields("agent").then(r => {
+ this.customFieldOptions = r.data.map(field => ({ label: field.name, value: field.id }));
+ });
+
+ this.collector = !!this.task.custom_field;
+
// copy only certain task props locally
- this.localTask.id = this.task.id;
- this.localTask.name = this.task.name;
- this.localTask.script = this.task.script;
- this.localTask.script_args = this.task.script_args;
- this.localTask.alert_severity = this.task.alert_severity;
- this.localTask.timeout = this.task.timeout;
+ this.autotask.id = this.task.id;
+ this.autotask.name = this.task.name;
+ this.autotask.script = this.task.script;
+ this.autotask.script_args = this.task.script_args;
+ this.autotask.alert_severity = this.task.alert_severity;
+ this.autotask.timeout = this.task.timeout;
+ this.autotask.custom_field = this.task.custom_field;
},
};
\ No newline at end of file