mirror of
https://github.com/apache/rocketmq-dashboard.git
synced 2025-09-10 19:48:29 +08:00
@@ -58,6 +58,12 @@ public class ConsumerController {
|
|||||||
return consumerService.refreshGroup(address, consumerGroup);
|
return consumerService.refreshGroup(address, consumerGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "group.refresh.all")
|
||||||
|
@ResponseBody
|
||||||
|
public Object refreshAll(String address) {
|
||||||
|
return consumerService.refreshAllGroup(address);
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/group.query")
|
@RequestMapping(value = "/group.query")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object groupQuery(@RequestParam String consumerGroup, String address) {
|
public Object groupQuery(@RequestParam String consumerGroup, String address) {
|
||||||
|
@@ -57,4 +57,6 @@ public interface ConsumerService {
|
|||||||
ConsumerRunningInfo getConsumerRunningInfo(String consumerGroup, String clientId, boolean jstack);
|
ConsumerRunningInfo getConsumerRunningInfo(String consumerGroup, String clientId, boolean jstack);
|
||||||
|
|
||||||
Object refreshGroup(String address, String consumerGroup);
|
Object refreshGroup(String address, String consumerGroup);
|
||||||
|
|
||||||
|
Object refreshAllGroup(String address);
|
||||||
}
|
}
|
||||||
|
@@ -529,6 +529,7 @@ public class ConsumerServiceImpl extends AbstractCommonService implements Consum
|
|||||||
if (groupConsumeInfo.getGroup().equals(consumerGroup)) {
|
if (groupConsumeInfo.getGroup().equals(consumerGroup)) {
|
||||||
GroupConsumeInfo updatedInfo = queryGroup(consumerGroup, "");
|
GroupConsumeInfo updatedInfo = queryGroup(consumerGroup, "");
|
||||||
updatedInfo.setUpdateTime(new Date());
|
updatedInfo.setUpdateTime(new Date());
|
||||||
|
updatedInfo.setGroup(consumerGroup);
|
||||||
cacheConsumeInfoList.set(i, updatedInfo);
|
cacheConsumeInfoList.set(i, updatedInfo);
|
||||||
return updatedInfo;
|
return updatedInfo;
|
||||||
}
|
}
|
||||||
@@ -536,4 +537,10 @@ public class ConsumerServiceImpl extends AbstractCommonService implements Consum
|
|||||||
}
|
}
|
||||||
throw new RuntimeException("No consumer group information available");
|
throw new RuntimeException("No consumer group information available");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<GroupConsumeInfo> refreshAllGroup(String address) {
|
||||||
|
cacheConsumeInfoList.clear();
|
||||||
|
return queryGroupList(false, address);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -98,7 +98,7 @@ module.controller('consumerController', ['$scope', 'ngDialog', '$http', 'Notific
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.refreshConsumerData = function () {
|
$scope.queryConsumerData = function () {
|
||||||
//Show loader
|
//Show loader
|
||||||
$('#loaderConsumer').removeClass("hide-myloader");
|
$('#loaderConsumer').removeClass("hide-myloader");
|
||||||
|
|
||||||
@@ -123,6 +123,30 @@ module.controller('consumerController', ['$scope', 'ngDialog', '$http', 'Notific
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
$scope.refreshConsumerData = function () {
|
||||||
|
//Show loader
|
||||||
|
$('#loaderConsumer').removeClass("hide-myloader");
|
||||||
|
|
||||||
|
$http({
|
||||||
|
method: "GET",
|
||||||
|
url: "consumer/group.refresh.all",
|
||||||
|
params: {
|
||||||
|
skipSysGroup: false
|
||||||
|
}
|
||||||
|
}).success(function (resp) {
|
||||||
|
if (resp.status == 0) {
|
||||||
|
$scope.allConsumerGrouopList = resp.data;
|
||||||
|
console.log($scope.allConsumerGrouopList);
|
||||||
|
console.log(JSON.stringify(resp));
|
||||||
|
$scope.showConsumerGroupList($scope.paginationConf.currentPage, $scope.allConsumerGrouopList.length);
|
||||||
|
|
||||||
|
//Hide loader
|
||||||
|
$('#loaderConsumer').addClass("hide-myloader");
|
||||||
|
} else {
|
||||||
|
Notification.error({message: resp.errMsg, delay: 2000});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
$scope.monitor = function (consumerGroupName) {
|
$scope.monitor = function (consumerGroupName) {
|
||||||
$http({
|
$http({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
@@ -148,12 +172,12 @@ module.controller('consumerController', ['$scope', 'ngDialog', '$http', 'Notific
|
|||||||
$scope.intervalProcess = null;
|
$scope.intervalProcess = null;
|
||||||
}
|
}
|
||||||
if ($scope.intervalProcessSwitch) {
|
if ($scope.intervalProcessSwitch) {
|
||||||
$scope.intervalProcess = setInterval($scope.refreshConsumerData, 10000);
|
$scope.intervalProcess = setInterval($scope.queryConsumerData, 10000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$scope.refreshConsumerData();
|
$scope.queryConsumerData();
|
||||||
$scope.filterStr = "";
|
$scope.filterStr = "";
|
||||||
$scope.$watch('filterStr', function () {
|
$scope.$watch('filterStr', function () {
|
||||||
$scope.paginationConf.currentPage = 1;
|
$scope.paginationConf.currentPage = 1;
|
||||||
@@ -255,7 +279,7 @@ module.controller('consumerController', ['$scope', 'ngDialog', '$http', 'Notific
|
|||||||
ngDialog.open({
|
ngDialog.open({
|
||||||
preCloseCallback: function (value) {
|
preCloseCallback: function (value) {
|
||||||
// Refresh topic list
|
// Refresh topic list
|
||||||
$scope.refreshConsumerData();
|
$scope.queryConsumerData();
|
||||||
},
|
},
|
||||||
template: $scope.rmqVersion ? 'consumerModifyDialogForV5' : 'consumerModifyDialog',
|
template: $scope.rmqVersion ? 'consumerModifyDialogForV5' : 'consumerModifyDialog',
|
||||||
controller: 'consumerModifyDialogController',
|
controller: 'consumerModifyDialogController',
|
||||||
@@ -339,7 +363,7 @@ module.controller('consumerController', ['$scope', 'ngDialog', '$http', 'Notific
|
|||||||
ngDialog.open({
|
ngDialog.open({
|
||||||
preCloseCallback: function (value) {
|
preCloseCallback: function (value) {
|
||||||
// Refresh topic list
|
// Refresh topic list
|
||||||
$scope.refreshConsumerData();
|
$scope.queryConsumerData();
|
||||||
},
|
},
|
||||||
template: 'deleteConsumerDialog',
|
template: 'deleteConsumerDialog',
|
||||||
controller: 'deleteConsumerDialogController',
|
controller: 'deleteConsumerDialogController',
|
||||||
|
@@ -33,6 +33,9 @@
|
|||||||
<button class="btn btn-raised btn-sm btn-primary" type="button" ng-show="{{writeOperationEnabled}}"
|
<button class="btn btn-raised btn-sm btn-primary" type="button" ng-show="{{writeOperationEnabled}}"
|
||||||
ng-click="openAddDialog()">{{'ADD' | translate}}/ {{'UPDATE' | translate}}
|
ng-click="openAddDialog()">{{'ADD' | translate}}/ {{'UPDATE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-raised btn-sm btn-primary" type="button" ng-click="refreshConsumerData()">
|
||||||
|
{{'REFRESH' | translate}}
|
||||||
|
</button>
|
||||||
<md-switch class="md-primary" md-no-ink aria-label="Switch No Ink" ng-model="intervalProcessSwitch">
|
<md-switch class="md-primary" md-no-ink aria-label="Switch No Ink" ng-model="intervalProcessSwitch">
|
||||||
{{'AUTO_REFRESH' | translate}}
|
{{'AUTO_REFRESH' | translate}}
|
||||||
</md-switch>
|
</md-switch>
|
||||||
|
Reference in New Issue
Block a user