55 lines
2.1 KiB
HTML
55 lines
2.1 KiB
HTML
<script type="text/javascript">
|
||
RED.nodes.registerType("zammad-organization", {
|
||
category: "Zammad",
|
||
color: "#3e8e41",
|
||
defaults: {
|
||
name: { value: "" },
|
||
config: { type: "zammad-config", required: true },
|
||
operation: { value: "list" }
|
||
},
|
||
inputs: 1,
|
||
outputs: 1,
|
||
icon: "font-awesome/fa-building",
|
||
label: function () {
|
||
return this.name || ("Zammad Org " + this.operation);
|
||
},
|
||
labelStyle: function () {
|
||
return this.name ? "node_label_italic" : "";
|
||
},
|
||
oneditprepare: function () {
|
||
$("#node-input-config").val(this.config ? this.config.id : "");
|
||
},
|
||
oneditsave: function () {
|
||
this.operation = $("#node-select-operation").val();
|
||
}
|
||
});
|
||
</script>
|
||
|
||
<script type="text/x-red" data-template-name="zammad-organization">
|
||
<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="Zammad Organization">
|
||
</div>
|
||
<div class="form-row">
|
||
<label for="node-input-config"><i class="fa fa-server"></i> Config</label>
|
||
<input type="text" id="node-input-config">
|
||
</div>
|
||
<div class="form-row">
|
||
<label for="node-select-operation"><i class="fa fa-wrench"></i> Operation</label>
|
||
<select id="node-select-operation">
|
||
<option value="list">List Organizations</option>
|
||
<option value="search">Search Organizations</option>
|
||
<option value="get">Get Organization by ID</option>
|
||
<option value="create">Create Organization</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-tips" style="color:#888; font-size:11px; margin-top:10px;">
|
||
<b>Search</b>: msg.query – e.g. <code>name:Acme Corp</code><br>
|
||
<b>Create</b>: msg.name, msg.note, msg.street, msg.zip, msg.city, msg.country
|
||
</div>
|
||
</script>
|
||
|
||
<script type="text/x-red" data-help-name="zammad-organization">
|
||
<p>Zammad organization operations: list, search, get, create.</p>
|
||
</script>
|