{% extends "package/_resource_edit_base.html" %} {% block primary_content_inner %} {% set has_error = status.error or status.error.message %} {%- set modal_id = ui.util.id() -%} {%- set form_id = ui.util.id() -%} {%- call ui.util.call(ui.form, method="POST", action=h.url_for('datapusher.delete_datastore_table', id=pkg_dict.id, resource_id=resource.id), attrs={"id": form_id}) -%} {{ ui.confirm_modal(_('Are you sure you want to delete the DataStore and Data Dictionary?'), id=modal_id, form_id=form_id) }} {{ ui.modal_handle(_('Delete from DataStore'), id=modal_id, style="danger") }} {%- endcall %} {%- call ui.util.call(ui.form, method="POST", action=h.url_for('datapusher.resource_data', id=pkg_dict.name, resource_id=resource.id)) -%} {{ ui.button(_('Upload to DataStore'), type="submit") }} {%- endcall %} {% if has_error %} {%- call ui.util.call(ui.alert, style="danger") -%} {{ _('Upload error:') }} {{ status.error.message }} {%- endcall %} {% elif status.task_info and status.task_info.error %} {%- call ui.util.call(ui.alert, style="danger") -%} {% if status.task_info.error is mapping %} {{ _('Error:') }} {{ status.task_info.error.message }} {% for error_key, error_value in status.task_info.error.items() %} {% if error_key != "message" and error_value %}
{{ error_key }}: {{ error_value }} {% endif %} {% endfor %} {% elif status.task_info.error is iterable %} {{ _('Error traceback:') }}
{{ ''.join(status.task_info.error) }}
{% endif %} {%- endcall %} {% endif %} {%- call ui.util.call(ui.table) -%} {{ ui.table_row(ui.table_cell(_('Status'), header=true) ~ ui.table_cell(h.datapusher_status_description(status))) }} {{ ui.table_row(ui.table_cell(_('Last updated'), header=true) ~ ui.table_cell(ui.datetime(status.last_updated) if status.last_updated else _("Never"))) }} {%- endcall %} {% if status.status and status.task_info and not has_error %} {{ ui.heading(_('Upload Log'), level=3) }} {%- call ui.util.call(ui.list) -%} {% for item in status.task_info.logs|sort(attribute='timestamp') %} {% set icon = 'check' if item.level == 'INFO' else 'exclamation' %} {% set class = ' failure' if icon == 'exclamation' else ' success' %} {%- call ui.util.call(ui.list_item) -%} {% for line in item.message.strip().split('\n') %} {{ line | urlize }}
{% endfor %} {{ h.time_ago_from_timestamp(item.timestamp) }} {%- with popover_id=ui.util.id() -%} {%- call ui.util.call(ui.popover, title=_("Details"), id=popover_id) -%} {%- call ui.util.call(ui.list) -%} {% for key, value in item.items() %} {%- call ui.util.call(ui.list_item) -%} {{ key }}: {{ h.clean_html(value|string) }} {%- endcall %} {% endfor %} {%- endcall %} {%- endcall %} {{ ui.popover_handle(_('Details'), id=popover_id) }} {%- endwith %} {%- endcall %} {% endfor %} {{ ui.list_item(_('End of log')) }} {%- endcall %} {% endif %} {% endblock %}