Merge pull request #1810 from jijiang/CA-268683

CA-268683: Turn on disable HA on unlicensed pool
This commit is contained in:
Mihaela Stoica 2017-10-11 17:07:49 +01:00 committed by GitHub
commit 3eed721f64
4 changed files with 18 additions and 4 deletions

View File

@ -1415,7 +1415,7 @@ namespace XenAdmin
bool show_home = SelectionManager.Selection.Count == 1 && SelectionManager.Selection[0].Value == null;
// The upsell pages use the first selected XenObject: but they're only shown if there is only one selected object (see calls to ShowTab() below).
bool dmc_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictDMC);
bool ha_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictHA);
bool ha_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictHA) && (selectionPool != null && !selectionPool.ha_enabled);
bool wlb_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictWLB);
bool ad_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictAD);
bool is_connected = selectionConnection != null && selectionConnection.IsConnected;

View File

@ -218,13 +218,15 @@ namespace XenAdmin.TabPages
if (PassedRbacChecks())
{
buttonConfigure.Visible = true;
buttonConfigure.Enabled = true;
bool haRestricted = Helpers.FeatureForbidden(pool, Host.RestrictHA);
buttonConfigure.Visible = !haRestricted;
buttonConfigure.Enabled = !haRestricted;
buttonEnableDisableHa.Visible = true;
buttonEnableDisableHa.Enabled = true;
pictureBoxWarningTriangle.Visible = false;
labelStatus.Text = string.Format(Messages.HA_TAB_CONFIGURED_BLURB, Helpers.GetName(pool).Ellipsise(30));
labelStatus.Text = string.Format(haRestricted ? Messages.HA_TAB_CONFIGURED_UNLICENSED : Messages.HA_TAB_CONFIGURED_BLURB, Helpers.GetName(pool).Ellipsise(30));
}
else
{

View File

@ -16776,6 +16776,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to HA is currently enabled for pool &apos;{0}&apos;..
/// </summary>
public static string HA_TAB_CONFIGURED_UNLICENSED {
get {
return ResourceManager.GetString("HA_TAB_CONFIGURED_UNLICENSED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unable to calculate maximum pool failure capacity..
/// </summary>

View File

@ -5899,6 +5899,9 @@ Reduce protection levels, or bring more servers online to increase the maximum s
Click Configure HA to alter the settings displayed below.</value>
</data>
<data name="HA_TAB_CONFIGURED_UNLICENSED" xml:space="preserve">
<value>HA is currently enabled for pool '{0}'.</value>
</data>
<data name="HA_UNABLE_TO_CALCULATE_MESSAGE" xml:space="preserve">
<value>Unable to calculate maximum pool failure capacity.</value>
</data>