Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
superrain51
apollo
提交
29793fbc
apollo
项目概览
superrain51
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
未验证
提交
29793fbc
编写于
8月 12, 2018
作者:
J
Jason Song
提交者:
GitHub
8月 12, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1357 from nobodyiam/portal-server-config
add query function for portal server config page
上级
c61a80a8
7c5a188a
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
74 addition
and
23 deletion
+74
-23
apollo-adminservice/pom.xml
apollo-adminservice/pom.xml
+1
-1
apollo-adminservice/src/main/docker/Dockerfile
apollo-adminservice/src/main/docker/Dockerfile
+1
-1
apollo-assembly/pom.xml
apollo-assembly/pom.xml
+1
-1
apollo-biz/pom.xml
apollo-biz/pom.xml
+1
-1
apollo-buildtools/pom.xml
apollo-buildtools/pom.xml
+1
-1
apollo-client/pom.xml
apollo-client/pom.xml
+1
-1
apollo-common/pom.xml
apollo-common/pom.xml
+1
-1
apollo-configservice/pom.xml
apollo-configservice/pom.xml
+1
-1
apollo-configservice/src/main/docker/Dockerfile
apollo-configservice/src/main/docker/Dockerfile
+1
-1
apollo-core/pom.xml
apollo-core/pom.xml
+1
-1
apollo-demo/pom.xml
apollo-demo/pom.xml
+1
-1
apollo-portal/pom.xml
apollo-portal/pom.xml
+1
-1
apollo-portal/src/main/docker/Dockerfile
apollo-portal/src/main/docker/Dockerfile
+1
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ServerConfigController.java
...work/apollo/portal/controller/ServerConfigController.java
+6
-1
apollo-portal/src/main/resources/static/scripts/controller/ServerConfigController.js
...urces/static/scripts/controller/ServerConfigController.js
+26
-2
apollo-portal/src/main/resources/static/scripts/services/ServerConfigService.js
.../resources/static/scripts/services/ServerConfigService.js
+15
-0
apollo-portal/src/main/resources/static/server_config.html
apollo-portal/src/main/resources/static/server_config.html
+13
-6
pom.xml
pom.xml
+1
-1
未找到文件。
apollo-adminservice/pom.xml
浏览文件 @
29793fbc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-adminservice/src/main/docker/Dockerfile
浏览文件 @
29793fbc
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
FROM
openjdk:8-jre-alpine
FROM
openjdk:8-jre-alpine
MAINTAINER
ameizi <sxyx2008@163.com>
MAINTAINER
ameizi <sxyx2008@163.com>
ENV
VERSION 1.
0.0
ENV
VERSION 1.
1.0-SNAPSHOT
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.6/main"
>
/etc/apk/repositories
\
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.6/main"
>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.6/community"
>>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.6/community"
>>
/etc/apk/repositories
\
...
...
apollo-assembly/pom.xml
浏览文件 @
29793fbc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-biz/pom.xml
浏览文件 @
29793fbc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-biz
</artifactId>
<artifactId>
apollo-biz
</artifactId>
...
...
apollo-buildtools/pom.xml
浏览文件 @
29793fbc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-client/pom.xml
浏览文件 @
29793fbc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-common/pom.xml
浏览文件 @
29793fbc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-configservice/pom.xml
浏览文件 @
29793fbc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-configservice/src/main/docker/Dockerfile
浏览文件 @
29793fbc
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
FROM
openjdk:8-jre-alpine
FROM
openjdk:8-jre-alpine
MAINTAINER
ameizi <sxyx2008@163.com>
MAINTAINER
ameizi <sxyx2008@163.com>
ENV
VERSION 1.
0.0
ENV
VERSION 1.
1.0-SNAPSHOT
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.6/main"
>
/etc/apk/repositories
\
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.6/main"
>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.6/community"
>>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.6/community"
>>
/etc/apk/repositories
\
...
...
apollo-core/pom.xml
浏览文件 @
29793fbc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-demo/pom.xml
浏览文件 @
29793fbc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-demo
</artifactId>
<artifactId>
apollo-demo
</artifactId>
...
...
apollo-portal/pom.xml
浏览文件 @
29793fbc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-portal/src/main/docker/Dockerfile
浏览文件 @
29793fbc
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
FROM
openjdk:8-jre-alpine
FROM
openjdk:8-jre-alpine
MAINTAINER
ameizi <sxyx2008@163.com>
MAINTAINER
ameizi <sxyx2008@163.com>
ENV
VERSION 1.
0.0
ENV
VERSION 1.
1.0-SNAPSHOT
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.6/main"
>
/etc/apk/repositories
\
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.6/main"
>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.6/community"
>>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.6/community"
>>
/etc/apk/repositories
\
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ServerConfigController.java
浏览文件 @
29793fbc
...
@@ -9,6 +9,7 @@ import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
...
@@ -9,6 +9,7 @@ import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
@@ -49,8 +50,12 @@ public class ServerConfigController {
...
@@ -49,8 +50,12 @@ public class ServerConfigController {
storedConfig
.
setDataChangeLastModifiedBy
(
modifiedBy
);
storedConfig
.
setDataChangeLastModifiedBy
(
modifiedBy
);
return
serverConfigRepository
.
save
(
storedConfig
);
return
serverConfigRepository
.
save
(
storedConfig
);
}
}
}
}
@PreAuthorize
(
value
=
"@permissionValidator.isSuperAdmin()"
)
@RequestMapping
(
value
=
"/server/config/{key:.+}"
,
method
=
RequestMethod
.
GET
)
public
ServerConfig
loadServerConfig
(
@PathVariable
String
key
)
{
return
serverConfigRepository
.
findByKey
(
key
);
}
}
}
apollo-portal/src/main/resources/static/scripts/controller/ServerConfigController.js
浏览文件 @
29793fbc
...
@@ -3,13 +3,37 @@ server_config_module.controller('ServerConfigController',
...
@@ -3,13 +3,37 @@ server_config_module.controller('ServerConfigController',
function
(
$scope
,
$window
,
toastr
,
ServerConfigService
,
AppUtil
)
{
function
(
$scope
,
$window
,
toastr
,
ServerConfigService
,
AppUtil
)
{
$scope
.
serverConfig
=
{};
$scope
.
serverConfig
=
{};
$scope
.
saveBtnDisabled
=
true
;
$scope
.
create
=
function
()
{
$scope
.
create
=
function
()
{
ServerConfigService
.
create
(
$scope
.
serverConfig
).
then
(
function
(
result
)
{
ServerConfigService
.
create
(
$scope
.
serverConfig
).
then
(
function
(
result
)
{
toastr
.
success
(
"
添加成功
"
);
toastr
.
success
(
"
保存成功
"
);
$scope
.
saveBtnDisabled
=
true
;
$scope
.
serverConfig
=
result
;
},
function
(
result
)
{
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
添加
失败
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
保存
失败
"
);
});
});
};
};
$scope
.
getServerConfigInfo
=
function
()
{
if
(
!
$scope
.
serverConfig
.
key
)
{
toastr
.
warning
(
"
请输入key
"
);
return
;
}
ServerConfigService
.
getServerConfigInfo
(
$scope
.
serverConfig
.
key
).
then
(
function
(
result
)
{
$scope
.
saveBtnDisabled
=
false
;
if
(
!
result
.
key
)
{
toastr
.
info
(
"
Key:
"
+
$scope
.
serverConfig
.
key
+
"
不存在,点击保存后会创建该配置项
"
);
return
;
}
toastr
.
info
(
"
Key:
"
+
$scope
.
serverConfig
.
key
+
"
已存在,点击保存后会覆盖该配置项
"
);
$scope
.
serverConfig
=
result
;
},
function
(
result
)
{
AppUtil
.
showErrorMsg
(
result
);
})
}
}]);
}]);
apollo-portal/src/main/resources/static/scripts/services/ServerConfigService.js
浏览文件 @
29793fbc
...
@@ -3,6 +3,10 @@ appService.service('ServerConfigService', ['$resource', '$q', function ($resourc
...
@@ -3,6 +3,10 @@ appService.service('ServerConfigService', ['$resource', '$q', function ($resourc
create_server_config
:
{
create_server_config
:
{
method
:
'
POST
'
,
method
:
'
POST
'
,
url
:
'
/server/config
'
url
:
'
/server/config
'
},
get_server_config_info
:
{
method
:
'
GET
'
,
url
:
'
/server/config/:key
'
}
}
});
});
return
{
return
{
...
@@ -14,6 +18,17 @@ appService.service('ServerConfigService', ['$resource', '$q', function ($resourc
...
@@ -14,6 +18,17 @@ appService.service('ServerConfigService', ['$resource', '$q', function ($resourc
d
.
reject
(
result
);
d
.
reject
(
result
);
});
});
return
d
.
promise
;
return
d
.
promise
;
},
getServerConfigInfo
:
function
(
key
)
{
var
d
=
$q
.
defer
();
server_config_resource
.
get_server_config_info
({
key
:
key
},
function
(
result
)
{
d
.
resolve
(
result
);
},
function
(
result
)
{
d
.
reject
(
result
);
});
return
d
.
promise
;
}
}
}
}
}]);
}]);
apollo-portal/src/main/resources/static/server_config.html
浏览文件 @
29793fbc
...
@@ -21,18 +21,22 @@
...
@@ -21,18 +21,22 @@
<div
class=
"panel"
>
<div
class=
"panel"
>
<header
class=
"panel-heading"
>
<header
class=
"panel-heading"
>
应用配置
应用配置
<small>
(维护ServerConfig表数据,如果已存在配置项则会覆盖,否则会创建配置项。配置更新后,一分钟后自动生效)
</small>
<small>
(维护
ApolloPortalDB.
ServerConfig表数据,如果已存在配置项则会覆盖,否则会创建配置项。配置更新后,一分钟后自动生效)
</small>
</header>
</header>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<form
class=
"form-horizontal"
ng-controller=
"ServerConfigController"
ng-submit=
"create()"
>
<form
class=
"form-horizontal"
ng-controller=
"ServerConfigController"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
<label
class=
"col-sm-2 control-label"
>
<apollorequiredfield></apollorequiredfield>
<apollorequiredfield></apollorequiredfield>
key
</label>
key
</label>
<div
class=
"col-sm-
9
"
>
<div
class=
"col-sm-
8
"
>
<input
type=
"text"
class=
"form-control"
name=
"key"
ng-model=
"serverConfig.key"
<input
type=
"text"
class=
"form-control"
name=
"key"
ng-model=
"serverConfig.key"
required
>
required
>
<small>
(修改配置前请先查询该配置信息)
</small>
</div>
<div
class=
"col-sm-1"
>
<button
class=
"btn btn-info"
ng-click=
"getServerConfigInfo()"
>
查询
</button>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
@@ -40,7 +44,7 @@
...
@@ -40,7 +44,7 @@
<apollorequiredfield></apollorequiredfield>
<apollorequiredfield></apollorequiredfield>
value
</label>
value
</label>
<div
class=
"col-sm-9"
>
<div
class=
"col-sm-9"
>
<textarea
class=
"form-control"
rows=
"4"
name=
"
comment
"
ng-model=
"serverConfig.value"
></textarea>
<textarea
class=
"form-control"
rows=
"4"
name=
"
value
"
ng-model=
"serverConfig.value"
></textarea>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
@@ -53,8 +57,11 @@
...
@@ -53,8 +57,11 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<button
type=
"submit"
class=
"btn btn-primary"
<button
type=
"submit"
class=
"btn btn-primary"
>
提交
</button>
ng-disabled=
"saveBtnDisabled"
ng-click=
"create()"
>
保存
</button>
</div>
</div>
</div>
</div>
</form>
</form>
...
...
pom.xml
浏览文件 @
29793fbc
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
0.0
</version>
<version>
1.
1.0-SNAPSHOT
</version>
<name>
Apollo
</name>
<name>
Apollo
</name>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<description>
Ctrip Configuration Center
</description>
<description>
Ctrip Configuration Center
</description>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录