package pl.java.scalatech;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.system.ApplicationPidFileWriter;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableCircuitBreaker
@EnableHystrixDashboard
@EnableDiscoveryClient
@Controller
public class DashboardHystrixApplication {
   
    @RequestMapping("/")
    public String home() {
        return "forward:/hystrix";
    }
    
    @Bean
    @LoadBalanced
    RestTemplate restTemplate(){
        return new RestTemplate();
    }
    
    public static void main(String[] args) {
        springPIDAppRun(args, DashboardHystrixApplication.class);
    }
    private static void springPIDAppRun(String[] args,Class<?> clazz) {
        SpringApplication springApplication = new SpringApplication(clazz);
        springApplication.addListeners(new ApplicationPidFileWriter());
        springApplication.run(args);
    }
    @Bean
    public ServletRegistrationBean mockStreamServlet() {
        return new ServletRegistrationBean(new MockStreamServlet(), "/mock.stream");
}
}

@@ -25,57 +25,250 @@
 h;%0A%0A
-import org.springframework.boot.SpringApplication
+%0A%0Aimport static pl.java.scalatech.tools.HostInformationTool.getIp;%0A%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.SpringApplication;%0Aimport org.springframework.boot.actuate.info.InfoContributor
 ;%0Aim
@@ -816,24 +816,73 @@
 ation.Bean;%0A
+import org.springframework.core.env.Environment;%0A
 import org.s
@@ -1182,24 +1182,82 @@
 ation %7B%0A   %0A
+    @Autowired%0A    private Environment environment;%0A    %0A%0A
     @Request
@@ -1843,22 +1843,16 @@
 ean%0A    
-public
  Servlet
@@ -1977,10 +1977,290 @@
 am%22);%0A%7D%0A
+    %0A    %0A    @Bean%0A    InfoContributor extendInfo() %7B%0A        return builder -%3E builder.withDetail(%22id%22, environment.getProperty(%22spring.application.name%22) + %22:%22%0A                + environment.getProperty(%22server.port%22))%0A                .withDetail(%22ip%22, getIp());%0A   %7D%0A    %0A    %0A
 %7D%0A

Update DashboardHystrixApplication.java