From patchwork Wed Jul 20 03:25:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 2779 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3095C23F57 for ; Wed, 20 Jul 2011 03:25:48 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id D8F29A18053 for ; Wed, 20 Jul 2011 03:25:47 +0000 (UTC) Received: by qwb8 with SMTP id 8so3388031qwb.11 for ; Tue, 19 Jul 2011 20:25:47 -0700 (PDT) Received: by 10.229.217.3 with SMTP id hk3mr7329833qcb.38.1311132347194; Tue, 19 Jul 2011 20:25:47 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.217.78 with SMTP id hl14cs102003qcb; Tue, 19 Jul 2011 20:25:46 -0700 (PDT) Received: by 10.216.9.219 with SMTP id 69mr6770694wet.72.1311132345395; Tue, 19 Jul 2011 20:25:45 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id p24si11091040weq.78.2011.07.19.20.25.45; Tue, 19 Jul 2011 20:25:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QjNPs-000689-MU for ; Wed, 20 Jul 2011 03:25:44 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 8D55B2E89BD for ; Wed, 20 Jul 2011 03:25:44 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-scheduler X-Launchpad-Branch: ~linaro-validation/lava-scheduler/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 34 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 34: a very simple ui for the scheduler Message-Id: <20110720032544.6170.44321.launchpad@loganberry.canonical.com> Date: Wed, 20 Jul 2011 03:25:44 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13405"; Instance="initZopeless config overlay" X-Launchpad-Hash: 9ac8f108e4d1bb107e1c4a8458f994e40396b995 Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-scheduler/scheduler-ui/+merge/67652 proposed by: Michael Hudson-Doyle (mwhudson) review: Approve - Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 34 [merge] committer: Michael-Doyle Hudson branch nick: trunk timestamp: Wed 2011-07-20 15:23:22 +1200 message: a very simple ui for the scheduler added: lava_scheduler_app/templates/lava_scheduler_app/_content.html lava_scheduler_app/templates/lava_scheduler_app/alljobs.html modified: lava_scheduler_app/models.py lava_scheduler_app/templates/lava_scheduler_app/index.html lava_scheduler_app/urls.py lava_scheduler_app/views.py --- lp:lava-scheduler https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk You are subscribed to branch lp:lava-scheduler. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription === modified file 'lava_scheduler_app/models.py' --- lava_scheduler_app/models.py 2011-06-22 23:38:39 +0000 +++ lava_scheduler_app/models.py 2011-07-11 21:24:27 +0000 @@ -78,6 +78,8 @@ (CANCELED, 'Canceled'), ) + id = models.IntegerField(primary_key=True) + submitter = models.ForeignKey( User, verbose_name = _(u"Submitter"), @@ -124,8 +126,11 @@ editable = False, ) - #def __unicode__(self): - # return self.description + def __unicode__(self): + r = "%s test job" % self.get_status_display() + if self.target: + r += " for %s" % (self.target.hostname,) + return r @classmethod def from_json_and_user(cls, json_data, user): === added file 'lava_scheduler_app/templates/lava_scheduler_app/_content.html' --- lava_scheduler_app/templates/lava_scheduler_app/_content.html 1970-01-01 00:00:00 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/_content.html 2011-07-20 03:15:42 +0000 @@ -0,0 +1,14 @@ +{% extends "layouts/content.html" %} + +{% block extrahead %} +{{ block.super }} + + + +{% endblock %} + + +{% block breadcrumbs %} +{{ block.super }} +
  • Scheduler
  • +{% endblock %} === added file 'lava_scheduler_app/templates/lava_scheduler_app/alljobs.html' --- lava_scheduler_app/templates/lava_scheduler_app/alljobs.html 1970-01-01 00:00:00 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/alljobs.html 2011-07-20 03:17:42 +0000 @@ -0,0 +1,45 @@ +{% extends "lava_scheduler_app/_content.html" %} + +{% block breadcrumbs %} +{{ block.super }} +
  • All Jobs
  • +{% endblock %} + + +{% block content %} +

    All Jobs

    + + + + + + + + + + + + + {% for job in jobs %} + + + + + + + + {% endfor %} + +
    IDStatusTargetSubmitterSubmit Time
    {{ job.id }}{{ job.get_status_display }}{{ job.target }}{{ job.submitter }}{{ job.submit_time }}
    + + + +{% endblock %} === modified file 'lava_scheduler_app/templates/lava_scheduler_app/index.html' --- lava_scheduler_app/templates/lava_scheduler_app/index.html 2011-07-08 02:57:31 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/index.html 2011-07-20 03:16:25 +0000 @@ -1,12 +1,62 @@ -{% extends "layouts/content.html" %} - - -{% block breadcrumbs %} -{{ block.super }} -
  • Scheduler
  • -{% endblock %} - +{% extends "lava_scheduler_app/_content.html" %} {% block content %} -

    Hello World from LAVA Scheduler

    +

    Devices

    + + + + + + + + + + + {% for device in devices %} + + + + + + {% endfor %} + +
    TypeHostnameStatus
    {{ device.device_type }}{{ device.hostname }}{{ device.get_status_display }}
    + +

    Active Jobs

    + + + + + + + + + + + + + {% for job in jobs %} + + + + + + + + {% endfor %} + +
    IDStatusTargetSubmitterSubmit Time
    {{ job.id }}{{ job.get_status_display }}{{ job.target }}{{ job.submitter }}{{ job.submit_time }}
    + +All jobs + + + {% endblock %} === modified file 'lava_scheduler_app/urls.py' --- lava_scheduler_app/urls.py 2011-07-12 02:25:34 +0000 +++ lava_scheduler_app/urls.py 2011-07-20 02:53:04 +0000 @@ -2,4 +2,6 @@ urlpatterns = patterns( 'lava_scheduler_app.views', - url(r'$', 'index')) + url(r'^$', 'index'), + url(r'^alljobs$', 'alljobs'), + ) === modified file 'lava_scheduler_app/views.py' --- lava_scheduler_app/views.py 2011-05-25 04:32:03 +0000 +++ lava_scheduler_app/views.py 2011-07-12 02:12:28 +0000 @@ -1,6 +1,23 @@ from django.template import RequestContext from django.shortcuts import render_to_response +from lava_scheduler_app.models import Device, TestJob + def index(request): - return render_to_response("lava_scheduler_app/index.html", {}, - RequestContext(request)) + return render_to_response( + "lava_scheduler_app/index.html", + { + 'devices': Device.objects.all(), + 'jobs': TestJob.objects.filter(status__in=[ + TestJob.SUBMITTED, TestJob.RUNNING]), + }, + RequestContext(request)) + + +def alljobs(request): + return render_to_response( + "lava_scheduler_app/alljobs.html", + { + 'jobs': TestJob.objects.all(), + }, + RequestContext(request))