diff --git a/Dockerfile b/Dockerfile index d0ded343..3640d4e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ FROM java:8 MAINTAINER king <1609724385@qq.com> VOLUME /tmp -COPY sentinel-dashboard/target/sentinel-dashboard.jar sentinel_dashboard.jar +COPY sentinel-dashboard/target/sentinel-dashboard.jar app.jar COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas ENV TimeZone=Asia/Shanghai ENV active=dev ENV JAVA_OPTS="-Xmx512M -Xms512M" RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone #EXPOSE 8098 -ENTRYPOINT java $JAVA_OPTS -Dserver.port=7777 -Dcsp.sentinel.dashboard.server=$IP:7777 -Dproject.name=sentinel-dashboard -Dsentinel.dashboard.auth.username=telpo -Dsentinel.dashboard.auth.password=telpo#1234 -jar /sentinel_dashboard.jar --spring.profiles.active=$active +ENTRYPOINT java $JAVA_OPTS -Dserver.port=7777 -Dcsp.sentinel.dashboard.server=$IP:7777 -Dproject +.name=sentinel-dashboard -Dsentinel.dashboard.auth.username=telpo -Dsentinel.dashboard.auth.password=telpo#1234 -jar /app.jar --spring.profiles.active=$active diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java index 63548966..a3bb5663 100755 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java @@ -27,6 +27,8 @@ import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.csp.sentinel.dashboard.domain.vo.MachineInfoVo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -41,9 +43,16 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping(value = "/app") public class AppController { + @Autowired + private static Logger logger = LoggerFactory.getLogger(AppController.class); @Autowired private AppManagement appManagement; + @GetMapping("/app.json") + public Result> queryApp(HttpServletRequest request) { + return Result.ofSuccess(appManagement.getAppNames()); + } + @GetMapping("/names.json") public Result> queryApps(HttpServletRequest request) { return Result.ofSuccess(appManagement.getAppNames()); diff --git a/sentinel-dashboard/src/main/resources/application.properties b/sentinel-dashboard/src/main/resources/application.properties index 27e56bc5..ee7db82d 100755 --- a/sentinel-dashboard/src/main/resources/application.properties +++ b/sentinel-dashboard/src/main/resources/application.properties @@ -7,7 +7,8 @@ spring.http.encoding.enabled=true server.servlet.session.cookie.name=sentinel_dashboard_cookie #logging settings -logging.level.org.springframework.web=INFO +logging.level.org.springframework.web=DEBUG +#logging.file=${user.home}/logs/csp/sentinel-dashboard.log logging.file=${user.home}/logs/csp/sentinel-dashboard.log logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n #logging.pattern.console= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n diff --git a/sentinel-dashboard/src/main/resources/bootstrap-test.yaml b/sentinel-dashboard/src/main/resources/bootstrap-test.yaml index 105faf8f..5397d61f 100644 --- a/sentinel-dashboard/src/main/resources/bootstrap-test.yaml +++ b/sentinel-dashboard/src/main/resources/bootstrap-test.yaml @@ -13,8 +13,8 @@ spring: port: 8719 datasource: - nacos: - server-addr: 172.19.42.44:8848 - data-id: ${spring.application.name}-sentinel-flow - group-id: DEFAULT_GROUP - data-type: json - rule-type: flow + server-addr: 172.19.42.44:8848 + data-id: ${spring.application.name}-sentinel-flow + group-id: DEFAULT_GROUP + data-type: json + rule-type: flow diff --git a/sentinel-dashboard/src/main/resources/bootstrap.yaml b/sentinel-dashboard/src/main/resources/bootstrap.yaml index af64a1b6..b0f73284 100644 --- a/sentinel-dashboard/src/main/resources/bootstrap.yaml +++ b/sentinel-dashboard/src/main/resources/bootstrap.yaml @@ -12,8 +12,8 @@ spring: dashboard: 172.19.192.44:7777 datasource: - nacos: - server-addr: 172.19.42.44:8848 - data-id: ${spring.application.name}-sentinel-flow - group-id: DEFAULT_GROUP - data-type: json - rule-type: flow + server-addr: 172.19.42.44:8848 + data-id: ${spring.application.name}-sentinel-flow + group-id: DEFAULT_GROUP + data-type: json + rule-type: flow