Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wrr-cat
apollo
提交
6698804e
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,发现更多精彩内容 >>
提交
6698804e
编写于
4月 26, 2016
作者:
L
lepdou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add miss envs
上级
536eb044
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
272 addition
and
66 deletion
+272
-66
apollo-portal/src/main/java/com/ctrip/apollo/portal/api/API.java
...portal/src/main/java/com/ctrip/apollo/portal/api/API.java
+0
-1
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/AppController.java
...ava/com/ctrip/apollo/portal/controller/AppController.java
+10
-5
apollo-portal/src/main/java/com/ctrip/apollo/portal/entity/AppInfoVO.java
...c/main/java/com/ctrip/apollo/portal/entity/AppInfoVO.java
+31
-0
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/AppService.java
...main/java/com/ctrip/apollo/portal/service/AppService.java
+23
-4
apollo-portal/src/main/resources/static/img/close.png
apollo-portal/src/main/resources/static/img/close.png
+0
-0
apollo-portal/src/main/resources/static/img/info.png
apollo-portal/src/main/resources/static/img/info.png
+0
-0
apollo-portal/src/main/resources/static/img/open.png
apollo-portal/src/main/resources/static/img/open.png
+0
-0
apollo-portal/src/main/resources/static/img/plus.png
apollo-portal/src/main/resources/static/img/plus.png
+0
-0
apollo-portal/src/main/resources/static/index.html
apollo-portal/src/main/resources/static/index.html
+1
-0
apollo-portal/src/main/resources/static/scripts/AppUtils.js
apollo-portal/src/main/resources/static/scripts/AppUtils.js
+12
-0
apollo-portal/src/main/resources/static/scripts/app.js
apollo-portal/src/main/resources/static/scripts/app.js
+6
-3
apollo-portal/src/main/resources/static/scripts/controller/CreateAppController.js
...esources/static/scripts/controller/CreateAppController.js
+5
-5
apollo-portal/src/main/resources/static/scripts/controller/IndexController.js
...in/resources/static/scripts/controller/IndexController.js
+4
-4
apollo-portal/src/main/resources/static/scripts/controller/app/AppConfigController.js
...rces/static/scripts/controller/app/AppConfigController.js
+53
-14
apollo-portal/src/main/resources/static/scripts/services/AppService.js
.../src/main/resources/static/scripts/services/AppService.js
+5
-5
apollo-portal/src/main/resources/static/styles/common-style.css
...-portal/src/main/resources/static/styles/common-style.css
+21
-0
apollo-portal/src/main/resources/static/views/app.html
apollo-portal/src/main/resources/static/views/app.html
+98
-24
apollo-portal/src/main/resources/static/views/create-app.html
...lo-portal/src/main/resources/static/views/create-app.html
+3
-1
未找到文件。
apollo-portal/src/main/java/com/ctrip/apollo/portal/api/API.java
浏览文件 @
6698804e
...
...
@@ -27,5 +27,4 @@ public class API {
public
String
getAdminServiceHost
(
Env
env
)
{
return
serviceLocator
.
getAdminService
(
env
).
getHomepageUrl
();
}
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/AppController.java
浏览文件 @
6698804e
...
...
@@ -12,6 +12,7 @@ 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.AppInfoVO
;
import
com.ctrip.apollo.portal.entity.ClusterNavTree
;
import
com.ctrip.apollo.portal.service.AppService
;
...
...
@@ -25,7 +26,7 @@ public class AppController {
private
AppService
appService
;
@RequestMapping
(
"/env/{env}"
)
@RequestMapping
(
"/env
s
/{env}"
)
public
List
<
AppDTO
>
findAllApp
(
@PathVariable
String
env
){
if
(
StringUtils
.
isEmpty
(
env
)){
throw
new
BadRequestException
(
"env can not be empty"
);
...
...
@@ -42,17 +43,21 @@ public class AppController {
return
appService
.
buildClusterNavTree
(
appId
);
}
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
,
consumes
=
{
"application/json"
})
public
ResponseEntity
<
Void
>
create
(
@RequestBody
AppDTO
app
)
{
@RequestMapping
(
value
=
"
/envs/{env}
"
,
method
=
RequestMethod
.
POST
,
consumes
=
{
"application/json"
})
public
ResponseEntity
<
Void
>
create
(
@
PathVariable
String
env
,
@
RequestBody
AppDTO
app
)
{
if
(
isInvalidApp
(
app
)){
throw
new
BadRequestException
(
"request payload contains empty"
);
}
appService
.
save
(
app
);
if
(
"ALL"
.
equals
(
env
)){
appService
.
save
(
app
);
}
else
{
appService
.
save
(
Env
.
valueOf
(
env
),
app
);
}
return
ResponseEntity
.
ok
().
build
();
}
@RequestMapping
(
value
=
"/{appId}"
,
method
=
RequestMethod
.
GET
)
public
App
DT
O
load
(
@PathVariable
String
appId
){
public
App
InfoV
O
load
(
@PathVariable
String
appId
){
if
(
StringUtils
.
isEmpty
(
appId
)){
throw
new
BadRequestException
(
"app id can not be empty."
);
}
...
...
apollo-portal/src/main/java/com/ctrip/apollo/portal/entity/AppInfoVO.java
0 → 100644
浏览文件 @
6698804e
package
com.ctrip.apollo.portal.entity
;
import
com.ctrip.apollo.core.dto.AppDTO
;
import
com.ctrip.apollo.core.enums.Env
;
import
java.util.List
;
public
class
AppInfoVO
{
private
AppDTO
app
;
/**
* 在创建app的时候可能在某些环境下创建失败
*/
private
List
<
Env
>
missEnvs
;
public
AppDTO
getApp
()
{
return
app
;
}
public
void
setApp
(
AppDTO
app
)
{
this
.
app
=
app
;
}
public
List
<
Env
>
getMissEnvs
()
{
return
missEnvs
;
}
public
void
setMissEnvs
(
List
<
Env
>
missEnvs
)
{
this
.
missEnvs
=
missEnvs
;
}
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/AppService.java
浏览文件 @
6698804e
package
com.ctrip.apollo.portal.service
;
import
java.util.Arrays
;
import
java.util.LinkedList
;
import
java.util.List
;
import
org.slf4j.Logger
;
...
...
@@ -17,6 +19,7 @@ import com.ctrip.apollo.core.exception.BadRequestException;
import
com.ctrip.apollo.core.exception.ServiceException
;
import
com.ctrip.apollo.portal.PortalSettings
;
import
com.ctrip.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.apollo.portal.entity.AppInfoVO
;
import
com.ctrip.apollo.portal.entity.ClusterNavTree
;
@Service
...
...
@@ -37,16 +40,19 @@ public class AppService {
return
appAPI
.
findApps
(
env
);
}
public
App
DT
O
load
(
String
appId
)
{
public
App
InfoV
O
load
(
String
appId
)
{
//轮询环境直到能找到此app的信息
AppDTO
app
=
null
;
List
<
Env
>
missEnvs
=
new
LinkedList
<>();
for
(
Env
env
:
portalSettings
.
getEnvs
())
{
try
{
app
=
appAPI
.
loadApp
(
env
,
appId
);
break
;
}
catch
(
HttpClientErrorException
e
)
{
//not exist maybe because create app fail.
if
(
e
.
getStatusCode
()
==
HttpStatus
.
NOT_FOUND
)
{
missEnvs
.
add
(
env
);
logger
.
warn
(
"app:{} in {} not exist"
,
appId
,
env
);
}
else
{
logger
.
error
(
"load app info({}) from env:{} error."
,
appId
,
env
);
...
...
@@ -54,11 +60,15 @@ public class AppService {
}
}
}
if
(
app
==
null
){
if
(
app
==
null
)
{
throw
new
BadRequestException
(
String
.
format
(
"invalid app id %s"
,
appId
));
}
return
app
;
AppInfoVO
appInfo
=
new
AppInfoVO
();
appInfo
.
setApp
(
app
);
appInfo
.
setMissEnvs
(
missEnvs
);
return
appInfo
;
}
...
...
@@ -86,4 +96,13 @@ public class AppService {
}
}
public
void
save
(
Env
env
,
AppDTO
app
)
{
try
{
appAPI
.
save
(
env
,
app
);
}
catch
(
HttpStatusCodeException
e
)
{
logger
.
error
(
ExceptionUtils
.
toString
(
e
));
throw
e
;
}
}
}
apollo-portal/src/main/resources/static/img/close.png
0 → 100644
浏览文件 @
6698804e
2.9 KB
apollo-portal/src/main/resources/static/img/info.png
0 → 100644
浏览文件 @
6698804e
5.9 KB
apollo-portal/src/main/resources/static/img/open.png
0 → 100644
浏览文件 @
6698804e
2.2 KB
apollo-portal/src/main/resources/static/img/plus.png
0 → 100644
浏览文件 @
6698804e
2.5 KB
apollo-portal/src/main/resources/static/index.html
浏览文件 @
6698804e
...
...
@@ -79,6 +79,7 @@
<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/services/EnvService.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/AppUtils.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/controller/IndexController.js"
></script>
</body>
</html>
apollo-portal/src/main/resources/static/scripts/AppUtils.js
0 → 100644
浏览文件 @
6698804e
appUtil
.
service
(
'
AppUtil
'
,
[
function
()
{
return
{
errorMsg
:
function
(
response
)
{
var
msg
=
"
Code:
"
+
response
.
status
;
if
(
response
.
data
.
message
!=
null
){
msg
+=
"
Msg:
"
+
response
.
data
.
message
;
}
return
msg
;
}
}
}]);
apollo-portal/src/main/resources/static/scripts/app.js
浏览文件 @
6698804e
/**service module 定义*/
var
appService
=
angular
.
module
(
'
app.service
'
,
[
'
ngResource
'
]);
/**utils*/
var
appUtil
=
angular
.
module
(
'
app.util
'
,
[]);
/** page module 定义*/
// 首页
var
index_module
=
angular
.
module
(
'
index
'
,
[
'
toastr
'
,
'
app.service
'
,
'
angular-loading-bar
'
]);
var
index_module
=
angular
.
module
(
'
index
'
,
[
'
toastr
'
,
'
app.service
'
,
'
a
pp.util
'
,
'
a
ngular-loading-bar
'
]);
//项目主页
var
application_module
=
angular
.
module
(
'
application
'
,
[
'
app.service
'
,
'
toastr
'
,
'
angular-loading-bar
'
]);
var
application_module
=
angular
.
module
(
'
application
'
,
[
'
app.service
'
,
'
app.util
'
,
'
toastr
'
,
'
angular-loading-bar
'
]);
//创建项目页面
var
create_app_module
=
angular
.
module
(
'
create_app
'
,
[
'
ngResource
'
,
'
toastr
'
,
'
app.service
'
,
'
angular-loading-bar
'
]);
var
create_app_module
=
angular
.
module
(
'
create_app
'
,
[
'
ngResource
'
,
'
toastr
'
,
'
app.service
'
,
'
a
pp.util
'
,
'
a
ngular-loading-bar
'
]);
...
...
apollo-portal/src/main/resources/static/scripts/controller/CreateAppController.js
浏览文件 @
6698804e
create_app_module
.
controller
(
'
CreateAppController
'
,
[
'
$scope
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
function
(
$scope
,
$window
,
toastr
,
AppService
)
{
create_app_module
.
controller
(
'
CreateAppController
'
,
[
'
$scope
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
'
AppUtil
'
,
function
(
$scope
,
$window
,
toastr
,
AppService
,
AppUtil
)
{
$scope
.
sav
e
=
function
()
{
AppService
.
add
(
$scope
.
app
).
then
(
function
(
result
)
{
$scope
.
creat
e
=
function
()
{
AppService
.
create
(
'
ALL
'
,
$scope
.
app
).
then
(
function
(
result
)
{
toastr
.
success
(
'
添加成功!
'
);
setInterval
(
function
()
{
$window
.
location
.
href
=
'
/views/app.html?#appid=
'
+
result
.
appId
;
},
1000
);
},
function
(
result
)
{
toastr
.
error
(
result
.
status
+
result
.
data
.
message
,
'
添加失败!
'
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
)
,
'
添加失败!
'
);
});
};
...
...
apollo-portal/src/main/resources/static/scripts/controller/IndexController.js
浏览文件 @
6698804e
index_module
.
controller
(
'
IndexController
'
,
[
'
$scope
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
'
EnvService
'
,
function
(
$scope
,
$window
,
toastr
,
AppService
,
EnvService
)
{
index_module
.
controller
(
'
IndexController
'
,
[
'
$scope
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
'
AppUtil
'
,
'
EnvService
'
,
function
(
$scope
,
$window
,
toastr
,
AppService
,
AppUtil
,
EnvService
)
{
$scope
.
envs
=
[];
$scope
.
selectedEnv
=
''
;
...
...
@@ -8,7 +8,7 @@ index_module.controller('IndexController', ['$scope', '$window', 'toastr', 'AppS
//default select first env
$scope
.
switchEnv
(
$scope
.
envs
[
0
]);
},
function
(
result
)
{
toastr
.
error
(
result
.
status
+
result
.
data
.
message
,
"
load env error
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
)
,
"
load env error
"
);
});
var
apps
=
[];
...
...
@@ -25,7 +25,7 @@ index_module.controller('IndexController', ['$scope', '$window', 'toastr', 'AppS
$scope
.
appsCount
=
apps
.
length
;
$scope
.
selectedEnv
=
env
;
},
function
(
result
)
{
toastr
.
error
(
result
.
status
+
result
.
data
.
message
,
"
load apps error
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
)
,
"
load apps error
"
);
});
};
...
...
apollo-portal/src/main/resources/static/scripts/controller/app/AppConfigController.js
浏览文件 @
6698804e
application_module
.
controller
(
"
AppConfigController
"
,
[
'
$scope
'
,
'
$location
'
,
'
toastr
'
,
'
AppService
'
,
'
ConfigService
'
,
function
(
$scope
,
$location
,
toastr
,
AppService
,
ConfigService
)
{
[
'
$scope
'
,
'
$location
'
,
'
toastr
'
,
'
AppService
'
,
'
AppUtil
'
,
'
ConfigService
'
,
function
(
$scope
,
$location
,
toastr
,
AppService
,
AppUtil
,
ConfigService
)
{
var
appId
=
$location
.
$$url
.
split
(
"
=
"
)[
1
];
var
currentUser
=
'
test_user
'
;
...
...
@@ -12,7 +12,7 @@ application_module.controller("AppConfigController",
$scope
.
pageContext
=
pageContext
;
//////
/////// load cluster nav tree ///
//////
//////
load cluster nav tree
//////
AppService
.
load_nav_tree
(
$scope
.
pageContext
.
appId
).
then
(
function
(
result
)
{
var
navTree
=
[];
...
...
@@ -58,18 +58,20 @@ application_module.controller("AppConfigController",
}
});
},
function
(
result
)
{
toastr
.
error
(
result
.
status
+
result
.
data
.
message
,
"
加载导航出错
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
)
,
"
加载导航出错
"
);
});
//////
///// app info //////
//////
//////
app info
//////
AppService
.
load
(
$scope
.
pageContext
.
appId
).
then
(
function
(
result
)
{
$scope
.
appInfo
=
result
;
$scope
.
appBaseInfo
=
result
.
app
;
$scope
.
missEnvs
=
result
.
missEnvs
;
$scope
.
selectedEnvs
=
angular
.
copy
(
$scope
.
missEnvs
);
},
function
(
result
)
{
toastr
.
error
(
result
.
status
+
result
.
data
.
message
,
"
加载App信息出错
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
)
,
"
加载App信息出错
"
);
});
//////
///// namespace //////
//////
//////
namespace
//////
var
namespace_view_type
=
{
TEXT
:
'
text
'
,
...
...
@@ -103,11 +105,11 @@ application_module.controller("AppConfigController",
}
},
function
(
result
)
{
toastr
.
error
(
result
.
status
+
result
.
data
.
message
,
"
加载配置信息出错
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
)
,
"
加载配置信息出错
"
);
});
}
//////
//////global view oper ///////
//////
//////
global view oper
//////
$scope
.
switchView
=
function
(
namespace
,
viewType
)
{
...
...
@@ -138,7 +140,7 @@ application_module.controller("AppConfigController",
return
result
;
}
//////
//// text view oper ///
//////
//////
text view oper
//////
$scope
.
draft
=
{};
//保存草稿
...
...
@@ -161,7 +163,7 @@ application_module.controller("AppConfigController",
$scope
.
toggleTextEditStatus
(
$scope
.
draft
);
},
function
(
result
)
{
toastr
.
error
(
result
.
status
+
result
.
data
.
message
,
"
更新失败
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
)
,
"
更新失败
"
);
}
);
...
...
@@ -169,6 +171,7 @@ application_module.controller("AppConfigController",
$scope
.
isItemsViewOpened
=
true
;
$scope
.
toggleItemView
=
function
(
isOpened
)
{
$scope
.
isItemsViewOpened
=
isOpened
;
};
...
...
@@ -185,7 +188,7 @@ application_module.controller("AppConfigController",
}
};
//////
//// table view oper ///
//////
//////
table view oper
//////
//查看旧值
$scope
.
queryOldValue
=
function
(
key
,
oldValue
)
{
...
...
@@ -215,11 +218,47 @@ application_module.controller("AppConfigController",
refreshNamespaces
();
},
function
(
result
)
{
toastr
.
error
(
result
.
status
+
result
.
data
.
message
,
"
发布失败
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
)
,
"
发布失败
"
);
}
);
}
////// create env //////
$scope
.
toggleSelection
=
function
toggleSelection
(
env
)
{
var
idx
=
$scope
.
selectedEnvs
.
indexOf
(
env
);
// is currently selected
if
(
idx
>
-
1
)
{
$scope
.
selectedEnvs
.
splice
(
idx
,
1
);
}
// is newly selected
else
{
$scope
.
selectedEnvs
.
push
(
env
);
}
};
$scope
.
createEnvs
=
function
()
{
var
count
=
0
;
$scope
.
selectedEnvs
.
forEach
(
function
(
env
)
{
AppService
.
create
(
env
,
$scope
.
appBaseInfo
).
then
(
function
(
result
)
{
toastr
.
success
(
env
,
'
创建成功
'
);
count
++
;
if
(
count
==
$scope
.
selectedEnvs
){
$route
.
reload
();
}
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
'
创建失败:
'
+
env
);
count
++
;
if
(
count
==
$scope
.
selectedEnvs
){
$route
.
reload
();
}
});
});
};
}]);
apollo-portal/src/main/resources/static/scripts/services/AppService.js
浏览文件 @
6698804e
...
...
@@ -3,7 +3,7 @@ appService.service('AppService', ['$resource', '$q', function ($resource, $q) {
find_all_app
:{
method
:
'
GET
'
,
isArray
:
true
,
url
:
'
/apps/env/:env
'
url
:
'
/apps/env
s
/:env
'
},
load_navtree
:{
methode
:
'
GET
'
,
...
...
@@ -14,9 +14,9 @@ appService.service('AppService', ['$resource', '$q', function ($resource, $q) {
method
:
'
GET
'
,
isArray
:
false
},
add
_app
:
{
create
_app
:
{
method
:
'
POST
'
,
url
:
'
/apps
'
url
:
'
/apps
/envs/:env
'
}
});
return
{
...
...
@@ -42,9 +42,9 @@ appService.service('AppService', ['$resource', '$q', function ($resource, $q) {
});
return
d
.
promise
;
},
add
:
function
(
app
)
{
create
:
function
(
env
,
app
)
{
var
d
=
$q
.
defer
();
app_resource
.
add_app
({
},
app
,
function
(
result
)
{
app_resource
.
create_app
({
env
:
env
},
app
,
function
(
result
)
{
d
.
resolve
(
result
);
},
function
(
result
)
{
d
.
reject
(
result
);
...
...
apollo-portal/src/main/resources/static/styles/common-style.css
浏览文件 @
6698804e
...
...
@@ -16,6 +16,21 @@ a {
cursor
:
pointer
;
}
.i-20
{
height
:
20px
;
width
:
20px
;
}
.i-25-20
{
height
:
20px
;
width
:
25px
;
}
.i-15
{
height
:
15px
;
width
:
15px
;
}
.apollo-container
{
min-height
:
90%
;
}
...
...
@@ -122,6 +137,12 @@ table th {
font-weight
:
300
;
}
.project-info
th
{
text-align
:
right
;
padding
:
4px
6px
;
white-space
:
nowrap
;
}
.project-info
td
{
word-wrap
:
break-word
;
word-break
:
break-all
;
...
...
apollo-portal/src/main/resources/static/views/app.html
浏览文件 @
6698804e
...
...
@@ -28,35 +28,71 @@
<!--app info-->
<section
class=
"panel"
>
<header
class=
"panel-heading"
>
应用信息
<span
class=
"tools pull-right"
>
<a
href=
"javascript:;"
class=
"icon-chevron-down"
></a>
</span>
<img
src=
"../img/info.png"
class=
"i-25-20"
/>
应用信息
<span
class=
"tools pull-right"
>
<a
href=
"javascript:;"
class=
"icon-chevron-down"
></a>
</span>
</header>
<div
class=
"panel-body"
>
<table
class=
"project-info"
>
<tbody>
<tr>
<th>
应用ID:
</th>
<td>
{{appInfo.appId}}
</td>
<td>
{{app
Base
Info.appId}}
</td>
</tr>
<tr>
<th>
应用名:
</th>
<td>
{{appInfo.name}}
</td>
<td>
{{app
Base
Info.name}}
</td>
</tr>
<tr>
<th>
Owner:
</th>
<td>
{{appInfo.ownerName}}
</td>
<td>
{{app
Base
Info.ownerName}}
</td>
</tr>
<tr>
<th>
Owner Email:
</th>
<td>
{{appInfo.ownerEmail}}
</td>
<td>
{{appBaseInfo.ownerEmail}}
</td>
</tr>
<tr
ng-show=
"missEnvs.length > 0"
>
<th>
缺失的环境:
</th>
<td>
<font
ng-repeat=
"env in missEnvs"
>
{{env}}
</font>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<a
class=
"list-group-item"
data-toggle=
"modal"
data-target=
"#createEnvModal"
ng-show=
"missEnvs.length > 0"
>
<div
class=
"row"
>
<div
class=
"col-md-2"
><img
src=
"../img/plus.png"
class=
"i-20"
></div>
<div
class=
"col-md-7 hidden-xs"
>
<p
class=
"apps-description"
>
添加环境
</p>
</div>
</div>
</a>
<a
class=
"list-group-item"
target=
"_blank"
href=
"/views/app.html?#/appid={{app.appId}}"
>
<div
class=
"row"
>
<div
class=
"col-md-2"
><img
src=
"../img/plus.png"
class=
"i-20"
></div>
<div
class=
"col-md-7 hidden-xs"
>
<p
class=
"apps-description"
>
添加集群
</p>
</div>
</div>
</a>
<a
class=
"list-group-item"
target=
"_blank"
href=
"/views/app.html?#/appid={{app.appId}}"
>
<div
class=
"row"
>
<div
class=
"col-md-2"
><img
src=
"../img/plus.png"
class=
"i-20"
></div>
<div
class=
"col-md-7 hidden-xs"
>
<p
class=
"apps-description"
>
添加Namespace
</p>
</div>
</div>
</a>
</section>
</div>
<div
class=
"col-md-9 config-item-container"
>
...
...
@@ -65,12 +101,14 @@
<div
class=
"panel"
>
<header
class=
"panel-heading"
>
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<div
class=
"col-md-3"
>
<img
src=
"../img/close.png"
class=
"i-15"
ng-show=
"!isItemsViewOpened"
/>
<img
src=
"../img/open.png"
class=
"i-15"
ng-show=
"isItemsViewOpened"
/>
<b>
{{namespace.namespace.namespaceName}}
</b>
<span
class=
"label label-info"
ng-show=
"namespace.itemModifiedCnt > 0"
>
有修改,可发布
<span
class=
"badge"
>
{{namespace.itemModifiedCnt}}
</span></span>
</div>
<div
class=
"col-md-
7
"
>
<div
class=
"col-md-
8
"
>
<div
class=
"btn-toolbar"
role=
"toolbar"
aria-label=
"..."
>
<div
class=
"btn-group"
role=
"group"
aria-label=
"..."
>
<button
type=
"button"
data-toggle=
"modal"
data-target=
"#releaseModal"
...
...
@@ -120,7 +158,7 @@
<span
class=
"glyphicon glyphicon-remove"
aria-hidden=
"true"
></span>
</a>
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"修改配置"
ng-show=
"!namespace.isTextEditing && namespace.viewType == 'text'"
ng-show=
"!namespace.isTextEditing && namespace.viewType == 'text'
&& isItemsViewOpened
"
ng-click=
"toggleTextEditStatus(namespace)"
>
<span
class=
"glyphicon glyphicon-pencil"
aria-hidden=
"true"
></span>
</a>
...
...
@@ -134,7 +172,8 @@
</header>
<!--text view-->
<textarea
class=
"form-control"
rows=
"30"
ng-show=
"isItemsViewOpened && namespace.viewType == 'text'"
<textarea
class=
"form-control"
rows=
"30"
ng-show=
"isItemsViewOpened && namespace.viewType == 'text'"
ng-disabled=
"!namespace.isTextEditing"
ng-model=
"namespace.text"
>
{{namespace.text}}
</textarea>
...
...
@@ -145,7 +184,7 @@
ng-show=
"isItemsViewOpened && namespace.viewType == 'table'"
>
<thead>
<tr>
<th
>
<th>
Key
</th>
<th>
...
...
@@ -164,7 +203,8 @@
</thead>
<tbody>
<tr
ng-repeat=
"config in namespace.items"
ng-class=
"{warning:config.modified}"
ng-if=
"config.item.key"
>
<tr
ng-repeat=
"config in namespace.items"
ng-class=
"{warning:config.modified}"
ng-if=
"config.item.key"
>
<td
width=
"25%"
>
{{config.item.key}}
</td>
...
...
@@ -175,7 +215,7 @@
ng-show=
"config.modified"
ng-click=
"queryOldValue(config.item.key, config.oldValue)"
></button>
{{config.item.value}}
</td
>
</td>
<td
width=
"20%"
>
{{config.item.comment}}
</td>
...
...
@@ -192,7 +232,8 @@
</div>
<!--历史修改视图-->
<div
class=
"J_historyview history-view"
ng-show=
"isItemsViewOpened && namespace.viewType == 'history'"
>
<div
class=
"J_historyview history-view"
ng-show=
"isItemsViewOpened && namespace.viewType == 'history'"
>
<div
class=
"row"
>
<div
class=
"col-md-11 col-md-offset-1 list"
style=
""
>
<div
class=
"media"
>
...
...
@@ -244,39 +285,40 @@
</div>
<!-- view old value Modal -->
<div
class=
"modal fade "
id=
"oldValueModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
>
<div
class=
"modal fade "
id=
"oldValueModal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog modal-sm"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header panel-primary"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
旧值
</h4>
<h4
class=
"modal-title"
>
旧值
</h4>
</div>
<div
class=
"modal-body"
>
{{OldValue}}
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
</div>
</div>
</div>
</div>
<!-- commit modify config modal-->
<div
class=
"modal fade"
id=
"commitModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel2"
>
<div
class=
"modal fade"
id=
"commitModal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header panel-primary"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel2"
>
Commit changes
</h4>
<h4
class=
"modal-title"
>
Commit changes
</h4>
</div>
<div
class=
"modal-body"
>
<textarea
rows=
"4"
class=
"form-control"
style=
"width:570px;"
placeholder=
"input change log...."
ng-model=
"commitComment"
></textarea>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
ng-click=
"commitChange()"
>
提交
</button>
...
...
@@ -285,26 +327,57 @@
</div>
</div>
<!--create
R
elease modal-->
<div
class=
"modal fade"
id=
"releaseModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel3"
>
<!--create
r
elease modal-->
<div
class=
"modal fade"
id=
"releaseModal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header panel-primary"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel3"
>
发布
</h4>
<h4
class=
"modal-title"
>
发布
</h4>
</div>
<div
class=
"modal-body"
>
<textarea
rows=
"4"
class=
"form-control"
style=
"width:570px;"
ng-model=
"releaseComment"
placeholder=
"input release log...."
></textarea>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
ng-click=
"release()"
>
提交
</button>
</div>
</div>
</div>
</div>
<!--create env modal-->
<div
class=
"modal fade"
id=
"createEnvModal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header panel-primary"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
>
添加环境
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"form-group"
>
<label>
请选择环境:
</label>
<div
class=
"checkbox"
ng-repeat=
"env in missEnvs"
>
<label>
<input
type=
"checkbox"
name=
"selectedEnvs[]"
value=
"{{env}}"
ng-checked=
"selectedEnvs.indexOf(env) > -1"
ng-click=
"toggleSelection(env)"
>
{{env}}
</label>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
ng-click=
"createEnvs()"
>
添加
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
@@ -339,6 +412,7 @@
<!--service-->
<script
type=
"application/javascript"
src=
"../scripts/services/AppService.js"
></script>
<script
type=
"application/javascript"
src=
"../scripts/services/ConfigService.js"
></script>
<script
type=
"application/javascript"
src=
"../scripts/AppUtils.js"
></script>
<!--controller-->
<script
type=
"application/javascript"
src=
"../scripts/controller/app/AppConfigController.js"
></script>
...
...
apollo-portal/src/main/resources/static/views/create-app.html
浏览文件 @
6698804e
...
...
@@ -24,7 +24,7 @@
</header>
<div
class=
"panel-body"
>
<form
class=
"form-horizontal"
ng-controller=
"CreateAppController"
ng-submit=
"
sav
e()"
>
<form
class=
"form-horizontal"
ng-controller=
"CreateAppController"
ng-submit=
"
creat
e()"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><font
style=
"color: red"
>
*
</font>
应用ID
</label>
<div
class=
"col-sm-3"
>
...
...
@@ -81,6 +81,8 @@
<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/AppUtils.js"
></script>
<script
type=
"application/javascript"
src=
"../scripts/controller/CreateAppController.js"
></script>
</body>
</html>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录