simplify host overview, remove update as it is already on host edit view (and it supports v4 and v6 there)

This commit is contained in:
Thomas Waldmann 2013-10-27 12:32:08 +01:00
parent cdb4f9af20
commit 0761f27e32

View File

@ -10,14 +10,13 @@
{% for host in hosts %} {% for host in hosts %}
<tr> <tr>
<td><a href="{% url 'host_view' host.pk %}"><b>{{ host.subdomain }}.{{ host.domain.domain }}</b></a></td> <td><a href="{% url 'host_view' host.pk %}"><b>{{ host.subdomain }}.{{ host.domain.domain }}</b></a></td>
<td id="last{{ host.pk }}">{{ host.last_api_update|timesince }}</td> <td>{{ host.last_api_update|timesince }}</td>
<td>{{ host.getIPv4 }}</td> <td>{{ host.getIPv4 }}</td>
<td>{{ host.getIPv6 }}</td> <td>{{ host.getIPv6 }}</td>
<td>{{ host.comment }}</td> <td>{{ host.comment }}</td>
<td> <td>
<a href="{% url 'host_view' host.pk %}"><i class="icon icon-pencil"></i> edit</a> | <a href="{% url 'host_view' host.pk %}"><i class="icon icon-pencil"></i> edit</a> |
<a href="{% url 'delete_host' host.pk %}"><i class="icon icon-remove"></i> delete</a> | <a href="{% url 'delete_host' host.pk %}"><i class="icon icon-remove"></i> delete</a>
<a href="#" onclick="update_host('{{ host.get_fqdn }}',{{ host.pk }})"><i class="icon icon-refresh"></i> update</a>
</td> </td>
</tr> </tr>
{% empty %} {% empty %}
@ -25,19 +24,6 @@
{% endfor %} {% endfor %}
</table> </table>
</div> </div>
<script>
update_host = function(host,pk) {
$('#update_result').text('updating...');
$.get( "{% url 'nic_update_authorized' %}", { myip: $('#myip').val(), hostname: host } )
.done(function( data ) {
$('#last'+pk).text("0 minutes");
}).fail(function( data ) {
$('#last'+pk).text("error updating");
});
}
</script>
</div> </div>
<hr> <hr>