mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-12-30 07:40:13 +01:00
8ce3dc9952
- Check call home enrollment status on connecting to a pool: If status is unknown it means that the pool is not enrolled (enabled) and has never been (disabled). If that's the case, then show the Health Check Overview dialog with the pool selected - "Enroll now" on Health Check Overview will try enroll the selected pool into call home using existing token authentication. If this is not possible, then a dialog will be presented for the user to perform the initial authentication.
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using System.Linq;
|
|
using XenAdmin.Dialogs;
|
|
using XenAdmin.Dialogs.CallHome;
|
|
|
|
namespace XenAdmin.Commands
|
|
{
|
|
internal class CallHomeCommand : Command
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of this Command. The parameter-less constructor is required if
|
|
/// this Command is to be attached to a ToolStrip menu item or button. It should not be used in any other scenario.
|
|
/// </summary>
|
|
public CallHomeCommand()
|
|
{
|
|
}
|
|
|
|
public CallHomeCommand(IMainWindow mainWindow)
|
|
: base(mainWindow)
|
|
{
|
|
}
|
|
|
|
protected override void ExecuteCore(SelectedItemCollection selection)
|
|
{
|
|
if (Program.MainWindow.HealthCheckOverviewLauncher != null)
|
|
Program.MainWindow.HealthCheckOverviewLauncher.LaunchIfRequired(false, selection);
|
|
}
|
|
|
|
protected override bool CanExecuteCore(SelectedItemCollection selection)
|
|
{
|
|
return ConnectionsManager.XenConnectionsCopy.Any(xenConnection => xenConnection.IsConnected);
|
|
}
|
|
}
|
|
}
|