Merge of upstream

This commit is contained in:
Alexander Schulz 2020-02-06 23:41:49 +01:00
parent c3dcc35d30
commit 20e9b8b994
9 changed files with 5068 additions and 4950 deletions

View File

@ -958,50 +958,51 @@ namespace XenAdmin.Core
public static void CheckHotfixEligibility(IXenConnection connection)
{
var master = Helpers.GetMaster(connection);
if (master == null)
return;
//var master = Helpers.GetMaster(connection);
//if (master == null)
// return;
var hotfixEligibility = HotfixEligibility(master, out var xenServerVersion);
//var hotfixEligibility = HotfixEligibility(master, out var xenServerVersion);
if (!HotfixEligibilityAlert.IsAlertNeeded(hotfixEligibility, xenServerVersion, !master.IsFreeLicenseOrExpired()))
{
Alert.RemoveAlert(a => a is HotfixEligibilityAlert && connection.Equals(a.Connection));
return;
}
//if (!HotfixEligibilityAlert.IsAlertNeeded(hotfixEligibility, xenServerVersion, !master.IsFreeLicenseOrExpired()))
//{
// Alert.RemoveAlert(a => a is HotfixEligibilityAlert && connection.Equals(a.Connection));
// return;
//}
//var alertIndex = Alert.FindAlertIndex(a => a is HotfixEligibilityAlert alert && connection.Equals(alert.Connection) && xenServerVersion == alert.Version);
//if (alertIndex == -1)
//{
// Alert.RemoveAlert(a => a is HotfixEligibilityAlert && connection.Equals(a.Connection)); // ensure that there is no other alert for this connection
// Alert.AddAlert(new HotfixEligibilityAlert(connection, xenServerVersion));
//}
//else
// Alert.RefreshAlertAt(alertIndex);
var alertIndex = Alert.FindAlertIndex(a => a is HotfixEligibilityAlert alert && connection.Equals(alert.Connection) && xenServerVersion == alert.Version);
if (alertIndex == -1)
{
Alert.RemoveAlert(a => a is HotfixEligibilityAlert && connection.Equals(a.Connection)); // ensure that there is no other alert for this connection
Alert.AddAlert(new HotfixEligibilityAlert(connection, xenServerVersion));
}
else
Alert.RefreshAlertAt(alertIndex);
}
public static void CheckHotfixEligibility()
{
var alerts = new List<HotfixEligibilityAlert>();
//var alerts = new List<HotfixEligibilityAlert>();
foreach (var connection in ConnectionsManager.XenConnectionsCopy)
{
if (!connection.IsConnected)
continue;
//foreach (var connection in ConnectionsManager.XenConnectionsCopy)
//{
// if (!connection.IsConnected)
// continue;
var master = Helpers.GetMaster(connection);
if (master == null)
continue;
// var master = Helpers.GetMaster(connection);
// if (master == null)
// continue;
var hotfixEligibility = HotfixEligibility(master, out var xenServerVersion);
if (!HotfixEligibilityAlert.IsAlertNeeded(hotfixEligibility, xenServerVersion, !master.IsFreeLicenseOrExpired()))
continue;
// var hotfixEligibility = HotfixEligibility(master, out var xenServerVersion);
// if (!HotfixEligibilityAlert.IsAlertNeeded(hotfixEligibility, xenServerVersion, !master.IsFreeLicenseOrExpired()))
// continue;
alerts.Add(new HotfixEligibilityAlert(connection, xenServerVersion));
}
// alerts.Add(new HotfixEligibilityAlert(connection, xenServerVersion));
//}
Alert.RemoveAlert(a => a is HotfixEligibilityAlert);
Alert.AddAlertRange(alerts);
//Alert.RemoveAlert(a => a is HotfixEligibilityAlert);
//Alert.AddAlertRange(alerts);
}
}
}

View File

@ -55,11 +55,11 @@ namespace XenAdmin.Help
if (string.IsNullOrEmpty(HelpUrl))
{
HelpUrl = InvisibleMessages.HELP_URL;
//HelpUrl = InvisibleMessages.HELP_URL;
HelpQuery = string.Format(InvisibleMessages.HELP_URL_QUERY,
$"{Branding.XENCENTER_VERSION}.{Program.Version.Revision}".Replace('.', '_'),
Messages.XENCENTER);
//HelpQuery = string.Format(InvisibleMessages.HELP_URL_QUERY,
// $"{Branding.XENCENTER_VERSION}.{Program.Version.Revision}".Replace('.', '_'),
// Messages.XENCENTER);
}
}

View File

@ -1361,7 +1361,7 @@ namespace XenAdmin.Properties {
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap _000_UserAndGroup_h32bit_16 {
get {
@ -1371,7 +1371,7 @@ namespace XenAdmin.Properties {
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap _000_UserAndGroup_h32bit_32 {
get {
@ -2821,7 +2821,7 @@ namespace XenAdmin.Properties {
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap redhat_16x {
get {
@ -3461,7 +3461,7 @@ namespace XenAdmin.Properties {
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap xcm_32x32 {
get {
@ -3471,7 +3471,7 @@ namespace XenAdmin.Properties {
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap XS {
get {

View File

@ -1132,7 +1132,6 @@
<data name="_000_VMPausedDisabled_h32bit_16_green" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Images\000_VMPausedDisabled_h32bit_16_green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
<data name="_000_UserAndGroup_h32bit_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\000_userandgroup_h32bit_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

View File

@ -110,12 +110,8 @@ namespace XenAdmin.TabPages
if (xenObject is Pool p)
{
var additionalString = PoolAdditionalLicenseString();
pdSectionGeneral.UpdateEntryValueWithKey(
Messages.POOL_LICENSE,
additionalString != string.Empty
? string.Format(Messages.MAINWINDOW_CONTEXT_REASON, Helpers.GetFriendlyLicenseName(p), additionalString)
: Helpers.GetFriendlyLicenseName(p),
Messages.POOL_LICENSE, Helpers.GetFriendlyLicenseName(p),
true);
}
});
@ -1102,13 +1098,13 @@ namespace XenAdmin.TabPages
pdSectionVersion.AddEntry(Messages.SOFTWARE_VERSION_BUILD_NUMBER, host.software_version["build_number"]);
if (host.software_version.ContainsKey("product_version"))
{
var hotfixEligibilityString = AdditionalVersionString(host);
if (string.IsNullOrEmpty(hotfixEligibilityString))
//var hotfixEligibilityString = AdditionalVersionString(host);
//if (string.IsNullOrEmpty(hotfixEligibilityString))
pdSectionVersion.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION, host.ProductVersionText());
else
pdSectionVersion.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION,
string.Format(Messages.MAINWINDOW_CONTEXT_REASON, host.ProductVersionText(), hotfixEligibilityString),
Color.Red);
//else
// pdSectionVersion.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION,
// string.Format(Messages.MAINWINDOW_CONTEXT_REASON, host.ProductVersionText(), hotfixEligibilityString),
// Color.Red);
}
if (host.software_version.ContainsKey("dbv"))
pdSectionVersion.AddEntry("DBV", host.software_version["dbv"]);
@ -1342,38 +1338,34 @@ namespace XenAdmin.TabPages
Pool p = xenObject as Pool;
if (p != null)
{
var additionalString = PoolAdditionalLicenseString();
s.AddEntry(Messages.POOL_LICENSE,
additionalString != string.Empty
? string.Format(Messages.MAINWINDOW_CONTEXT_REASON, Helpers.GetFriendlyLicenseName(p), additionalString)
: Helpers.GetFriendlyLicenseName(p));
s.AddEntry(Messages.POOL_LICENSE, Helpers.GetFriendlyLicenseName(p));
s.AddEntry(Messages.NUMBER_OF_SOCKETS, p.CpuSockets().ToString());
var master = p.Connection.Resolve(p.master);
if (master != null)
{
if (p.IsPoolFullyUpgraded())
{
var hotfixEligibilityString = AdditionalVersionString(master);
if (string.IsNullOrEmpty(hotfixEligibilityString))
//if (p.IsPoolFullyUpgraded())
//{
//var hotfixEligibilityString = AdditionalVersionString(master);
//if (string.IsNullOrEmpty(hotfixEligibilityString))
s.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION, master.ProductVersionText());
else
s.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION,
string.Format(Messages.MAINWINDOW_CONTEXT_REASON, master.ProductVersionText(), hotfixEligibilityString),
Color.Red);
}
else
{
var cmd = new RollingUpgradeCommand(Program.MainWindow);
var runRpuWizard = new ToolStripMenuItem(Messages.ROLLING_POOL_UPGRADE_ELLIPSIS,
null,
(sender, args) => cmd.Execute());
//else
// s.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION,
// string.Format(Messages.MAINWINDOW_CONTEXT_REASON, master.ProductVersionText(), hotfixEligibilityString),
// Color.Red);
//}
//else
//{
// var cmd = new RollingUpgradeCommand(Program.MainWindow);
// var runRpuWizard = new ToolStripMenuItem(Messages.ROLLING_POOL_UPGRADE_ELLIPSIS,
// null,
// (sender, args) => cmd.Execute());
s.AddEntryLink(Messages.SOFTWARE_VERSION_PRODUCT_VERSION,
string.Format(Messages.POOL_VERSIONS_LINK_TEXT, master.ProductVersionText()),
new[] {runRpuWizard},
cmd);
}
// s.AddEntryLink(Messages.SOFTWARE_VERSION_PRODUCT_VERSION,
// string.Format(Messages.POOL_VERSIONS_LINK_TEXT, master.ProductVersionText()),
// new[] {runRpuWizard},
// cmd);
//}
}
}
@ -1395,62 +1387,62 @@ namespace XenAdmin.TabPages
s.AddEntry(FriendlyName("host.uuid"), GetUUID(xenObject));
}
private string PoolAdditionalLicenseString()
{
if (licenseStatus != null && licenseStatus.LicencedHost != null)
{
if (licenseStatus.LicencedHost.edition == "xcp-ng")
return string.Empty;
else if (licenseStatus.CurrentState == LicenseStatus.HostState.Expired)
return Messages.LICENSE_EXPIRED;
else if (licenseStatus.CurrentState == LicenseStatus.HostState.Free)
return Messages.LICENSE_UNLICENSED;
else
return string.Empty;
}
else
return string.Empty;
}
//private string PoolAdditionalLicenseString()
//{
// if (licenseStatus != null && licenseStatus.LicencedHost != null)
// {
// if (licenseStatus.LicencedHost.edition == "xcp-ng")
// return string.Empty;
// else if (licenseStatus.CurrentState == LicenseStatus.HostState.Expired)
// return Messages.LICENSE_EXPIRED;
// else if (licenseStatus.CurrentState == LicenseStatus.HostState.Free)
// return Messages.LICENSE_UNLICENSED;
// else
// return string.Empty;
// }
// else
// return string.Empty;
//}
private string AdditionalVersionString(Host host)
{
var hotfixEligibility = Updates.HotfixEligibility(host, out var xenServerVersion);
var unlicensed = host.IsFreeLicenseOrExpired();
//private string AdditionalVersionString(Host host)
//{
// var hotfixEligibility = Updates.HotfixEligibility(host, out var xenServerVersion);
// var unlicensed = host.IsFreeLicenseOrExpired();
switch (hotfixEligibility)
{
// premium
case hotfix_eligibility.premium when unlicensed && xenServerVersion.HotfixEligibilityPremiumDate != DateTime.MinValue:
return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_FREE, HelpersGUI.DateTimeToString(xenServerVersion.HotfixEligibilityPremiumDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
case hotfix_eligibility.premium when unlicensed:
return Messages.HOTFIX_ELIGIBILITY_WARNING_FREE_NO_DATE;
// switch (hotfixEligibility)
// {
// // premium
// case hotfix_eligibility.premium when unlicensed && xenServerVersion.HotfixEligibilityPremiumDate != DateTime.MinValue:
// return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_FREE, HelpersGUI.DateTimeToString(xenServerVersion.HotfixEligibilityPremiumDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
// case hotfix_eligibility.premium when unlicensed:
// return Messages.HOTFIX_ELIGIBILITY_WARNING_FREE_NO_DATE;
// cu
case hotfix_eligibility.cu when unlicensed && xenServerVersion.HotfixEligibilityPremiumDate != DateTime.MinValue:
return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_FREE, HelpersGUI.DateTimeToString(xenServerVersion.HotfixEligibilityPremiumDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
case hotfix_eligibility.cu when unlicensed:
return Messages.HOTFIX_ELIGIBILITY_WARNING_FREE_NO_DATE;
// // cu
// case hotfix_eligibility.cu when unlicensed && xenServerVersion.HotfixEligibilityPremiumDate != DateTime.MinValue:
// return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_FREE, HelpersGUI.DateTimeToString(xenServerVersion.HotfixEligibilityPremiumDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
// case hotfix_eligibility.cu when unlicensed:
// return Messages.HOTFIX_ELIGIBILITY_WARNING_FREE_NO_DATE;
case hotfix_eligibility.cu when xenServerVersion.HotfixEligibilityNoneDate != DateTime.MinValue:
return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_CU, HelpersGUI.DateTimeToString(xenServerVersion.HotfixEligibilityNoneDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
case hotfix_eligibility.cu:
return Messages.HOTFIX_ELIGIBILITY_WARNING_CU_NO_DATE;
// case hotfix_eligibility.cu when xenServerVersion.HotfixEligibilityNoneDate != DateTime.MinValue:
// return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_CU, HelpersGUI.DateTimeToString(xenServerVersion.HotfixEligibilityNoneDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
// case hotfix_eligibility.cu:
// return Messages.HOTFIX_ELIGIBILITY_WARNING_CU_NO_DATE;
// none
case hotfix_eligibility.none when unlicensed && xenServerVersion.EolDate != DateTime.MinValue:
return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_EOL_FREE, HelpersGUI.DateTimeToString(xenServerVersion.EolDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
case hotfix_eligibility.none when xenServerVersion.EolDate != DateTime.MinValue:
return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_EOL, HelpersGUI.DateTimeToString(xenServerVersion.EolDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
case hotfix_eligibility.none when unlicensed:
return Messages.HOTFIX_ELIGIBILITY_WARNING_EOL_FREE_NO_DATE;
case hotfix_eligibility.none:
return Messages.HOTFIX_ELIGIBILITY_WARNING_EOL_NO_DATE;
// // none
// case hotfix_eligibility.none when unlicensed && xenServerVersion.EolDate != DateTime.MinValue:
// return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_EOL_FREE, HelpersGUI.DateTimeToString(xenServerVersion.EolDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
// case hotfix_eligibility.none when xenServerVersion.EolDate != DateTime.MinValue:
// return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_EOL, HelpersGUI.DateTimeToString(xenServerVersion.EolDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
// case hotfix_eligibility.none when unlicensed:
// return Messages.HOTFIX_ELIGIBILITY_WARNING_EOL_FREE_NO_DATE;
// case hotfix_eligibility.none:
// return Messages.HOTFIX_ELIGIBILITY_WARNING_EOL_NO_DATE;
// default
default:
return string.Empty;
}
}
// // default
// default:
// return string.Empty;
// }
//}
private static void GenerateVirtualisationStatusForGeneralBox(PDSection s, VM vm)
{

View File

@ -90,6 +90,24 @@ namespace XenAdmin {
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die https://xcp-ng.org ähnelt.
/// </summary>
public static string COMMUNITY_URL {
get {
return ResourceManager.GetString("COMMUNITY_URL", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die ähnelt.
/// </summary>
public static string DEPRECATION_URL {
get {
return ResourceManager.GetString("DEPRECATION_URL", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die ähnelt.
/// </summary>
public static string HEALTH_CHECK_PRIVACY_STATEMENT_URL {
get {
return ResourceManager.GetString("HEALTH_CHECK_PRIVACY_STATEMENT_URL", resourceCulture);
@ -231,6 +249,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die ähnelt.
/// </summary>
public static string PV_GUESTS_CHECK_URL {
get {
return ResourceManager.GetString("PV_GUESTS_CHECK_URL", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die https://xcp-ng.com ähnelt.
/// </summary>

View File

@ -198,4 +198,10 @@
<data name="HELP_URL" xml:space="preserve">
<value />
</data>
<data name="DEPRECATION_URL" xml:space="preserve">
<value />
</data>
<data name="PV_GUESTS_CHECK_URL" xml:space="preserve">
<value />
</data>
</root>

File diff suppressed because it is too large Load Diff

View File

@ -14460,4 +14460,16 @@ You will need to navigate to the Console on each of the selected VMs to complete
<data name="YOU_ARE_HERE" xml:space="preserve">
<value>You are here</value>
</data>
<data name="ACTION_VM_PAUSED" xml:space="preserve">
<value>VM paused</value>
</data>
<data name="ACTION_VM_PAUSING" xml:space="preserve">
<value>VM pausing</value>
</data>
<data name="ACTION_VM_PAUSED" xml:space="preserve">
<value>VM paused</value>
</data>
<data name="ACTION_VM_PAUSING" xml:space="preserve">
<value>VM pausing</value>
</data>
</root>