-
Notifications
You must be signed in to change notification settings - Fork 382
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
#6371 get rid of the OK button #6487
Conversation
beakerx/beakerx/static/tree.js
Outdated
function _setupContinuousSync() { | ||
var lastSyncedTs = null; | ||
function synchronizeTick() { | ||
setTimeout(function() { |
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.
wouldn't it be better to use _.debounce instead of implementing the same idea ourselves?
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.
@scottdraves sorry i missed this comment
@@ -38,7 +46,11 @@ | |||
<div class="beakerx_container"> | |||
<form id="beakerx_jvm_settings_form" class="form-horizontal"> | |||
<fieldset id="default_options"> | |||
<legend>JVM Options:</legend> | |||
<legend>JVM Options: <span id="sync_indicator"> |
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.
please move the sync indicator to the bottom, where the "Result" string is, and where the errors are shown.
thanks that's better.
|
Moved sync indicator ad 2. and 3. ad 1. for egzample sending |
thanks. after #6511 is fixed then we should be able to remove "rebuilding" the form, so focus is not lost. |
OK please bring up to date with master and continue. |
Done |
Great, this is very close. the remaining problem: if the heap size field is bad, then it should not be sent to server.
|
Should be OK now |
return ''; | ||
} | ||
|
||
var parsedVal = parseFloat(val); |
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.
this is broken, please do not change how valid numbers are identified, it's actually quite tricky.
parseFloat("5a") = 5
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 did not change the way it was identified
see:
beakerx/beakerx/beakerx/static/tree.js
Lines 54 to 64 in 27dab19
var val = $("#heap_GB").val().trim(); | |
if (val.length > 0) { | |
if (!isNaN(val)) { | |
if (val % 1 === 0) { | |
result += '-Xmx' + val + 'g ' | |
} else { | |
result += '-Xmx' + parseInt(val * 1024) + 'm ' | |
} | |
} | |
} |
beakerx/beakerx/beakerx/static/tree.js
Lines 98 to 101 in 27dab19
if (val.length > 0 && isNaN(val)) { | |
$('#errors').append($('<span>').text("Heap Size must be a decimal number.")); | |
enable_button = false; | |
} |
All i did with it was a little extraction refactor, because i needed that logic in two different places.
I added additional check
- isFinite(val) will catch "5a"
also if i type a bad heap size, i can see the "sync" seems to run, it turns yellow and then goes green. |
"sync" issue you mentioned is fixed now Should there be some logic to prevent sending valid large numbers like "2e64"? |
i merged this by mistake and then reverted it.
it should be like this:
please fix this and make a new PR.
no |
Fixed and created new PR #6614 |
Additionally because of code refactor it contains fix for: