Skip to content

Commit

Permalink
Added MVP of #219
Browse files Browse the repository at this point in the history
I still need to make this a bit friendlier, but hey heres an MVP (Minimal Viable Product)
  • Loading branch information
michael-manley committed Feb 10, 2024
1 parent b413fd2 commit 777765f
Show file tree
Hide file tree
Showing 10 changed files with 818 additions and 90 deletions.
12 changes: 12 additions & 0 deletions XenAdmin/Wizards/NewSRWizard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public partial class NewSRWizard : XenWizardBase
private readonly ChooseSrTypePage xenTabPageChooseSrType;
private readonly ChooseSrProvisioningPage xenTabPageChooseSrProv;
private readonly RBACWarningPage xenTabPageRbacWarning;
private readonly LocalStorageFrontend xenTabPageLocalStorage;
#endregion

/// <summary>
Expand Down Expand Up @@ -109,6 +110,7 @@ internal NewSRWizard(IXenConnection connection, SR srToReattach, bool disasterRe
xenTabPageRbacWarning = new RBACWarningPage((srToReattach == null && !disasterRecoveryTask)
? Messages.RBAC_WARNING_PAGE_DESCRIPTION_SR_CREATE
: Messages.RBAC_WARNING_PAGE_DESCRIPTION_SR_ATTACH);
xenTabPageLocalStorage = new LocalStorageFrontend();

//do not use virtual members in constructor
var format = (srToReattach == null && !disasterRecoveryTask)
Expand Down Expand Up @@ -291,6 +293,8 @@ protected override void UpdateWizardContent(XenTabPage senderPage)
AddPage(xenTabPageCifs);
else if (m_srWizardType is SrWizardType_NfsIso)
AddPage(xenTabPageNfsIso);
else if (m_srWizardType is SrWizardType_LocalStorage)
AddPage(xenTabPageLocalStorage);

xenTabPageSrName.SrWizardType = m_srWizardType;
xenTabPageSrName.MatchingFrontends = xenTabPageChooseSrType.MatchingFrontends;
Expand Down Expand Up @@ -319,6 +323,8 @@ protected override void UpdateWizardContent(XenTabPage senderPage)
xenTabPageCifs.SrWizardType = m_srWizardType;
else if (m_srWizardType is SrWizardType_Fcoe)
xenTabPageLvmoFcoe.SrWizardType = m_srWizardType;
else if (m_srWizardType is SrWizardType_LocalStorage)
xenTabPageLocalStorage.SrWizardType = m_srWizardType;
#endregion
}
else if (senderPagetype == typeof(ChooseSrProvisioningPage))
Expand Down Expand Up @@ -358,6 +364,12 @@ protected override void UpdateWizardContent(XenTabPage senderPage)
m_srWizardType.DeviceConfig = xenTabPageVhdoNFS.DeviceConfig;
SetCustomDescription(m_srWizardType, xenTabPageVhdoNFS.SrDescription);
}
else if (senderPagetype == typeof(LocalStorageFrontend))
{
m_srWizardType.UUID = xenTabPageLocalStorage.UUID;
m_srWizardType.DeviceConfig = xenTabPageLocalStorage.DeviceConfig;
SetCustomDescription(m_srWizardType, xenTabPageLocalStorage.SrDescription);
}
}

private static void SetCustomDescription(SrWizardType srwizardtype, string description)
Expand Down
19 changes: 15 additions & 4 deletions XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ public ChooseSrTypePage()
radioButtonCifsIso.Tag = new SrWizardType_CifsIso();
radioButtonCifs.Tag = new SrWizardType_Cifs();
radioButtonFcoe.Tag = new SrWizardType_Fcoe();
radioButtonLS.Tag = new SrWizardType_LocalStorage();

_radioButtons = new[]
{
radioButtonNfs, radioButtonIscsi, radioButtonFibreChannel,
radioButtonCifs, radioButtonFcoe,
radioButtonCifs, radioButtonFcoe, radioButtonLS,
radioButtonNfsIso, radioButtonCifsIso
};
}
Expand Down
Loading

0 comments on commit 777765f

Please sign in to comment.