Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wrr-cat
apollo
提交
2fb37008
apollo
项目概览
wrr-cat
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2fb37008
编写于
4月 19, 2016
作者:
L
lepdou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
portal index page
上级
5b6e8bc8
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
160 addition
and
15 deletion
+160
-15
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/AppController.java
...ava/com/ctrip/apollo/portal/controller/AppController.java
+9
-0
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/AppService.java
...main/java/com/ctrip/apollo/portal/service/AppService.java
+4
-0
apollo-portal/src/main/resources/static/index.html
apollo-portal/src/main/resources/static/index.html
+67
-11
apollo-portal/src/main/resources/static/scripts/app.js
apollo-portal/src/main/resources/static/scripts/app.js
+3
-1
apollo-portal/src/main/resources/static/scripts/controller/IndexController.js
...in/resources/static/scripts/controller/IndexController.js
+28
-0
apollo-portal/src/main/resources/static/scripts/services/AppService.js
.../src/main/resources/static/scripts/services/AppService.js
+19
-3
apollo-portal/src/main/resources/static/styles/common-style.css
...-portal/src/main/resources/static/styles/common-style.css
+30
-0
未找到文件。
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/AppController.java
浏览文件 @
2fb37008
...
...
@@ -8,11 +8,14 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ctrip.apollo.core.dto.AppDTO
;
import
com.ctrip.apollo.core.enums.Env
;
import
com.ctrip.apollo.core.exception.BadRequestException
;
import
com.ctrip.apollo.core.utils.StringUtils
;
import
com.ctrip.apollo.portal.entity.ClusterNavTree
;
import
com.ctrip.apollo.portal.service.AppService
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/apps"
)
public
class
AppController
{
...
...
@@ -20,6 +23,12 @@ public class AppController {
@Autowired
private
AppService
appService
;
@RequestMapping
(
"/env/{env}"
)
public
List
<
AppDTO
>
findAllApp
(
@PathVariable
String
env
){
return
appService
.
findAll
(
Env
.
valueOf
(
env
));
}
@RequestMapping
(
"/{appId}/navtree"
)
public
ClusterNavTree
nav
(
@PathVariable
String
appId
)
{
if
(
StringUtils
.
isEmpty
(
appId
))
{
...
...
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/AppService.java
浏览文件 @
2fb37008
...
...
@@ -29,6 +29,10 @@ public class AppService {
@Autowired
private
AdminServiceAPI
.
AppAPI
appAPI
;
public
List
<
AppDTO
>
findAll
(
Env
env
){
return
appAPI
.
getApps
(
env
);
}
public
ClusterNavTree
buildClusterNavTree
(
String
appId
)
{
ClusterNavTree
tree
=
new
ClusterNavTree
();
...
...
apollo-portal/src/main/resources/static/index.html
浏览文件 @
2fb37008
<!doctype html>
<html
ng-app=
"
create_app
"
>
<html
ng-app=
"
index
"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<!-- styles -->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"vendor/bootstrap/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"vendor/angular/angular-toastr-1.4.1.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
'all'
href=
"vendor/angular/loading-bar.min.css"
>
<link
href=
"//cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.min.css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"styles/common-style.css"
>
<title>
apollo
</title>
</head>
<body>
<body
ng-controller=
"IndexController"
>
<
div
ng-include=
"'views/common/nav.html'"
></div
>
<
!--<div ng-include="'views/common/nav.html'"></div>--
>
<header
class=
"site-header jumbotron"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-xs-12"
><h1>
Apollo
</h1>
<p>
携程统一配置中心
<br><span
class=
"package-amount"
>
共收录了
<strong>
8888
</strong>
个项目
</span></p>
<form
class=
""
role=
"search"
>
<div
class=
"form-group"
><input
type=
"text"
class=
"form-control search clearable"
placeholder=
"搜索App, 例如:900088"
ng-model=
"searchKey"
ng-change=
"search()"
></div>
</form>
</div>
</div>
</div>
</header>
<div
class=
"container-fluid apollo-container"
>
<div
class=
"list-group apps"
>
<a
class=
"package list-group-item"
target=
"_blank"
href=
"/views/app.html?#/appid={{app.appId}}"
ng-repeat=
"app in apps "
>
<div
class=
"row"
>
<div
class=
"col-md-3"
><h4
class=
"apps-name"
>
{{app.appId}}
</h4></div>
<div
class=
"col-md-7 hidden-xs"
>
<p
class=
"apps-description"
>
{{app.name}}
</p>
</div>
<div
class=
"col-md-2"
>
<p
class=
"apps-description"
>
{{app.ownerName}}
<br>
{{app.ownerEmail}}
</p>
<div
class=
"row"
>
<div
class=
"col-lg-12 text-center"
>
<h1>
welcome to apollo!~~
</h1>
</div>
<div
class=
"package-extra-info col-md-9 col-md-offset-3 col-xs-12"
><span><i
class=
"glyphicon glyphicon-fire"
></i>
92793
</span>
</div>
</div>
</a>
<!--<a href="/bootstrap/" class="package list-group-item" data-library-name="bootstrap" target="_blank"-->
<!--onclick="_hmt.push(['_trackEvent', 'packages', 'click', 'bootstrap'])" style="display: block;">-->
<!--<div class="row">-->
<!--<div class="col-md-3"><h4 class="apps-name">{{app.appId}}</h4></div>-->
<!--<div class="col-md-7 hidden-xs">-->
<!--<p class="apps-description">{{app.name}}</p>-->
<!--</div>-->
<!--<div class="col-md-2">-->
<!--<p class="apps-description">-->
<!--{{app.ownerName}}-->
<!--<br>-->
<!--{{app.ownerEmail}}-->
<!--</p>-->
<img
src=
"img/dolphin.jpg"
style=
"width: 100px; height: 130px;"
/>
<a
class=
"btn btn-primary btn-lg"
href=
"views/create-app.html"
role=
"button"
>
create app
</a>
</div>
<!--</div>-->
<!--<div class="package-extra-info col-md-9 col-md-offset-3 col-xs-12"><span><i-->
<!--class="glyphicon glyphicon-fire"></i> 92793</span>-->
<!--</div>-->
<!--</div>-->
<!--</a>-->
<!--<a href="/bootstrap/" class="package list-group-item" data-library-name="bootstrap" target="_blank"-->
<!--onclick="_hmt.push(['_trackEvent', 'packages', 'click', 'bootstrap'])" style="display: block;">-->
<!--<div class="row">-->
<!--<div class="col-md-3"><h4 class="package-name">2222</h4></div>-->
<!--<div class="col-md-9 hidden-xs"><p class="package-description">The most popular front-end framework for-->
<!--developing responsive, mobile first projects on the web.</p></div>-->
<!--<div class="package-extra-info col-md-9 col-md-offset-3 col-xs-12"><span><i class="fa fa-star"></i> 92793</span>-->
<!--</div>-->
<!--</div>-->
<!--</a>-->
</div>
</div>
...
...
@@ -30,7 +87,6 @@
<!--angular-->
<script
src=
"vendor/angular/angular.min.js"
></script>
<script
src=
"vendor/angular/angular-route.min.js"
></script>
<script
src=
"vendor/angular/angular-resource.min.js"
></script>
<script
src=
"vendor/angular/angular-toastr-1.4.1.tpls.min.js"
></script>
<script
src=
"vendor/angular/loading-bar.min.js"
></script>
...
...
@@ -43,6 +99,6 @@
<script
type=
"application/javascript"
src=
"scripts/app.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/services/AppService.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/controller/
CreateApp
Controller.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/controller/
Index
Controller.js"
></script>
</body>
</html>
apollo-portal/src/main/resources/static/scripts/app.js
浏览文件 @
2fb37008
...
...
@@ -2,8 +2,10 @@
var
appService
=
angular
.
module
(
'
app.service
'
,
[
'
ngResource
'
]);
/** page module 定义*/
// 首页
var
index_module
=
angular
.
module
(
'
index
'
,
[
'
toastr
'
,
'
app.service
'
,
'
angular-loading-bar
'
]);
//项目主页
var
application_module
=
angular
.
module
(
'
application
'
,
[
'
ngResource
'
,
'
ui.router
'
,
'
app.service
'
,
'
toastr
'
,
'
angular-loading-bar
'
]);
var
application_module
=
angular
.
module
(
'
application
'
,
[
'
app.service
'
,
'
toastr
'
,
'
angular-loading-bar
'
]);
//创建项目页面
var
create_app_module
=
angular
.
module
(
'
create_app
'
,
[
'
ngResource
'
,
'
toastr
'
,
'
app.service
'
,
'
angular-loading-bar
'
]);
...
...
apollo-portal/src/main/resources/static/scripts/controller/IndexController.js
0 → 100644
浏览文件 @
2fb37008
index_module
.
controller
(
'
IndexController
'
,
[
'
$scope
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
function
(
$scope
,
$window
,
toastr
,
AppService
)
{
$scope
.
env
=
'
LOCAL
'
;
var
apps
=
[];
AppService
.
find_all_app
(
$scope
.
env
).
then
(
function
(
result
)
{
apps
=
result
;
$scope
.
apps
=
apps
;
});
$scope
.
search
=
function
()
{
var
key
=
$scope
.
searchKey
;
if
(
key
==
''
)
{
$scope
.
apps
=
apps
;
return
;
}
var
result
=
[];
apps
.
forEach
(
function
(
item
)
{
if
(
item
.
appId
.
indexOf
(
key
)
>=
0
||
item
.
name
.
indexOf
(
key
)
>=
0
)
{
result
.
push
(
item
);
}
});
$scope
.
apps
=
result
;
};
}]);
apollo-portal/src/main/resources/static/scripts/services/AppService.js
浏览文件 @
2fb37008
appService
.
service
(
'
AppService
'
,
[
'
$resource
'
,
'
$q
'
,
function
(
$resource
,
$q
)
{
var
app_resource
=
$resource
(
'
/apps/:appId
'
,
{},
{
find_all_app
:{
method
:
'
GET
'
,
isArray
:
true
,
url
:
'
/apps/env/:env
'
},
load_navtree
:{
methode
:
'
GET
'
,
isArray
:
false
,
...
...
@@ -15,7 +20,18 @@ appService.service('AppService', ['$resource', '$q', function ($resource, $q) {
}
});
return
{
load_nav_tree
:
function
loadNavTree
(
appId
){
find_all_app
:
function
(
env
)
{
var
d
=
$q
.
defer
();
app_resource
.
find_all_app
({
env
:
env
},
function
(
result
)
{
d
.
resolve
(
result
);
},
function
(
result
)
{
d
.
reject
(
result
);
});
return
d
.
promise
;
},
load_nav_tree
:
function
(
appId
){
var
d
=
$q
.
defer
();
app_resource
.
load_navtree
({
appId
:
appId
...
...
@@ -26,7 +42,7 @@ appService.service('AppService', ['$resource', '$q', function ($resource, $q) {
});
return
d
.
promise
;
},
add
:
function
add
(
app
)
{
add
:
function
(
app
)
{
var
d
=
$q
.
defer
();
app_resource
.
add_app
({},
app
,
function
(
result
)
{
d
.
resolve
(
result
);
...
...
@@ -35,7 +51,7 @@ appService.service('AppService', ['$resource', '$q', function ($resource, $q) {
});
return
d
.
promise
;
},
load
:
function
load
(
appId
)
{
load
:
function
(
appId
)
{
var
d
=
$q
.
defer
();
app_resource
.
load_app
({
appId
:
appId
...
...
apollo-portal/src/main/resources/static/styles/common-style.css
浏览文件 @
2fb37008
...
...
@@ -39,6 +39,36 @@ table th {
text-align
:
center
;
}
/*首页*/
.site-header
{
position
:
relative
;
text-align
:
center
;
background-color
:
#27AE60
;
color
:
#fff
;
margin-bottom
:
0
;
}
.site-header
.search
{
border
:
2px
solid
#27AE60
;
-webkit-box-shadow
:
none
;
box-shadow
:
none
;
font-size
:
16px
;
padding
:
13px
30px
;
border-radius
:
0
;
height
:
auto
;
text-align
:
center
;
}
.list-group
{
margin-top
:
20px
;
}
.apps
.apps-description
{
color
:
gray
;
font-family
:
"Apple Color Emoji"
;
font-size
:
16px
;
}
.app
{
background-color
:
#f5f5f5
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录