Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-11-30 15:04:22 -0500
committerChristopher Frost2012-11-30 15:04:22 -0500
commit4c16912da1cb4fd71439d8f50e5b7a4a66a74d67 (patch)
treeba1e054df4ff923541359dcc3f9e256c5bf3706b /org.eclipse.virgo.management.console
parent0669599cdb64f53493b27ac123b9bbbf707e3817 (diff)
parent32b553d4daf398fcb5eb9bb3e09bea7033c323c3 (diff)
downloadorg.eclipse.virgo.kernel-4c16912da1cb4fd71439d8f50e5b7a4a66a74d67.tar.gz
org.eclipse.virgo.kernel-4c16912da1cb4fd71439d8f50e5b7a4a66a74d67.tar.xz
org.eclipse.virgo.kernel-4c16912da1cb4fd71439d8f50e5b7a4a66a74d67.zip
Merge branch 'master' into 391637-WebAdminLogging
Diffstat (limited to 'org.eclipse.virgo.management.console')
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/js/artifacts.js151
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/js/dumps.js34
2 files changed, 110 insertions, 75 deletions
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/js/artifacts.js b/org.eclipse.virgo.management.console/src/main/webapp/js/artifacts.js
index c5094a73..d67ed137 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/js/artifacts.js
+++ b/org.eclipse.virgo.management.console/src/main/webapp/js/artifacts.js
@@ -139,20 +139,45 @@ var Tree = function() {
};
this.renderOperationResult = function(responseJSON, objectName){
- var artifact = new Artifact(objectName);
- if(responseJSON.status == 404){
- $('.' + artifact.key).remove();
- } else if(responseJSON.value){
- $.each($('.' + artifact.key), function(index, nodeToUpdate){
- var fxContainer = $(nodeToUpdate).children('.fx-container');
- if(fxContainer){
- fxContainer.remove();
- self.renderArtifactRequest(responseJSON, objectName, $(nodeToUpdate));
- }
+
+ $.each($('#artifacts-tree').children('.artifact-container'), function(index, node){
+ $(node).children('.fx-container').slideToggle(util.fxTime, function(){
+ $(this).remove();
});
- } else {
- alert('Unable to retrieve information about the modified Artifact, please refresh the page.');
- }
+ self.setIconElement($(node).children('.artifact-label').children('.twisty'), 'tree-icons/plus.png');
+ });
+
+
+// var artifact = new Artifact(objectName);
+// $.each($('.' + artifact.key), function(index, nodeToUpdate){
+// var fxContainer = $(nodeToUpdate).children('.fx-container');
+// if(fxContainer){
+// $.each(fxContainer.children('.artifact-container'), function(index, childNodeToUpdate){
+//
+// var classes = $(childNodeToUpdate).prop('class').split(' ');
+// $.each(classes, function(index, seperateClass){
+// if(seperateClass != 'artifact-container'){
+// $.each($('.' + seperateClass), function(index, otherChildNodeToUpdate){
+//
+// if(responseJSON.value){//Just close the otherChildNode
+// self.setIconElement($(otherChildNodeToUpdate).children('.artifact-label').children('.twisty'), 'tree-icons/plus.png');
+// var otherChildFxContaienr = $(otherChildNodeToUpdate).children('.fxContainer');
+// if(otherChildFxContaienr){
+// otherChildFxContaienr.remove();
+// }
+// }else{//Close the otherChildNodes parent as the state of the child is unknown.
+// $(otherChildNodeToUpdate).parent().remove();
+// }
+//
+// });
+// }
+// });
+//
+// });
+// fxContainer.remove();
+// self.renderArtifactRequest(responseJSON, objectName, $(nodeToUpdate));
+// }
+// });
};
/* **************** START PRIVATE METHODS **************** */
@@ -187,58 +212,62 @@ var Tree = function() {
*/
this.renderArtifactRequest = function(json, objectName, parent){
var fxContainer = $('<div />', {'class': 'fx-container'});
- var fullArtifact = new FullArtifact(json.value, objectName);
-
- var artifactControlBar = self.getArtifactControlBar(fullArtifact);
- if(fullArtifact.type == 'configuration'){
- var configControl = $('<a />', {'class': 'artifact-control'});
- configControl.attr('href', util.getCurrentHost() + '/content/configurations#' + fullArtifact.name);
- configControl.text('VIEW');
- artifactControlBar.append(configControl);
- }
-
- fxContainer.append(artifactControlBar);
- fxContainer.append(self.getArtifactAttribute('SymbolicName: ' + fullArtifact.name));
- fxContainer.append(self.getArtifactAttribute('Version: ' + fullArtifact.version));
- fxContainer.append(self.getArtifactAttribute('Region: ' + fullArtifact.region));
- fxContainer.append(self.getArtifactAttribute('Type: ' + fullArtifact.type));
- fxContainer.append(self.getArtifactAttribute(fullArtifact.state, 'state-' + fullArtifact.state));
-
- var spring = false;
- $.each(fullArtifact.properties, function(key, value){
- if(value == 'true' || value == true){
- if(key == 'Spring'){
- spring = true;
- fxContainer.append(self.getArtifactAttribute('Spring Powered', key));
- } else if(key == 'Scoped' || key == 'Atomic' || key == 'Scoped-Atomic'){
- fxContainer.append(self.getArtifactAttribute(key, key));
- } else {
- fxContainer.append(self.getArtifactAttribute(key + ': ' + value));
- }
- } else {
- if(key == 'Bundle Id'){
- fxContainer.append(self.getArtifactAttribute(key + ': ' + value, undefined, util.getCurrentHost() + '/content/wirings#' + value));
+ if(json.value == undefined){
+ parent.remove();
+ }else{
+ var fullArtifact = new FullArtifact(json.value, objectName);
+
+ var artifactControlBar = self.getArtifactControlBar(fullArtifact);
+ if(fullArtifact.type == 'configuration'){
+ var configControl = $('<a />', {'class': 'artifact-control'});
+ configControl.attr('href', util.getCurrentHost() + '/content/configurations#' + fullArtifact.name);
+ configControl.text('VIEW');
+ artifactControlBar.append(configControl);
+ }
+
+ fxContainer.append(artifactControlBar);
+ fxContainer.append(self.getArtifactAttribute('SymbolicName: ' + fullArtifact.name));
+ fxContainer.append(self.getArtifactAttribute('Version: ' + fullArtifact.version));
+ fxContainer.append(self.getArtifactAttribute('Region: ' + fullArtifact.region));
+ fxContainer.append(self.getArtifactAttribute('Type: ' + fullArtifact.type));
+ fxContainer.append(self.getArtifactAttribute(fullArtifact.state, 'state-' + fullArtifact.state));
+
+ var spring = false;
+ $.each(fullArtifact.properties, function(key, value){
+ if(value == 'true' || value == true){
+ if(key == 'Spring'){
+ spring = true;
+ fxContainer.append(self.getArtifactAttribute('Spring Powered', key));
+ } else if(key == 'Scoped' || key == 'Atomic' || key == 'Scoped-Atomic'){
+ fxContainer.append(self.getArtifactAttribute(key, key));
+ } else {
+ fxContainer.append(self.getArtifactAttribute(key + ': ' + value));
+ }
} else {
- fxContainer.append(self.getArtifactAttribute(key + ': ' + value));
+ if(key == 'Bundle Id'){
+ fxContainer.append(self.getArtifactAttribute(key + ': ' + value, undefined, util.getCurrentHost() + '/content/wirings#' + value));
+ } else {
+ fxContainer.append(self.getArtifactAttribute(key + ': ' + value));
+ }
}
+ });
+
+ if(spring == false && fullArtifact.type == 'bundle'){
+ fxContainer.append(self.getArtifactAttribute('No Spring', 'Spring'));
}
- });
-
- if(spring == false && fullArtifact.type == 'bundle'){
- fxContainer.append(self.getArtifactAttribute('No Spring', 'Spring'));
+
+ var dependents = fullArtifact.dependents.sort(function(a, b){
+ return a.compare(b);
+ });
+
+ $.each(dependents, function(index, objectName){
+ var dependentArtifact = new Artifact(objectName);
+ fxContainer.append(self.getArtifactLabel(dependentArtifact, parent.attr('id')));
+ });
+
+ parent.append(fxContainer);
+ fxContainer.slideToggle(util.fxTime);
}
-
- var dependents = fullArtifact.dependents.sort(function(a, b){
- return a.compare(b);
- });
-
- $.each(dependents, function(index, objectName){
- var dependentArtifact = new Artifact(objectName);
- fxContainer.append(self.getArtifactLabel(dependentArtifact, parent.attr('id')));
- });
-
- parent.append(fxContainer);
- fxContainer.slideToggle(util.fxTime);
};
/**
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/js/dumps.js b/org.eclipse.virgo.management.console/src/main/webapp/js/dumps.js
index ca18cfe8..181a2523 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/js/dumps.js
+++ b/org.eclipse.virgo.management.console/src/main/webapp/js/dumps.js
@@ -190,6 +190,8 @@ var DumpViewer = function(){
new TopBar(tableHolder, layoutManager, dataSource).init();
$('#side-bar').height($('#dump-item-content').height() - 32);
});
+ }, function(){
+ controls.append($('<div />').text('Unable to retrieve Bundle data for the state dump, this requires the Virgo Kernel or above.'));
});
};
@@ -255,21 +257,25 @@ var QuasiDataSource = function(dumpFolder){
});
};
- self.updateData = function(callback){
+ self.updateData = function(callback, failCallback){
util.doQuery('exec/org.eclipse.virgo.kernel:type=Medic,name=StateDumpInspector/listBundles/' + self.dumpFolder, function(response){
- self.bundles = {};
- $.each(response.value, function(index, item){
- self.bundles[item.identifier] = { 'SymbolicName': item.symbolicName,
- 'Version': item.version,
- 'Identifier': item.identifier,
- 'State': item.state,
- 'Region': item.region,
- 'Location': item.location,
- 'Fragment': item.fragment,
- 'ExportedPackages': item.exportedPackages,
- 'ImportedPackages': item.importedPackages};
- });
- callback();
+ if(response.value){
+ self.bundles = {};
+ $.each(response.value, function(index, item){
+ self.bundles[item.identifier] = { 'SymbolicName': item.symbolicName,
+ 'Version': item.version,
+ 'Identifier': item.identifier,
+ 'State': item.state,
+ 'Region': item.region,
+ 'Location': item.location,
+ 'Fragment': item.fragment,
+ 'ExportedPackages': item.exportedPackages,
+ 'ImportedPackages': item.importedPackages};
+ });
+ callback();
+ }else{
+ failCallback();
+ }
});
};

Back to the top