|
|
|
@ -1,24 +1,36 @@
|
|
|
|
<div class="max-w-6xl mx-auto">
|
|
|
|
<div class="max-w-6xl mx-auto">
|
|
|
|
<div class="flex space-x-8">
|
|
|
|
<div class="flex">
|
|
|
|
<%= render 'shared/settings_nav' %>
|
|
|
|
<%= render 'shared/settings_nav' %>
|
|
|
|
<div class="mt-4">
|
|
|
|
<div class="mt-4 w-full">
|
|
|
|
Storage settings
|
|
|
|
<div class="max-w-xl mx-auto">
|
|
|
|
|
|
|
|
<h1 class="text-4xl font-bold mb-4">Storage</h1>
|
|
|
|
|
|
|
|
<p class="mb-4">
|
|
|
|
|
|
|
|
Select files torage option (TODO)
|
|
|
|
|
|
|
|
</p>
|
|
|
|
<% value = @encrypted_config.value || { 'service' => 'disk' } %>
|
|
|
|
<% value = @encrypted_config.value || { 'service' => 'disk' } %>
|
|
|
|
<% configs = value['configs'] || {} %>
|
|
|
|
<% configs = value['configs'] || {} %>
|
|
|
|
<%= form_for @encrypted_config, url: settings_storage_index_path, method: :post, html: { autocomplete: 'off' } do |f| %>
|
|
|
|
<%= form_for @encrypted_config, url: settings_storage_index_path, method: :post, html: { autocomplete: 'off', class: 'w-full' } do |f| %>
|
|
|
|
<% options = [['Disk', 'disk'], ['AWS S3', 'aws_s3'], ['Google Cloud', 'google']] %>
|
|
|
|
<% options = [['Disk', 'disk'], ['AWS S3', 'aws_s3'], ['Google Cloud', 'google']] %>
|
|
|
|
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>">
|
|
|
|
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="block relative">
|
|
|
|
|
|
|
|
<div class="flex space-x-2 relative">
|
|
|
|
<% [['Disk', 'disk'], ['AWS S3', 'aws_s3'], ['Google Cloud', 'google']].each do |(label, val)| %>
|
|
|
|
<% [['Disk', 'disk'], ['AWS S3', 'aws_s3'], ['Google Cloud', 'google']].each do |(label, val)| %>
|
|
|
|
<%= f.radio_button :selected, val, checked: value['service'] == val, data: { action: 'change:toggle-visible#trigger' } %>
|
|
|
|
<%= f.label :selected, value: val, class: 'w-full flex flex-1 items-center space-x-2 btn btn-outline rounded-xl' do %>
|
|
|
|
<%= f.label :selected, label, value: val %>
|
|
|
|
<%= f.radio_button :selected, val, checked: value['service'] == val, data: { action: 'change:toggle-visible#trigger' }, class: 'base-radio' %>
|
|
|
|
|
|
|
|
<span><%= label %></span>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</toggle-visible>
|
|
|
|
</toggle-visible>
|
|
|
|
<disable-hidden id="disk" class="<%= 'hidden' if value['service'] != 'disk' %>">
|
|
|
|
<disable-hidden id="disk" class="<%= 'hidden' if value['service'] != 'disk' %>">
|
|
|
|
<%= f.fields_for :value do |ff| %>
|
|
|
|
<%= f.fields_for :value do |ff| %>
|
|
|
|
<%= ff.hidden_field :service, value: 'disk' %>
|
|
|
|
<%= ff.hidden_field :service, value: 'disk' %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<div>
|
|
|
|
<div class="text-center max-w-xl mx-auto my-8 text-xl font-medium leading-9">
|
|
|
|
Disk storage - no configs needed but make sure you have a persistant disk (heroku doesnt not have one)
|
|
|
|
Store all files on disk
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
No configs are needed but make sure your disk is persistent
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
(not suitable for Heroku and other PaaS)
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</disable-hidden>
|
|
|
|
</disable-hidden>
|
|
|
|
<disable-hidden id="aws_s3" class="<%= 'hidden' if value['service'] != 'aws_s3' %>">
|
|
|
|
<disable-hidden id="aws_s3" class="<%= 'hidden' if value['service'] != 'aws_s3' %>">
|
|
|
|
@ -44,6 +56,9 @@
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<%= fff.label :endpoint %>
|
|
|
|
<%= fff.label :endpoint %>
|
|
|
|
<%= fff.text_field :endpoint, value: configs['endpoint'], type: :url %>
|
|
|
|
<%= fff.text_field :endpoint, value: configs['endpoint'], type: :url %>
|
|
|
|
|
|
|
|
<small>
|
|
|
|
|
|
|
|
For AWS S3 compantiable APIs like Minio.
|
|
|
|
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
@ -67,8 +82,12 @@
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</disable-hidden>
|
|
|
|
</disable-hidden>
|
|
|
|
<%= f.button button_title %>
|
|
|
|
<div class="form-control">
|
|
|
|
|
|
|
|
<%= f.button button_title('OK'), class: 'base-button' %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="px-2 w-52 flex-none"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|