Commit cdd60e03 authored by Leigh Stoller's avatar Leigh Stoller

Change previous revision wrt terminate/freeze to allow quarantine or

terminate instead.
parent 7f170620
This diff is collapsed.
......@@ -264,11 +264,7 @@ $(function ()
lockdown_override});
xmlthing.done(callback);
});
// Warn/Kill an experiment.
$('#warnkill-experiment-button').click(function (event) {
event.preventDefault();
WarnExperiment();
});
SetupWarnKill();
// Handler for select/deselect all rows in the list view.
$('#select-all').change(function () {
......@@ -670,6 +666,12 @@ $(function ()
if (expinfo.admin_lockdown || !window.APT_OPTIONS.canterminate) {
terminate = 0;
}
// Or if paniced, most buttons disabled.
if (expinfo.paniced) {
terminate = extend = snapshot = destroy = 0;
refresh = reloadtopo = 0;
}
ButtonState('terminate', terminate);
ButtonState('refresh', refresh);
ButtonState('reloadtopo', reloadtopo);
......@@ -3461,6 +3463,28 @@ $(function ()
/*
* Terminate with cause and optionally freeze user.
*/
function SetupWarnKill()
{
$('#warnkill-experiment-button').click(function (event) {
event.preventDefault();
WarnExperiment();
});
// The Terminate/quarantine is a radio that can be unselected.
$('#destroy-quarantine-checkbox').change(function () {
if ($('#destroy-quarantine-checkbox').is(':checked')) {
// Flip the other checkbox off
$('#destroy-terminate-checkbox').prop("checked", false);
}
});
$('#destroy-terminate-checkbox').change(function () {
if ($('#destroy-terminate-checkbox').is(':checked')) {
// Flip the other checkbox off
$('#destroy-quarantine-checkbox').prop("checked", false);
}
});
}
function WarnExperiment()
{
// Handler for the Snapshot confirm button.
......@@ -3469,6 +3493,7 @@ $(function ()
event.preventDefault();
var reason = $('#destroy-experiment-reason').val();
var kill = $('#destroy-terminate-checkbox').is(':checked');
var panic = $('#destroy-quarantine-checkbox').is(':checked');
var freeze = $('#destroy-freeze-checkbox').is(':checked');
var args = {"uuid" : uuid};
if (reason != "") {
......@@ -3480,6 +3505,9 @@ $(function ()
if (kill) {
args["terminate"] = true;
}
else if (panic) {
args["quarantine"] = true;
}
sup.HideModal("#destroy-experiment-modal", function () {
sup.ShowWaitWait();
sup.CallServerMethod(null, "status", "Warn", args,
......
......@@ -1903,10 +1903,13 @@ function Do_WarnExperiment()
chmod($filename, 0666);
$options = "-f $filename ";
}
# Terminate experiment
# Terminate or Quarantine experiment
if (isset($ajax_args["terminate"]) && $ajax_args["terminate"]) {
$options .= "-T ";
}
elseif (isset($ajax_args["quarantine"]) && $ajax_args["quarantine"]) {
$options .= "-Q ";
}
# Freeze user
if (isset($ajax_args["freeze"]) && $ajax_args["freeze"]) {
$options .= "-F ";
......
......@@ -18,11 +18,16 @@
class='form-control' rows=5></textarea>
</div>
<input type=checkbox
id='destroy-quarantine-checkbox' value=yes>
Quarantine Experiment or
<input type=checkbox style="margin-left: 5px"
id='destroy-terminate-checkbox' value=yes>
Terminate Experiment
<input type=checkbox style="margin-left: 20px"
<div>
<input type=checkbox
id='destroy-freeze-checkbox' value=yes>
Freeze User?
</div>
<div style="margin-top: 10px;">
<button class='btn btn-primary'
style="margin-right: 10px;"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment