LAVA Scheduler (deprecated)

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

Proposed by Michael Hudson-Doyle on 2012-03-19
Status: Merged
Approved by: Zygmunt Krynicki on 2012-03-20
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
To merge this branch: bzr merge lp:~mwhudson/lava-scheduler/restore-pinning-js-bug-927981
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) 2012-03-19 Approve on 2012-03-20
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 on 2012-03-19

version that works in chrome

160. By Michael Hudson-Doyle on 2012-03-19

changes

Zygmunt Krynicki (zkrynicki) wrote :

+1

review: Approve

Preview Diff

1=== modified file 'doc/changes.rst'
2--- doc/changes.rst 2012-03-15 21:27:02 +0000
3+++ doc/changes.rst 2012-03-19 23:56:17 +0000
4@@ -1,18 +1,20 @@
5 Version History
6 ***************
7
8-* Show all dispatcher logs.
9-* Highlight action lines.
10-* Download log file in summary page
11
12 .. _version_0_12:
13
14 Version 0.12 (UNRELEASED)
15 =========================
16 * Two fixes around job privacy:
17- * Display ValueErrors raised by from_json_and_user nicely to API
18- users.
19+ * Display ValueErrors raised by from_json_and_user nicely to API users.
20 * Allow submission to anonymous streams again.
21+* Job view improvements:
22+ * Show all dispatcher logs.
23+ * Highlight action lines.
24+ * Add link to download log file in summary page.
25+ * If the job log view is scrolled to the bottom when new output arrives, keep
26+ the view at the bottom.
27
28 .. _version_0_11:
29
30
31=== modified file 'fake-dispatcher'
32--- fake-dispatcher 2011-08-24 10:33:21 +0000
33+++ fake-dispatcher 2012-03-19 23:56:17 +0000
34@@ -1,8 +1,13 @@
35 #!/bin/sh
36 echo starting processing $1
37 echo error >&2
38-for i in `seq 3`; do
39-sleep 2
40+for i in `seq 100`; do
41+echo p $i
42+cat $1
43+echo
44+done
45+for i in `seq 300`; do
46+sleep 1
47 echo $i
48 cat $1
49 echo
50
51=== modified file 'lava_scheduler_app/management/commands/scheduler.py'
52--- lava_scheduler_app/management/commands/scheduler.py 2012-02-16 01:39:54 +0000
53+++ lava_scheduler_app/management/commands/scheduler.py 2012-03-19 23:56:17 +0000
54@@ -59,8 +59,10 @@
55 source = DatabaseJobSource()
56
57 if options['use_fake']:
58+ import lava_scheduler_app
59+ opd = os.path.dirname
60 dispatcher = os.path.join(
61- os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
62+ opd(opd(os.path.abspath(lava_scheduler_app.__file__))),
63 'fake-dispatcher')
64 else:
65 dispatcher = options['dispatcher']
66
67=== modified file 'lava_scheduler_app/templates/lava_scheduler_app/job_log_file.html'
68--- lava_scheduler_app/templates/lava_scheduler_app/job_log_file.html 2011-12-13 04:22:40 +0000
69+++ lava_scheduler_app/templates/lava_scheduler_app/job_log_file.html 2012-03-19 23:56:17 +0000
70@@ -37,6 +37,9 @@
71 var d = data[i];
72 var cls = 'log_' + d[0];
73 var last_pre = $("#logfile_content pre:last");
74+ var s = $("html"), w = $(window);
75+ var atBottom = w.attr('innerHeight') + w.scrollTop() >= s.attr('scrollHeight')
76+ && w.attr('innerHeight') > progressNode.attr('offsetHeight');
77 if (last_pre.attr('class') == cls) {
78 last_pre.append(document.createTextNode(d[2]));
79 } else {
80@@ -45,6 +48,9 @@
81 newNode.text(d[2]);
82 newNode.insertBefore(progressNode);
83 }
84+ if (atBottom) {
85+ w.scrollTop(s.attr('scrollHeight'))
86+ }
87 }
88 logLenth = xhr.getResponseHeader('X-Current-Size');
89 if (xhr.getResponseHeader('X-Is-Finished')) {

Subscribers

People subscribed via source and target branches