add webhook secret
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<%= render 'shared/turbo_modal', title: 'Webhook Secret' do %>
|
||||
<%= form_for @encrypted_config, url: webhook_secret_index_path, method: :post, html: { class: 'space-y-4' }, data: { turbo_frame: :_top } do |f| %>
|
||||
<div class="space-y-2">
|
||||
<%= f.fields_for :value, Struct.new(:key, :value).new(*@encrypted_config.value.to_a.first) do |ff| %>
|
||||
<div class="form-control">
|
||||
<%= ff.label :key, class: 'label' %>
|
||||
<%= ff.text_field :key, class: 'base-input', placeholder: 'X-Example-Header' %>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= ff.label :value, class: 'label' %>
|
||||
<%= ff.text_field :value, class: 'base-input' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-control pt-2">
|
||||
<%= f.button button_title, class: 'base-button' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -9,9 +9,12 @@
|
||||
<div class="card-body p-6">
|
||||
<%= form_for @encrypted_config, url: settings_webhooks_path, method: :post, html: { autocomplete: 'off' } do |f| %>
|
||||
<%= f.label :value, 'Webhook URL', class: 'text-sm font-semibold' %>
|
||||
<div class="flex flex-row flex-wrap space-y-2 md:space-y-0 md:flex-nowrap md:space-x-4 mt-2">
|
||||
<div class="flex flex-row flex-wrap space-y-2 md:space-y-0 md:flex-nowrap md:space-x-2 mt-2">
|
||||
<%= f.url_field :value, class: 'input font-mono input-bordered w-full', placeholder: 'https://example.com/hook' %>
|
||||
<%= f.button button_title(title: 'Save', disabled_with: 'Saving'), class: 'base-button w-full md:w-32' %>
|
||||
<a href="<%= webhook_secret_index_path %>" data-turbo-frame="modal" class="white-button w-full md:w-auto">
|
||||
Add Secret
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% preference = current_account.account_configs.find_by(key: AccountConfig::WEBHOOK_PREFERENCES_KEY)&.value || {} %>
|
||||
|
||||
Reference in New Issue
Block a user