storage backend reworked

This commit is contained in:
vabene1111
2018-05-25 16:49:10 +02:00
parent c5986c6e7f
commit 4871b6194c
21 changed files with 278 additions and 128 deletions

View File

@@ -65,6 +65,8 @@
class="fas fa-archive"></i> {% trans 'Category' %}</a>
<a class="dropdown-item" href="{% url 'new_keyword' %}"><i
class="fas fa-tags"></i> {% trans 'Keyword' %}</a>
<a class="dropdown-item" href="{% url 'new_storage' %}"><i
class="fas fa-database"></i> {% trans 'Storage Backend' %}</a>
</div>
</li>
<li class="nav-item dropdown">
@@ -81,6 +83,8 @@
class="far fa-file-alt"></i> {% trans 'New Recipes' %}</a>
<a class="dropdown-item" href="{% url 'list_import_log' %}"><i
class="fas fa-history"></i> {% trans 'Import Log' %}</a>
<a class="dropdown-item" href="{% url 'list_storage' %}"><i
class="fas fa-database"></i> {% trans 'Storage Backends' %}</a>
</div>
</li>
<li class="nav-item dropdown">

View File

@@ -24,7 +24,7 @@
</div>
<br/>
<a href="{% url 'api_dropbox_sync' %}" class="btn btn-warning">{% trans 'Sync Now!' %}</a>
<a href="{% url 'batch_sync_wait' %}" class="btn btn-warning">{% trans 'Sync Now!' %}</a>
<br/><br/>
{% render_table monitored_paths %}

View File

@@ -0,0 +1,26 @@
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans 'Importing Recipes' %}{% endblock %}
{% block content %}
<h3>
{% trans 'Importing Recipes' %}
</h3>
<br/>
<br/>
<br/>
<br/>
<div class="text-center">
<i class="fas fa-sync fa-spin fa-10x"></i>
</div>
<script>
$(document).ready(function () {
window.location.href = "http://192.168.178.27:8000/cookbook/api/sync_all"
});
</script>
{% endblock %}

View File

@@ -13,6 +13,17 @@
<h3>{% trans 'Edit' %} {{ title }}</h3>
{% if form.Meta.model|get_class == 'Storage' %} <!-- TODO make one include for this text block -->
<div class="alert alert-danger" role="alert">
<h4 class="alert-heading"><i class="far fa-exclamation-triangle"></i> {% trans 'Security Warning' %}</h4>
<p>{% blocktrans %}
The <b>Password and Token</b> field are stored as <b>plain text</b> inside the database.
This is necessary because they are needed to make API requests, but it also increases the risk of someone stealing it. <br/>
To limit the possible damage use read only tokens or accounts if available or create separate accounts with limited access (only to recipes).
{% endblocktrans %}</p>
</div>
{% endif %}
<form action="." method="post">
{% csrf_token %}
{{ form|crispy }}

View File

@@ -13,6 +13,17 @@
<h3>{% trans 'New' %} {{ title }} </h3>
{% if form.Meta.model|get_class == 'Storage' %} <!-- TODO make one include for this text block -->
<div class="alert alert-danger" role="alert">
<h4 class="alert-heading"><i class="far fa-exclamation-triangle"></i> {% trans 'Security Warning' %}</h4>
<p>{% blocktrans %}
The <b>Password and Token</b> field are stored as <b>plain text</b> inside the database.
This is necessary because they are needed to make API requests, but it also increases the risk of someone stealing it. <br/>
To limit the possible damage use read only tokens or accounts if available or create separate accounts with limited access (only to recipes).
{% endblocktrans %}</p>
</div>
{% endif %}
<form action="." method="post">
{% csrf_token %}
{{ form|crispy }}