mirror of
https://github.com/we-promise/sure.git
synced 2026-04-20 12:34:12 +00:00
30 lines
1.2 KiB
Plaintext
30 lines
1.2 KiB
Plaintext
<div class="space-y-4">
|
|
<div>
|
|
<h2 class="font-medium mb-1"><%= t(".title") %></h2>
|
|
<% if ENV["OPENAI_ACCESS_TOKEN"].present? %>
|
|
<p class="text-sm text-secondary"><%= t(".env_configured_message") %></p>
|
|
<% else %>
|
|
<p class="text-secondary text-sm mb-4"><%= t(".description") %></p>
|
|
<% end %>
|
|
</div>
|
|
|
|
<%= styled_form_with model: Setting.new,
|
|
url: settings_hosting_path,
|
|
method: :patch,
|
|
data: {
|
|
controller: "auto-submit-form",
|
|
"auto-submit-form-trigger-event-value": "blur"
|
|
} do |form| %>
|
|
<%= form.password_field :openai_access_token,
|
|
label: t(".label"),
|
|
placeholder: t(".placeholder"),
|
|
value: (Setting.openai_access_token.present? ? "********" : nil),
|
|
autocomplete: "off",
|
|
autocapitalize: "none",
|
|
spellcheck: "false",
|
|
inputmode: "text",
|
|
disabled: ENV["OPENAI_ACCESS_TOKEN"].present?,
|
|
data: { "auto-submit-form-target": "auto" } %>
|
|
<% end %>
|
|
</div>
|