Zammad API nodes for Node-RED
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType("zammad-config", {
|
||||
category: "config",
|
||||
defaults: {
|
||||
name: { value: "" },
|
||||
baseUrl: { value: "https://support.hanssonit.se/api/v1", required: true },
|
||||
useToken: { value: true }
|
||||
},
|
||||
credentials: {
|
||||
token: { type: "text" },
|
||||
username: { type: "text" },
|
||||
password: { type: "password" }
|
||||
},
|
||||
label: function () {
|
||||
return this.name || this.baseUrl || "Zammad";
|
||||
},
|
||||
labelStyle: function () {
|
||||
return this.name ? "node_label_italic" : "";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-template-name="zammad-config">
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-config-input-name" placeholder="Zammad Config">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-baseUrl"><i class="fa fa-server"></i> Base URL</label>
|
||||
<input type="text" id="node-config-input-baseUrl" placeholder="https://support.hanssonit.se/api/v1">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-useToken"><i class="fa fa-lock"></i> Use Token Auth</label>
|
||||
<input type="checkbox" id="node-config-input-useToken" checked style="width:auto;">
|
||||
</div>
|
||||
<div id="zammad-token-section">
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-token"><i class="fa fa-key"></i> API Token</label>
|
||||
<input type="text" id="node-config-input-token" autocomplete="off">
|
||||
<div class="form-tips" style="color:#888; font-size:11px; margin-top:4px;">
|
||||
Create token at https://support.hanssonit.se while logged in.<br>
|
||||
Required permission: <b>ticket.agent</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="zammad-basic-section" style="display:none;">
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-username"><i class="fa fa-user"></i> Username</label>
|
||||
<input type="text" id="node-config-input-username" placeholder="Hannes">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-password"><i class="fa fa-key"></i> Password</label>
|
||||
<input type="password" id="node-config-input-password" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="zammad-config">
|
||||
<p>Zammad API configuration node.</p>
|
||||
<h3>Details</h3>
|
||||
<p>Configure your Zammad instance connection.</p>
|
||||
<ul>
|
||||
<li><b>Base URL</b> – Must be <code>https://support.hanssonit.se/api/v1</code> (do not use zammad.kafit.se).</li>
|
||||
<li><b>Token Auth</b> – Preferred. Create token on support.hanssonit.se with <code>ticket.agent</code> permission.</li>
|
||||
<li><b>Basic Auth</b> – Username is typically just <code>Hannes</code> (not full email).</li>
|
||||
</ul>
|
||||
</script>
|
||||
Reference in New Issue
Block a user