From 653d7fffa3df9051eb9a0f94ba7790c5c63a916e Mon Sep 17 00:00:00 2001 From: Cheng Zhang Date: Wed, 13 Aug 2014 11:17:23 +0800 Subject: [PATCH] CA-142266: remove Enter at storage to avoid CSV format display problem Signed-off-by: Cheng Zhang --- .../GUIActions/ExportResourceReportAction.cs | 30 ++++++++++++------- XenAdmin/ReportViewer/resource_report.rdlc | 6 ++-- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/XenAdmin/Actions/GUIActions/ExportResourceReportAction.cs b/XenAdmin/Actions/GUIActions/ExportResourceReportAction.cs index 96dac8524..ff3512b76 100755 --- a/XenAdmin/Actions/GUIActions/ExportResourceReportAction.cs +++ b/XenAdmin/Actions/GUIActions/ExportResourceReportAction.cs @@ -531,7 +531,7 @@ namespace XenAdmin.Actions ParamLabelsStr += "LBL_CPUUSAGE|"; ParamValuesStr += Messages.OVERVIEW_CPU_USAGE + "|"; ParamLabelsStr += "LBL_NETWORKUSAGE|"; - ParamValuesStr += Messages.OVERVIEW_NETWORK + "" + Messages.OVERVIEW_UNITS + "|"; + ParamValuesStr += Messages.OVERVIEW_NETWORK + " " + Messages.OVERVIEW_UNITS + "|"; ParamLabelsStr += "LBL_MEMORYUSAGE|"; ParamValuesStr += Messages.OVERVIEW_MEMORY_USAGE + "|"; ParamLabelsStr += "LBL_UPTIME|"; @@ -631,7 +631,7 @@ namespace XenAdmin.Actions SR sr = pbd.Connection.Resolve(pbd.SR); if(sr.IsLocalSR && sr.type.ToLower() == "lvm") { - srSizeString += SRSizeString(sr) + ";\n"; + srSizeString += SRSizeString(sr) + ";"; } } if (srSizeString.Length == 0) @@ -686,7 +686,7 @@ namespace XenAdmin.Actions foreach (XenAPI.Host host in Connection.Cache.Hosts) { if (host.CanSeeNetwork(network)) - location += host.name_label + ";"; + location += host.name_label + ":" + host.uuid + ";"; } if (location.Length == 0) location = Messages.HYPHEN; @@ -715,28 +715,38 @@ namespace XenAdmin.Actions string srSizeString = SRSizeString(sr); string locationStr = ""; + bool haveLocation = false; + bool haveServerPath = false; + bool haveDevice = false; + bool haveTargetIQN = false; + bool haveSCSIid = false; foreach (XenRef pbdRef in sr.PBDs) { PBD pbd = sr.Connection.Resolve(pbdRef); - if (pbd.device_config.ContainsKey("location")) + if (!haveLocation && pbd.device_config.ContainsKey("location")) { + haveLocation = true; locationStr += "location:" + pbd.device_config["location"] + ";"; } - if (pbd.device_config.ContainsKey("device")) + if (!haveDevice && pbd.device_config.ContainsKey("device")) { + haveDevice = true; locationStr += "device:" + pbd.device_config["device"] + ";"; } - if (pbd.device_config.ContainsKey("SCSIid")) + if (!haveSCSIid && pbd.device_config.ContainsKey("SCSIid")) { + haveSCSIid = true; locationStr += "SCSIid:" + pbd.device_config["SCSIid"] + ";"; } - if (pbd.device_config.ContainsKey("targetIQN")) + if (!haveTargetIQN && pbd.device_config.ContainsKey("targetIQN")) { + haveTargetIQN = true; locationStr += "targetIQN:" + pbd.device_config["targetIQN"] + ";"; } - if (pbd.device_config.ContainsKey("server")) + if (!haveServerPath && pbd.device_config.ContainsKey("server")) { + haveServerPath = true; locationStr += "server:" + pbd.device_config["server"]; if(pbd.device_config.ContainsKey("serverpath")) locationStr += pbd.device_config["serverpath"] + ";"; @@ -766,8 +776,8 @@ namespace XenAdmin.Actions if (Cancelling) throw new CancelledException(); - - if (vm.is_a_snapshot || vm.is_a_template || vm.is_control_domain || vm.is_snapshot_from_vmpp) + + if (!vm.is_a_real_vm) { PercentComplete = Convert.ToInt32((++itemIndex) * baseIndex / itemCount); continue; diff --git a/XenAdmin/ReportViewer/resource_report.rdlc b/XenAdmin/ReportViewer/resource_report.rdlc index 292186809..ebe038caf 100755 --- a/XenAdmin/ReportViewer/resource_report.rdlc +++ b/XenAdmin/ReportViewer/resource_report.rdlc @@ -702,7 +702,7 @@ 7 true - =Code.GetLabel("LBL_LOCATION") + =Code.GetLabel("LBL_STORAGE") @@ -2973,7 +2973,7 @@ 3 Report_HostInfo 2.75cm - 53.52646cm + 54.02646cm
@@ -3542,7 +3542,7 @@ 3.25cm - 4.25cm + 4.75cm 3.77646cm