diff frontend/mfrontend/templates/joblist_ajax.html @ 30:50708627f3c7

Ukończona strona klienta
author mild@mild-laptop
date Sun, 05 Jun 2011 23:10:18 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/frontend/mfrontend/templates/joblist_ajax.html	Sun Jun 05 23:10:18 2011 +0200
@@ -0,0 +1,94 @@
+{% block body %}
+<table border="0" cellpadding="0" cellspacing="0" class="tbt"><tr>
+	<td class="tbtl">&nbsp;</td>
+	<td class="tbtbot" nowrap="nowrap"><b>Lista zadań</b></td>
+	<td class="tbtr">&nbsp;</td>
+</tr></table>
+
+<table align="center" width="100%" border="0" cellspacing="1" cellpadding="4" class="forumline">
+    <tr>
+	<td class="row1">
+<table border="0" cellpadding="0" cellspacing="0" class="tbt" width="70%" align="center">
+    <tr>
+            <th class="colhead">id</th>
+            <th class="colhead">Właściciel</th>
+            <th class="colhead">Hash</th>
+            <th class="colhead">Opis</th>
+            <th class="colhead">Metoda</th>
+            <th class="colhead">Stan</th>
+            <th class="colhead">Postęp</th>
+	    <th class="colhead">Wynik</th>
+
+    </tr>
+    {% for job in jobs %}
+    <tr class="row{{ job.index % 2 + 2}}">
+        <td>{{ job.id }}</td>
+        <td>{{ job.username }}</td>
+        <td>{{ job.hash }}</td>
+        <td>{{ job.label }}</td>
+        <td>{% if job.method is sameas 0 %}
+                Brute-force
+            {% else %}
+		słownik
+            {% endif %}</td>
+        <td align="center">{{ job.state_text }}</td>
+        <td align="center">{% if job.percent is not sameas None %}
+		{% if job.percent == 100 %}
+		<span class="state100">{{job.percent}}</span>
+	        {% else %}
+		{% if job.percent >= 87 %}
+		<span class="state87">{{job.percent}}</span>
+	        {% else %}
+		{% if job.percent >= 75 %}
+		<span class="state75">{{job.percent}}</span>
+	        {% else %}
+		{% if job.percent >= 62 %}
+		<span class="state62">{{job.percent}}</span>
+	        {% else %}
+		{% if job.percent >= 50 %}
+		<span class="state50">{{job.percent}}</span>
+	        {% else %}
+		{% if job.percent >= 37 %}
+		<span class="state37">{{job.percent}}</span>
+	        {% else %}
+		{% if job.percent >= 25 %}
+		<span class="state25">{{job.percent}}</span>
+	        {% else %}
+		{% if job.percent >= 12 %}
+		<span class="state12">{{job.percent}}</span>
+	        {% else %}
+		<span class="state0">{{job.percent}}</span>
+            {% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}
+	
+            {% else %}
+                brak danych
+            {% endif %}
+        </td>
+        <td align="center">
+	    {% if job.result is not sameas None %}
+		{{job.result}}
+            {% else %}
+                brak danych
+            {% endif %}
+	</td>
+    </tr>
+    {% endfor %}
+</table></td></tr></table>
+<table border="0" cellpadding="0" cellspacing="0" class="tbl"><tr>
+	<td class="tbll">&nbsp;</td>
+	<td class="tblbot">&nbsp;</td>
+	<td class="tblr">&nbsp;</td>
+</tr></table>
+<script>
+function refresh()
+{
+	$.ajax({
+	url: "/jobs/ajax/",
+	success: function (html){
+		$("#result").html(html);	
+	}
+	});
+}
+setTimeout(refresh,5000);
+</script>
+{% endblock %}