update storage config template

pull/105/head
Alex Turchyn 2 years ago
parent 8b760281d2
commit 7234915818

@ -1,10 +1,8 @@
<div class="max-w-6xl mx-auto px-2 py-3">
<%= link_to 'Create Template', new_template_path, data: { turbo_frame: :modal } %>
<% @templates.each do |template| %>
<div>
<%= template.name %> |
<a href="<%= template_path(template) %>">edit</a> |
<a href="<%= template_submissions_path(template) %>">submissions</a> |
</div>
<% end %>
</div>
<% @templates.each do |template| %>
<div>
<%= template.name %> |
<a href="<%= template_path(template) %>">edit</a> |
<a href="<%= template_submissions_path(template) %>">submissions</a> |
</div>
<% end %>

@ -1,17 +1,19 @@
<div class="max-w-6xl mx-auto">
<div class="flex space-x-8">
<%= render 'shared/settings_nav' %>
<div class="mt-4">
<%= form_for '', url: settings_esign_index_path, method: :post do |f| %>
<file-dropzone data-name="verify_attachments">
<label for="file">
<input id="attachment_uuid" name="attachment_uuid" class="hidden" data-target="file-dropzone.valueField" type="text" autocomplete="off">
<input id="file" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file">
LCick to upload
</label>
</file-dropzone>
<%= f.button button_title %>
<% end %>
</div>
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-16">
<%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl">
<h1 class="text-4xl font-bold mb-4">eSign</h1>
<p>
Upload your electronic signature
</p>
<%= form_for '', url: settings_esign_index_path, method: :post do |f| %>
<file-dropzone data-name="verify_attachments" class="">
<label for="file">
<input id="attachment_uuid" name="attachment_uuid" class="hidden" data-target="file-dropzone.valueField" type="text" autocomplete="off">
<input id="file" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file">
Cick to upload
</label>
</file-dropzone>
<%= f.button button_title %>
<% end %>
</div>
</div>

@ -17,7 +17,7 @@
<% if flash.present? %>
<div id="flash" class="absolute top-0 w-full">
<div class="max-w-xl mx-auto mt-1.5">
<div class="alert shadow-lg py-3">
<div class="alert py-3">
<div class="flex w-full justify-between">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-info flex-shrink-0 w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
<span class="w-full"><%= flash[:notice] || flash[:alert] %></span>
@ -27,7 +27,7 @@
</div>
</div>
<% end %>
<div class="max-w-6xl mx-auto px-4 md:px-0">
<div class="max-w-6xl mx-auto px-4 md:px-2">
<%= yield %>
</div>
</body>

@ -1,4 +1,4 @@
<div class="max-w-6xl mb-4 mx-auto px-2 py-3 flex items-center justify-between">
<div class="max-w-6xl mb-4 mx-auto px-4 md:px-2 py-3 flex items-center justify-between">
<a href="<%= root_path %>" class="text-2xl font-bold items-center flex space-x-2">
<%= render 'shared/logo' %>
<span>DocuSeal</span>
@ -12,7 +12,7 @@
</label>
<ul tabindex="0" class="dropdown-content p-2 mt-2 shadow-2xl menu bg-white rounded-box whitespace-nowrap">
<li class>
<%= link_to 'Profile', '', class: 'text-right' %>
<%= link_to 'Profile', settings_profile_index_path, class: 'text-right' %>
</li>
<li class>
<%= link_to 'Sign out', destroy_user_session_path, data: { turbo_method: :delete } %>

@ -1,32 +1,22 @@
<menu-active class="block w-full md:w-52">
<div class="-ml-3.5">
<ul class="menu menu-compact px-2">
<ul class="menu menu-compact px-2 space-y-1">
<li class="menu-title"><span>Settings</span></li>
<li></li>
<li>
<a href="<%= settings_profile_index_path %>" class="hover:bg-base-300 text-base">
Profile
</a>
<%= link_to 'Profile', settings_profile_index_path, class: "text-base hover:bg-base-300" %>
</li>
<li>
<a href="<%= settings_email_index_path %>" class="hover:bg-base-300 text-base">
Email
</a>
<%= link_to 'Email', settings_email_index_path, class: "text-base hover:bg-base-300" %>
</li>
<li>
<a href="<%= settings_storage_index_path %>" class="hover:bg-base-300 text-base">
Storage
</a>
<%= link_to 'Storage', settings_storage_index_path, class: "text-base hover:bg-base-300" %>
</li>
<li>
<a href="<%= settings_esign_index_path %>" class="hover:bg-base-300 text-base">
eSign
</a>
<%= link_to 'eSign', settings_esign_index_path, class: "text-base hover:bg-base-300" %>
</li>
<li>
<a href="<%= settings_users_path %>" class="hover:bg-base-300 text-base">
Team
</a>
<%= link_to 'Team', settings_users_path, class: "text-base hover:bg-base-300" %>
</li>
</ul>
</div>

@ -1,28 +1,32 @@
<%= f.fields_for :value do |ff| %>
<%= ff.hidden_field :service, value: 'aws_s3' %>
<%= ff.fields_for :configs, configs do |fff| %>
<div>
<%= fff.label :access_key_id, 'Access key ID' %>
<%= fff.text_field :access_key_id, value: configs['access_key_id'], required: true %>
<div class="grid md:grid-cols-2 gap-4">
<div class="form-control">
<%= fff.label :access_key_id, 'Access key ID', class: 'label' %>
<%= fff.text_field :access_key_id, value: configs['access_key_id'], required: true, class: 'base-input' %>
</div>
<div class="form-control">
<%= fff.label :secret_access_key, class: 'label' %>
<%= fff.password_field :secret_access_key, value: configs['secret_access_key'], required: true, class: 'base-input' %>
</div>
</div>
<div class="grid md:grid-cols-2 gap-4">
<div class="form-control">
<%= fff.label :region, class: 'label' %>
<%= fff.text_field :region, value: configs['region'], required: true, class: 'base-input' %>
</div>
<div class="form-control">
<%= fff.label :bucket, class: 'label' %>
<%= fff.text_field :bucket, value: value['service'] == 'aws_s3' ? configs['bucket'] : '', required: true, class: 'base-input' %>
</div>
</div>
<div>
<%= fff.label :secret_access_key %>
<%= fff.password_field :secret_access_key, value: configs['secret_access_key'], required: true %>
</div>
<div>
<%= fff.label :region %>
<%= fff.text_field :region, value: configs['region'], required: true %>
</div>
<div>
<%= fff.label :bucket %>
<%= fff.text_field :bucket, value: value['service'] == 'aws_s3' ? configs['bucket'] : '', required: true %>
</div>
<div>
<%= fff.label :endpoint %>
<%= fff.text_field :endpoint, value: configs['endpoint'], type: :url %>
<small>
For AWS S3 compantiable APIs like Minio.
</small>
<div class="form-control">
<%= fff.label :endpoint, class: 'label' %>
<%= fff.text_field :endpoint, value: configs['endpoint'], type: :url, class: 'base-input' %>
<label class="label">
<span class="label-text-alt">For AWS S3 compantiable APIs like Minio.</span>
</label>
</div>
<% end %>
<% end %>

@ -1,10 +1,17 @@
<%= f.fields_for :value do |ff| %>
<%= ff.hidden_field :service, value: 'disk' %>
<% end %>
<div class="text-center max-w-xl mx-auto my-8 text-xl font-medium leading-9">
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 class="alert my-4">
<div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-current flex-shrink-0 w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
<div>
<h3 class="font-bold"> Store all files on disk</h3>
<p class="text-gray-700">
No configs are needed but make sure your disk is persistent
<br>
<i>(not suitable for Heroku and other PaaS)</i>
</p>
</div>
</div>
</div>

@ -1,17 +1,19 @@
<%= f.fields_for :value do |ff| %>
<%= ff.hidden_field :service, value: 'google' %>
<%= ff.fields_for :configs, configs do |fff| %>
<div>
<%= fff.label :project, 'Project' %>
<%= fff.text_field :project, value: configs['project'], required: true %>
<div class="grid md:grid-cols-2 gap-4">
<div class="form-control">
<%= fff.label :project, 'Project', class: 'label' %>
<%= fff.text_field :project, value: configs['project'], required: true, class: 'base-input' %>
</div>
<div class="form-control">
<%= fff.label :bucket, class: 'label' %>
<%= fff.text_field :bucket, value: value['service'] == 'google' ? configs['bucket'] : '', required: true , class: 'base-input' %>
</div>
</div>
<div>
<%= fff.label :bucket %>
<%= fff.text_field :bucket, value: value['service'] == 'google' ? configs['bucket'] : '', required: true %>
</div>
<div>
<%= fff.label :credentials, 'Credentials (JSON key content)' %>
<%= fff.text_area :credentials, value: configs['credentials'], required: true %>
<div class="form-control">
<%= fff.label :credentials, 'Credentials (JSON key content)', class: 'label' %>
<%= fff.text_area :credentials, value: configs['credentials'], required: true, class: 'base-input' %>
</div>
<% end %>
<% end %>

@ -1,36 +1,36 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-16">
<%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl">
<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' } %>
<% configs = value['configs'] || {} %>
<%= 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']] %>
<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)| %>
<%= f.label :selected, value: val, class: 'w-full flex flex-1 items-center space-x-2 btn btn-outline rounded-xl' do %>
<%= f.radio_button :selected, val, checked: value['service'] == val, data: { action: 'change:toggle-visible#trigger' }, class: 'base-radio' %>
<span><%= label %></span>
<% end %>
<% end %>
</div>
</toggle-visible>
<disable-hidden id="disk" class="<%= 'hidden' if value['service'] != 'disk' %>">
<%= render "disk_form", f: f %>
</disable-hidden>
<disable-hidden id="aws_s3" class="<%= 'hidden' if value['service'] != 'aws_s3' %>">
<%= render "aws_form", f: f, configs: configs, value: value %>
</disable-hidden>
<disable-hidden id="google" class="<%= 'hidden' if value['service'] != 'google' %>">
<%= render "google_cloud", f: f, configs: configs, value: value %>
</disable-hidden>
<div class="form-control">
<%= f.button button_title('OK'), class: 'base-button' %>
</div>
<% end %>
<h1 class="text-4xl font-bold mb-4">Storage</h1>
<p class="mb-4">
Select files storage option (TODO)
</p>
<% value = @encrypted_config.value || { 'service' => 'disk' } %>
<% configs = value['configs'] || {} %>
<%= 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']] %>
<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)| %>
<%= f.label :selected, value: val, class: 'w-full flex flex-1 items-center space-x-2 btn btn-outline rounded-xl' do %>
<%= f.radio_button :selected, val, checked: value['service'] == val, data: { action: 'change:toggle-visible#trigger' }, class: 'base-radio' %>
<span><%= label %></span>
<% end %>
<% end %>
</div>
</toggle-visible>
<disable-hidden id="disk" class="<%= 'block my-4 hidden' if value['service'] != 'disk' %>">
<%= render "disk_form", f: f %>
</disable-hidden>
<disable-hidden id="aws_s3" class="<%= 'block my-4 hidden' if value['service'] != 'aws_s3' %>">
<%= render "aws_form", f: f, configs: configs, value: value %>
</disable-hidden>
<disable-hidden id="google" class="<%= 'block my-4 hidden' if value['service'] != 'google' %>">
<%= render "google_cloud", f: f, configs: configs, value: value %>
</disable-hidden>
<div class="form-control">
<%= f.button button_title('OK'), class: 'base-button' %>
</div>
<% end %>
</div>
</div>

@ -1,4 +1,4 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-16">
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-2">
<%= render 'shared/settings_nav' %>
<div class="w-full">
<div class="flex justify-between mb-4">

Loading…
Cancel
Save