{% extends "app/logged_in_base.html" %}
{% load i18n tz %}

{% block content %}
<h3>Processing Node</h3>
<table class="table table-bordered table-striped table-first-col-bold">
	<tr>
		<td>{% trans "Hostname" %}</td>
		<td>{{ processing_node.hostname }}</td>
	</tr>
	<tr>
		<td>{% trans "Port" %}</td>
		<td>{{ processing_node.port }}</td>
	</tr>
	<tr>
		<td>{% trans "API Version" %}</td>
		<td>{{ processing_node.api_version }}</td>
	</tr>
	<tr>
		<td>{% trans "Queue Count" %}</td>
		<td>{{ processing_node.queue_count }}</td>
	</tr>
	<tr>
		<td>{% trans "Last Refreshed" %}</td>
		<td>{{ processing_node.last_refreshed|timesince }} {% trans 'ago' %} ({{ processing_node.last_refreshed|localtime }})</td> <!-- TODO: timezone? -->
	</tr>
	<tr>
		<td>{% trans "Options (JSON)" %}</td>
		<td><div data-console data-console-lang="js" data-console-height="300">{{ available_options_json}}</div></td>
	</tr>
</table>
{% if user.is_superuser %} 
<div class="text-center">
	<button class="btn btn-default" onclick="location.href='{% url "admin:nodeodm_processingnode_change" processing_node.id %}';"><i class="glyphicon glyphicon-pencil"></i> {% trans "Edit" %}</button>
	<button class="btn btn-danger" onclick="location.href='{% url "admin:nodeodm_processingnode_delete" processing_node.id  %}';"><i class="glyphicon glyphicon-trash"></i> {% trans "Delete" %}</button>
</div>
{% endif %}

{% endblock %}
