-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto reload result page on state change from scheduled to running #940
Conversation
else if (state == "scheduled") { | ||
// reload when test starts | ||
window.setInterval(function() { | ||
$.ajax("/tests/" + jobid + "/status").done(function(newStatus) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't hard code URLs in javascript - I thought I told you yesterday
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed.
264eb99
to
a428e17
Compare
Good approach |
window.setInterval(function() { | ||
$.ajax(status_url).done(function(newStatus) { | ||
if (newStatus.state == 'running' || newStatus.state == 'waiting') { | ||
setTimeout(function() {location.href = location.href.replace(/#.*/, '');}, 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we shouldn't just reload if the status changed. If the job goes from scheduled to obsoleted, you want to know too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
a428e17
to
e62aed9
Compare
Now of course I wonder if this can't be tested. |
it's not obvious how, but as this is not a critical feature put some thought into it |
e62aed9
to
28e17b5
Compare
Rebased. |
The complete js code on the running page is not tested because phantomJS doesn't like our websocket stuff. Also I don't see a way of updating the db that is used by the phantomJS mojo instance while the mojo instance is running. |
See https://progress.opensuse.org/issues/2238