Add description and validation for nodes input field

This commit is contained in:
Suven-p 2024-10-16 07:06:22 +05:45
parent 4c47d2f12a
commit 1c020233e4
2 changed files with 18 additions and 1 deletions

View file

@ -1052,5 +1052,8 @@
"Can be found on:": "Can be found on: {0}",
"The phone number of the recipient in E.164 format.": "The phone number of the recipient in E.164 format.",
"Either a text sender ID or a phone number in E.164 format if you want to be able to receive replies.":"Either a text sender ID or a phone number in E.164 format if you want to be able to receive replies.",
"RabbitMQ Nodes": "RabbitMQ Nodes"
"RabbitMQ Nodes": "RabbitMQ Nodes",
"rabbitmqNodesDescription": "Enter the URL for the RabbitMQ management nodes including protocol and port.",
"rabbitmqNodesRequired": "At least one RabbitMQ node is required.",
"rabbitmqNodesInvalid": "Please enter URL for RabbitMQ nodes."
}

View file

@ -257,6 +257,9 @@
:preselect-first="false"
@tag="addRabbitmqNode"
></VueMultiselect>
<div class="form-text">
{{ $t("rabbitmqNodesDescription") }}
</div>
</div>
<div class="my-3">
@ -1780,6 +1783,17 @@ message HealthCheckResponse {
return false;
}
}
if (this.monitor.type === "rabbitmq") {
if (this.monitor.rabbitmqNodes.length === 0) {
toast.error(this.$t("rabbitmqNodesRequired"));
return false;
}
if (!this.monitor.rabbitmqNodes.every(node => node.startsWith("http://" || node.startsWith("https://")))) {
toast.error(this.$t("rabbitmqNodesInvalid"));
return false;
}
}
return true;
},