Commit 9c71307c by 乐兜

Refresh session & add admin pages entry point

parent e5c10127
...@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse;
* @author Jason Song(song_s@ctrip.com) * @author Jason Song(song_s@ctrip.com)
*/ */
public class CtripSsoHeartbeatHandler implements SsoHeartbeatHandler { public class CtripSsoHeartbeatHandler implements SsoHeartbeatHandler {
@Override @Override
public void doHeartbeat(HttpServletRequest request, HttpServletResponse response) { public void doHeartbeat(HttpServletRequest request, HttpServletResponse response) {
try { try {
...@@ -18,4 +19,5 @@ public class CtripSsoHeartbeatHandler implements SsoHeartbeatHandler { ...@@ -18,4 +19,5 @@ public class CtripSsoHeartbeatHandler implements SsoHeartbeatHandler {
} catch (IOException e) { } catch (IOException e) {
} }
} }
} }
...@@ -11,12 +11,13 @@ import javax.servlet.http.HttpServletResponse; ...@@ -11,12 +11,13 @@ import javax.servlet.http.HttpServletResponse;
* @author Jason Song(song_s@ctrip.com) * @author Jason Song(song_s@ctrip.com)
*/ */
public class DefaultSsoHeartbeatHandler implements SsoHeartbeatHandler { public class DefaultSsoHeartbeatHandler implements SsoHeartbeatHandler {
@Override @Override
public void doHeartbeat(HttpServletRequest request, HttpServletResponse response) { public void doHeartbeat(HttpServletRequest request, HttpServletResponse response) {
try { try {
response.setContentType("text/plain;charset=utf-8"); response.sendRedirect("default_sso_heartbeat.html");
response.getWriter().write("default sso heartbeat handler");
} catch (IOException e) { } catch (IOException e) {
} }
} }
} }
...@@ -119,10 +119,11 @@ ...@@ -119,10 +119,11 @@
<script type="application/javascript" src="scripts/services/EnvService.js"></script> <script type="application/javascript" src="scripts/services/EnvService.js"></script>
<script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script>
<script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script>
<script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="scripts/services/OrganizationService.js"></script> <script type="application/javascript" src="scripts/services/OrganizationService.js"></script>
<script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/AppUtils.js"></script>
<script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/controller/AppController.js"></script> <script type="application/javascript" src="scripts/controller/AppController.js"></script>
<script src="scripts/valdr.js" type="text/javascript"></script> <script src="scripts/valdr.js" type="text/javascript"></script>
......
...@@ -189,6 +189,7 @@ ...@@ -189,6 +189,7 @@
<script type="application/javascript" src="../scripts/services/CommonService.js"></script> <script type="application/javascript" src="../scripts/services/CommonService.js"></script>
<script type="application/javascript" src="../scripts/services/PermissionService.js"></script> <script type="application/javascript" src="../scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="../scripts/services/OrganizationService.js"></script> <script type="application/javascript" src="../scripts/services/OrganizationService.js"></script>
<script type="application/javascript" src="../scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="../scripts/AppUtils.js"></script> <script type="application/javascript" src="../scripts/AppUtils.js"></script>
......
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
<script type="application/javascript" src="scripts/services/ClusterService.js"></script> <script type="application/javascript" src="scripts/services/ClusterService.js"></script>
<script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script>
<script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="scripts/controller/ClusterController.js"></script> <script type="application/javascript" src="scripts/controller/ClusterController.js"></script>
......
...@@ -270,6 +270,7 @@ ...@@ -270,6 +270,7 @@
<script type="application/javascript" src="../scripts/services/CommonService.js"></script> <script type="application/javascript" src="../scripts/services/CommonService.js"></script>
<script type="application/javascript" src="../scripts/services/ReleaseHistoryService.js"></script> <script type="application/javascript" src="../scripts/services/ReleaseHistoryService.js"></script>
<script type="application/javascript" src="../scripts/services/ConfigService.js"></script> <script type="application/javascript" src="../scripts/services/ConfigService.js"></script>
<script type="application/javascript" src="../scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="../scripts/AppUtils.js"></script> <script type="application/javascript" src="../scripts/AppUtils.js"></script>
<script type="application/javascript" src="../scripts/controller/config/ReleaseHistoryController.js"></script> <script type="application/javascript" src="../scripts/controller/config/ReleaseHistoryController.js"></script>
......
...@@ -235,6 +235,8 @@ ...@@ -235,6 +235,8 @@
<script type="application/javascript" src="../scripts/services/ConfigService.js"></script> <script type="application/javascript" src="../scripts/services/ConfigService.js"></script>
<script type="application/javascript" src="../scripts/services/UserService.js"></script> <script type="application/javascript" src="../scripts/services/UserService.js"></script>
<script type="application/javascript" src="../scripts/services/CommonService.js"></script> <script type="application/javascript" src="../scripts/services/CommonService.js"></script>
<script type="application/javascript" src="../scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="../scripts/AppUtils.js"></script> <script type="application/javascript" src="../scripts/AppUtils.js"></script>
<script type="application/javascript" src="../scripts/controller/config/SyncConfigController.js"></script> <script type="application/javascript" src="../scripts/controller/config/SyncConfigController.js"></script>
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SSO Heartbeat</title>
<script type="text/javascript">
var reloading = false;
setInterval(function () {
if (reloading) {
return;
}
reloading = true;
location.reload(true);
}, 60000);
</script>
</head>
<body>
</body>
</html>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</div> </div>
</div> </div>
<div class="no-favorites text-center" ng-show="!favorites || favorites.length == 0"> <div class="no-favorites text-center" ng-show="!favorites || favorites.length == 0">
<h4>您还没有收藏过任何项目,在项目主页可以收藏项目哟~</h4> <h4>您还没有收藏过任何项目在项目主页可以收藏项目哟~</h4>
</div> </div>
</aside> </aside>
...@@ -128,6 +128,7 @@ ...@@ -128,6 +128,7 @@
<script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script>
<script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script>
<script type="application/javascript" src="scripts/services/FavoriteService.js"></script> <script type="application/javascript" src="scripts/services/FavoriteService.js"></script>
<script type="application/javascript" src="scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script>
<script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/directive/directive.js"></script>
......
/** navbar */ /** navbar */
directive_module.directive('apollonav', directive_module.directive('apollonav',
function ($compile, $window, toastr, AppUtil, AppService, EnvService, UserService, CommonService) { function ($compile, $window, toastr, AppUtil, AppService, EnvService,
UserService, CommonService, PermissionService) {
return { return {
restrict: 'E', restrict: 'E',
templateUrl: '../../views/common/nav.html', templateUrl: '../../views/common/nav.html',
...@@ -82,7 +83,7 @@ directive_module.directive('apollonav', ...@@ -82,7 +83,7 @@ directive_module.directive('apollonav',
} }
//强制刷新 //强制刷新
scope.$apply(function () { scope.$apply(function () {
scope.copyedApps = scope.copyedApps; scope.copiedApps = scope.copiedApps;
}); });
}); });
...@@ -97,7 +98,7 @@ directive_module.directive('apollonav', ...@@ -97,7 +98,7 @@ directive_module.directive('apollonav',
}); });
function clearAppsSelectedStatus() { function clearAppsSelectedStatus() {
scope.copyedApps.forEach(function (app) { scope.copiedApps.forEach(function (app) {
app.selected = false; app.selected = false;
}) })
...@@ -117,6 +118,10 @@ directive_module.directive('apollonav', ...@@ -117,6 +118,10 @@ directive_module.directive('apollonav',
}, function (result) { }, function (result) {
}); });
PermissionService.has_root_permission().then(function(result) {
scope.hasRootPermission = result.hasPermission;
})
} }
} }
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<div class="panel"> <div class="panel">
<header class="panel-heading"> <header class="panel-heading">
应用配置 应用配置
<small>(维护ServerConfig表数据,如果已存在配置项则会覆盖,否则会创建配置项。配置更新后,一分钟后自动生效)</small>
</header> </header>
<div class="panel-body"> <div class="panel-body">
...@@ -53,7 +54,7 @@ ...@@ -53,7 +54,7 @@
<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-default">提交</button> <button type="submit" class="btn btn-primary">提交</button>
</div> </div>
</div> </div>
</form> </form>
...@@ -86,6 +87,7 @@ ...@@ -86,6 +87,7 @@
<script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script>
<script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script>
<script type="application/javascript" src="scripts/services/ServerConfigService.js"></script> <script type="application/javascript" src="scripts/services/ServerConfigService.js"></script>
<script type="application/javascript" src="scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="scripts/controller/ServerConfigController.js"></script> <script type="application/javascript" src="scripts/controller/ServerConfigController.js"></script>
</body> </body>
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
<script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script>
<script type="application/javascript" src="scripts/services/OrganizationService.js"></script> <script type="application/javascript" src="scripts/services/OrganizationService.js"></script>
<script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/services/PermissionService.js"></script>
<script type="application/javascript" src="scripts/controller/UserController.js"></script> <script type="application/javascript" src="scripts/controller/UserController.js"></script>
......
...@@ -25,6 +25,16 @@ ...@@ -25,6 +25,16 @@
<span class="glyphicon glyphicon-question-sign"></span> 帮助 <span class="glyphicon glyphicon-question-sign"></span> 帮助
</a> </a>
</li> </li>
<li class="dropdown" ng-if="hasRootPermission">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-cog"></span>&nbsp;管理员工具
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/user-manage.html" target="_blank">用户管理</a></li>
<li><a href="/open/manage.html" target="_blank">开放平台授权管理</a></li>
<li><a href="/server_config.html" target="_blank">系统参数</a></li>
</ul>
</li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-user"></span>&nbsp;{{userName}} <span class="glyphicon glyphicon-user"></span>&nbsp;{{userName}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment