Add triangle icons to flip open and close the inline bundle details
and open just the single bundle with details when clicking on the
bundle name
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@667571 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
index c775a57..2aeaff9 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
@@ -308,6 +308,7 @@
pw.println( "<script src='" + appRoot + "/res/ui/bundles.js' language='JavaScript'></script>" );
Util.startScript( pw );
+ pw.println( "var appRoot = '" + appRoot + "';" );
pw.println( "var bundleListData = " );
JSONWriter jw = new JSONWriter( pw );
try
diff --git a/webconsole/src/main/resources/res/imgs/down.gif b/webconsole/src/main/resources/res/imgs/down.gif
new file mode 100644
index 0000000..d7687d6
--- /dev/null
+++ b/webconsole/src/main/resources/res/imgs/down.gif
Binary files differ
diff --git a/webconsole/src/main/resources/res/imgs/right.gif b/webconsole/src/main/resources/res/imgs/right.gif
new file mode 100644
index 0000000..3d11fad
--- /dev/null
+++ b/webconsole/src/main/resources/res/imgs/right.gif
Binary files differ
diff --git a/webconsole/src/main/resources/res/ui/admin.css b/webconsole/src/main/resources/res/ui/admin.css
index fdb5084..57b5fad 100644
--- a/webconsole/src/main/resources/res/ui/admin.css
+++ b/webconsole/src/main/resources/res/ui/admin.css
@@ -170,6 +170,11 @@
padding: 5px;
}
+td.content img {
+ width: 10px;
+ height: 10px;
+}
+
td.disabled {
color: #999999;
}
diff --git a/webconsole/src/main/resources/res/ui/bundles.js b/webconsole/src/main/resources/res/ui/bundles.js
index 07efab4..35ff677 100644
--- a/webconsole/src/main/resources/res/ui/bundles.js
+++ b/webconsole/src/main/resources/res/ui/bundles.js
@@ -91,8 +91,10 @@
/* String */ function bundleInternal( /* Bundle */ bundle )
{
+ var icon = (bundle.props) ? "down" : "right";
var theBundle = "<td class='content right'>" + bundle.bundleId + "</td>";
- theBundle += "<td class='content'><a href='javascript:showDetails(" + bundle.bundleId + ")'>" + bundle.name + "</a></td>";
+ theBundle += "<td class='content'><img src='" + appRoot + "/res/imgs/" + icon + ".gif' onClick='showDetails(" + bundle.bundleId + ")' id='bundle" + bundle.bundleId + "_inline' />";
+ theBundle += " <a href='" + appRoot + "/bundles/" + bundle.bundleId + "'>" + bundle.name + "</a></td>";
theBundle += "<td class='content center'>" + bundle.state + "</td>";
// no buttons for system bundle
@@ -202,10 +204,12 @@
if (span.innerHTML)
{
span.innerHTML = '';
+ newLinkValue(bundleId, appRoot + "/res/imgs/right.gif");
}
else
{
- sendRequest('GET', "bundles/" + bundleId + ".json", displayBundleDetails);
+ sendRequest('GET', appRoot + "/bundles/" + bundleId + ".json", displayBundleDetails);
+ newLinkValue(bundleId, appRoot + "/res/imgs/down.gif");
}
}
}
@@ -220,6 +224,17 @@
}
+function newLinkValue(bundleId, newLinkValue)
+{
+
+ var link = document.getElementById("bundle" + bundleId + "_inline");
+ if (link)
+ {
+ link.src = newLinkValue;
+ }
+}
+
+
/* String */ function bundleDetails( props )
{
var innerHtml = '<td class=\"content\"> </td><td class=\"content\" colspan=\"6\"><table broder=\"0\">';