소스 검색

nacos持久化

master
wangjx 3 년 전
부모
커밋
09356e42c4
3개의 변경된 파일2개의 추가작업 그리고 7개의 파일을 삭제
  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 파일 보기

@@ -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 파일 보기

@@ -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 파일 보기

@@ -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">


Loading…
취소
저장