depicts/templates/query_list.html

91 lines
2.2 KiB
HTML
Raw Normal View History

2019-11-26 14:01:14 +00:00
{% extends "base.html" %}
2019-11-26 16:09:30 +00:00
{% block title %}Wikidata Query Service report{% endblock %}
2019-11-26 14:01:14 +00:00
{% block content %}
<div class="p-2">
<div class="container">
2019-11-26 16:07:57 +00:00
<div class="row">
<div class="col">
2019-11-26 16:09:30 +00:00
<h1>{{ self.title() }}</h1>
2019-11-26 16:07:57 +00:00
<p>This report lists every query sent to the <a href="https://query.wikidata.org/">Wikidata Query Service</a> (WQDS) by WADE. Failed queries are in red.</p>
</div>
</div>
2019-11-26 14:01:14 +00:00
<div class="row">
2019-11-26 19:23:48 +00:00
<div class="col-1"></div>
2019-11-26 17:21:58 +00:00
<div class="col-2">template</div>
2019-11-26 19:10:30 +00:00
<div class="col-2">when</div>
<div class="col-2">time</div>
2019-11-26 14:01:14 +00:00
<div class="col">options</div>
</div>
{% for obj in q %}
2019-11-26 19:23:48 +00:00
<div class="border {% if obj.bad %}border-danger{% endif %} my-1 py-1">
<div class="row">
<div class="col-1"></div>
<div class="col-2">
2019-11-26 19:10:30 +00:00
{{ obj.template or '' }}
</div>
2019-11-26 19:23:48 +00:00
<div class="col-2">
2019-11-26 19:01:38 +00:00
{{ obj.start_time.strftime('%Y %b %d %H:%M') }}
2019-11-26 14:01:14 +00:00
</div>
2019-11-26 17:21:58 +00:00
2019-11-26 19:23:48 +00:00
<div class="col-2">
2019-11-26 19:01:38 +00:00
{% if obj.end_time %}
2019-11-26 19:10:30 +00:00
{{ obj.display_seconds }}&nbsp;seconds
2019-11-26 19:01:38 +00:00
{% else %}
2019-11-26 19:04:09 +00:00
<span class="badge badge-info">running</span>
2019-11-26 19:01:38 +00:00
{% endif %}
2019-11-26 17:21:58 +00:00
</div>
2019-11-26 14:01:14 +00:00
<div class="col">
2019-11-26 19:10:30 +00:00
<a href="#" class="toggle" data-id="{{ obj.id }}">show/hide SPARQL</a> |
<a href="https://query.wikidata.org/#{{ obj.sparql_query | urlencode }}">view in WDQS</a>
</div>
2019-11-26 14:01:14 +00:00
</div>
2019-11-26 19:10:30 +00:00
<div class="row">
2019-11-26 19:23:48 +00:00
<div class="col-1"></div>
<div class="col-11"><a href="{{ obj.path }}">{{ obj.path }}</a></div>
2019-11-26 14:01:14 +00:00
</div>
<div id="query_{{ obj.id }}" class="row sparql">
<div class="col">
<pre>{{ obj.sparql_query }}</pre>
</div>
</div>
<div class="row error">
<div class="col">
{% if obj.status_code != 200 %}
<div>status code: {{ obj.status_code }}</div>
<pre>{{ obj.error_text }}</pre>
{% endif %}
</div>
</div>
2019-11-26 19:23:48 +00:00
</div>
2019-11-26 14:01:14 +00:00
{% endfor %}
</div>
</div>
{% endblock %}
{% block script %}
<script>
$('.sparql').hide();
$('.error').hide();
$('.toggle').click(function() {
var query_id = $(this).data('id');
$('#query_' + query_id).toggle();
});
</script>
{% endblock %}