From patchwork Tue Mar 13 03:26:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Spring Zhang X-Patchwork-Id: 7252 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 A387223E01 for ; Tue, 13 Mar 2012 03:26:13 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 44D80A1847E for ; Tue, 13 Mar 2012 03:26:13 +0000 (UTC) Received: by iage36 with SMTP id e36so232101iag.11 for ; Mon, 12 Mar 2012 20:26:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=rwm0BiRhUChX6680fGFvV1wORBgef9dvcU5D+uffnTM=; b=Yz1ttM+hNQ2Pxm1JocxrjpSZ4UW4s/cOC6bT5Yyk2ky5uYCwSC2VfM63r7f3UmdTcn Z9XpNynsNtCvDCMQaAwL71i9y0P5VkSEAV6AG0TF5jKOb1vb0LxBUWPfEndGLS7hKWQM GnEKidqNqZgwHknDszc+WKHuWdAHbyr3Ossk2UdQXih4fCk/htQgXcqBd3yxuneYyTzl 2oHrsRvfrFP/SvYA6szgJErT0ZjMLrLv63sqXakrZp3SIcvqLZwzdP5MfYoJS/6KtpIK QNjEKrw+OrQaCnrpsN0bb+bJpLwKb8DKT/FvPTDcuCN33d2YjmeWxbn1N5BJ+N0J3y9U bcFQ== Received: by 10.50.158.133 with SMTP id wu5mr1856502igb.50.1331609172718; Mon, 12 Mar 2012 20:26:12 -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.231.53.18 with SMTP id k18csp56332ibg; Mon, 12 Mar 2012 20:26:11 -0700 (PDT) Received: by 10.180.24.7 with SMTP id q7mr3366948wif.11.1331609171087; Mon, 12 Mar 2012 20:26:11 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id k58si20397434weq.8.2012.03.12.20.26.10 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Mar 2012 20:26:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1S7ING-0006be-Ag for ; Tue, 13 Mar 2012 03:26:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 35694E0136 for ; Tue, 13 Mar 2012 03:26:10 +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: 147 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 147: Add a common template for health job and device detail Message-Id: <20120313032610.10714.50811.launchpad@ackee.canonical.com> Date: Tue, 13 Mar 2012 03:26:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14933"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 815c1ca1fff7cc8bdbaa1b37b80e2c289cf458b8 X-Gm-Message-State: ALoCoQkcDbLnEv/4V+wxTAP1DvqusPPX4PLfnT+2HrF76FC6H4Xugnw/0jtplpZXop0gMD9AEwtQ Merge authors: Spring Zhang (qzhang) Related merge proposals: https://code.launchpad.net/~qzhang/lava-scheduler/add-template4device/+merge/95154 proposed by: Spring Zhang (qzhang) review: Approve - Michael Hudson-Doyle (mwhudson) review: Resubmit - Spring Zhang (qzhang) ------------------------------------------------------------ revno: 147 [merge] committer: Spring Zhang branch nick: lava-scheduler timestamp: Tue 2012-03-13 11:23:57 +0800 message: Add a common template for health job and device detail added: lava_scheduler_app/templates/lava_scheduler_app/_device_base.html modified: lava_scheduler_app/templates/lava_scheduler_app/device.html lava_scheduler_app/templates/lava_scheduler_app/health_jobs.html 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 === added file 'lava_scheduler_app/templates/lava_scheduler_app/_device_base.html' --- lava_scheduler_app/templates/lava_scheduler_app/_device_base.html 1970-01-01 00:00:00 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/_device_base.html 2012-03-09 02:49:54 +0000 @@ -0,0 +1,145 @@ +{% extends "lava_scheduler_app/_content.html" %} + +{% load django_tables2 %} + +{% block extrahead %} +{{ block.super }} + + + +{% endblock %} + + +{% block content %} +{% block device_heading %}{% endblock %} + +{% if show_maintenance %} +
+ {% csrf_token %} + +
+ +{% endif %} +{% if show_online %} +
+ {% csrf_token %} + +
+ +{% endif %} + +
+
+
Hostname:
+
{{ device.hostname }}
+ +
Device type:
+
{{ device.device_type }}
+ +
Device Tags
+ {% for tag in device.tags.all %} +
{{ tag.name }}
+ {% empty %} +
None
+ {% endfor %} +
+
+
Status:
+
+ {{ device.get_status_display }} + {% if transition %} + (reason: {{ transition }}) + {% endif %} +
+
Health Status:
+
+ {{ device.get_health_status_display }} +
+ {% if device.current_job %} +
Currently running:
+
Job {{ device.current_job }}
+ {% endif %} +
+
+
+ +{% block content_columns %} +{% endblock %} + +
+ See status transitions + {% render_table transition_table %} +
+ + + +{% endblock %} + === modified file 'lava_scheduler_app/templates/lava_scheduler_app/device.html' --- lava_scheduler_app/templates/lava_scheduler_app/device.html 2012-03-05 00:23:16 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/device.html 2012-03-12 10:00:23 +0000 @@ -1,141 +1,11 @@ -{% extends "lava_scheduler_app/_content.html" %} +{% extends "lava_scheduler_app/_device_base.html" %} {% load django_tables2 %} -{% block extrahead %} -{{ block.super }} - - - -{% endblock %} - -{% block content %} +{% block device_heading %}

Device {{ device }}

- -{% if show_maintenance %} -
- {% csrf_token %} - -
- -{% endif %} -{% if show_online %} -
- {% csrf_token %} - -
- -{% endif %} - -
-
-
Hostname:
-
{{ device.hostname }}
- -
Device type:
-
{{ device.device_type }}
- -
Device Tags
- {% for tag in device.tags.all %} -
{{ tag.name }}
- {% empty %} -
None
- {% endfor %} -
-
-
Status:
-
- {{ device.get_status_display }} - {% if transition %} - (reason: {{ transition }}) - {% endif %} -
-
Health Status:
-
- {{ device.get_health_status_display }} -
- {% if device.current_job %} -
Currently running:
-
Job {{ device.current_job }}
- {% endif %} -
-
-
- +{% endblock %} + +{% block content_columns %} {% render_table recent_job_table %} - -
- See status transitions - {% render_table transition_table %} -
- - {% endblock %} === modified file 'lava_scheduler_app/templates/lava_scheduler_app/health_jobs.html' --- lava_scheduler_app/templates/lava_scheduler_app/health_jobs.html 2012-03-01 23:38:16 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/health_jobs.html 2012-03-09 02:49:54 +0000 @@ -1,69 +1,11 @@ -{% extends "lava_scheduler_app/_content.html" %} +{% extends "lava_scheduler_app/_device_base.html" %} {% load django_tables2 %} -{% block extrahead %} -{{ block.super }} - -{% endblock %} - -{% block content %} +{% block device_heading %}

Device {{ device }} Health Job List

- -{% if show_maintenance %} -
- {% csrf_token %} - -
-{% endif %} -{% if show_online %} -
- {% csrf_token %} - -
-{% endif %} - -
-
-
Hostname:
-
{{ device.hostname }}
- -
Device type:
-
{{ device.device_type }}
- -
Device Tags
- {% for tag in device.tags.all %} -
{{ tag.name }}
- {% empty %} -
None
- {% endfor %} -
-
-
Status:
-
{{ device.get_status_display }}
-
Health Status:
-
- {{ device.get_health_status_display }} -
- {% if device.current_job %} -
Currently running:
-
Job {{ device.current_job }}
- {% endif %} -
-
-
- - +{% endblock %} + +{% block content_columns %} {% render_table health_job_table %} - {% endblock %} === modified file 'lava_scheduler_app/views.py' --- lava_scheduler_app/views.py 2012-03-07 01:59:51 +0000 +++ lava_scheduler_app/views.py 2012-03-13 03:18:14 +0000 @@ -184,7 +184,8 @@ "hostname", "last_health_report_job") def render_hostname(self, record): - return pklink(record) + return mark_safe('%s' % ( + record.get_device_health_url(), escape(record.pk))) def render_last_health_report_job(self, record): report = record.last_health_report_job @@ -226,7 +227,7 @@ def get_queryset(self): device, = self.params - TestJob.objects.select_related( + return TestJob.objects.select_related( "submitter", ).filter( actual_device=device, @@ -249,6 +250,9 @@ "lava_scheduler_app/health_jobs.html", { 'device': device, + 'transition_table': DeviceTransitionTable( + 'transitions', reverse(transition_json, kwargs=dict(pk=device.pk)), + params=(device,)), 'health_job_table': HealthJobTable( 'health_jobs', reverse(health_jobs_json, kwargs=dict(pk=pk)), params=(device,)),