diff --git a/cookbook/helper/dropbox.py b/cookbook/helper/dropbox.py index 64edebf4a..1ddb4f8e5 100644 --- a/cookbook/helper/dropbox.py +++ b/cookbook/helper/dropbox.py @@ -12,7 +12,11 @@ def sync_all(): monitors = Monitor.objects.all() for monitor in monitors: - import_all(monitor) + ret = import_all(monitor) + if not ret: + return ret + + return True def import_all(monitor): diff --git a/cookbook/tables.py b/cookbook/tables.py index 967c9d2c9..62afae9df 100644 --- a/cookbook/tables.py +++ b/cookbook/tables.py @@ -41,13 +41,23 @@ class KeywordTable(tables.Table): fields = ('id', 'name') +class ImportLogTable(tables.Table): + monitor_id = tables.LinkColumn('edit_monitor', args=[A('monitor_id')]) + + class Meta: + model = ImportLog + template_name = 'generic/table_template.html' + fields = ('status', 'msg', 'monitor_id', 'created_at') + + class MonitoredPathTable(tables.Table): + id = tables.LinkColumn('edit_monitor', args=[A('id')]) delete = tables.TemplateColumn("" + _('Delete') + "") class Meta: model = Monitor template_name = 'generic/table_template.html' - fields = ('path', 'last_checked') + fields = ('id', 'path', 'last_checked') class NewRecipeTable(tables.Table): @@ -56,4 +66,4 @@ class NewRecipeTable(tables.Table): class Meta: model = NewRecipe template_name = 'generic/table_template.html' - fields = ('name','path') + fields = ('id', 'name', 'path') diff --git a/cookbook/templates/base.html b/cookbook/templates/base.html index 4d938f30d..08c8a1787 100644 --- a/cookbook/templates/base.html +++ b/cookbook/templates/base.html @@ -71,6 +71,8 @@ class="fas fa-archive"> {% trans 'Category' %} {% trans 'Keyword' %} + {% trans 'Import Log' %}