forked from HomeAdvisor/Kafdrop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Display overall cluster health - Identify missing broker nodes - Show broker partition assignments - Convert to Bootstrap 3 - Start of integration test suite
- Loading branch information
Showing
30 changed files
with
1,267 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/api-test/groovy/com/homeadvisor/kafdrop/KafdropApiSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import spock.lang.Shared | ||
import spock.lang.Specification | ||
|
||
import groovyx.net.http.RESTClient | ||
|
||
/** | ||
* Spock test that exercises Kafdrop APIs. | ||
*/ | ||
class KafdropApiSpec extends Specification | ||
{ | ||
@Shared RESTClient restClient = new RESTClient() | ||
|
||
def "Cluster APIs"() | ||
{ | ||
|
||
} | ||
|
||
def "Topic APIs"() | ||
{ | ||
|
||
} | ||
|
||
def "Broker APIs"() | ||
{ | ||
|
||
} | ||
|
||
def "Consumer APIs"() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/java/com/homeadvisor/kafdrop/config/InterceptorConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright 2017 HomeAdvisor, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* | ||
*/ | ||
|
||
package com.homeadvisor.kafdrop.config; | ||
|
||
import org.apache.commons.lang.StringUtils; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.core.env.Environment; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.servlet.ModelAndView; | ||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; | ||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
@Component | ||
public class InterceptorConfiguration extends WebMvcConfigurerAdapter { | ||
|
||
@Autowired | ||
private Environment environment; | ||
|
||
@Override | ||
public void addInterceptors(InterceptorRegistry registry) { | ||
registry.addInterceptor(new ProfileHandlerInterceptor()); | ||
} | ||
|
||
|
||
public class ProfileHandlerInterceptor extends HandlerInterceptorAdapter { | ||
@Override | ||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { | ||
final String[] activeProfiles = environment.getActiveProfiles(); | ||
if (modelAndView != null && activeProfiles != null && activeProfiles.length > 0) { | ||
modelAndView.addObject("profile", String.join(",", activeProfiles)); | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.