Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX improvements: CA-381442, XSI-1476, CA-375740 #3198

Merged
merged 5 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions XenAdmin/Alerts/Types/OutOfSyncWithCdnAlert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace XenAdmin.Alerts
{
public class OutOfSyncWithCdnAlert : Alert
{
private readonly TimeSpan _outOfSyncSpan;
private readonly TimeSpan _outOfSyncSpan = TimeSpan.Zero;
private readonly Pool _pool;

private OutOfSyncWithCdnAlert(Pool pool, DateTime timestamp)
Expand All @@ -49,12 +49,19 @@ private OutOfSyncWithCdnAlert(Pool pool, DateTime timestamp)
_pool = pool;
Connection = _pool.Connection;

_outOfSyncSpan = _timestamp - _pool.last_update_sync;
if (pool.last_update_sync > Util.GetUnixMinDateTime())
{
_outOfSyncSpan = _timestamp - _pool.last_update_sync;

if (_outOfSyncSpan >= TimeSpan.FromDays(180))
Priority = AlertPriority.Priority1;
else if (_outOfSyncSpan >= TimeSpan.FromDays(90))
Priority = AlertPriority.Priority2;
if (_outOfSyncSpan >= TimeSpan.FromDays(180))
Priority = AlertPriority.Priority1;
else if (_outOfSyncSpan >= TimeSpan.FromDays(90))
Priority = AlertPriority.Priority2;
}
else
{
Priority = AlertPriority.Priority3;
}
}

public static bool TryCreate(IXenConnection connection, out Alert alert)
Expand All @@ -79,8 +86,9 @@ public static bool TryCreate(IXenConnection connection, out Alert alert)

public override string AppliesTo => Helpers.GetName(_pool);

public override string Description => string.Format(Messages.ALERT_CDN_OUT_OF_SYNC_DESCRIPTION,
AlertExtensions.GetGuiDate(_pool.last_update_sync));
public override string Description => _outOfSyncSpan == TimeSpan.Zero
? Messages.ALERT_CDN_NEVER_SYNC_TITLE
: string.Format(Messages.ALERT_CDN_OUT_OF_SYNC_DESCRIPTION, AlertExtensions.GetGuiDate(_pool.last_update_sync));

public override Action FixLinkAction
{
Expand All @@ -99,7 +107,9 @@ public override Action FixLinkAction

public override string HelpID => "TODO";

public override string Title => string.Format(Messages.ALERT_CDN_OUT_OF_SYNC_TITLE, _outOfSyncSpan.Days);
public override string Title => _outOfSyncSpan == TimeSpan.Zero
? Messages.ALERT_CDN_NEVER_SYNC_TITLE
: string.Format(Messages.ALERT_CDN_OUT_OF_SYNC_TITLE, _outOfSyncSpan.Days);
}


Expand Down
2 changes: 1 addition & 1 deletion XenAdmin/Dialogs/PropertiesDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private void Build()

ShowTab(GeneralEditPage = new GeneralEditPage());

if (!isVmAppliance)
if (!isVmAppliance && !isVmss)
ShowTab(CustomFieldsEditPage = new CustomFieldsDisplayPage {AutoScroll = true});

if (isVm)
Expand Down
4 changes: 2 additions & 2 deletions XenAdmin/Dialogs/ServerUpdates/ConfigCdnUpdatesPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ private void ToggleConfigPanelEditState()
buttonApply.Enabled = buttonDiscard.Enabled = active;
comboBoxRepo.Enabled = active;

textBoxProxyUrl.ReadOnly = textBoxProxyUsername.ReadOnly = textBoxProxyPassword.ReadOnly = !active;
checkBoxPeriodicSync.Enabled = radioButtonDaily.Enabled = radioButtonWeekly.Enabled = comboBoxWeekday.Enabled = active;
textBoxProxyUrl.Enabled = textBoxProxyUsername.Enabled = textBoxProxyPassword.Enabled =
checkBoxPeriodicSync.Enabled = radioButtonDaily.Enabled = radioButtonWeekly.Enabled = comboBoxWeekday.Enabled = active;

if (!active)
UpdateConfigPanel();
Expand Down
1 change: 1 addition & 0 deletions XenAdmin/Images.cs
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ public static class StaticImages
public static Bitmap usb_16 = Properties.Resources.usb_16;
public static Bitmap yinhekylin_16x = Properties.Resources.yinhekylin_16x;
public static Bitmap rightArrowLong_Blue_16 = Properties.Resources.rightArrowLong_Blue_16;
public static Bitmap rpm_package = Properties.Resources.rpm_package;
}
}
}
Binary file added XenAdmin/Images/rpm_package.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions XenAdmin/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion XenAdmin/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1156,4 +1156,7 @@
<data name="livepatch_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Images\livepatch_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
<data name="rpm_package" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Images\rpm_package.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
2 changes: 1 addition & 1 deletion XenAdmin/SettingsPanels/CustomFieldsDisplayPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ private Label CreateNewLabel(CustomFieldDefinition customFieldDefinition)
return new Label
{
Anchor = AnchorStyles.Left | AnchorStyles.Right,
Text = customFieldDefinition.Name.EscapeAmpersands().Ellipsise(25),
Text = customFieldDefinition.Name.EscapeAmpersands().Ellipsise(45),
Font = Program.DefaultFont,
AutoSize = true,
AutoEllipsis = false
Expand Down
2 changes: 1 addition & 1 deletion XenAdmin/TabPages/CdnUpdates/CdnExpandableRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ internal class RpmCategoryRow : CdnExpandableRow
public RpmCategoryRow(params string[] rpms)
{
SetValues(string.Format(Messages.HOTFIX_RPMS_TO_INSTALL, rpms.Length),
Images.StaticImages._000_Patch_h32bit_16);
Images.StaticImages.rpm_package);

ChildRows = new List<CdnExpandableRow> { new RpmsRow(rpms) };
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,6 @@ public override bool EnableNext()
return AutomaticRadioButton.Checked || ManualRadioButton.Checked;
}

private void UpdateEnablement()
{
textBoxLog.Enabled = ManualRadioButton.Checked;
OnPageUpdated();
}

#region Accessors

public WizardMode WizardMode { get; set; }
Expand All @@ -196,12 +190,14 @@ private void UpdateEnablement()

private void AutomaticRadioButton_CheckedChanged(object sender, EventArgs e)
{
UpdateEnablement();
if (AutomaticRadioButton.Checked)
OnPageUpdated();
}

private void ManualRadioButton_CheckedChanged(object sender, EventArgs e)
{
UpdateEnablement();
if (ManualRadioButton.Checked)
OnPageUpdated();
}

private void button1_Click(object sender, EventArgs e)
Expand Down
1 change: 1 addition & 0 deletions XenAdmin/XenAdmin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4575,6 +4575,7 @@
<None Include="Images\saved_searches_24.png" />
<None Include="Images\RunningDC_16.png" />
<None Include="Images\rightArrowLong_Blue_16.png" />
<None Include="Images\rpm_package.png" />
<Content Include="Images\save_to_disk.png" />
<Content Include="Images\scilinux_16x.png" />
<None Include="Images\server_32.png" />
Expand Down
9 changes: 9 additions & 0 deletions XenModel/Messages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions XenModel/Messages.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1834,6 +1834,9 @@ This alarm is set to be triggered when the total throughput exceeds {4}.</value>
<data name="ALERT_CAP_LABEL" xml:space="preserve">
<value>(Showing first {0} entries)</value>
</data>
<data name="ALERT_CDN_NEVER_SYNC_TITLE" xml:space="preserve">
<value>You have never synchronized with the update channel.</value>
</data>
<data name="ALERT_CDN_OUT_OF_SYNC_DESCRIPTION" xml:space="preserve">
<value>The last synchronization with the update channel took place on {0}.</value>
</data>
Expand Down
Loading