use of org.ovirt.engine.ui.uicommonweb.models.HostMaintenanceConfirmationModel in project ovirt-engine by oVirt.
the class HostListModel method maintenance.
private void maintenance(boolean isMaintenanceReasonVisible, boolean supportsGlusterService) {
if (getConfirmWindow() != null) {
return;
}
HostMaintenanceConfirmationModel model = new HostMaintenanceConfirmationModel();
setConfirmWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().maintenanceHostsTitle());
model.setHelpTag(HelpTag.maintenance_host);
// $NON-NLS-1$
model.setHashName("maintenance_host");
model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToPlaceFollowingHostsIntoMaintenanceModeMsg());
model.setReasonVisible(isMaintenanceReasonVisible);
if (supportsGlusterService) {
model.getStopGlusterServices().setIsAvailable(true);
model.getStopGlusterServices().setEntity(false);
model.getForce().setIsAvailable(true);
model.getForce().setEntity(false);
model.setForceLabel(ConstantsManager.getInstance().getConstants().ignoreGlusterQuorumChecks());
}
// model.Items = SelectedItems.Cast<VDS>().Select(a => a.vds_name);
ArrayList<String> vdss = new ArrayList<>();
for (Object item : getSelectedItems()) {
VDS vds = (VDS) item;
vdss.add(vds.getName());
}
model.setItems(vdss);
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnMaintenance", this);
model.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("CancelConfirm", this);
model.getCommands().add(tempVar2);
}
use of org.ovirt.engine.ui.uicommonweb.models.HostMaintenanceConfirmationModel in project ovirt-engine by oVirt.
the class HostListModel method onMaintenance.
public void onMaintenance() {
HostMaintenanceConfirmationModel model = (HostMaintenanceConfirmationModel) getConfirmWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<Guid> vdss = new ArrayList<>();
for (Object item : getSelectedItems()) {
VDS vds = (VDS) item;
vdss.add(vds.getId());
}
MaintenanceNumberOfVdssParameters params = new MaintenanceNumberOfVdssParameters(vdss, false, model.getReason().getEntity(), model.getStopGlusterServices().getEntity(), model.getForce().getEntity());
cancelConfirm();
Frontend.getInstance().runAction(ActionType.MaintenanceNumberOfVdss, params);
}
use of org.ovirt.engine.ui.uicommonweb.models.HostMaintenanceConfirmationModel in project ovirt-engine by oVirt.
the class HostMaintenanceConfirmationPopupView method edit.
@Override
public void edit(HostMaintenanceConfirmationModel object) {
driver.edit(object);
// Bind "Latch.IsAvailable"
object.getLatch().getPropertyChangedEvent().addListener((ev, sender, args) -> {
if ("IsAvailable".equals(args.propertyName)) {
// $NON-NLS-1$
EntityModel entity = (EntityModel) sender;
if (entity.getIsAvailable()) {
latch.setVisible(true);
}
}
});
if (object.getForceLabel() != null) {
force.setLabel(object.getForceLabel());
}
force.asCheckBox().setValue(object.getForce().getEntity());
// Bind "Force.Label"
object.getPropertyChangedEvent().addListener((ev, sender, args) -> {
if ("ForceLabel".equals(args.propertyName)) {
// $NON-NLS-1$
ConfirmationModel entity = (ConfirmationModel) sender;
force.setLabel(entity.getForceLabel());
}
});
setNote(object.getNote());
// Bind "Note"
object.getPropertyChangedEvent().addListener((ev, sender, args) -> {
if ("Note".equals(args.propertyName)) {
// $NON-NLS-1$
ConfirmationModel entity = (ConfirmationModel) sender;
setNote(entity.getNote());
}
});
// Bind "ReasonVisible"
object.getPropertyChangedEvent().addListener((ev, sender, args) -> {
if ("ReasonVisible".equals(args.propertyName)) {
// $NON-NLS-1$
updateReasonVisibility((HostMaintenanceConfirmationModel) sender);
}
});
}
Aggregations