68 lines
2.9 KiB
HTML
68 lines
2.9 KiB
HTML
<script type="text/javascript">
|
||
RED.nodes.registerType("zammad-config", {
|
||
category: "config",
|
||
defaults: {
|
||
name: { value: "" },
|
||
baseUrl: { value: "https://example.com/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://example.com/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 your Zammad instance 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> – 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>
|
||
<li><b>Basic Auth</b> – Username is typically just <code>Hannes</code> (not full email).</li>
|
||
</ul>
|
||
</script>
|