Skip to content

Commit

Permalink
添加多套皮肤以及添加路由配置功能
Browse files Browse the repository at this point in the history
  • Loading branch information
bieberHe committed Aug 1, 2015
1 parent 086215d commit 0eb543c
Show file tree
Hide file tree
Showing 75 changed files with 120,400 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package com.dubboclub.web.controller;

import com.alibaba.dubbo.common.Constants;
import com.dubboclub.admin.model.Provider;
import com.dubboclub.admin.model.Route;
import com.dubboclub.admin.service.ProviderService;
import com.dubboclub.admin.service.RouteService;
import com.dubboclub.web.model.BasicResponse;
import com.dubboclub.web.model.OverrideAbstractInfo;
import com.dubboclub.web.model.RouteAbstractInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -13,6 +18,7 @@
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;

/**
Expand All @@ -25,6 +31,8 @@ public class RouterController {
@Autowired
private RouteService routeService;

@Autowired
private ProviderService providerService;

@RequestMapping("provider/{serviceKey}/list.htm")
public @ResponseBody List<Route> queryRoutesByServiceKey(@PathVariable("serviceKey")String serviceKey) throws UnsupportedEncodingException {
Expand All @@ -41,6 +49,17 @@ BasicResponse createRoute(@RequestBody Route route){
return response;
}

@RequestMapping("batch-delete-{ids}.htm")
public @ResponseBody BasicResponse batchDelete(@PathVariable("ids")String ids){
BasicResponse response = new BasicResponse();
String[] idArray = Constants.COMMA_SPLIT_PATTERN.split(ids);
for(String id:idArray){
routeService.deleteRoute(Long.parseLong(id));
}
response.setResult(BasicResponse.SUCCESS);
return response;
}


@RequestMapping("{type}_{id}.htm")
public @ResponseBody BasicResponse delete(@PathVariable("type")String type,@PathVariable("id")Long id){
Expand All @@ -66,6 +85,22 @@ BasicResponse createRoute(@RequestBody Route route){
return response;
}


@ResponseBody
@RequestMapping("list.htm")
public List<RouteAbstractInfo> list(){
List<Provider> providers = providerService.listAllProvider();
List<RouteAbstractInfo> routeAbstractInfos = new ArrayList<RouteAbstractInfo>();
for(Provider provider :providers){
RouteAbstractInfo routeAbstractInfo = new RouteAbstractInfo();
routeAbstractInfo.setServiceKey(provider.getServiceKey());
routeAbstractInfo.setApplicationName(provider.getApplication());
routeAbstractInfo.setRouteCount(routeService.listByServiceKey(provider.getServiceKey()).size());
routeAbstractInfos.add(routeAbstractInfo);
}
return routeAbstractInfos;
}

@RequestMapping("get_{id}.htm")
public @ResponseBody Route getRoute(@PathVariable("id")Long id){
return routeService.getRoute(id);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.dubboclub.web.model;

/**
* Created by bieber on 2015/8/1.
*/
public class RouteAbstractInfo {

private String applicationName;

private String serviceKey;

private int routeCount;

public String getApplicationName() {
return applicationName;
}

public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}

public String getServiceKey() {
return serviceKey;
}

public void setServiceKey(String serviceKey) {
this.serviceKey = serviceKey;
}

public int getRouteCount() {
return routeCount;
}

public void setRouteCount(int routeCount) {
this.routeCount = routeCount;
}
}
5 changes: 4 additions & 1 deletion dubbokeeper-ui/src/main/webapp/WEB-INF/jsp/common/header.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/libs/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/libs/bootstrap-table.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/libs/bootstrap/css/bootstrap-theme.min.css">
<%--<link rel="stylesheet" href="${pageContext.request.contextPath}/css/libs/bootstrap/css/bootstrap-theme.min.css">--%>
<theme-tpl></theme-tpl>
<%--<link rel="stylesheet" href="${pageContext.request.contextPath}/css/libs/themes/sandstone/bootstrap.css" media="screen">--%>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/libs/themes/assets/css/bootswatch.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/animation.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/libs/font-awesome/font-awesome.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/validator.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@


<script type="text/javascript" src="${pageContext.request.contextPath}/js/libs/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/css/libs/themes/assets/js/bootswatch.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/libs/showdown.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/libs/showdown-table.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/libs/mustache.min.js"></script>
Expand Down
1 change: 1 addition & 0 deletions dubbokeeper-ui/src/main/webapp/WEB-INF/jsp/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
</div>
<dialog-tpl></dialog-tpl>
<%@include file="common/scripts.jsp"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/modules/theme/theme.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/modules/router/router.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/modules/override/override.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/modules/statistics/statistics.js"></script>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
(function(){
$(window).scroll(function () {
var top = $(document).scrollTop();
$('.splash').css({
'background-position': '0px -'+(top/3).toFixed(2)+'px'
});
if(top > 50)
$('#home > .navbar').removeClass('navbar-transparent');
else
$('#home > .navbar').addClass('navbar-transparent');
});

$("a[href='#']").click(function(e) {
e.preventDefault();
});

var $button = $("<div id='source-button' class='btn btn-primary btn-xs'>&lt; &gt;</div>").click(function(){
var html = $(this).parent().html();
html = cleanSource(html);
$("#source-modal pre").text(html);
$("#source-modal").modal();
});

$('.bs-component [data-toggle="popover"]').popover();
$('.bs-component [data-toggle="tooltip"]').tooltip();

$(".bs-component").hover(function(){
$(this).append($button);
$button.show();
}, function(){
$button.hide();
});

function cleanSource(html) {
var lines = html.split(/\n/);

lines.shift();
lines.splice(-1, 1);

var indentSize = lines[0].length - lines[0].trim().length,
re = new RegExp(" {" + indentSize + "}");

lines = lines.map(function(line){
if (line.match(re)) {
line = line.substring(indentSize);
}

return line;
});

lines = lines.join("\n");

return lines;
}

})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(function(){
var bsa = document.createElement('script');
bsa.type = 'text/javascript';
bsa.async = true;
bsa.src = 'http://s3.buysellads.com/ac/bsa.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);
})();
Loading

0 comments on commit 0eb543c

Please sign in to comment.