adding endpoint option for syslog
This commit is contained in:
@@ -1517,6 +1517,20 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTenzirConfigModalOpen(false);
|
setTenzirConfigModalOpen(false);
|
||||||
|
} else if (selectedOption === "Syslog listener") {
|
||||||
|
trigger.parameters = []
|
||||||
|
|
||||||
|
const endpoint = document.getElementById('endpoint')?.value
|
||||||
|
|
||||||
|
if(endpoint) {
|
||||||
|
trigger.parameters.push({
|
||||||
|
name: "endpoint",
|
||||||
|
value: endpoint
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
toast("Please enter your endpoint");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -15587,7 +15601,28 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
start_node: "",
|
start_node: "",
|
||||||
};
|
};
|
||||||
submitPipeline(selectedTrigger, selectedTriggerIndex, pipelineConfig);
|
submitPipeline(selectedTrigger, selectedTriggerIndex, pipelineConfig);
|
||||||
}}}
|
} else if (selectedOption === "Syslog listener"){
|
||||||
|
let command = ""
|
||||||
|
const endpoint = (selectedTrigger?.parameters?.find(param => param.name === "endpoint")?.value) || ''
|
||||||
|
if(endpoint) {
|
||||||
|
command = `from tcp://${endpoint} | read syslog | import`
|
||||||
|
} else {
|
||||||
|
toast("please enter the topic name")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const pipelineConfig = {
|
||||||
|
command: command,
|
||||||
|
name: selectedTrigger.label,
|
||||||
|
type: "create",
|
||||||
|
environment: selectedTrigger.environment,
|
||||||
|
workflow_id: workflow.id,
|
||||||
|
trigger_id: selectedTrigger.id,
|
||||||
|
start_node: "",
|
||||||
|
};
|
||||||
|
submitPipeline(selectedTrigger, selectedTriggerIndex, pipelineConfig);
|
||||||
|
}
|
||||||
|
}}
|
||||||
color="primary"
|
color="primary"
|
||||||
>
|
>
|
||||||
Start
|
Start
|
||||||
@@ -21394,6 +21429,30 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : null}{" "}
|
) : null}{" "}
|
||||||
|
|
||||||
|
{selectedOption === "Syslog listener" ? (
|
||||||
|
<div>
|
||||||
|
<b>End Point</b>
|
||||||
|
<TextField
|
||||||
|
id="endpoint"
|
||||||
|
style={{
|
||||||
|
backgroundColor: theme.palette.inputColor,
|
||||||
|
borderRadius: theme.palette.borderRadius,
|
||||||
|
}}
|
||||||
|
InputProps={{
|
||||||
|
style: {},
|
||||||
|
}}
|
||||||
|
fullWidth
|
||||||
|
color="primary"
|
||||||
|
placeholder={"0.0.0.0:5162"}
|
||||||
|
defaultValue={
|
||||||
|
selectedTrigger?.parameters?.find(
|
||||||
|
(param) => param.name === "endpoint",
|
||||||
|
)?.value || ""
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : null}{" "}
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
|
|||||||
Reference in New Issue
Block a user