use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class HostInterfaceListModel method onSaveNetworkConfig.
public void onSaveNetworkConfig() {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
model.startProgress();
new SaveNetworkConfigAction(this, model, getEntity()).execute();
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class HostListModel method stop.
public void stop(String uiCommand) {
ConfirmationModel model = new ConfirmationModel();
setConfirmWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().stopHostsTitle());
model.setHelpTag(HelpTag.stop_host);
// $NON-NLS-1$
model.setHashName("stop_host");
model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToStopTheFollowingHostsMsg());
// model.Items = SelectedItems.Cast<VDS>().Select(a => a.vds_name);
ArrayList<String> items = new ArrayList<>();
for (Object item : getSelectedItems()) {
VDS vds = (VDS) item;
items.add(vds.getName());
}
model.setItems(items);
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand(uiCommand, this);
model.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
model.getCommands().add(tempVar2);
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class HostListModel method onSshRestart.
public void onSshRestart() {
ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VDS vds = (VDS) item;
VdsActionParameters params = new VdsActionParameters(vds.getId());
params.setPrevVdsStatus(vds.getStatus());
list.add(params);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.SshHostReboot, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancelConfirm();
}, model);
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class HostListModel method onStop.
public void onStop() {
ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VDS vds = (VDS) item;
list.add(new FenceVdsActionParameters(vds.getId()));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.StopVds, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancelConfirm();
}, model);
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class HostListModel method onManualFence.
public void onManualFence() {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
if (!model.validate()) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VDS vds = (VDS) item;
FenceVdsManualyParameters parameters = new FenceVdsManualyParameters(true);
parameters.setStoragePoolId(vds.getStoragePoolId());
parameters.setVdsId(vds.getId());
list.add(parameters);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.FenceVdsManualy, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
Aggregations