[CP-17415] XC: Add awareness of new AD feature flag

Added awareness; basic license now shows upsell tab and premium license shows full feature tab.

Signed-off-by: Frederico Mazzone <fredericom@citrite.net>
This commit is contained in:
Frederico Mazzone 2016-05-20 13:01:51 +01:00
parent 5ba776d0bf
commit 9a729e2547
9 changed files with 126 additions and 25 deletions

View File

@ -280,6 +280,7 @@ namespace XenAdmin
this.StatusStrip = new System.Windows.Forms.StatusStrip();
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.statusProgressBar = new System.Windows.Forms.ToolStripProgressBar();
this.TabPageADUpsell = new System.Windows.Forms.TabPage();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@ -353,6 +354,7 @@ namespace XenAdmin
this.TheTabControl.Controls.Add(this.TabPageWLB);
this.TheTabControl.Controls.Add(this.TabPageWLBUpsell);
this.TheTabControl.Controls.Add(this.TabPageAD);
this.TheTabControl.Controls.Add(this.TabPageADUpsell);
this.TheTabControl.Controls.Add(this.TabPageGPU);
this.TheTabControl.Controls.Add(this.TabPageSearch);
this.TheTabControl.Controls.Add(this.TabPageDockerProcess);
@ -1837,6 +1839,12 @@ namespace XenAdmin
this.statusProgressBar.Name = "statusProgressBar";
this.statusProgressBar.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never;
//
// TabPageADUpsell
//
resources.ApplyResources(this.TabPageADUpsell, "TabPageADUpsell");
this.TabPageADUpsell.Name = "TabPageADUpsell";
this.TabPageADUpsell.UseVisualStyleBackColor = true;
//
// MainWindow
//
resources.ApplyResources(this, "$this");
@ -2098,6 +2106,7 @@ namespace XenAdmin
private CommandToolStripButton resumeContainerToolStripButton;
private CommandToolStripButton restartContainerToolStripButton;
private CommandToolStripMenuItem healthCheckToolStripMenuItem1;
private TabPage TabPageADUpsell;
}
}

View File

@ -97,6 +97,7 @@ namespace XenAdmin
internal readonly PhysicalStoragePage PhysicalStoragePage = new PhysicalStoragePage();
internal readonly VMStoragePage VMStoragePage = new VMStoragePage();
internal readonly AdPage AdPage = new AdPage();
internal readonly ADUpsellPage AdUpsellPage = new ADUpsellPage();
internal readonly GpuPage GpuPage = new GpuPage();
internal readonly DockerProcessPage DockerProcessPage = new DockerProcessPage();
internal readonly DockerDetailsPage DockerDetailsPage = new DockerDetailsPage();
@ -178,6 +179,7 @@ namespace XenAdmin
AddTabContents(WLBUpsellPage, TabPageWLBUpsell);
AddTabContents(PhysicalStoragePage, TabPagePhysicalStorage);
AddTabContents(AdPage, TabPageAD);
AddTabContents(AdUpsellPage, TabPageADUpsell);
AddTabContents(GpuPage, TabPageGPU);
AddTabContents(SearchPage, TabPageSearch);
AddTabContents(DockerProcessPage, TabPageDockerProcess);
@ -1359,6 +1361,7 @@ namespace XenAdmin
bool dmc_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictDMC);
bool ha_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictHA);
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;
bool multi = SelectionManager.Selection.Count > 1;
@ -1408,7 +1411,7 @@ namespace XenAdmin
if(!(SelectionManager.Selection.All(s => Helpers.IsClearwater(s.Connection)) || wlb_upsell ))
ShowTab(TabPageWLB, !multi && !SearchMode && isPoolSelected);
ShowTab(TabPageAD, !multi && !SearchMode && (isPoolSelected || isHostSelected && isHostLive));
ShowTab(ad_upsell ? TabPageADUpsell : TabPageAD, !multi && !SearchMode && (isPoolSelected || isHostSelected && isHostLive));
foreach (TabPageFeature f in pluginManager.GetAllFeatures<TabPageFeature>(f => !f.IsConsoleReplacement && !multi && f.ShowTab))
ShowTab(f.TabPage, true);

View File

@ -684,6 +684,33 @@
<data name="&gt;&gt;TabPageAD.ZOrder" xml:space="preserve">
<value>16</value>
</data>
<data name="TabPageADUpsell.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
</data>
<data name="TabPageADUpsell.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="TabPageADUpsell.Size" type="System.Drawing.Size, System.Drawing">
<value>753, 592</value>
</data>
<data name="TabPageADUpsell.TabIndex" type="System.Int32, mscorlib">
<value>21</value>
</data>
<data name="TabPageADUpsell.Text" xml:space="preserve">
<value>Users</value>
</data>
<data name="&gt;&gt;TabPageADUpsell.Name" xml:space="preserve">
<value>TabPageADUpsell</value>
</data>
<data name="&gt;&gt;TabPageADUpsell.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;TabPageADUpsell.Parent" xml:space="preserve">
<value>TheTabControl</value>
</data>
<data name="&gt;&gt;TabPageADUpsell.ZOrder" xml:space="preserve">
<value>17</value>
</data>
<data name="TabPageGPU.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
</data>
@ -706,7 +733,7 @@
<value>TheTabControl</value>
</data>
<data name="&gt;&gt;TabPageGPU.ZOrder" xml:space="preserve">
<value>17</value>
<value>18</value>
</data>
<data name="TabPageSearch.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@ -736,7 +763,7 @@
<value>TheTabControl</value>
</data>
<data name="&gt;&gt;TabPageSearch.ZOrder" xml:space="preserve">
<value>18</value>
<value>19</value>
</data>
<data name="TabPageDockerProcess.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
@ -766,7 +793,7 @@
<value>TheTabControl</value>
</data>
<data name="&gt;&gt;TabPageDockerProcess.ZOrder" xml:space="preserve">
<value>19</value>
<value>20</value>
</data>
<data name="TabPageDockerDetails.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@ -796,7 +823,7 @@
<value>TheTabControl</value>
</data>
<data name="&gt;&gt;TabPageDockerDetails.ZOrder" xml:space="preserve">
<value>20</value>
<value>21</value>
</data>
<data name="TheTabControl.Font" type="System.Drawing.Font, System.Drawing">
<value>Verdana, 8.25pt</value>
@ -1699,13 +1726,13 @@
<value>163, 5</value>
</metadata>
<data name="ShowToolbarMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>147, 22</value>
<value>146, 22</value>
</data>
<data name="ShowToolbarMenuItem.Text" xml:space="preserve">
<value>Show &amp;Toolbar</value>
</data>
<data name="ToolBarContextMenu.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 26</value>
<value>147, 26</value>
</data>
<data name="&gt;&gt;ToolBarContextMenu.Name" xml:space="preserve">
<value>ToolBarContextMenu</value>
@ -2523,7 +2550,7 @@
<value>False</value>
</data>
<data name="helpTopicsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
<value>228, 22</value>
</data>
<data name="helpTopicsToolStripMenuItem.Text" xml:space="preserve">
<value>Help &amp;Contents</value>
@ -2532,46 +2559,46 @@
<value>F1</value>
</data>
<data name="helpContextMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
<value>228, 22</value>
</data>
<data name="helpContextMenuItem.Text" xml:space="preserve">
<value>Conte&amp;xt Help</value>
</data>
<data name="toolStripMenuItem15.Size" type="System.Drawing.Size, System.Drawing">
<value>192, 6</value>
<value>225, 6</value>
</data>
<data name="viewApplicationLogToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
<value>228, 22</value>
</data>
<data name="viewApplicationLogToolStripMenuItem.Text" xml:space="preserve">
<value>View [XenCenter] &amp;Log Files</value>
</data>
<data name="toolStripMenuItem17.Size" type="System.Drawing.Size, System.Drawing">
<value>192, 6</value>
<value>225, 6</value>
</data>
<data name="xenSourceOnTheWebToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
<value>228, 22</value>
</data>
<data name="xenSourceOnTheWebToolStripMenuItem.Text" xml:space="preserve">
<value>[XenServer product] on the &amp;Web</value>
</data>
<data name="xenCenterPluginsOnlineToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
<value>228, 22</value>
</data>
<data name="xenCenterPluginsOnlineToolStripMenuItem.Text" xml:space="preserve">
<value>[XenCenter] &amp;Plugins online</value>
</data>
<data name="toolStripSeparator7.Size" type="System.Drawing.Size, System.Drawing">
<value>192, 6</value>
<value>225, 6</value>
</data>
<data name="pluginItemsPlaceHolderToolStripMenuItem8.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
<value>228, 22</value>
</data>
<data name="pluginItemsPlaceHolderToolStripMenuItem8.Text" xml:space="preserve">
<value>PluginItemsPlaceHolder</value>
</data>
<data name="aboutXenSourceAdminToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
<value>228, 22</value>
</data>
<data name="aboutXenSourceAdminToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;About [XenCenter]</value>

View File

@ -52,26 +52,35 @@ namespace XenAdmin.TabPages
}
}
public class ADUpsellPage : UpsellTabPage
{
public ADUpsellPage()
: base(Messages.ACTIVE_DIRECTORY_TAB_TITLE, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_AD :
Messages.UPSELL_BLURB_AD + Messages.UPSELL_BLURB_AD_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_AD)
{ }
}
public class BallooningUpsellPage : UpsellTabPage
{
public BallooningUpsellPage()
: base(Messages.DYNAMIC_MEMORY_CONTROL, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_DMC : Messages.UPSELL_BLURB_DMC + Messages.UPSELL_BLURB_DMC_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_DMC)
: base(Messages.DYNAMIC_MEMORY_CONTROL, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_DMC :
Messages.UPSELL_BLURB_DMC + Messages.UPSELL_BLURB_DMC_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_DMC)
{ }
}
public class HAUpsellPage : UpsellTabPage
{
public HAUpsellPage()
: base(Messages.HIGH_AVAILABILITY, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_HA : Messages.UPSELL_BLURB_HA + Messages.UPSELL_BLURB_HA_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_HA)
: base(Messages.HIGH_AVAILABILITY, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_HA :
Messages.UPSELL_BLURB_HA + Messages.UPSELL_BLURB_HA_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_HA)
{ }
}
public class WLBUpsellPage : UpsellTabPage
{
public WLBUpsellPage()
: base(Messages.WORKLOAD_BALANCING,
HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_WLB : Messages.UPSELL_BLURB_WLB + Messages.UPSELL_BLURB_WLB_MORE,
InvisibleMessages.UPSELL_LEARNMOREURL_WLB)
: base(Messages.WORKLOAD_BALANCING, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_WLB :
Messages.UPSELL_BLURB_WLB + Messages.UPSELL_BLURB_WLB_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_WLB)
{ }
}
}

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -258,6 +258,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to http://www.citrix.com/xenserver/le/features/ad.
/// </summary>
public static string UPSELL_LEARNMOREURL_AD {
get {
return ResourceManager.GetString("UPSELL_LEARNMOREURL_AD", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to http://www.citrix.com/xenserver/le/features/alerts.
/// </summary>

View File

@ -246,4 +246,7 @@
<data name="XENSERVER_UPDATE_URL" xml:space="preserve">
<value>http://updates.xensource.com/XenServer/updates.xml</value>
</data>
<data name="UPSELL_LEARNMOREURL_AD" xml:space="preserve">
<value>http://www.citrix.com/xenserver/le/features/ad</value>
</data>
</root>

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18444
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -33147,6 +33147,26 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Upgrade your [XenServer] license to enable Active Directory. Active Directory allows you to configure [XenServer] access control by adding named user accounts..
/// </summary>
public static string UPSELL_BLURB_AD {
get {
return ResourceManager.GetString("UPSELL_BLURB_AD", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to
///
///To learn more about the [XenServer] Active Directory feature or to start a [XenServer] trial, click the button below..
/// </summary>
public static string UPSELL_BLURB_AD_MORE {
get {
return ResourceManager.GetString("UPSELL_BLURB_AD_MORE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Upgrade your [XenServer] license to enable Alerting and Reporting capabilities. Email based performance and error alerting will proactively notify administrators of error conditions or performance problems before they affect critical services..
/// </summary>

View File

@ -11491,6 +11491,14 @@ Note that if RBAC is enabled, only updates which you have privileges to dismiss
<data name="UPLOAD_PATCH_UPLOADED" xml:space="preserve">
<value>Uploaded</value>
</data>
<data name="UPSELL_BLURB_AD" xml:space="preserve">
<value>Upgrade your [XenServer] license to enable Active Directory. Active Directory allows you to configure [XenServer] access control by adding named user accounts.</value>
</data>
<data name="UPSELL_BLURB_AD_MORE" xml:space="preserve">
<value>
To learn more about the [XenServer] Active Directory feature or to start a [XenServer] trial, click the button below.</value>
</data>
<data name="UPSELL_BLURB_ALERTS" xml:space="preserve">
<value>Upgrade your [XenServer] license to enable Alerting and Reporting capabilities. Email based performance and error alerting will proactively notify administrators of error conditions or performance problems before they affect critical services.</value>
</data>

View File

@ -456,6 +456,19 @@ namespace XenAPI
return h._RestrictIntraPoolMigrate;
}
/// <summary>
/// Active directory is restricted only if the "restrict_ad" key exists and it is true
/// </summary>
private bool _RestrictAD
{
get { return BoolKey(license_params, "restrict_ad"); }
}
public static bool RestrictAD(Host h)
{
return h._RestrictAD;
}
private bool _RestrictReadCaching
{
get { return BoolKeyPreferTrue(license_params, "restrict_read_caching"); }