From 639e6600c0effec5f1fcfde0925b2739df16246c Mon Sep 17 00:00:00 2001 From: me Date: Mon, 30 Mar 2015 20:33:18 +0400 Subject: [PATCH] wsp-10323 fix job progress --- .../Virtualization/VirtualizationServerController.cs | 7 +++++++ .../WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization/VirtualizationServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization/VirtualizationServerController.cs index 254ff3e9..4dfe23b5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization/VirtualizationServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization/VirtualizationServerController.cs @@ -612,6 +612,7 @@ namespace WebsitePanel.EnterpriseServer #region Setup External network TaskManager.Write("VPS_CREATE_SETUP_EXTERNAL_NETWORK"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress try { @@ -644,6 +645,7 @@ namespace WebsitePanel.EnterpriseServer #region Setup Management network TaskManager.Write("VPS_CREATE_SETUP_MANAGEMENT_NETWORK"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress try { @@ -704,6 +706,7 @@ namespace WebsitePanel.EnterpriseServer #region Setup Private network TaskManager.Write("VPS_CREATE_SETUP_PRIVATE_NETWORK"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress try { @@ -759,6 +762,7 @@ namespace WebsitePanel.EnterpriseServer TaskManager.Write("VPS_CREATE_CONVERT_VHD"); TaskManager.Write("VPS_CREATE_CONVERT_SOURCE_VHD", vm.OperatingSystemTemplatePath); TaskManager.Write("VPS_CREATE_CONVERT_DEST_VHD", vm.VirtualHardDrivePath); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress try { // convert VHD @@ -817,6 +821,7 @@ namespace WebsitePanel.EnterpriseServer if (vm.HddSize > hddSizeGB) { TaskManager.Write("VPS_CREATE_EXPAND_VHD"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress // expand VHD try @@ -958,6 +963,7 @@ namespace WebsitePanel.EnterpriseServer TaskManager.Write("VPS_CREATE_CPU_CORES", vm.CpuCores.ToString()); TaskManager.Write("VPS_CREATE_RAM_SIZE", vm.RamSize.ToString()); TaskManager.Write("VPS_CREATE_CREATE_VM"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress // create virtual machine try { @@ -1031,6 +1037,7 @@ namespace WebsitePanel.EnterpriseServer #region Start VPS TaskManager.Write("VPS_CREATE_START_VPS"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress try { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs index c1c05f80..bbcd3638 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs @@ -215,9 +215,14 @@ namespace WebsitePanel.Portal.VPS.UserControls gauge.Visible = false; if (e.Item.ItemIndex == task.GetLogs().Count - 1) { - gauge.Visible = true; - gauge.Total = task.IndicatorMaximum; - gauge.Progress = task.IndicatorCurrent; + if (task.IndicatorCurrent == -1) + litRecord.Text += "..."; + else + { + gauge.Visible = true; + gauge.Total = task.IndicatorMaximum; + gauge.Progress = task.IndicatorCurrent; + } } } }