2026-10-14 23:17:40 +02:00
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
RED.nodes.registerType("zammad-config", {
|
|
|
|
|
|
category: "config",
|
|
|
|
|
|
defaults: {
|
|
|
|
|
|
name: { value: "" },
|
2026-10-14 23:21:15 +02:00
|
|
|
|
baseUrl: { value: "https://example.com/api/v1", required: true },
|
2026-10-14 23:17:40 +02:00
|
|
|
|
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>
|
2026-10-14 23:21:15 +02:00
|
|
|
|
<input type="text" id="node-config-input-baseUrl" placeholder="https://example.com/api/v1">
|
2026-10-14 23:17:40 +02:00
|
|
|
|
</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;">
|
2026-10-14 23:21:15 +02:00
|
|
|
|
Create token at your Zammad instance while logged in.<br>
|
2026-10-14 23:17:40 +02:00
|
|
|
|
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>
|
2026-10-14 23:21:15 +02:00
|
|
|
|
<li><b>Base URL</b> – Your Zammad API v1 URL, e.g. <code>https://example.com/api/v1</code></li>
|
|
|
|
|
|
<li><b>Token Auth</b> – Preferred. Create token with <code>ticket.agent</code> permission.</li>
|
2026-10-14 23:17:40 +02:00
|
|
|
|
<li><b>Basic Auth</b> – Username is typically just <code>Hannes</code> (not full email).</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
</script>
|