-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamqp-output.html
69 lines (64 loc) · 2.5 KB
/
amqp-output.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<script type="text/javascript">
RED.nodes.registerType('amqp-output',{
category: 'ProcessCube (MQ)',
color: '#00aed7',
defaults: {
name: {value: "", type: "string"},
amqpServer: {value: "", type: "amqp-config"},
exchange: {value: "", type: "string", required:true},
exchangeType: { value: 'fanout'},
routingKey: { value: "" },
routingKeyFieldType: { value: "str"},
},
inputs: 1,
outputs: 0,
icon: "font-awesome/fa-envelope-open",
label: function() {
return this.name||"amqp-output";
},
oneditprepare: function () {
$('#node-input-exchangeType').change(function (e) {
const exchangeType = this.value
if (['fanout'].includes(exchangeType)) {
$('.routing-key-form-input').hide()
} else {
$('.routing-key-form-input').show()
}
});
$("#node-input-routingKey").typedInput({
typeField: "#node-input-routingKeyFieldType",
types: ["str","env"]
});
},
});
</script>
<script type="text/html" data-template-name="amqp-output">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-amqpServer"><i class="fa fa-tag"></i> AMQP Server</label>
<input type="text" id="node-input-amqpServer" placeholder="">
</div>
<div class="form-row wide-label-amqp-in">
<label for="node-input-exchangeType"><i class="fa fa-filter"></i> Type</label>
<select id="node-input-exchangeType">
<option value="topic">Topic</option>
<option value="direct">Direct</option>
<option value="fanout">Fanout</option>
</select>
</div>
<div class="form-row">
<label for="node-input-exchange"><i class="fa fa-tag"></i> Exchange</label>
<input type="text" id="node-input-exchange" placeholder="Exchange">
</div>
<div class="form-row routing-key-form-input">
<label>Routing key:</label>
<input type="text" id="node-input-routingKey">
<input type="hidden" id="node-input-routingKeyFieldType">
</div>
</script>
<script type="text/html" data-help-name="amqp-output">
<p>A node to publish AMQP Messages.</p>
</script>