[
https://issues.apache.org/jira/browse/SCB-808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16594946#comment-16594946
]
ASF GitHub Bot commented on SCB-808:
------------------------------------
asifdxtreme closed pull request #430: [SCB-808]Aut-refresh the dashboard and
service-list page every 10sec
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/430
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/frontend/app/scripts/modules/dashboard/controllers/dashboardCtrl.js
b/frontend/app/scripts/modules/dashboard/controllers/dashboardCtrl.js
index ead2f050..ba2541ff 100644
--- a/frontend/app/scripts/modules/dashboard/controllers/dashboardCtrl.js
+++ b/frontend/app/scripts/modules/dashboard/controllers/dashboardCtrl.js
@@ -163,4 +163,11 @@ angular.module('serviceCenter.dashboard', [])
$scope.getAllServices();
+ var dashboardRefresh = $interval(function(){
+ $scope.getAllServices();
+ }, 10000);
+
+ $scope.$on('$destroy', function(){
+ $interval.cancel(dashboardRefresh);
+ })
}]);
\ No newline at end of file
diff --git
a/frontend/app/scripts/modules/serviceCenter/controllers/servicesListCtrl.js
b/frontend/app/scripts/modules/serviceCenter/controllers/servicesListCtrl.js
index ab449c7c..50e5f210 100644
--- a/frontend/app/scripts/modules/serviceCenter/controllers/servicesListCtrl.js
+++ b/frontend/app/scripts/modules/serviceCenter/controllers/servicesListCtrl.js
@@ -16,8 +16,8 @@
*/
'use strict';
angular.module('serviceCenter.sc', [])
- .controller('servicesListController', ['$scope', 'httpService',
'apiConstant', 'commonService', '$stateParams', '$mdDialog',
- function($scope, httpService, apiConstant, commonService,
$stateParams, $mdDialog) {
+ .controller('servicesListController', ['$scope', 'httpService',
'apiConstant', 'commonService', '$stateParams', '$mdDialog', '$interval',
+ function($scope, httpService, apiConstant, commonService,
$stateParams, $mdDialog, $interval) {
$scope.appList = 'fetching';
$scope.serviceList = 'serviceList';
@@ -153,6 +153,14 @@ angular.module('serviceCenter.sc', [])
};
$scope.getAllServices();
+ var serviceRefresh = $interval(function(){
+ $scope.getAllServices();
+ }, 10000);
+
+ $scope.$on('$destroy', function(){
+ $interval.cancel(serviceRefresh);
+ })
+
function processService(service) {
var instanceApi = apiConstant.api.instances.url;
var instanceUrl = instanceApi.replace("{{serviceId}}",
service.serviceId);
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Aut-refresh the dashboard and service-list page every 10sec
> -----------------------------------------------------------
>
> Key: SCB-808
> URL: https://issues.apache.org/jira/browse/SCB-808
> Project: Apache ServiceComb
> Issue Type: Improvement
> Components: Service-Center
> Affects Versions: service-center-1.1.0
> Reporter: xiaoyimei
> Assignee: xiaoyimei
> Priority: Minor
>
> The refresh should only happen if the user is browsing that page
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)