servers.html 4 KB
Newer Older
1
{% extends "edumanage/welcome.html"%}
2 3 4 5
			{% block crumbs %}
	    			<li><a href="{% url manage %}">Home</a><span class="divider">/</span></li>
	    			<li class="active">Servers</li>
	    			{% endblock %}
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
{% load i18n %}
{% block extrahead %}
<script type="text/javascript" src="/static/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/js/datatables_bootstrap.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	 {% if servers %}
var oTable = $('#table').dataTable({
	"sPaginationType": "bootstrap",
	"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
	"aoColumns": [{
        "bSearchable": true,
        "bSortable": true
    }, {
        "bSearchable": true,
        "bSortable": true
    }, {
        "bSearchable": true,
        "bSortable": true
    }, {
        "bSearchable": true,
        "bSortable": true
    }, {
        "bSearchable": true,
        "bSortable": true
    }, {
        "bSearchable": true,
        "bSortable": true
    }, {
        "bSearchable": true,
        "bSortable": true
    }, {
        "bSearchable": true,
        "bSortable": true
    }, {
        "bVisible": true,
        "bSearchable": false,
        "bSortable": false
    }],
    "aaSorting": [[0, 'desc']],
    "iDisplayLength": 25,
    "oSearch": {"bSmart": false, "bRegex":true},
    "oLanguage": {
    	"sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "servers" %}',
        "sProcessing":   "Processing...",
        "sZeroRecords": '{% trans "No records to display" %}',
        "sInfo":         "Showing _START_ to _END_ of _TOTAL_ entries",
        "sInfoEmpty":    "{% trans "Showing 0 to 0 of 0 entries" %}",
        "sInfoFiltered": "(filtered from _MAX_ total entries)",
        "sInfoPostFix":  "",
        "sSearch":       '{% trans "Search:" %}',
        "sUrl":          "",
        "oPaginate": {
            "sFirst":    '{% trans "First" %}',
            "sPrevious": '{% trans "Previous" %}',
            "sNext":     '{% trans "Next" %}',
            "sLast":     '{% trans "Last" %}'
        }
    }
});
66

Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
67 68 69 70 71 72
oTable.fnDraw();

{% endif %}
});
</script>
{% endblock %}
73

74 75 76 77 78 79 80
	{% block navbar %}
			
    		{% endblock %}
    		
    		{% block homeactive %}{% endblock %}
    		{% block serversactive %}class="active"{% endblock %}
            {% block subcontent %}
81

82
	            	
83 84
	              <h4>Servers</h4>
	              <hr>
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
85 86
	              <div><a href="{% url edit-servers %}" class="btn btn-primary">Add new server</a></div>
	              <div class="span10"></div>
87
	              {% if servers %}
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
88 89
	              <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="table">
					<thead>
90
					<tr>
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
91 92 93 94 95 96 97 98 99
						<th>Name</th>
						<th>Type</th>
						<th>Port</th>
						<th>acct_port</th>
						<th>timeout</th>
						<th>retry</th>
						<th>status_server</th>
						<th>proto</th>
						<th style="text-align: center;">Action</th>
100 101
					</tr>
					</thead>
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
102

103 104
					<tbody>
	                {% for server in servers %}
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
105 106 107 108 109 110 111 112 113 114
	              	<tr class="GradeC">
	                	<td>{{server.name}}</td>
	                	<td>{{server.get_ertype_display}}</td>
	                	<td>{{server.port}}</td>
	                	<td>{{server.acct_port}}</td>
	                	<td>{{server.timeout}}</td>
	                	<td>{{server.retry}}</td>
	                	<td>{{server.status_server}}</td>
	                	<td>{{server.proto}}</td>
	                	<td style="text-align: center;"><a href="{% url edit-servers server.pk %}" class="btn btn-small">edit</a> <a href="{% url edit-servers server.pk %}" class="btn btn-small btn-warning">delete</a></td>
115 116 117 118 119 120 121 122 123
	                </tr>
	              	{% endfor %}
	              	</tbody>
	              </table>
	              {% else %}
	              <div>No servers defined yet (<a href="{% url edit-servers %}">add</a>)</div>
	              {% endif %}

            {% endblock %}
124