Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#45: Make the profile update. Need a way to avoid the little flickering.
  • Loading branch information
davsclaus committed Apr 10, 2013
1 parent c0f6234 commit f72eb03
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
15 changes: 9 additions & 6 deletions hawtio-web/src/main/webapp/app/camel/js/profile.ts
Expand Up @@ -98,6 +98,7 @@ module Camel {


var populateProfileMessages = function (response) {
console.log("Populate profile data...")
var updatedData = [];

// its xml structure so we need to parse it
Expand Down Expand Up @@ -238,14 +239,16 @@ module Camel {
updatedData.reverse();
}

// TODO: need a way to update data without flickering
// if we do as below with the forEach then the data does not update
// replace data with updated data
if ($scope.data.length === 0) {
// if ($scope.data.length === 0) {
$scope.data = updatedData;
} else {
updatedData.forEach((data, idx) => {
$scope[idx] = data;
});
}
// } else {
// updatedData.forEach((data, idx) => {
// $scope.data[idx] = data;
// });
// }

Core.$apply($scope);
};
Expand Down
10 changes: 4 additions & 6 deletions hawtio-web/src/test/resources/applicationContext.xml
Expand Up @@ -94,16 +94,14 @@
</otherwise>
</choice>
</route>
<!--
<!-- route for having something trigger all the time -->
<route id="timerToLog">
<from uri="timer:foo?period=5000"/>
<marshal>
<json library="Jackson"/>
</marshal>
<from uri="timer:foo?period=2000"/>
<setBody><constant>Hello World</constant></setBody>
<delay><constant>500</constant></delay>
<log message="The message contains ${body}"/>
<to uri="activemq:timer.events"/>
</route>
-->
</camelContext>

<!-- infinispan demo -->
Expand Down

0 comments on commit f72eb03

Please sign in to comment.