Merge lp:~mwhudson/lava-scheduler/restore-pinning-js-bug-927981 into lp:lava-scheduler

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 160
Merged at revision: 156
Proposed branch: lp:~mwhudson/lava-scheduler/restore-pinning-js-bug-927981
Merge into: lp:lava-scheduler
Diff against target: 89 lines (+23/-8)
4 files modified
doc/changes.rst (+7/-5)
fake-dispatcher (+7/-2)
lava_scheduler_app/management/commands/scheduler.py (+3/-1)
lava_scheduler_app/templates/lava_scheduler_app/job_log_file.html (+6/-0)
To merge this branch: bzr merge lp:~mwhudson/lava-scheduler/restore-pinning-js-bug-927981
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+98141@code.launchpad.net

Description of the change

This branch restores the javascript that the old job page had to, if the window is scrolled to the bottom, keep it there.

To post a comment you must log in.
159. By Michael Hudson-Doyle

version that works in chrome

160. By Michael Hudson-Doyle

changes

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/changes.rst'
--- doc/changes.rst 2012-03-15 21:27:02 +0000
+++ doc/changes.rst 2012-03-19 23:56:17 +0000
@@ -1,18 +1,20 @@
1Version History1Version History
2***************2***************
33
4* Show all dispatcher logs.
5* Highlight action lines.
6* Download log file in summary page
74
8.. _version_0_12:5.. _version_0_12:
96
10Version 0.12 (UNRELEASED)7Version 0.12 (UNRELEASED)
11=========================8=========================
12* Two fixes around job privacy:9* Two fixes around job privacy:
13 * Display ValueErrors raised by from_json_and_user nicely to API10 * Display ValueErrors raised by from_json_and_user nicely to API users.
14 users.
15 * Allow submission to anonymous streams again.11 * Allow submission to anonymous streams again.
12* Job view improvements:
13 * Show all dispatcher logs.
14 * Highlight action lines.
15 * Add link to download log file in summary page.
16 * If the job log view is scrolled to the bottom when new output arrives, keep
17 the view at the bottom.
1618
17.. _version_0_11:19.. _version_0_11:
1820
1921
=== modified file 'fake-dispatcher'
--- fake-dispatcher 2011-08-24 10:33:21 +0000
+++ fake-dispatcher 2012-03-19 23:56:17 +0000
@@ -1,8 +1,13 @@
1#!/bin/sh1#!/bin/sh
2echo starting processing $12echo starting processing $1
3echo error >&23echo error >&2
4for i in `seq 3`; do4for i in `seq 100`; do
5sleep 25echo p $i
6cat $1
7echo
8done
9for i in `seq 300`; do
10sleep 1
6echo $i11echo $i
7cat $112cat $1
8echo13echo
914
=== modified file 'lava_scheduler_app/management/commands/scheduler.py'
--- lava_scheduler_app/management/commands/scheduler.py 2012-02-16 01:39:54 +0000
+++ lava_scheduler_app/management/commands/scheduler.py 2012-03-19 23:56:17 +0000
@@ -59,8 +59,10 @@
59 source = DatabaseJobSource()59 source = DatabaseJobSource()
6060
61 if options['use_fake']:61 if options['use_fake']:
62 import lava_scheduler_app
63 opd = os.path.dirname
62 dispatcher = os.path.join(64 dispatcher = os.path.join(
63 os.path.dirname(os.path.dirname(os.path.abspath(__file__))),65 opd(opd(os.path.abspath(lava_scheduler_app.__file__))),
64 'fake-dispatcher')66 'fake-dispatcher')
65 else:67 else:
66 dispatcher = options['dispatcher']68 dispatcher = options['dispatcher']
6769
=== modified file 'lava_scheduler_app/templates/lava_scheduler_app/job_log_file.html'
--- lava_scheduler_app/templates/lava_scheduler_app/job_log_file.html 2011-12-13 04:22:40 +0000
+++ lava_scheduler_app/templates/lava_scheduler_app/job_log_file.html 2012-03-19 23:56:17 +0000
@@ -37,6 +37,9 @@
37 var d = data[i];37 var d = data[i];
38 var cls = 'log_' + d[0];38 var cls = 'log_' + d[0];
39 var last_pre = $("#logfile_content pre:last");39 var last_pre = $("#logfile_content pre:last");
40 var s = $("html"), w = $(window);
41 var atBottom = w.attr('innerHeight') + w.scrollTop() >= s.attr('scrollHeight')
42 && w.attr('innerHeight') > progressNode.attr('offsetHeight');
40 if (last_pre.attr('class') == cls) {43 if (last_pre.attr('class') == cls) {
41 last_pre.append(document.createTextNode(d[2]));44 last_pre.append(document.createTextNode(d[2]));
42 } else {45 } else {
@@ -45,6 +48,9 @@
45 newNode.text(d[2]);48 newNode.text(d[2]);
46 newNode.insertBefore(progressNode);49 newNode.insertBefore(progressNode);
47 }50 }
51 if (atBottom) {
52 w.scrollTop(s.attr('scrollHeight'))
53 }
48 }54 }
49 logLenth = xhr.getResponseHeader('X-Current-Size');55 logLenth = xhr.getResponseHeader('X-Current-Size');
50 if (xhr.getResponseHeader('X-Is-Finished')) {56 if (xhr.getResponseHeader('X-Is-Finished')) {

Subscribers

People subscribed via source and target branches