Refresh function image during ui update loop
**What**
Update the function image value during the `refreshData`
@@ -185,7 +185,10 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f
var cl = function (previousItems) {
$http.get("../system/functions").then(function (response) {
- if (response && response.data) {
+ if (response == null || response.data == null) {
+ return
+ }
+
if (previousItems.length != response.data.length) {
$scope.functions = response.data;
@@ -200,13 +203,13 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f
for (var i = 0; i < $scope.functions.length; i++) {
for (var j = 0; j < response.data.length; j++) {
if ($scope.functions[i].name == response.data[j].name) {
+ $scope.functions[i].image = response.data[j].image;
$scope.functions[i].replicas = response.data[j].replicas;
$scope.functions[i].invocationCount = response.data[j].invocationCount;
}
}
}
}
- }
});
};
cl(previous);
