From patchwork Wed Jul 27 00:27:18 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: 3166 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 AA84423F3F for ; Wed, 27 Jul 2011 00:27:21 +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 62EAEA1881A for ; Wed, 27 Jul 2011 00:27:21 +0000 (UTC) Received: by qwb8 with SMTP id 8so829514qwb.11 for ; Tue, 26 Jul 2011 17:27:20 -0700 (PDT) Received: by 10.229.236.10 with SMTP id ki10mr1102082qcb.274.1311726440756; Tue, 26 Jul 2011 17:27:20 -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 hl14cs129310qcb; Tue, 26 Jul 2011 17:27:20 -0700 (PDT) Received: by 10.216.137.92 with SMTP id x70mr2112700wei.62.1311726439025; Tue, 26 Jul 2011 17:27:19 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id v47si1883261wec.59.2011.07.26.17.27.18; Tue, 26 Jul 2011 17:27:19 -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 1Qlry2-000258-FS for ; Wed, 27 Jul 2011 00:27:18 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 6EB822E8914 for ; Wed, 27 Jul 2011 00:27:18 +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: 49 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 49: fix two bugs in the new job view: Message-Id: <20110727002718.6332.65357.launchpad@loganberry.canonical.com> Date: Wed, 27 Jul 2011 00:27:18 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13503"; Instance="initZopeless config overlay" X-Launchpad-Hash: 67b016577edde18385b6505a3f579036219a3d69 Merge authors: Michael Hudson-Doyle (mwhudson) ------------------------------------------------------------ revno: 49 [merge] committer: Michael-Doyle Hudson branch nick: trunk timestamp: Wed 2011-07-27 12:25:45 +1200 message: fix two bugs in the new job view: 1) a newline was inserted on each poll even if there was no new data 2) the json definition could flow out of the tab modified: fake-dispatcher lava_scheduler_app/templates/lava_scheduler_app/job.html --- 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 'fake-dispatcher' --- fake-dispatcher 2011-07-25 05:41:22 +0000 +++ fake-dispatcher 2011-07-27 00:22:15 +0000 @@ -2,7 +2,7 @@ echo starting processing $1 echo error >&2 for i in `seq 30`; do -sleep 1 +sleep 2 echo $i cat $1 echo === modified file 'lava_scheduler_app/templates/lava_scheduler_app/job.html' --- lava_scheduler_app/templates/lava_scheduler_app/job.html 2011-07-26 05:10:49 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/job.html 2011-07-27 00:23:24 +0000 @@ -67,10 +67,8 @@
  • Output
  • {% endif %} -
    -
    -{{ job.definition }}
    -    
    +
    +
    {{ job.definition }}
    {% if log_file_present %}
    @@ -105,23 +103,25 @@ global: false, success: function (data, success, xhr) { var node = $("
    ");
    -      node.text(data);
    -      var progressNode = $('#tab-output img');
    -      var scrollDiv = progressNode.closest('div');
    -      var atBottom = scrollDiv.attr('offsetHeight') + scrollDiv.attr('scrollTop') >= scrollDiv.attr('scrollHeight') && scrollDiv.attr('offsetHeight') > progressNode.attr('offsetHeight');
    -      var skipped = xhr.getResponseHeader('X-Skipped-Bytes');
    -      if (skipped) {
    -        var notice = $('... skipped ' + skipped + ' bytes (load) ...');
    -        var curLength = logLenth;
    -        $('a', notice).click(function (e) {
    -          e.preventDefault();
    -          loadExtra(notice, curLength, skipped);
    -        });
    -        notice.insertBefore(progressNode);
    -      }
    -      node.insertBefore(progressNode);
    -      if (atBottom) {
    -        scrollDiv.attr('scrollTop', scrollDiv.attr('scrollHeight'))
    +      if (data.length > 0) {
    +        node.text(data);
    +        var progressNode = $('#tab-output img');
    +        var scrollDiv = progressNode.closest('div');
    +        var atBottom = scrollDiv.attr('offsetHeight') + scrollDiv.attr('scrollTop') >= scrollDiv.attr('scrollHeight') && scrollDiv.attr('offsetHeight') > progressNode.attr('offsetHeight');
    +        var skipped = xhr.getResponseHeader('X-Skipped-Bytes');
    +        if (skipped) {
    +          var notice = $('... skipped ' + skipped + ' bytes (load) ...');
    +          var curLength = logLenth;
    +          $('a', notice).click(function (e) {
    +            e.preventDefault();
    +            loadExtra(notice, curLength, skipped);
    +          });
    +          notice.insertBefore(progressNode);
    +        }
    +        node.insertBefore(progressNode);
    +        if (atBottom) {
    +          scrollDiv.attr('scrollTop', scrollDiv.attr('scrollHeight'))
    +        }
           }
           logLenth = xhr.getResponseHeader('X-Current-Size');
           if (xhr.getResponseHeader('X-Is-Finished')) {