add working directory property for allocation
authorMaciej Tronowski <mtro@man.poznan.pl>
Fri, 24 Apr 2015 11:05:49 +0000 (13:05 +0200)
committerMaciej Tronowski <mtro@man.poznan.pl>
Fri, 24 Apr 2015 11:05:49 +0000 (13:05 +0200)
pkgs/pyqcg-0.4.tar.gz [deleted file]
pkgs/pyqcg-0.5.tar.gz [new file with mode: 0644]
qcg/migrations/0002_allocation_working_directory.py [new file with mode: 0644]
qcg/models.py
qcg/static/qcg/main.css
qcg/templates/qcg/task.html
requirements.txt

diff --git a/pkgs/pyqcg-0.4.tar.gz b/pkgs/pyqcg-0.4.tar.gz
deleted file mode 100644 (file)
index f16de07..0000000
Binary files a/pkgs/pyqcg-0.4.tar.gz and /dev/null differ
diff --git a/pkgs/pyqcg-0.5.tar.gz b/pkgs/pyqcg-0.5.tar.gz
new file mode 100644 (file)
index 0000000..5bbb3ff
Binary files /dev/null and b/pkgs/pyqcg-0.5.tar.gz differ
diff --git a/qcg/migrations/0002_allocation_working_directory.py b/qcg/migrations/0002_allocation_working_directory.py
new file mode 100644 (file)
index 0000000..c246e0f
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('qcg', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='allocation',
+            name='working_directory',
+            field=models.CharField(default=b'', max_length=1024, verbose_name='Katalog roboczy', blank=True),
+            preserve_default=True,
+        ),
+    ]
index b41fe85..0bc0cb2 100644 (file)
@@ -194,6 +194,7 @@ class Allocation(models.Model):
     efficiency = models.IntegerField(u"Efektywność", blank=True, null=True)  # ??
     comment = models.TextField(u"Komentarz", blank=True, default='')
     memory_usage = models.PositiveIntegerField(u"Użycie pamięci", blank=True, null=True)
+    working_directory = models.CharField(u"Katalog roboczy", max_length=1024, blank=True, default='')
 
     class Meta:
         verbose_name = u"Alokacja"
@@ -208,7 +209,8 @@ class Allocation(models.Model):
         attrs = get_attributes(qcg_allocation, ('host_name', 'status_description', 'processes_count', 'slots_count',
                                                 'processes_group_id', 'submission_time', 'estimated_start_time',
                                                 'finish_time', 'local_submission_time', 'local_start_time',
-                                                'local_finish_time', 'purged', 'efficiency', 'comment', 'memory_usage'))
+                                                'local_finish_time', 'purged', 'efficiency', 'comment', 'memory_usage',
+                                                'working_directory'))
 
         attrs['status'] = Allocation.STATUS_CHOICES_REVERSED[qcg_allocation.status]
 
index a27898f..160a15c 100644 (file)
@@ -169,3 +169,21 @@ textarea {
 #host .selectize-input {
     padding-right: 32px;
 }
+
+
+
+/* task details view */
+
+.working-dir {
+    margin-top: 10px;
+}
+
+@media (min-width: 768px) {
+    .working-dir {
+        position: absolute;
+        right: 15px;
+        top: 50%;
+        margin-top: -17px;
+        z-index: 1;
+    }
+}
index 18df41a..e9b85ad 100644 (file)
@@ -1,6 +1,22 @@
 {% extends 'qcg/base.html' %}
 {% load qcg_utils staticfiles %}
 
+{% block extra_js %}
+    {% include 'filex/source.js.html' %}
+
+    <script>
+        var filex = filex || {};
+
+        $(function () {
+            'use strict';
+
+            $('.working-dir').on('click', function() {
+                filex.load($(this).data('url'));
+            });
+        });
+    </script>
+{% endblock extra_js %}
+
 {% block container %}
     <ol class="breadcrumb">
         <li><a href="{% url 'jobs' %}">Zadania</a></li>
                                 {% display_attribute 'Lokalna data zakończenia' task.local_finish_time %}
                                 {% display_attribute 'Efektywność' alloc.efficiency %}
                                 {% display_attribute 'Użycie pamięci' alloc.memory_usage %}
+                                {% display_attribute 'Katalog roboczy' alloc.working_directory %}
                                 {% display_attribute 'Usunięty katalog roboczy?' task.purged %}
+
+                                {% if alloc.working_directory %}
+                                    <button class="btn btn-default working-dir"
+                                            data-toggle="modal" data-target="#gridftp" data-url="{{ alloc.working_directory|cut:'gsiftp://'  }}">
+                                        Przeglądaj katalog roboczy
+                                    </button>
+                                {% endif %}
                             </li>
                         {% endfor %}
                     </ul>
         </div>
     </div>
 
+    <div id="gridftp" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true">
+        <div class="modal-dialog modal-lg">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                    <h4 class="modal-title" id="modal-label">Katalog roboczy</h4>
+                </div>
+                <div class="modal-body">
+                    {% include 'filex/source.html' %}
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Ok</button>
+                </div>
+            </div>
+        </div>
+    </div>
+
 {% endblock %}
index 29825a0..94386ea 100644 (file)
@@ -1,8 +1,8 @@
-Django
+Django<1.8
 django-grappelli
 django-bootstrap3
 pkgs/django-openid-auth-0.5.1.tar.gz
-pkgs/pyqcg-0.4.tar.gz
+pkgs/pyqcg-0.5.tar.gz
 pkgs/python-gridftp-1.3.4.tar.gz
 python-openid
 pytz