Merge pull request #1808 from jijiang/master

CA-249852: Add license status in pool general tab
This commit is contained in:
Mihaela Stoica 2017-10-12 15:25:29 +01:00 committed by GitHub
commit 3adb7b3f5c
7 changed files with 50 additions and 23 deletions

View File

@ -358,14 +358,14 @@ namespace XenAdmin.Dialogs
case Dialogs.LicenseStatus.HostState.Expired:
if (licenseStatus.PoolLicensingModel == Dialogs.LicenseStatus.LicensingModel.Clearwater)
return Messages.LICENSE_UNSUPPORTED;
return Messages.LICENSE_EXPIRED;
return Messages.LICENSE_UNLICENSED;
case Dialogs.LicenseStatus.HostState.Free:
switch (licenseStatus.PoolLicensingModel)
{
case Dialogs.LicenseStatus.LicensingModel.Clearwater:
return Messages.LICENSE_UNSUPPORTED;
case Dialogs.LicenseStatus.LicensingModel.Creedence:
return Messages.LICENSE_EXPIRED;
return Messages.LICENSE_UNLICENSED;
default:
return Messages.LICENSE_FREE;
}

View File

@ -74,12 +74,12 @@ namespace XenAdmin.TabPages
if (Status.CurrentState == LicenseStatus.HostState.Expired)
{
return Status.PoolLicensingModel == LicenseStatus.LicensingModel.Clearwater ? Messages.LICENSE_UNSUPPORTED : Messages.LICENSE_EXPIRED;
return Status.PoolLicensingModel == LicenseStatus.LicensingModel.Clearwater ? Messages.LICENSE_UNSUPPORTED : Messages.LICENSE_UNLICENSED;
}
if (Status.CurrentState == LicenseStatus.HostState.Free)
{
return Status.PoolLicensingModel == LicenseStatus.LicensingModel.Clearwater ? Messages.LICENSE_UNSUPPORTED : Messages.LICENSE_EXPIRED;
return Status.PoolLicensingModel == LicenseStatus.LicensingModel.Clearwater ? Messages.LICENSE_UNSUPPORTED : Messages.LICENSE_UNLICENSED;
}
TimeSpan s = Status.LicenseExpiresExactlyIn;

View File

@ -117,6 +117,19 @@ namespace XenAdmin.TabPages
ss.ExpiryStatus,
true);
});
Pool p = xenObject as Pool;
if (p != null)
Program.Invoke(Program.MainWindow, () =>
{
var additionalString = PoolAdditionalLicenseString();
pdSectionGeneral.UpdateEntryValueWithKey(
Messages.POOL_LICENSE,
additionalString != string.Empty
? string.Format(Messages.MAINWINDOW_CONTEXT_REASON, p.LicenseString(), additionalString)
: p.LicenseString(),
true);
});
}
void s_contentReceivedFocus(PDSection s)
@ -1286,7 +1299,11 @@ namespace XenAdmin.TabPages
Pool p = xenObject as Pool;
if (p != null)
{
s.AddEntry(Messages.POOL_LICENSE, p.LicenseString());
var additionalString = PoolAdditionalLicenseString();
s.AddEntry(Messages.POOL_LICENSE,
additionalString != string.Empty
? string.Format(Messages.MAINWINDOW_CONTEXT_REASON, p.LicenseString(), additionalString)
: p.LicenseString());
s.AddEntry(Messages.NUMBER_OF_SOCKETS, p.CpuSockets().ToString());
var master = p.Connection.Resolve(p.master);
@ -1329,6 +1346,16 @@ namespace XenAdmin.TabPages
s.AddEntry(FriendlyName("host.uuid"), GetUUID(xenObject));
}
private string PoolAdditionalLicenseString()
{
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;
}
private static void GenerateVirtualisationStatusForGeneralBox(PDSection s, VM vm)
{
if (vm != null && vm.Connection != null)

View File

@ -19639,7 +19639,7 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to Unlicensed.
/// Looks up a localized string similar to License expired.
/// </summary>
public static string LICENSE_EXPIRED {
get {
@ -19710,15 +19710,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to License Expired.
/// </summary>
public static string LICENSE_EXPIRY_TITLE {
get {
return ResourceManager.GetString("LICENSE_EXPIRY_TITLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This field is disabled due to license restrictions on the server..
/// </summary>
@ -20003,6 +19994,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Unlicensed.
/// </summary>
public static string LICENSE_UNLICENSED {
get {
return ResourceManager.GetString("LICENSE_UNLICENSED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unsupported.
/// </summary>

View File

@ -6806,7 +6806,7 @@ SCSI ID: {2}
<data name="LICENSE_ERROR_TITLE" xml:space="preserve">
<value>ライセンス エラー</value>
</data>
<data name="LICENSE_EXPIRED" xml:space="preserve">
<data name="LICENSE_UNLICENSED" xml:space="preserve">
<value>非ライセンス</value>
</data>
<data name="LICENSE_EXPIRED_NO_LICENSES_AVAILABLE" xml:space="preserve">
@ -6831,7 +6831,7 @@ SCSI ID: {2}
<value>[XenServer] オンライン</value>
<comment>this text could be improved</comment>
</data>
<data name="LICENSE_EXPIRY_TITLE" xml:space="preserve">
<data name="LICENSE_EXPIRED" xml:space="preserve">
<value>期限切れのライセンス</value>
</data>
<data name="LICENSE_FIELD_DISABLED" xml:space="preserve">

View File

@ -6846,7 +6846,7 @@ Size: {3}</value>
<data name="LICENSE_ERROR_TITLE" xml:space="preserve">
<value>Licensing Error</value>
</data>
<data name="LICENSE_EXPIRED" xml:space="preserve">
<data name="LICENSE_UNLICENSED" xml:space="preserve">
<value>Unlicensed</value>
</data>
<data name="LICENSE_EXPIRED_NO_LICENSES_AVAILABLE" xml:space="preserve">
@ -6871,8 +6871,8 @@ Size: {3}</value>
<value>[XenServer] Online</value>
<comment>this text could be improved</comment>
</data>
<data name="LICENSE_EXPIRY_TITLE" xml:space="preserve">
<value>License Expired</value>
<data name="LICENSE_EXPIRED" xml:space="preserve">
<value>License expired</value>
</data>
<data name="LICENSE_FIELD_DISABLED" xml:space="preserve">
<value>This field is disabled due to license restrictions on the server.</value>

View File

@ -6800,7 +6800,7 @@ SCSI ID: {2}
<data name="LICENSE_ERROR_TITLE" xml:space="preserve">
<value>许可错误</value>
</data>
<data name="LICENSE_EXPIRED" xml:space="preserve">
<data name="LICENSE_UNLICENSED" xml:space="preserve">
<value>未获许可</value>
</data>
<data name="LICENSE_EXPIRED_NO_LICENSES_AVAILABLE" xml:space="preserve">
@ -6825,7 +6825,7 @@ SCSI ID: {2}
<value>在线 [XenServer]</value>
<comment>this text could be improved</comment>
</data>
<data name="LICENSE_EXPIRY_TITLE" xml:space="preserve">
<data name="LICENSE_EXPIRED" xml:space="preserve">
<value>许可证已过期</value>
</data>
<data name="LICENSE_FIELD_DISABLED" xml:space="preserve">