Merge pull request 'Add remoteStorage settings' (#117) from feature/rs-settings into master
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #117 Reviewed-by: raucao <raucao@noreply.kosmos.org>
This commit was merged in pull request #117.
This commit is contained in:
@@ -104,4 +104,14 @@ class Setting < RailsSettings::Base
|
||||
#
|
||||
|
||||
field :nostr_enabled, type: :boolean, default: true
|
||||
|
||||
#
|
||||
# RemoteStorage
|
||||
#
|
||||
|
||||
field :remotestorage_enabled, type: :boolean,
|
||||
default: (ENV["RS_STORAGE_URL"].present?.to_s || false)
|
||||
|
||||
field :rs_storage_url, type: :string,
|
||||
default: ENV["RS_STORAGE_URL"].presence
|
||||
end
|
||||
|
||||
17
app/views/admin/settings/services/_remotestorage.html.erb
Normal file
17
app/views/admin/settings/services/_remotestorage.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<h3>RemoteStorage</h3>
|
||||
<ul role="list">
|
||||
<%= render FormElements::FieldsetToggleComponent.new(
|
||||
form: f,
|
||||
attribute: :remotestorage_enabled,
|
||||
enabled: Setting.remotestorage_enabled?,
|
||||
title: "Enable RemoteStorage integration",
|
||||
description: "RemoteStorage configuration present and features enabled"
|
||||
) %>
|
||||
<% if Setting.remotestorage_enabled? %>
|
||||
<%= render FormElements::FieldsetComponent.new(title: "Storage URL") do %>
|
||||
<%= f.text_field :rs_storage_url,
|
||||
value: Setting.rs_storage_url,
|
||||
class: "w-full", disabled: true %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -47,3 +47,10 @@
|
||||
icon: Setting.nostr_enabled? ? "check" : "x",
|
||||
active: current_page?(admin_settings_services_path(params: { s: "nostr" })),
|
||||
) %>
|
||||
<%= render SidenavLinkComponent.new(
|
||||
level: 2,
|
||||
name: "RemoteStorage",
|
||||
path: admin_settings_services_path(params: { s: "remotestorage" }),
|
||||
icon: Setting.remotestorage_enabled? ? "check" : "x",
|
||||
active: current_page?(admin_settings_services_path(params: { s: "remotestorage" })),
|
||||
) %>
|
||||
|
||||
Reference in New Issue
Block a user