<% content_for :title, 'Settings' %>

User Settings

<%= render 'settings/navigation' %>
<%= form_for :settings, url: settings_path, method: :patch, data: { turbo_method: :patch, turbo: false } do |f| %>

<%= icon 'camera', class: 'mr-2 text-primary' %> Immich Integration

<%= f.label :immich_url, class: 'label' do %> Immich URL <% end %> <%= f.url_field :immich_url, value: current_user.safe_settings.immich_url, class: "input input-bordered w-full pr-10", placeholder: 'http://192.168.0.1:2283' %> The base URL of your Immich instance
<%= f.label :immich_api_key, class: 'label' do %> Immich API Key <% end %>
<%= f.password_field :immich_api_key, value: current_user.safe_settings.immich_api_key, class: "input input-bordered w-full pr-10", placeholder: 'xxxxxxxxxxxxxx' %>
Found in your Immich admin panel under API settings. Required permissions: asset.read and asset.view.
<%= icon 'triangle-alert'%> Security Warning: Disabling SSL verification makes your connection vulnerable to man-in-the-middle attacks. Only enable this for self-signed certificates you trust on your local network.
<%= button_tag 'Refresh photo cache', name: 'refresh_photos_cache', value: '1', class: 'btn btn-sm btn-outline' %> Clears cached photo metadata and thumbnails for all integrations.

<%= icon 'camera', class: 'mr-2 text-primary' %> Photoprism Integration

<%= f.label :photoprism_url, class: 'label' do %> Photoprism URL <% end %>
<%= f.url_field :photoprism_url, value: current_user.safe_settings.photoprism_url, class: "input input-bordered w-full pr-10", placeholder: 'http://192.168.0.1:2342' %>
The base URL of your Photoprism instance
<%= f.label :photoprism_api_key, class: 'label' do %> Photoprism API Key <% end %>
<%= f.password_field :photoprism_api_key, value: current_user.safe_settings.photoprism_api_key, class: "input input-bordered w-full pr-10", placeholder: 'xxxxxxxxxxxxxx' %>
Found in your Photoprism settings under Library
<%= icon 'triangle-alert'%> Security Warning: Disabling SSL verification makes your connection vulnerable to man-in-the-middle attacks. Only enable this for self-signed certificates you trust on your local network.
<%#
%>
<% unless DawarichSettings.self_hosted? || current_user.provider.blank? %>

<%= icon 'link', class: "text-primary mr-1" %> Connected Accounts

You've connected your account using the following OAuth provider: <%= current_user.provider.capitalize %>

<% end %>
<%= f.submit "Save & Test Connection", class: "btn btn-primary" %>
<% end %>