mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
Incorporating review comments.
Signed-off-by: Sharath Babu <Sharath.Babu@citrix.com>
This commit is contained in:
parent
18289192b7
commit
07128eb9b4
@ -72,18 +72,14 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery
|
||||
}
|
||||
|
||||
private IVMPolicy _policy;
|
||||
public void RefreshTab(IVMPolicy policy)
|
||||
public void StartRefreshTab()
|
||||
{
|
||||
_policy = policy;
|
||||
if (_policy == null)
|
||||
{
|
||||
labelHistory.Text = "";
|
||||
comboBox1.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
comboBox1.Enabled = true;
|
||||
int hoursFromNow = 0;
|
||||
/* hoursFromNow has 3 possible values:
|
||||
1) 0 -> top 10 messages (default)
|
||||
2) 24 -> messages from past 24 Hrs
|
||||
3) 7 * 24 -> messages from lst 7 days */
|
||||
|
||||
var hoursFromNow = 0;
|
||||
switch (comboBox1.SelectedIndex)
|
||||
{
|
||||
case 0: /* default value*/
|
||||
@ -99,7 +95,20 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery
|
||||
PureAsyncAction action = _policy.getAlertsAction(_policy, hoursFromNow);
|
||||
action.Completed += action_Completed;
|
||||
action.RunAsync();
|
||||
RefreshGrid(_policy.PolicyAlerts);
|
||||
}
|
||||
|
||||
public void RefreshTab(IVMPolicy policy)
|
||||
{
|
||||
_policy = policy;
|
||||
if (_policy == null)
|
||||
{
|
||||
labelHistory.Text = "";
|
||||
comboBox1.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
comboBox1.Enabled = true;
|
||||
StartRefreshTab();
|
||||
}
|
||||
|
||||
}
|
||||
@ -184,30 +193,7 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery
|
||||
{
|
||||
if (_policy != null)
|
||||
{
|
||||
/* hoursFromNow has 3 possible values:
|
||||
1) 0 -> top 10 messages (default)
|
||||
2) 24 -> messages from past 24 Hrs
|
||||
3) 7 * 24 -> messages from lst 7 days */
|
||||
|
||||
int hoursFromNow = 0 ;
|
||||
|
||||
switch (comboBox1.SelectedIndex)
|
||||
{
|
||||
case 0: /* default value*/
|
||||
break;
|
||||
case 1:
|
||||
hoursFromNow = 24;
|
||||
break;
|
||||
case 2:
|
||||
hoursFromNow = 7 * 24;
|
||||
break;
|
||||
}
|
||||
|
||||
dataGridView1.Rows.Clear();
|
||||
panelLoading.Visible = true;
|
||||
PureAsyncAction action = _policy.getAlertsAction(_policy, hoursFromNow);
|
||||
action.Completed += action_Completed;
|
||||
action.RunAsync();
|
||||
StartRefreshTab();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user