From 88db9976c6f348ad8356a0a939911e7a1aae489d Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Mon, 10 Nov 2014 13:55:11 +0000 Subject: [PATCH] Move hystrix templates to /hystrix/* --- .../hystrix/dashboard/HystrixDashboardController.java | 9 +++++---- .../src/main/resources/templates/{ => hystrix}/index.ftl | 0 .../main/resources/templates/{ => hystrix}/monitor.ftl | 0 3 files changed, 5 insertions(+), 4 deletions(-) rename spring-cloud-netflix-hystrix-dashboard/src/main/resources/templates/{ => hystrix}/index.ftl (100%) rename spring-cloud-netflix-hystrix-dashboard/src/main/resources/templates/{ => hystrix}/monitor.ftl (100%) diff --git a/spring-cloud-netflix-hystrix-dashboard/src/main/java/org/springframework/cloud/netflix/hystrix/dashboard/HystrixDashboardController.java b/spring-cloud-netflix-hystrix-dashboard/src/main/java/org/springframework/cloud/netflix/hystrix/dashboard/HystrixDashboardController.java index a562c35e..5a494883 100644 --- a/spring-cloud-netflix-hystrix-dashboard/src/main/java/org/springframework/cloud/netflix/hystrix/dashboard/HystrixDashboardController.java +++ b/spring-cloud-netflix-hystrix-dashboard/src/main/java/org/springframework/cloud/netflix/hystrix/dashboard/HystrixDashboardController.java @@ -17,6 +17,7 @@ package org.springframework.cloud.netflix.hystrix.dashboard; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.context.request.WebRequest; @@ -30,14 +31,14 @@ public class HystrixDashboardController { @RequestMapping("/hystrix") public String home(Model model, WebRequest request) { model.addAttribute("basePath", extractPath(request)); - return "index"; + return "hystrix/index"; } - @RequestMapping("/hystrix/monitor") - public String monitor(Model model, WebRequest request) { + @RequestMapping("/hystrix/{path}") + public String monitor(@PathVariable String path, Model model, WebRequest request) { model.addAttribute("basePath", extractPath(request)); model.addAttribute("contextPath", request.getContextPath()); - return "monitor"; + return "hystrix/" + path; } private String extractPath(WebRequest request) { diff --git a/spring-cloud-netflix-hystrix-dashboard/src/main/resources/templates/index.ftl b/spring-cloud-netflix-hystrix-dashboard/src/main/resources/templates/hystrix/index.ftl similarity index 100% rename from spring-cloud-netflix-hystrix-dashboard/src/main/resources/templates/index.ftl rename to spring-cloud-netflix-hystrix-dashboard/src/main/resources/templates/hystrix/index.ftl diff --git a/spring-cloud-netflix-hystrix-dashboard/src/main/resources/templates/monitor.ftl b/spring-cloud-netflix-hystrix-dashboard/src/main/resources/templates/hystrix/monitor.ftl similarity index 100% rename from spring-cloud-netflix-hystrix-dashboard/src/main/resources/templates/monitor.ftl rename to spring-cloud-netflix-hystrix-dashboard/src/main/resources/templates/hystrix/monitor.ftl