Search in sources :

Example 6 with HostModel

use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel in project ovirt-engine by oVirt.

the class ClusterGuideModel method addHost.

public void addHost() {
    HostModel model = new NewHostModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().newHostTitle());
    model.setHelpTag(HelpTag.new_host);
    // $NON-NLS-1$
    model.setHashName("new_host");
    model.getPort().setEntity(54321);
    model.getOverrideIpTables().setEntity(true);
    model.setSpmPriorityValue(null);
    model.getCluster().setSelectedItem(getEntity());
    model.getCluster().setIsChangeable(false);
    AsyncDataProvider.getInstance().getDataCenterList(new AsyncQuery<>(dataCenters -> {
        HostModel model1 = (HostModel) getWindow();
        model1.getDataCenter().setItems(dataCenters);
        if (getEntity().getStoragePoolId() != null) {
            model1.getDataCenter().setSelectedItem(Linq.firstOrNull(dataCenters, new Linq.IdPredicate<>(getEntity().getStoragePoolId())));
        }
        model1.getDataCenter().setIsChangeable(false);
        // $NON-NLS-1$
        UICommand tempVar = UICommand.createDefaultOkUiCommand("OnConfirmPMHost", ClusterGuideModel.this);
        model1.getCommands().add(tempVar);
        // $NON-NLS-1$
        UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", ClusterGuideModel.this);
        model1.getCommands().add(tempVar2);
    }));
}
Also used : HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) GuideModel(org.ovirt.engine.ui.uicommonweb.models.GuideModel) ArrayList(java.util.ArrayList) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ActionType(org.ovirt.engine.core.common.action.ActionType) Frontend(org.ovirt.engine.ui.frontend.Frontend) ManagementNetworkOnClusterOperationParameters(org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters) ChangeVDSClusterParameters(org.ovirt.engine.core.common.action.ChangeVDSClusterParameters) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) VdsActionParameters(org.ovirt.engine.core.common.action.VdsActionParameters) MoveHostData(org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHostData) Linq(org.ovirt.engine.ui.uicommonweb.Linq) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) ApproveVdsParameters(org.ovirt.engine.core.common.action.hostdeploy.ApproveVdsParameters) ApplicationModeHelper(org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper) MoveHost(org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost) List(java.util.List) VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) VDS(org.ovirt.engine.core.common.businessentities.VDS) Timer(com.google.gwt.user.client.Timer) AddVdsActionParameters(org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters) Linq(org.ovirt.engine.ui.uicommonweb.Linq) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel)

Example 7 with HostModel

use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel in project ovirt-engine by oVirt.

the class ClusterGuideModel method postOnAddHost.

public void postOnAddHost(ActionReturnValue returnValue) {
    HostModel model = (HostModel) getWindow();
    model.stopProgress();
    if (returnValue != null && returnValue.getSucceeded()) {
        cancel();
        postAction();
    }
}
Also used : HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel)

Example 8 with HostModel

use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel in project ovirt-engine by oVirt.

the class DataCenterGuideModel method addHost.

public void addHost() {
    final HostModel model = new NewHostModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().newHostTitle());
    model.setHelpTag(HelpTag.new_host_guide_me);
    // $NON-NLS-1$
    model.setHashName("new_host_guide_me");
    model.getPort().setEntity(54321);
    model.getOverrideIpTables().setEntity(true);
    model.setSpmPriorityValue(null);
    model.getDataCenter().setItems(Collections.singletonList(getEntity()), getEntity());
    model.getDataCenter().setIsChangeable(false);
    // $NON-NLS-1$
    UICommand tempVar = UICommand.createDefaultOkUiCommand("OnConfirmPMHost", this);
    tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok());
    tempVar.setIsDefault(true);
    model.getCommands().add(tempVar);
    // $NON-NLS-1$
    UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
    model.getCommands().add(tempVar2);
}
Also used : NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel)

Example 9 with HostModel

use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel in project ovirt-engine by oVirt.

the class DataCenterGuideModel method postOnAddHost.

public void postOnAddHost(ActionReturnValue returnValue) {
    HostModel model = (HostModel) getWindow();
    model.stopProgress();
    if (returnValue != null && returnValue.getSucceeded()) {
        cancel();
        postAction();
    }
}
Also used : NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel)

Example 10 with HostModel

use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel in project ovirt-engine by oVirt.

the class DataCenterGuideModel method onConfirmPMHost.

public void onConfirmPMHost() {
    HostModel model = (HostModel) getWindow();
    if (!model.validate()) {
        return;
    }
    if (!model.getIsPm().getEntity()) {
        ConfirmationModel confirmModel = new ConfirmationModel();
        setConfirmWindow(confirmModel);
        confirmModel.setTitle(ConstantsManager.getInstance().getConstants().powerManagementConfigurationTitle());
        confirmModel.setHelpTag(HelpTag.power_management_configuration);
        // $NON-NLS-1$
        confirmModel.setHashName("power_management_configuration");
        confirmModel.setMessage(ConstantsManager.getInstance().getConstants().youHavntConfigPmMsg());
        // $NON-NLS-1$
        UICommand tempVar = UICommand.createDefaultOkUiCommand("OnAddHost", this);
        confirmModel.getCommands().add(tempVar);
        // $NON-NLS-1$
        UICommand tempVar2 = UICommand.createCancelUiCommand("CancelConfirmWithFocus", this);
        confirmModel.getCommands().add(tempVar2);
    } else {
        onAddHost();
    }
}
Also used : NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Aggregations

HostModel (org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel)11 NewHostModel (org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel)10 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)5 VDS (org.ovirt.engine.core.common.businessentities.VDS)4 AddVdsActionParameters (org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters)3 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)2 ApplicationMode (org.ovirt.engine.core.common.mode.ApplicationMode)2 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)2 GWT (com.google.gwt.core.client.GWT)1 Scheduler (com.google.gwt.core.client.Scheduler)1 Element (com.google.gwt.dom.client.Element)1 Display (com.google.gwt.dom.client.Style.Display)1 TextDecoration (com.google.gwt.dom.client.Style.TextDecoration)1 HasClickHandlers (com.google.gwt.event.dom.client.HasClickHandlers)1 EventBus (com.google.gwt.event.shared.EventBus)1 CssResource (com.google.gwt.resources.client.CssResource)1 SafeHtmlUtils (com.google.gwt.safehtml.shared.SafeHtmlUtils)1 UiBinder (com.google.gwt.uibinder.client.UiBinder)1 UiField (com.google.gwt.uibinder.client.UiField)1 Timer (com.google.gwt.user.client.Timer)1