Fix integration API key field: read from saved credentials like NetBox
This commit is contained in:
parent
b8a625005c
commit
2709ab4674
1 changed files with 19 additions and 16 deletions
|
|
@ -1464,24 +1464,27 @@
|
|||
</h4>
|
||||
</div>
|
||||
|
||||
<.input
|
||||
field={@integration_form[:api_key]}
|
||||
type="password"
|
||||
label={
|
||||
if(provider.id == "pagerduty",
|
||||
<div>
|
||||
<label class="block text-sm font-semibold text-gray-900 dark:text-white mb-1">
|
||||
{if(provider.id == "pagerduty",
|
||||
do: "Integration Key (Routing Key)",
|
||||
else: "API Key"
|
||||
)
|
||||
}
|
||||
placeholder={
|
||||
if(provider.id == "pagerduty",
|
||||
do: "Enter your PagerDuty integration key",
|
||||
else: "Enter your #{provider.name} API key"
|
||||
)
|
||||
}
|
||||
autocomplete="off"
|
||||
value={get_credential(@integrations[provider.id], "api_key")}
|
||||
/>
|
||||
)}
|
||||
</label>
|
||||
<input
|
||||
type="password"
|
||||
name="integration[api_key]"
|
||||
value={get_credential(@integrations[provider.id], "api_key")}
|
||||
placeholder={
|
||||
if(provider.id == "pagerduty",
|
||||
do: "Enter your PagerDuty integration key",
|
||||
else: "Enter your #{provider.name} API key"
|
||||
)
|
||||
}
|
||||
autocomplete="off"
|
||||
class="block w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder-gray-400 focus:border-indigo-500 focus:ring-indigo-500 dark:border-white/10 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= if provider.id == "pagerduty" do %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue