From: <he...@hy...> - 2007-12-05 21:58:49
|
Author: heather Date: 2007-12-05 13:58:45 -0800 (Wed, 05 Dec 2007) New Revision: 7090 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=7090 Modified: trunk/src/org/hyperic/hq/livedata/formatters/WhoFormatter.java Log: HHQ-1244 - added a non breaking space to fix broken layout in live exec 'who' when there isn't a remote host Modified: trunk/src/org/hyperic/hq/livedata/formatters/WhoFormatter.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/formatters/WhoFormatter.java 2007-12-05 21:30:00 UTC (rev 7089) +++ trunk/src/org/hyperic/hq/livedata/formatters/WhoFormatter.java 2007-12-05 21:58:45 UTC (rev 7090) @@ -67,7 +67,7 @@ StringBuffer r = new StringBuffer(); DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT); - + r.append("<div class='who_livedata'><table cellpadding='0' cellspacing='0'><thead><tr>"); r.append("<td>") .append(BUNDLE.format("formatter.who.head.user")) @@ -85,19 +85,26 @@ for (int i=0; i<w.length; i++) { String dateStr; - + String hostStr; + if (w[i].getTime() == 0) dateStr = "unknown"; else dateStr = fmt.format(new Date(w[i].getTime() * 1000)); - r.append("<tr><td>") + + if (w[i].getHost() == null || w[i].getHost().trim().length() == 0) + hostStr = " "; + else + hostStr = w[i].getHost(); + + r.append("<tr><td>") .append(w[i].getUser()) .append("</td><td>") .append(w[i].getDevice()) .append("</td><td>") .append(dateStr) .append("</td><td>") - .append(w[i].getHost()) + .append(hostStr) .append("</td></tr>"); } r.append("</tbody></table></div>"); |