CA-84876: Show more infrastructure information for objects

-Fixing recently found issues
This commit is contained in:
Gabor Apati-Nagy 2015-01-15 13:34:22 +00:00
parent da8fbb4aa1
commit cc85dc0142
3 changed files with 9 additions and 3 deletions

View File

@ -209,6 +209,9 @@ namespace XenAPI
if (Connection != null)
{
var srOfVdi = Connection.Resolve(SR);
if (srOfVdi == null)
return base.NameWithLocation;
return string.Format(Messages.VDI_ON_SR_TITLE, Name, srOfVdi.Name, srOfVdi.LocationString);
}

View File

@ -1099,6 +1099,9 @@ namespace XenAPI
else if (this.is_a_snapshot)
{
var snapshotOf = this.Connection.Resolve(this.snapshot_of);
if (snapshot_of == null)
return base.NameWithLocation;
return string.Format(Messages.SNAPSHOT_OF_TITLE, Name, snapshotOf.Name, LocationString);
}
else if (this.is_a_template)
@ -1110,7 +1113,7 @@ namespace XenAPI
}
}
return NameWithLocation;
return base.NameWithLocation;
}
}

View File

@ -281,12 +281,12 @@ namespace XenAPI
{
get
{
if (Connection == null)
if (Connection == null || string.IsNullOrEmpty(Connection.Name))
return string.Empty;
if (Helpers.IsPool(Connection))
return string.Format(Messages.IN_POOL, Connection.Name);
return string.Format(Messages.ON_SERVER, Connection.Name);
}
}