Ver código fonte

nacos持久化

master
wangjx 3 anos atrás
pai
commit
09356e42c4
3 arquivos alterados com 2 adições e 7 exclusões
  1. +1
    -3
      sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleNacosProvider.java
  2. +0
    -3
      sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleNacosPublisher.java
  3. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/sidebar/sidebar.html

+ 1
- 3
sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleNacosProvider.java Ver arquivo

@@ -20,7 +20,6 @@ import com.alibaba.csp.sentinel.dashboard.config.NacosPropertiesConfiguration;
import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity;
import com.alibaba.csp.sentinel.datasource.Converter;
import com.alibaba.nacos.api.config.ConfigService;
import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
@@ -31,7 +30,6 @@ import java.util.List;
/**
* @author Eric Zhao
*/
@Log4j
@Service
public class FlowRuleNacosProvider implements DynamicRuleProvider<List<FlowRuleEntity>> {

@@ -47,7 +45,7 @@ public class FlowRuleNacosProvider implements DynamicRuleProvider<List<FlowRuleE
public List<FlowRuleEntity> getRules(String appName) throws Exception {
String dataId=new StringBuilder(appName).append(NacosConstants.DATA_ID_POSTFIX).toString();
String rules = configService.getConfig(dataId,nacosPropertiesConfiguration.getGroupId(),3000);
log.info("pull FlowRule from nacos Config:"+rules);
//log.info("pull FlowRule from nacos Config:"+rules);
if (rules.isEmpty()) {
return new ArrayList<>();
} else {


+ 0
- 3
sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleNacosPublisher.java Ver arquivo

@@ -21,18 +21,15 @@ import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity;
import com.alibaba.csp.sentinel.datasource.Converter;
import com.alibaba.csp.sentinel.util.AssertUtil;
import com.alibaba.nacos.api.config.ConfigService;
import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
* @author Eric Zhao
*/
@Log4j
@Service
public class FlowRuleNacosPublisher implements DynamicRulePublisher<List<FlowRuleEntity>> {



+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/sidebar/sidebar.html Ver arquivo

@@ -21,7 +21,7 @@
<span class="fa arrow"></span>
<span class="arrow">({{entry.healthyCount}}/{{entry.machines.length}})</span>
</a -->
<li class="glyphicon-dashboard" ng-repeat="entry in apps | filter: { app: searchApp }">
<li ng-class="glyphicon-dashboard" ng-repeat="entry in apps | filter: { app: searchApp }">
sentinel_dashboard
<!--<ul class="nav nav-second-level" collapse="{{entry.active}}" style="display: none;">-->
<ul class="nav nav-second-level" ng-show="entry.active">


Carregando…
Cancelar
Salvar