2024-06-20 17:57:00 -04:00
|
|
|
<% content_for :title, 'Settings' %>
|
|
|
|
|
|
2024-11-28 09:54:36 -05:00
|
|
|
<div class="min-h-content w-full my-5">
|
2025-05-17 15:44:22 -04:00
|
|
|
<h1 class="text-3xl font-bold mb-6">User Settings</h1>
|
2024-07-09 17:50:19 -04:00
|
|
|
<%= render 'settings/navigation' %>
|
2024-07-09 14:28:59 -04:00
|
|
|
|
2025-05-17 15:44:22 -04:00
|
|
|
<div class="card bg-base-200 shadow-xl">
|
|
|
|
|
<%= form_for :settings, url: settings_path, method: :patch, data: { turbo_method: :patch, turbo: false } do |f| %>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="space-y-8 animate-fade-in">
|
|
|
|
|
<div>
|
|
|
|
|
<h2 class="text-2xl font-bold mb-4 flex items-center">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-camera mr-2 text-primary">
|
|
|
|
|
<path d="M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"></path>
|
|
|
|
|
<circle cx="12" cy="13" r="3"></circle>
|
|
|
|
|
</svg>Immich Integration
|
|
|
|
|
</h2>
|
|
|
|
|
<div class="bg-base-100 p-5 rounded-lg shadow-sm space-y-4">
|
|
|
|
|
<div class="form-control w-full">
|
|
|
|
|
<%= f.label :immich_url, class: 'label' do %>
|
|
|
|
|
<span class="label-text font-medium">Immich URL</span>
|
|
|
|
|
<% 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' %>
|
|
|
|
|
<span class="label-text-alt mt-1">The base URL of your Immich instance</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-control w-full">
|
|
|
|
|
<%= f.label :immich_api_key, class: 'label' do %>
|
|
|
|
|
<span class="label-text font-medium">Immich API Key</span>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="relative">
|
|
|
|
|
<%= f.password_field :immich_api_key, value: current_user.safe_settings.immich_api_key, class: "input input-bordered w-full pr-10", placeholder: 'xxxxxxxxxxxxxx' %>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="label-text-alt mt-1">Found in your Immich admin panel under API settings</span>
|
|
|
|
|
</div>
|
|
|
|
|
<%# <div class="flex justify-end">
|
|
|
|
|
<button class="btn btn-sm btn-outline">Test Connection</button>
|
|
|
|
|
</div> %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<h2 class="text-2xl font-bold mb-4 flex items-center">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-camera mr-2 text-primary">
|
|
|
|
|
<path d="M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"></path>
|
|
|
|
|
<circle cx="12" cy="13" r="3"></circle>
|
|
|
|
|
</svg>Photoprism Integration
|
|
|
|
|
</h2>
|
|
|
|
|
<div class="bg-base-100 p-5 rounded-lg shadow-sm space-y-4">
|
|
|
|
|
<div class="form-control w-full">
|
|
|
|
|
<%= f.label :photoprism_url, class: 'label' do %>
|
|
|
|
|
<span class="label-text font-medium">Photoprism URL</span>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="relative">
|
|
|
|
|
<%= 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' %>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="label-text-alt mt-1">The base URL of your Photoprism instance</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-control w-full">
|
|
|
|
|
<%= f.label :photoprism_api_key, class: 'label' do %>
|
|
|
|
|
<span class="label-text font-medium">Photoprism API Key</span>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="relative">
|
|
|
|
|
<%= f.password_field :photoprism_api_key, value: current_user.safe_settings.photoprism_api_key, class: "input input-bordered w-full pr-10", placeholder: 'xxxxxxxxxxxxxx' %>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="label-text-alt mt-1">Found in your Photoprism settings under Library</span>
|
|
|
|
|
</div>
|
|
|
|
|
<%# <div class="flex justify-end">
|
|
|
|
|
<button class="btn btn-sm btn-outline">Test Connection</button>
|
|
|
|
|
</div> %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-10-29 08:27:43 -04:00
|
|
|
|
|
|
|
|
<% unless DawarichSettings.self_hosted? %>
|
|
|
|
|
<div>
|
|
|
|
|
<h2 class="text-2xl font-bold mb-4 flex items-center">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link mr-2 text-primary">
|
|
|
|
|
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
|
|
|
|
|
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
|
|
|
|
|
</svg>Connected Accounts
|
|
|
|
|
</h2>
|
|
|
|
|
<div class="bg-base-100 p-5 rounded-lg shadow-sm space-y-4">
|
|
|
|
|
<div class="flex items-center justify-between p-4 border border-base-300 rounded-lg">
|
|
|
|
|
<div class="flex items-center space-x-3">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" class="text-[#FF424D]">
|
|
|
|
|
<path d="M0 .48v23.04h24V.48zm22.89 21.93H1.11V1.61h21.78zm-3.2-6.15c-1.05 0-2.08-.28-2.99-.81.88 1.99 2.83 3.37 5.08 3.37 3.09 0 5.59-2.5 5.59-5.59 0-3.09-2.5-5.59-5.59-5.59-2.25 0-4.2 1.33-5.08 3.25.9-.48 1.93-.73 3-.73 3.56 0 6.44 2.88 6.44 6.44s-2.88 6.44-6.44 6.44z"/>
|
|
|
|
|
</svg>
|
|
|
|
|
<div>
|
|
|
|
|
<h3 class="font-semibold">Patreon</h3>
|
|
|
|
|
<p class="text-sm text-base-content/70">
|
|
|
|
|
<% if current_user.patreon_connected? %>
|
|
|
|
|
Connected
|
|
|
|
|
<% else %>
|
|
|
|
|
Not connected
|
|
|
|
|
<% end %>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% if current_user.patreon_connected? %>
|
|
|
|
|
<%= button_to "Disconnect", disconnect_patreon_settings_path,
|
|
|
|
|
method: :delete,
|
|
|
|
|
class: "btn btn-sm btn-outline btn-error",
|
|
|
|
|
form: { data: { turbo_confirm: "Are you sure you want to disconnect your Patreon account?" } } %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= link_to "Connect", user_patreon_omniauth_authorize_path,
|
|
|
|
|
class: "btn btn-sm btn-primary",
|
|
|
|
|
method: :post %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<p class="text-sm text-base-content/70 mt-2">
|
|
|
|
|
Connect your Patreon account to support the development of Dawarich and get access to exclusive features.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2024-08-21 12:40:54 -04:00
|
|
|
</div>
|
2025-05-17 15:44:22 -04:00
|
|
|
<div class="card-actions justify-end mt-6">
|
|
|
|
|
<%= f.submit "Save changes", class: "btn btn-primary" %>
|
2024-08-21 12:40:54 -04:00
|
|
|
</div>
|
2025-05-17 15:44:22 -04:00
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2024-06-20 17:57:00 -04:00
|
|
|
</div>
|
|
|
|
|
</div>
|