UNPKG

node-red-contrib-kafka-consumer

Version:

An Apache Kafka connector for node-red

54 lines (47 loc) 2.2 kB
<!-- The main node definition that is registered with the editor. This defines things such as the palette category, the editable properties (defaults) and what icon to use. It is within a regular javascript script tag --> <script type="text/javascript"> RED.nodes.registerType('Kafka Consumer', { category:'storage', color: 'white', defaults: { name: {value:""}, zkquorum: {value:"", required: true}, topic: {value:"", required: true}, groupId: {value:"", required: true}, autoCommit: {value:true, required: true} }, inputs:0, outputs:1, icon: "kafka_logo.png", label: function() { return this.name||"Kafka Consumer" } }); </script> <!-- The edit template that defines the content of the edit dialog for the node. It is defined in a script of type 'text/x-red' with 'data-template-name' set to the type of the node. --> <script type="text/x-red" data-template-name="Kafka Consumer"> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-row"> <label for="node-input-zkquorum"><i class="icon-tag"></i> zkquorum</label> <input type="text" id="node-input-zkquorum" placeholder="localhost:2181"> </div> <div class="forum-row"> <label for="node-input-topic"><i class="icon-tag"></i> Topic(s)</label> <input type="text" id="node-input-topic" placeholder="Topic(s)"> </div> <div class="form-row"> <label for="node-input-groupId"><i class="icon-tag"></i> GroupId</label> <input type="text" id="node-input-groupId" placeholder="test-consumer-group"> </div> <div class="form-row"> <label for="node-input-autoCommit"><i class="icon-tag"></i> Auto Commit</label> <input type="checkbox" id="node-input-autoCommit" style="display: inline-block; width: auto; vertical-align: top;" placeholder="Auto Commit"> </div> </script> <!-- The help text that gets displayed in the info sidebar tab. It is defined in a script of type 'text/x-red' with data-help-name set to the type of the node. --> <script type="text/x-red" data-help-name="Kafka Consumer"> <p>A node that reads message payloads from Apache Kafka</p> </script>