FELIX-2287 Improved Handling of queries on the OBR page:
- accept empty query to select all resources
- print error message if filter string is invalid
- fix WebConsoleUtil.urlDecode to return an empty string if
the value is an empty string (to be inline with the
URLDecode.decode methods).
- add resource symbolic name in parens after presentation
name to differentiate resources with the same presentation
name but different symbolic names
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@984322 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/resources/res/ui/obr.js b/webconsole/src/main/resources/res/ui/obr.js
index 7c40daa..58e5ffb 100644
--- a/webconsole/src/main/resources/res/ui/obr.js
+++ b/webconsole/src/main/resources/res/ui/obr.js
@@ -137,7 +137,14 @@
blockElement.appendChild(titleElement);
titleElement.appendChild(inputElement);
titleElement.appendChild(text(" "));
- titleElement.appendChild(text(res.presentationname ? res.presentationname : res.symbolicname));
+ if (res.presentationname) {
+ titleElement.appendChild(text(res.presentationname));
+ titleElement.appendChild(text(" ("));
+ titleElement.appendChild(text(res.symbolicname));
+ titleElement.appendChild(text(")"));
+ } else {
+ titleElement.appendChild(text(res.symbolicname));
+ }
$(titleElement).click(function() {showVersions(res.symbolicname)});
_tr = tr( null, { 'id' : 'row' + _id } , [
@@ -426,11 +433,17 @@
$('#detailsTable').removeClass('ui-helper-hidden');
for (var i in obrData.resources ) {
renderDetailedResource( obrData.resources[i] );
- }
- } else {
+ }
+ } else if (obrData.resources) {
for (var i in obrData.resources ) {
renderResource( obrData.resources[i] );
- }
+ }
+ } else if (obrData.error) {
+ _tr = tr( "ui-state-error", null , [
+ td( "ui-state-error-text", { 'colspan': '2' },
+ [ text(i18n.error + ": " + obrData.error) ] )
+ ]);
+ resTable.append( _tr );
}
} else {
$('.statline').html(i18n.status_no);