Commit c102e2b9 authored by zhaojinghao's avatar zhaojinghao Committed by Jason Song

Support using relative path to access portal via reverse proxy or slb (#2754)

parent fe016be4
package com.ctrip.framework.apollo.portal.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class PrefixPathController {
@Value("${prefixPath:}")
private String prefixPath;
@GetMapping("/prefixPath")
public String getPrefixPath(){
return prefixPath;
}
}
......@@ -271,7 +271,7 @@ public class AuthConfiguration {
http.csrf().disable();
http.headers().frameOptions().sameOrigin();
http.authorizeRequests()
.antMatchers("/prometheus/**","/metrics/**","/openapi/**", "/vendor/**", "/styles/**", "/scripts/**", "/views/**", "/img/**", "/i18n/**").permitAll()
.antMatchers("/prometheus/**","/metrics/**","/openapi/**", "/vendor/**", "/styles/**", "/scripts/**", "/views/**", "/img/**", "/i18n/**", "/prefixPath").permitAll()
.antMatchers("/**").hasAnyRole(USER_ROLE);
http.formLogin().loginPage("/signin").defaultSuccessUrl("/", true).permitAll().failureUrl("/signin?#/error").and()
.httpBasic();
......@@ -403,7 +403,7 @@ public class AuthConfiguration {
http.csrf().disable();
http.headers().frameOptions().sameOrigin();
http.authorizeRequests()
.antMatchers("/prometheus/**","/metrics/**","/openapi/**", "/vendor/**", "/styles/**", "/scripts/**", "/views/**", "/img/**", "/i18n/**").permitAll()
.antMatchers("/prometheus/**","/metrics/**","/openapi/**", "/vendor/**", "/styles/**", "/scripts/**", "/views/**", "/img/**", "/i18n/**", "/prefixPath").permitAll()
.antMatchers("/**").authenticated();
http.formLogin().loginPage("/signin").defaultSuccessUrl("/", true).permitAll().failureUrl("/signin?#/error").and()
.httpBasic();
......
......@@ -28,7 +28,7 @@
</div>
<div class="col-md-5 text-right">
<a type="button" class="btn btn-info" data-dismiss="modal"
href="/config.html?#appid={{pageContext.appId}}">{{'Common.ReturnToIndex' | translate }}
href="{{ '/config.html' | prefixPath }}?#appid={{pageContext.appId}}">{{'Common.ReturnToIndex' | translate }}
</a>
</div>
</div>
......
......@@ -26,7 +26,7 @@
<h4>{{'Cluster.CreateCluster' | translate }}</h4>
</div>
<div class="col-md-6 text-right">
<a type="button" class="btn btn-info" href="/config.html?#/appid={{appId}}">{{'Common.ReturnToIndex' | translate }}
<a type="button" class="btn btn-info" href="config.html?#/appid={{appId}}">{{'Common.ReturnToIndex' | translate }}
</a>
</div>
</div>
......
......@@ -24,7 +24,7 @@
<br>
<p>
<span ng-bind="pageContext.appId"></span> {{'Config.AppIdNotFound' | translate }}<a
href="/app.html">{{'Config.ClickByCreate' | translate }}</a>
href="app.html">{{'Config.ClickByCreate' | translate }}</a>
</p>
</div>
......@@ -51,7 +51,7 @@
{{'Config.ProjectInfo' | translate }}
<span class="pull-right">
<a href="/app/setting.html?#/appid={{pageContext.appId}}"
<a href="app/setting.html?#/appid={{pageContext.appId}}"
style="margin-right: 5px;text-decoration:none;">
<img src="img/edit.png" class="i-20 cursor-pointer" data-tooltip="tooltip"
data-placement="bottom"
......@@ -118,7 +118,7 @@
<section>
<apolloentrance apollo-title="'Config.ProjectManage' | translate"
apollo-img-src="'project-manage'"
apollo-href="'/app/setting.html?#/appid=' + pageContext.appId"></apolloentrance>
apollo-href="'app/setting.html?#/appid=' + pageContext.appId"></apolloentrance>
<a class="list-group-item" ng-show="missEnvs.length > 0" ng-click="createAppInMissEnv()">
<div class="row icon-text icon-plus-orange">
......
......@@ -44,7 +44,7 @@
<div class="pull-right back-btn">
<a type="button" class="btn btn-info"
href="/config.html?#/appid={{pageContext.appId}}">{{'Common.ReturnToIndex' | translate }}
href="{{ '/config.html' | prefixPath }}?#/appid={{pageContext.appId}}">{{'Common.ReturnToIndex' | translate }}
</a>
</div>
......
......@@ -3,13 +3,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="icon" href="../img/config.png">
<link rel="icon" href="img/config.png">
<!-- 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 rel="stylesheet" type="text/css" href="../styles/common-style.css">
<link rel="stylesheet" type="text/css" href="../vendor/select2/select2.min.css">
<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 rel="stylesheet" type="text/css" href="styles/common-style.css">
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<title>{{'Delete.Title' | translate }}</title>
</head>
......@@ -182,17 +182,17 @@
</div>
</div>
<div ng-include="'../views/common/footer.html'"></div>
<div ng-include="'views/common/footer.html'"></div>
<!-- jquery.js -->
<script src="../vendor/jquery.min.js" type="text/javascript"></script>
<script src="vendor/jquery.min.js" type="text/javascript"></script>
<!--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>
<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>
<script src="vendor/angular/angular-cookies.min.js"></script>
<script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script>
......@@ -200,33 +200,33 @@
<script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script>
<!--valdr-->
<script src="../vendor/valdr/valdr.min.js" type="text/javascript"></script>
<script src="../vendor/valdr/valdr-message.min.js" type="text/javascript"></script>
<script src="vendor/valdr/valdr.min.js" type="text/javascript"></script>
<script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script>
<!-- bootstrap.js -->
<script src="../vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../vendor/lodash.min.js"></script>
<script src="vendor/lodash.min.js"></script>
<script src="../vendor/select2/select2.min.js" type="text/javascript"></script>
<script src="vendor/select2/select2.min.js" type="text/javascript"></script>
<!--biz-->
<!--must import-->
<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/services/UserService.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/ClusterService.js"></script>
<script type="application/javascript" src="../scripts/services/NamespaceService.js"></script>
<script type="application/javascript" src="../scripts/AppUtils.js"></script>
<script type="application/javascript" src="../scripts/PageCommon.js"></script>
<script type="application/javascript" src="../scripts/directive/directive.js"></script>
<script type="application/javascript" src="../scripts/valdr.js"></script>
<script type="application/javascript" src="../scripts/controller/DeleteAppClusterNamespaceController.js"></script>
<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/services/UserService.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/ClusterService.js"></script>
<script type="application/javascript" src="scripts/services/NamespaceService.js"></script>
<script type="application/javascript" src="scripts/AppUtils.js"></script>
<script type="application/javascript" src="scripts/PageCommon.js"></script>
<script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/valdr.js"></script>
<script type="application/javascript" src="scripts/controller/DeleteAppClusterNamespaceController.js"></script>
</body>
</html>
\ No newline at end of file
......@@ -242,7 +242,7 @@
<div class="panel-body">
<div class="row">
<div class="col-lg-12">
<form id="login-form" action="/signin" method="post" role="form" style="display: block;">
<form id="login-form" action="signin" method="post" role="form" style="display: block;">
<p class="text-center"><img src="img/logo-detail.png" style="width: 500px;"></p>
<div class="form-group">
<input type="text" name="username" tabindex="1" class="form-control"
......@@ -290,6 +290,7 @@
<script type="application/javascript">
$(function () {
$('#login-form-link').click(function (e) {
$("#login-form").delay(100).fadeIn(100);
......@@ -306,6 +307,10 @@
e.preventDefault();
});
$.get("prefixPath", function(result){
window.localStorage.setItem("prefixPath",result);
});
});
</script>
......
......@@ -30,7 +30,7 @@
</div>
<div class="col-md-5 text-right">
<a type="button" class="btn btn-info" data-dismiss="modal"
href="/config.html?#appid={{pageContext.appId}}">{{'Common.ReturnToIndex' | translate }}
href="{{ '/config.html' | prefixPath }}?#appid={{pageContext.appId}}">{{'Common.ReturnToIndex' | translate }}
</a>
</div>
</div>
......
appUtil.service('AppUtil', ['toastr', '$window', '$q', '$translate', function (toastr, $window, $q, $translate) {
appUtil.service('AppUtil', ['toastr', '$window', '$q', '$translate', 'prefixLocation', function (toastr, $window, $q, $translate, prefixLocation) {
function parseErrorMsg(response) {
if (response.status == -1) {
......@@ -43,6 +43,9 @@ appUtil.service('AppUtil', ['toastr', '$window', '$q', '$translate', function (t
}
return {
prefixPath: function(){
return prefixLocation;
},
errorMsg: parseErrorMsg,
pureErrorMsg: parsePureErrorMsg,
ajax: ajax,
......
var prefixPath = window.localStorage.getItem("prefixPath") || "";
/**utils*/
var appUtil = angular.module('app.util', ['toastr', 'ngCookies', 'pascalprecht.translate'])
.config(['$translateProvider', function ($translateProvider) {
.constant("prefixLocation", prefixPath) // 前缀路径
.filter('prefixPath',['prefixLocation', function(prefixLocation) { // 前缀路径过滤器
return function(text) {
return prefixLocation + text;
}
}])
.config(['$translateProvider','prefixLocation', function ($translateProvider,prefixLocation) {
$translateProvider.useSanitizeValueStrategy(null); // disable sanitization by default
$translateProvider.useCookieStorage();
$translateProvider.useStaticFilesLoader({
prefix: '/i18n/',
prefix: prefixLocation + '/i18n/',
suffix: '.json'
});
$translateProvider.registerAvailableLanguageKeys(['en', 'zh-CN'], {
......@@ -16,6 +24,8 @@ var appUtil = angular.module('app.util', ['toastr', 'ngCookies', 'pascalprecht.t
})
$translateProvider.uniformLanguageTag('bcp47').determinePreferredLanguage();
}]);
/**service module 定义*/
var appService = angular.module('app.service', ['ngResource', 'app.util'])
......
......@@ -96,7 +96,7 @@ function createAppController($scope, $window, $translate, toastr, AppService, Ap
toastr.success($translate.instant('Common.Created'));
setInterval(function () {
$scope.submitBtnDisabled = false;
$window.location.href = '/config.html?#appid=' + result.appId;
$window.location.href = AppUtil.prefixPath() + '/config.html?#appid=' + result.appId;
}, 1000);
}, function (result) {
$scope.submitBtnDisabled = false;
......
......@@ -132,11 +132,11 @@ function IndexController($scope, $window, $translate, toastr, AppUtil, AppServic
}
function goToCreateAppPage() {
$window.location.href = "/app.html";
$window.location.href = AppUtil.prefixPath() + "/app.html";
}
function goToAppHomePage(appId) {
$window.location.href = "/config.html?#/appid=" + appId;
$window.location.href = AppUtil.prefixPath() + "/config.html?#/appid=" + appId;
}
function toggleOperationBtn(app) {
......
......@@ -114,7 +114,7 @@ namespace_module.controller("LinkNamespaceController",
setInterval(function () {
$scope.submitBtnDisabled = false;
$window.location.href =
'/namespace/role.html?#appid=' + $scope.appId
AppUtil.prefixPath() + '/namespace/role.html?#appid=' + $scope.appId
+ "&namespaceName=" + $scope.namespaceName;
}, 1000);
}, function (result) {
......@@ -142,7 +142,7 @@ namespace_module.controller("LinkNamespaceController",
setTimeout(function () {
$scope.submitBtnDisabled = false;
$window.location.href =
"/namespace/role.html?#/appid=" + $scope.appId
AppUtil.prefixPath() + "/namespace/role.html?#/appid=" + $scope.appId
+ "&namespaceName=" + result.name;
}, 1000);
}, function (result) {
......@@ -159,7 +159,7 @@ namespace_module.controller("LinkNamespaceController",
};
$scope.back = function () {
$window.location.href = '/config.html?#appid=' + $scope.appId;
$window.location.href = AppUtil.prefixPath() + '/config.html?#appid=' + $scope.appId;
};
$scope.switchType = function (type) {
......
......@@ -14,7 +14,7 @@ function ConfigBaseInfoController($rootScope, $scope, $window, $location, $trans
var appId = urlParams.appid;
if (!appId) {
$window.location.href = '/index.html';
$window.location.href = AppUtil.prefixPath() + '/index.html';
return;
}
......@@ -258,7 +258,7 @@ function ConfigBaseInfoController($rootScope, $scope, $window, $location, $trans
cluster: $rootScope.pageContext.clusterName
}));
$window.location.href = "/config.html#/appid="
$window.location.href = AppUtil.prefixPath() + "/config.html#/appid="
+ $rootScope.pageContext.appId
+ "&env=" + $rootScope.pageContext.env
+ "&cluster=" + $rootScope.pageContext.clusterName;
......
......@@ -352,7 +352,7 @@ function controller($rootScope, $scope, $translate, toastr, AppUtil, EventManage
otherAppAssociatedNamespaces.forEach(function (namespace) {
var appId = namespace.appId;
var clusterName = namespace.clusterName;
var url = '/config.html?#/appid=' + appId + '&env=' + $scope.pageContext.env + '&cluster='
var url = AppUtil.prefixPath() + '/config.html?#/appid=' + appId + '&env=' + $scope.pageContext.env + '&cluster='
+ clusterName;
namespaceTips.push("<a target='_blank' href=\'" + url + "\'>AppId = " + appId + ", Cluster = " + clusterName
......
......@@ -82,7 +82,7 @@ diff_item_module.controller("DiffItemController",
}
function backToAppHomePage() {
$window.location.href = '/config.html?#appid=' + $scope.pageContext.appId;
$window.location.href = AppUtil.prefixPath() + '/config.html?#appid=' + $scope.pageContext.appId;
}
function switchSelect(o) {
......
......@@ -195,7 +195,7 @@ sync_item_module.controller("SyncItemController",
}
function backToAppHomePage() {
$window.location.href = '/config.html?#appid=' + $scope.pageContext.appId;
$window.location.href = AppUtil.prefixPath() + '/config.html?#appid=' + $scope.pageContext.appId;
}
function switchSelect(o) {
......
......@@ -4,7 +4,7 @@ function deleteNamespaceModalDirective($window, $q, $translate, toastr, AppUtil,
PermissionService, UserService, NamespaceService) {
return {
restrict: 'E',
templateUrl: '../../views/component/delete-namespace-modal.html',
templateUrl: AppUtil.prefixPath() + '/views/component/delete-namespace-modal.html',
transclude: true,
replace: true,
scope: {
......
directive_module.directive('apollodiff',
function ($compile, $window) {
function ($compile, $window, AppUtil) {
return {
restrict: 'E',
templateUrl: '../../views/component/diff.html',
templateUrl: AppUtil.prefixPath() + '/views/component/diff.html',
transclude: true,
replace: true,
scope: {
......
......@@ -4,7 +4,7 @@ directive_module.directive('apollonav',
UserService, CommonService, PermissionService) {
return {
restrict: 'E',
templateUrl: '../../views/common/nav.html',
templateUrl: AppUtil.prefixPath() + '/views/common/nav.html',
transclude: true,
replace: true,
link: function (scope, element, attrs) {
......@@ -22,7 +22,7 @@ directive_module.directive('apollonav',
$('#app-search-list').select2({
placeholder: placeholderLabel,
ajax: {
url: "/apps/search/by-appid-or-name",
url: AppUtil.prefixPath() + "/apps/search/by-appid-or-name",
dataType: 'json',
delay: 400,
data: function (params) {
......@@ -75,7 +75,7 @@ directive_module.directive('apollonav',
$window.location.hash = "appid=" + selectedAppId;
$window.location.reload();
} else {
$window.location.href = '/config.html?#appid=' + selectedAppId;
$window.location.href = AppUtil.prefixPath() + '/config.html?#appid=' + selectedAppId;
}
};
......@@ -101,7 +101,7 @@ directive_module.directive('apollonav',
directive_module.directive('apolloclusterselector', function ($compile, $window, AppService, AppUtil, toastr) {
return {
restrict: 'E',
templateUrl: '../../views/component/env-selector.html',
templateUrl: AppUtil.prefixPath() + '/views/component/env-selector.html',
transclude: true,
replace: true,
scope: {
......@@ -192,10 +192,10 @@ directive_module.directive('apollorequiredfield', function ($compile, $window) {
});
/** 确认框 */
directive_module.directive('apolloconfirmdialog', function ($compile, $window, $sce,$translate) {
directive_module.directive('apolloconfirmdialog', function ($compile, $window, $sce,$translate,AppUtil) {
return {
restrict: 'E',
templateUrl: '../../views/component/confirm-dialog.html',
templateUrl: AppUtil.prefixPath() + '/views/component/confirm-dialog.html',
transclude: true,
replace: true,
scope: {
......@@ -231,10 +231,10 @@ directive_module.directive('apolloconfirmdialog', function ($compile, $window, $
});
/** entrance */
directive_module.directive('apolloentrance', function ($compile, $window) {
directive_module.directive('apolloentrance', function ($compile, $window,AppUtil) {
return {
restrict: 'E',
templateUrl: '../../views/component/entrance.html',
templateUrl: AppUtil.prefixPath() + '/views/component/entrance.html',
transclude: true,
replace: true,
scope: {
......@@ -248,10 +248,10 @@ directive_module.directive('apolloentrance', function ($compile, $window) {
});
/** entrance */
directive_module.directive('apollouserselector', function ($compile, $window) {
directive_module.directive('apollouserselector', function ($compile, $window,AppUtil) {
return {
restrict: 'E',
templateUrl: '../../views/component/user-selector.html',
templateUrl: AppUtil.prefixPath() + '/views/component/user-selector.html',
transclude: true,
replace: true,
scope: {
......@@ -264,7 +264,7 @@ directive_module.directive('apollouserselector', function ($compile, $window) {
var select2Options = {
ajax: {
url: '/users',
url: AppUtil.prefixPath() + '/users',
dataType: 'json',
delay: 250,
data: function (params) {
......@@ -300,10 +300,10 @@ directive_module.directive('apollouserselector', function ($compile, $window) {
}
});
directive_module.directive('apollomultipleuserselector', function ($compile, $window) {
directive_module.directive('apollomultipleuserselector', function ($compile, $window,AppUtil) {
return {
restrict: 'E',
templateUrl: '../../views/component/multiple-user-selector.html',
templateUrl: AppUtil.prefixPath() + '/views/component/multiple-user-selector.html',
transclude: true,
replace: true,
scope: {
......@@ -315,7 +315,7 @@ directive_module.directive('apollomultipleuserselector', function ($compile, $wi
var searchUsersAjax = {
ajax: {
url: '/users',
url: AppUtil.prefixPath() + '/users',
dataType: 'json',
delay: 250,
data: function (params) {
......
......@@ -3,7 +3,7 @@ directive_module.directive('rulesmodal', rulesModalDirective);
function rulesModalDirective($translate, toastr, AppUtil, EventManager, InstanceService) {
return {
restrict: 'E',
templateUrl: '../../views/component/gray-release-rules-modal.html',
templateUrl: AppUtil.prefixPath() + '/views/component/gray-release-rules-modal.html',
transclude: true,
replace: true,
scope: {
......
......@@ -3,7 +3,7 @@ directive_module.directive('itemmodal', itemModalDirective);
function itemModalDirective($translate, toastr, $sce, AppUtil, EventManager, ConfigService) {
return {
restrict: 'E',
templateUrl: '../../views/component/item-modal.html',
templateUrl: AppUtil.prefixPath() + '/views/component/item-modal.html',
transclude: true,
replace: true,
scope: {
......
......@@ -3,7 +3,7 @@ directive_module.directive('mergeandpublishmodal', mergeAndPublishDirective);
function mergeAndPublishDirective(AppUtil, EventManager) {
return {
restrict: 'E',
templateUrl: '../../views/component/merge-and-publish-modal.html',
templateUrl: AppUtil.prefixPath() + '/views/component/merge-and-publish-modal.html',
transclude: true,
replace: true,
scope: {
......
......@@ -4,7 +4,7 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio
UserService, CommitService, ReleaseService, InstanceService, NamespaceBranchService, ConfigService) {
return {
restrict: 'E',
templateUrl: '../../views/component/namespace-panel.html',
templateUrl: AppUtil.prefixPath() + '/views/component/namespace-panel.html',
transclude: true,
replace: true,
scope: {
......@@ -697,7 +697,7 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio
return false;
}
$window.location.href =
"config/sync.html?#/appid=" + scope.appId + "&env="
AppUtil.prefixPath() + "/config/sync.html?#/appid=" + scope.appId + "&env="
+ scope.env + "&clusterName="
+ scope.cluster
+ "&namespaceName=" + namespace.baseInfo.namespaceName;
......@@ -705,7 +705,7 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio
function goToDiffPage(namespace) {
$window.location.href =
"config/diff.html?#/appid=" + scope.appId + "&env="
AppUtil.prefixPath() + "/config/diff.html?#/appid=" + scope.appId + "&env="
+ scope.env + "&clusterName="
+ scope.cluster
+ "&namespaceName=" + namespace.baseInfo.namespaceName;
......@@ -770,7 +770,7 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio
}
function goToParentAppConfigPage(namespace) {
$window.location.href = "/config.html?#/appid=" + namespace.parentAppId;
$window.location.href = AppUtil.prefixPath() + "/config.html?#/appid=" + namespace.parentAppId;
$window.location.reload();
}
......
......@@ -3,7 +3,7 @@ directive_module.directive('publishdenymodal', publishDenyDirective);
function publishDenyDirective(AppUtil, EventManager) {
return {
restrict: 'E',
templateUrl: '../../views/component/publish-deny-modal.html',
templateUrl: AppUtil.prefixPath() + '/views/component/publish-deny-modal.html',
transclude: true,
replace: true,
scope: {
......
......@@ -3,7 +3,7 @@ directive_module.directive('releasemodal', releaseModalDirective);
function releaseModalDirective($translate, toastr, AppUtil, EventManager, ReleaseService, NamespaceBranchService) {
return {
restrict: 'E',
templateUrl: '../../views/component/release-modal.html',
templateUrl: AppUtil.prefixPath() + '/views/component/release-modal.html',
transclude: true,
replace: true,
scope: {
......
......@@ -3,7 +3,7 @@ directive_module.directive('rollbackmodal', rollbackModalDirective);
function rollbackModalDirective($translate, AppUtil, EventManager, ReleaseService, toastr) {
return {
restrict: 'E',
templateUrl: '../../views/component/rollback-modal.html',
templateUrl: AppUtil.prefixPath() + '/views/component/rollback-modal.html',
transclude: true,
replace: true,
scope: {
......
directive_module.directive('showtextmodal', showTextModalDirective);
function showTextModalDirective() {
function showTextModalDirective(AppUtil) {
return {
restrict: 'E',
templateUrl: '../../views/component/show-text-modal.html',
templateUrl: AppUtil.prefixPath() + '/views/component/show-text-modal.html',
transclude: true,
replace: true,
scope: {
......
appService.service('AppService', ['$resource', '$q', function ($resource, $q) {
var app_resource = $resource('/apps/:appId', {}, {
appService.service('AppService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var app_resource = $resource(AppUtil.prefixPath() + '/apps/:appId', {}, {
find_apps: {
method: 'GET',
isArray: true,
url: '/apps'
url: AppUtil.prefixPath() + '/apps'
},
find_app_by_owner: {
method: 'GET',
isArray: true,
url: '/apps/by-owner'
url: AppUtil.prefixPath() + '/apps/by-owner'
},
load_navtree: {
method: 'GET',
isArray: false,
url: '/apps/:appId/navtree'
url: AppUtil.prefixPath() + '/apps/:appId/navtree'
},
load_app: {
method: 'GET',
......@@ -21,27 +21,27 @@ appService.service('AppService', ['$resource', '$q', function ($resource, $q) {
},
create_app: {
method: 'POST',
url: '/apps'
url: AppUtil.prefixPath() + '/apps'
},
update_app: {
method: 'PUT',
url: '/apps/:appId'
url: AppUtil.prefixPath() + '/apps/:appId'
},
create_app_remote: {
method: 'POST',
url: '/apps/envs/:env'
url: AppUtil.prefixPath() + '/apps/envs/:env'
},
find_miss_envs: {
method: 'GET',
url: '/apps/:appId/miss_envs'
url: AppUtil.prefixPath() + '/apps/:appId/miss_envs'
},
create_missing_namespaces: {
method: 'POST',
url: '/apps/:appId/envs/:env/clusters/:clusterName/missing-namespaces'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/missing-namespaces'
},
find_missing_namespaces: {
method: 'GET',
url: '/apps/:appId/envs/:env/clusters/:clusterName/missing-namespaces'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/missing-namespaces'
},
delete_app: {
method: 'DELETE',
......@@ -49,15 +49,15 @@ appService.service('AppService', ['$resource', '$q', function ($resource, $q) {
},
allow_app_master_assign_role: {
method: 'POST',
url: '/apps/:appId/system/master/:userId'
url: AppUtil.prefixPath() + '/apps/:appId/system/master/:userId'
},
delete_app_master_assign_role: {
method: 'DELETE',
url: '/apps/:appId/system/master/:userId'
url: AppUtil.prefixPath() + '/apps/:appId/system/master/:userId'
},
has_create_application_role: {
method: 'GET',
url: '/system/role/createApplication/:userId'
url: AppUtil.prefixPath() + '/system/role/createApplication/:userId'
}
});
return {
......
appService.service('CommitService', ['$resource', '$q', function ($resource, $q) {
appService.service('CommitService', ['$resource', '$q','AppUtil', function ($resource, $q, AppUtil) {
var commit_resource = $resource('', {}, {
find_commits: {
method: 'GET',
isArray: true,
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/commits?page=:page'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/commits?page=:page'
}
});
return {
......
......@@ -4,7 +4,7 @@ appService.service('CommonService', ['$resource', '$q', 'AppUtil',
page_setting: {
method: 'GET',
isArray: false,
url: '/page-settings'
url: AppUtil.prefixPath() + '/page-settings'
}
});
......
appService.service("ConfigService", ['$resource', '$q', function ($resource, $q) {
appService.service("ConfigService", ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var config_source = $resource("", {}, {
load_namespace: {
method: 'GET',
isArray: false,
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName'
},
load_public_namespace_for_associated_namespace: {
method: 'GET',
isArray: false,
url: '/envs/:env/apps/:appId/clusters/:clusterName/namespaces/:namespaceName/associated-public-namespace'
url: AppUtil.prefixPath() + '/envs/:env/apps/:appId/clusters/:clusterName/namespaces/:namespaceName/associated-public-namespace'
},
load_all_namespaces: {
method: 'GET',
isArray: true,
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces'
},
find_items: {
method: 'GET',
isArray: true,
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/items'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/items'
},
modify_items: {
method: 'PUT',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/items'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/items'
},
diff: {
method: 'POST',
url: '/namespaces/:namespaceName/diff',
url: AppUtil.prefixPath() + '/namespaces/:namespaceName/diff',
isArray: true
},
sync_item: {
method: 'PUT',
url: '/apps/:appId/namespaces/:namespaceName/items',
url: AppUtil.prefixPath() + '/apps/:appId/namespaces/:namespaceName/items',
isArray: false
},
create_item: {
method: 'POST',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/item'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/item'
},
update_item: {
method: 'PUT',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/item'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/item'
},
delete_item: {
method: 'DELETE',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/items/:itemId'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/items/:itemId'
},
syntax_check_text: {
method: 'POST',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/syntax-check'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/syntax-check'
}
});
......
......@@ -4,17 +4,17 @@ appService.service('ConsumerService', ['$resource', '$q', 'AppUtil',
create_consumer: {
method: 'POST',
isArray: false,
url: '/consumers'
url: AppUtil.prefixPath() + '/consumers'
},
get_consumer_token_by_appId: {
method: 'GET',
isArray: false,
url: '/consumers/by-appId'
url: AppUtil.prefixPath() + '/consumers/by-appId'
},
assign_role_to_consumer: {
method: 'POST',
isArray: true,
url: '/consumers/:token/assign-role'
url: AppUtil.prefixPath() + '/consumers/:token/assign-role'
}
});
......
appService.service('EnvService', ['$resource', '$q', function ($resource, $q) {
var env_resource = $resource('/envs', {}, {
appService.service('EnvService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var env_resource = $resource(AppUtil.prefixPath() + '/envs', {}, {
find_all_envs:{
method: 'GET',
isArray: true,
url:'/envs'
url: AppUtil.prefixPath() + '/envs'
}
});
return {
......
appService.service('FavoriteService', ['$resource', '$q', function ($resource, $q) {
appService.service('FavoriteService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var resource = $resource('', {}, {
find_favorites: {
method: 'GET',
url: '/favorites',
url: AppUtil.prefixPath() + '/favorites',
isArray: true
},
add_favorite: {
method: 'POST',
url: '/favorites'
url: AppUtil.prefixPath() + '/favorites'
},
delete_favorite: {
method: 'DELETE',
url: '/favorites/:favoriteId'
url: AppUtil.prefixPath() + '/favorites/:favoriteId'
},
to_top: {
method: 'PUT',
url: '/favorites/:favoriteId'
url: AppUtil.prefixPath() + '/favorites/:favoriteId'
}
});
return {
......
appService.service('InstanceService', ['$resource', '$q', function ($resource, $q) {
appService.service('InstanceService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var resource = $resource('', {}, {
find_instances_by_release: {
method: 'GET',
url: '/envs/:env/instances/by-release'
url: AppUtil.prefixPath() + '/envs/:env/instances/by-release'
},
find_instances_by_namespace: {
method: 'GET',
isArray: false,
url: '/envs/:env/instances/by-namespace'
url: AppUtil.prefixPath() + '/envs/:env/instances/by-namespace'
},
find_by_releases_not_in: {
method: 'GET',
isArray: true,
url: '/envs/:env/instances/by-namespace-and-releases-not-in'
url: AppUtil.prefixPath() + '/envs/:env/instances/by-namespace-and-releases-not-in'
},
get_instance_count_by_namespace: {
method: 'GET',
isArray: false,
url: "envs/:env/instances/by-namespace/count"
url: AppUtil.prefixPath() + "/envs/:env/instances/by-namespace/count"
}
});
......
appService.service('NamespaceBranchService', ['$resource', '$q', function ($resource, $q) {
appService.service('NamespaceBranchService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var resource = $resource('', {}, {
find_namespace_branch: {
method: 'GET',
isArray: false,
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches'
},
create_branch: {
method: 'POST',
isArray: false,
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches'
},
delete_branch: {
method: 'DELETE',
isArray: false,
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches/:branchName'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches/:branchName'
},
merge_and_release_branch: {
method: 'POST',
isArray: false,
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches/:branchName/merge'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches/:branchName/merge'
},
find_branch_gray_rules: {
method: 'GET',
isArray: false,
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches/:branchName/rules'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches/:branchName/rules'
},
update_branch_gray_rules: {
method: 'PUT',
isArray: false,
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches/:branchName/rules'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches/:branchName/rules'
}
});
......
appService.service("NamespaceService", ['$resource', '$q', function ($resource, $q) {
appService.service("NamespaceService", ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var namespace_source = $resource("", {}, {
find_public_namespaces: {
method: 'GET',
isArray: true,
url: '/appnamespaces/public'
url: AppUtil.prefixPath() + '/appnamespaces/public'
},
createNamespace: {
method: 'POST',
url: '/apps/:appId/namespaces',
url: AppUtil.prefixPath() + '/apps/:appId/namespaces',
isArray: false
},
createAppNamespace: {
method: 'POST',
url: '/apps/:appId/appnamespaces?appendNamespacePrefix=:appendNamespacePrefix',
url: AppUtil.prefixPath() + '/apps/:appId/appnamespaces?appendNamespacePrefix=:appendNamespacePrefix',
isArray: false
},
getNamespacePublishInfo: {
method: 'GET',
url: '/apps/:appId/namespaces/publish_info'
url: AppUtil.prefixPath() + '/apps/:appId/namespaces/publish_info'
},
deleteNamespace: {
method: 'DELETE',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName'
},
getPublicAppNamespaceAllNamespaces: {
method: 'GET',
url: '/envs/:env/appnamespaces/:publicNamespaceName/namespaces',
url: AppUtil.prefixPath() + '/envs/:env/appnamespaces/:publicNamespaceName/namespaces',
isArray: true
},
loadAppNamespace: {
method: 'GET',
url: '/apps/:appId/appnamespaces/:namespaceName'
url: AppUtil.prefixPath() + '/apps/:appId/appnamespaces/:namespaceName'
},
deleteAppNamespace: {
method: 'DELETE',
url: '/apps/:appId/appnamespaces/:namespaceName'
url: AppUtil.prefixPath() + '/apps/:appId/appnamespaces/:namespaceName'
}
});
......
appService.service("OrganizationService", ['$resource', '$q', function ($resource, $q) {
appService.service("OrganizationService", ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var organization_source = $resource("", {}, {
find_organizations: {
method: 'GET',
isArray: true,
url: '/organizations'
url: AppUtil.prefixPath() + '/organizations'
}
});
......
appService.service('PermissionService', ['$resource', '$q', function ($resource, $q) {
appService.service('PermissionService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var permission_resource = $resource('', {}, {
init_app_namespace_permission: {
method: 'POST',
url: '/apps/:appId/initPermission',
url: AppUtil.prefixPath() + '/apps/:appId/initPermission',
headers: {
'Content-Type': 'text/plain;charset=UTF-8'
}
},
has_app_permission: {
method: 'GET',
url: '/apps/:appId/permissions/:permissionType'
url: AppUtil.prefixPath() + '/apps/:appId/permissions/:permissionType'
},
has_namespace_permission: {
method: 'GET',
url: '/apps/:appId/namespaces/:namespaceName/permissions/:permissionType'
url: AppUtil.prefixPath() + '/apps/:appId/namespaces/:namespaceName/permissions/:permissionType'
},
has_namespace_env_permission: {
method: 'GET',
url: '/apps/:appId/envs/:env/namespaces/:namespaceName/permissions/:permissionType'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/namespaces/:namespaceName/permissions/:permissionType'
},
has_root_permission:{
method: 'GET',
url: '/permissions/root'
url: AppUtil.prefixPath() + '/permissions/root'
},
get_namespace_role_users: {
method: 'GET',
url: '/apps/:appId/namespaces/:namespaceName/role_users'
url: AppUtil.prefixPath() + '/apps/:appId/namespaces/:namespaceName/role_users'
},
get_namespace_env_role_users: {
method: 'GET',
url: '/apps/:appId/envs/:env/namespaces/:namespaceName/role_users'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/namespaces/:namespaceName/role_users'
},
assign_namespace_role_to_user: {
method: 'POST',
url: '/apps/:appId/namespaces/:namespaceName/roles/:roleType',
url: AppUtil.prefixPath() + '/apps/:appId/namespaces/:namespaceName/roles/:roleType',
headers: {
'Content-Type': 'text/plain;charset=UTF-8'
}
},
assign_namespace_env_role_to_user: {
method: 'POST',
url: '/apps/:appId/envs/:env/namespaces/:namespaceName/roles/:roleType',
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/namespaces/:namespaceName/roles/:roleType',
headers: {
'Content-Type': 'text/plain;charset=UTF-8'
}
},
remove_namespace_role_from_user: {
method: 'DELETE',
url: '/apps/:appId/namespaces/:namespaceName/roles/:roleType?user=:user'
url: AppUtil.prefixPath() + '/apps/:appId/namespaces/:namespaceName/roles/:roleType?user=:user'
},
remove_namespace_env_role_from_user: {
method: 'DELETE',
url: '/apps/:appId/envs/:env/namespaces/:namespaceName/roles/:roleType?user=:user'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/namespaces/:namespaceName/roles/:roleType?user=:user'
},
get_app_role_users: {
method: 'GET',
url: '/apps/:appId/role_users'
url: AppUtil.prefixPath() + '/apps/:appId/role_users'
},
assign_app_role_to_user: {
method: 'POST',
url: '/apps/:appId/roles/:roleType',
url: AppUtil.prefixPath() + '/apps/:appId/roles/:roleType',
headers: {
'Content-Type': 'text/plain;charset=UTF-8'
}
},
remove_app_role_from_user: {
method: 'DELETE',
url: '/apps/:appId/roles/:roleType?user=:user'
url: AppUtil.prefixPath() + '/apps/:appId/roles/:roleType?user=:user'
},
has_open_manage_app_master_role_limit: {
method: 'GET',
url: '/system/role/manageAppMaster'
url: AppUtil.prefixPath() + '/system/role/manageAppMaster'
}
});
......
appService.service('ReleaseHistoryService', ['$resource', '$q', function ($resource, $q) {
appService.service('ReleaseHistoryService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var resource = $resource('', {}, {
find_release_history_by_namespace: {
method: 'GET',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/releases/histories',
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/releases/histories',
isArray: true
}
});
......
appService.service('ReleaseService', ['$resource', '$q', function ($resource, $q) {
appService.service('ReleaseService', ['$resource', '$q','AppUtil', function ($resource, $q,AppUtil) {
var resource = $resource('', {}, {
find_all_releases: {
method: 'GET',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/releases/all',
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/releases/all',
isArray: true
},
find_active_releases: {
method: 'GET',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/releases/active',
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/releases/active',
isArray: true
},
compare: {
method: 'GET',
url: '/envs/:env/releases/compare'
url: AppUtil.prefixPath() + '/envs/:env/releases/compare'
},
release: {
method: 'POST',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/releases'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/releases'
},
gray_release: {
method: 'POST',
url: '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches/:branchName/releases'
url: AppUtil.prefixPath() + '/apps/:appId/envs/:env/clusters/:clusterName/namespaces/:namespaceName/branches/:branchName/releases'
},
rollback: {
method: 'PUT',
......
appService.service('ServerConfigService', ['$resource', '$q', function ($resource, $q) {
appService.service('ServerConfigService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var server_config_resource = $resource('', {}, {
create_server_config: {
method: 'POST',
url: '/server/config'
url: AppUtil.prefixPath() + '/server/config'
},
get_server_config_info: {
method: 'GET',
url: '/server/config/:key'
url: AppUtil.prefixPath() + '/server/config/:key'
}
});
return {
......
appService.service('SystemInfoService', ['$resource', '$q', function ($resource, $q) {
appService.service('SystemInfoService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var system_info_resource = $resource('', {}, {
load_system_info: {
method: 'GET',
url: '/system-info'
url: AppUtil.prefixPath() + '/system-info'
},
check_health: {
method: 'GET',
url: '/system-info/health'
url: AppUtil.prefixPath() + '/system-info/health'
}
});
return {
......
appService.service('SystemRoleService', ['$resource', '$q', function ($resource, $q) {
appService.service('SystemRoleService', ['$resource', '$q', 'AppUtil', function ($resource, $q,AppUtil) {
var system_role_service = $resource('', {}, {
add_create_application_role: {
method: 'POST',
url: '/system/role/createApplication'
url: AppUtil.prefixPath() + '/system/role/createApplication'
},
delete_create_application_role: {
method: 'DELETE',
url: '/system/role/createApplication/:userId'
url: AppUtil.prefixPath() + '/system/role/createApplication/:userId'
},
get_create_application_role_users: {
method: 'GET',
url: '/system/role/createApplication',
url: AppUtil.prefixPath() + '/system/role/createApplication',
isArray: true
},
has_open_manage_app_master_role_limit: {
method: 'GET',
url: '/system/role/manageAppMaster'
url: AppUtil.prefixPath() + '/system/role/manageAppMaster'
}
});
return {
......
appService.service('UserService', ['$resource', '$q', function ($resource, $q) {
appService.service('UserService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var user_resource = $resource('', {}, {
load_user: {
method: 'GET',
url: '/user'
url: AppUtil.prefixPath() + '/user'
},
find_users: {
method: 'GET',
url: '/users'
url: AppUtil.prefixPath() + '/users'
},
create_or_update_user: {
method: 'POST',
url: '/users'
url: AppUtil.prefixPath() + '/users'
}
});
return {
......
......@@ -3,13 +3,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="icon" href="../img/config.png">
<link rel="icon" href="img/config.png">
<!-- 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 rel="stylesheet" type="text/css" href="../styles/common-style.css">
<link rel="stylesheet" type="text/css" href="../vendor/select2/select2.min.css">
<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 rel="stylesheet" type="text/css" href="styles/common-style.css">
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<title>{{'SystemRole.Title' | translate }}</title>
</head>
......@@ -131,17 +131,17 @@
</div>
</div>
<div ng-include="'../views/common/footer.html'"></div>
<div ng-include="'views/common/footer.html'"></div>
<!-- jquery.js -->
<script src="../vendor/jquery.min.js" type="text/javascript"></script>
<script src="vendor/jquery.min.js" type="text/javascript"></script>
<!--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>
<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>
<script src="vendor/angular/angular-cookies.min.js"></script>
<script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script>
......@@ -149,34 +149,34 @@
<script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script>
<!--valdr-->
<script src="../vendor/valdr/valdr.min.js" type="text/javascript"></script>
<script src="../vendor/valdr/valdr-message.min.js" type="text/javascript"></script>
<script src="vendor/valdr/valdr.min.js" type="text/javascript"></script>
<script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script>
<!-- bootstrap.js -->
<script src="../vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../vendor/lodash.min.js"></script>
<script src="vendor/lodash.min.js"></script>
<script src="../vendor/select2/select2.min.js" type="text/javascript"></script>
<script src="vendor/select2/select2.min.js" type="text/javascript"></script>
<!--biz-->
<!--must import-->
<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/services/UserService.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/ClusterService.js"></script>
<script type="application/javascript" src="../scripts/services/NamespaceService.js"></script>
<script type="application/javascript" src="../scripts/services/SystemRoleService.js"></script>
<script type="application/javascript" src="../scripts/AppUtils.js"></script>
<script type="application/javascript" src="../scripts/PageCommon.js"></script>
<script type="application/javascript" src="../scripts/directive/directive.js"></script>
<script type="application/javascript" src="../scripts/valdr.js"></script>
<script type="application/javascript" src="../scripts/controller/role/SystemRoleController.js"></script>
<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/services/UserService.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/ClusterService.js"></script>
<script type="application/javascript" src="scripts/services/NamespaceService.js"></script>
<script type="application/javascript" src="scripts/services/SystemRoleService.js"></script>
<script type="application/javascript" src="scripts/AppUtils.js"></script>
<script type="application/javascript" src="scripts/PageCommon.js"></script>
<script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/valdr.js"></script>
<script type="application/javascript" src="scripts/controller/role/SystemRoleController.js"></script>
</body>
</html>
......@@ -3,13 +3,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="icon" href="../img/config.png">
<link rel="icon" href="img/config.png">
<!-- 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 rel="stylesheet" type="text/css" href="../styles/common-style.css">
<link rel="stylesheet" type="text/css" href="../vendor/select2/select2.min.css">
<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 rel="stylesheet" type="text/css" href="styles/common-style.css">
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<title>{{'SystemInfo.Title' | translate }}</title>
</head>
......@@ -108,17 +108,17 @@
</div>
</div>
<div ng-include="'../views/common/footer.html'"></div>
<div ng-include="'views/common/footer.html'"></div>
<!-- jquery.js -->
<script src="../vendor/jquery.min.js" type="text/javascript"></script>
<script src="vendor/jquery.min.js" type="text/javascript"></script>
<!--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>
<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>
<script src="vendor/angular/angular-cookies.min.js"></script>
<script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script>
......@@ -126,34 +126,34 @@
<script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script>
<!--valdr-->
<script src="../vendor/valdr/valdr.min.js" type="text/javascript"></script>
<script src="../vendor/valdr/valdr-message.min.js" type="text/javascript"></script>
<script src="vendor/valdr/valdr.min.js" type="text/javascript"></script>
<script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script>
<!-- bootstrap.js -->
<script src="../vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../vendor/lodash.min.js"></script>
<script src="vendor/lodash.min.js"></script>
<script src="../vendor/select2/select2.min.js" type="text/javascript"></script>
<script src="vendor/select2/select2.min.js" type="text/javascript"></script>
<!--biz-->
<!--must import-->
<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/services/UserService.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/ClusterService.js"></script>
<script type="application/javascript" src="../scripts/services/NamespaceService.js"></script>
<script type="application/javascript" src="../scripts/services/SystemInfoService.js"></script>
<script type="application/javascript" src="../scripts/AppUtils.js"></script>
<script type="application/javascript" src="../scripts/PageCommon.js"></script>
<script type="application/javascript" src="../scripts/directive/directive.js"></script>
<script type="application/javascript" src="../scripts/valdr.js"></script>
<script type="application/javascript" src="../scripts/controller/SystemInfoController.js"></script>
<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/services/UserService.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/ClusterService.js"></script>
<script type="application/javascript" src="scripts/services/NamespaceService.js"></script>
<script type="application/javascript" src="scripts/services/SystemInfoService.js"></script>
<script type="application/javascript" src="scripts/AppUtils.js"></script>
<script type="application/javascript" src="scripts/PageCommon.js"></script>
<script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/valdr.js"></script>
<script type="application/javascript" src="scripts/controller/SystemInfoController.js"></script>
</body>
</html>
\ No newline at end of file
......@@ -3,8 +3,8 @@
<p class="text-center">
<span class="glyphicon glyphicon-copyright-mark" aria-hidden="true"></span>{{'Common.Ctrip' | translate }} {{'Common.CtripDepartment' | translate }}
<a href="https://github.com/ctripcorp/apollo" target="_blank">
<img src="../../img/github.png" style="width: 50px; height: 20px;">
<img src="{{ '/img/github.png' | prefixPath }}" style="width: 50px; height: 20px;">
</a>
</p>
</div>
<iframe src="/sso_heartbeat" class="hide"></iframe>
<iframe ng-src="{{ '/sso_heartbeat' | prefixPath }}" class="hide"></iframe>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<img class="navbar-brand side-bar-switch cursor-pointer" src="../../img/show_sidebar.png"
<img class="navbar-brand side-bar-switch cursor-pointer" src="{{ '/img/show_sidebar.png' | prefixPath }}"
onMouseOver="this.style.background='#f1f2f7'"
onMouseOut="this.style.background='#fff'"
data-tooltip="tooltip" data-placement="bottom" title="{{'Common.Nav.ShowNavBar' | translate }}"
ng-show="viewMode == 2 && !showSideBar"
ng-click="showSideBar = !showSideBar">
<img class="navbar-brand side-bar-switch cursor-pointer" src="../../img/hide_sidebar.png"
<img class="navbar-brand side-bar-switch cursor-pointer" src="{{ '/img/hide_sidebar.png' | prefixPath }}"
onMouseOver="this.style.background='#f1f2f7'"
onMouseOut="this.style.background='#fff'"
data-tooltip="tooltip" data-placement="bottom" title="{{'Common.Nav.HideNavBar' | translate }}"
ng-show="viewMode == 2 && showSideBar"
ng-click="showSideBar = !showSideBar">
<a class="navbar-brand logo" href="/">
<img src="../../img/logo-simple.png" style="height:45px; margin-top: -13px">
<a class="navbar-brand logo" href="{{ '/' | prefixPath }}">
<img src="{{ '/img/logo-simple.png' | prefixPath }}" style="height:45px; margin-top: -13px">
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
......@@ -39,12 +39,12 @@
<span class="glyphicon glyphicon-cog"></span>&nbsp;{{'Common.Nav.AdminTools' | translate }}
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/user-manage.html" target="_blank">{{'Common.Nav.UserManage' | translate }}</a></li>
<li><a href="/system-role-manage.html" target="_blank">{{'Common.Nav.SystemRoleManage' | translate }}</a></li>
<li><a href="/open/manage.html" target="_blank">{{'Common.Nav.OpenMange' | translate }}</a></li>
<li><a href="/server_config.html" target="_blank">{{'Common.Nav.SystemConfig' | translate }}</a></li>
<li><a href="/delete_app_cluster_namespace.html" target="_blank">{{'Common.Nav.DeleteApp-Cluster-Namespace' | translate }}</a></li>
<li><a href="/system_info.html" target="_blank">{{'Common.Nav.SystemInfo' | translate }}</a></li>
<li><a ng-href="{{ '/user-manage.html' | prefixPath }}" target="_blank">{{'Common.Nav.UserManage' | translate }}</a></li>
<li><a href="{{ '/system-role-manage.html' | prefixPath }}" target="_blank">{{'Common.Nav.SystemRoleManage' | translate }}</a></li>
<li><a href="{{ '/open/manage.html' | prefixPath }}" target="_blank">{{'Common.Nav.OpenMange' | translate }}</a></li>
<li><a href="{{ '/server_config.html' | prefixPath }}" target="_blank">{{'Common.Nav.SystemConfig' | translate }}</a></li>
<li><a href="{{ '/delete_app_cluster_namespace.html' | prefixPath }}" target="_blank">{{'Common.Nav.DeleteApp-Cluster-Namespace' | translate }}</a></li>
<li><a href="{{ '/system_info.html' | prefixPath }}" target="_blank">{{'Common.Nav.SystemInfo' | translate }}</a></li>
</ul>
</li>
<li class="dropdown">
......@@ -52,7 +52,7 @@
<span class="glyphicon glyphicon-user"></span>&nbsp;{{userName}}
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/user/logout">{{'Common.Nav.Logout' | translate }}</a></li>
<li><a href="{{ '/user/logout' | prefixPath }}">{{'Common.Nav.Logout' | translate }}</a></li>
</ul>
</li>
......
......@@ -364,7 +364,7 @@
<button class="btn btn-default btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Instance.RefreshList' | translate }}"
ng-click="refreshInstancesInfo(namespace.branch)">
<img src="../../img/refresh.png" />
<img ng-src="{{ '/img/refresh.png' | prefixPath }}" />
</button>
</div>
<div class="panel-body">
......@@ -372,7 +372,7 @@
<div class="panel-heading">
<a target="_blank" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Instance.ItemToSee' | translate }}"
href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{namespace.baseInfo.clusterName}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{namespace.branch.latestRelease.id}}">
ng-href="{{ '/config/history.html' | prefixPath }}?#/appid={{appId}}&env={{env}}&clusterName={{namespace.baseInfo.clusterName}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{namespace.branch.latestRelease.id}}">
{{namespace.branch.latestRelease.name}}
</a>
</div>
......
......@@ -54,13 +54,13 @@
</button>
<a type="button" class="btn btn-default btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Master.Items.PublishHistoryTips' | translate }}"
href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}">
href="{{ '/config/history.html' | prefixPath }}?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}">
<img src="img/release-history.png">
{{'Component.Namespace.Master.Items.PublishHistory' | translate }}
</a>
<a type="button" class="btn btn-default btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Master.Items.GrantTips' | translate }}"
href="/namespace/role.html?#/appid={{appId}}&namespaceName={{namespace.baseInfo.namespaceName}}"
href="{{ '/namespace/role.html' | prefixPath }}?#/appid={{appId}}&namespaceName={{namespace.baseInfo.namespaceName}}"
ng-show="hasAssignUserPermission">
<img src="img/assign.png">
{{'Component.Namespace.Master.Items.Grant' | translate }}
......@@ -456,7 +456,7 @@
<div class="row">
<div class="padding-top-5 col-md-4 col-sm-4">
{{'Component.Namespace.Master.Items.Body.Public.Title' | translate }}
<a href="/config.html?#/appid={{namespace.publicNamespace.baseInfo.appId}}&env={{env}}&cluster={{namespace.publicNamespace.baseInfo.clusterName}}"
<a href="{{ '/config.html' | prefixPath }}?#/appid={{namespace.publicNamespace.baseInfo.appId}}&env={{env}}&cluster={{namespace.publicNamespace.baseInfo.clusterName}}"
target="_blank">
<small>
({{'Common.AppId' | translate }}:{{namespace.publicNamespace.baseInfo.appId}},
......@@ -672,7 +672,7 @@
</div>
<div class="panel-body text-center">
{{'Component.Namespace.Master.Items.Body.Public.NoPublicNamespaceTips1' | translate }}
<a href="/config.html?#/appid={{namespace.parentAppId}}"
<a href="{{ '/config.html' | prefixPath }}?#/appid={{namespace.parentAppId}}"
target="_blank">{{namespace.parentAppId}}</a>
{{'Component.Namespace.Master.Items.Body.Public.NoPublicNamespaceTips2' | translate:this }}
</div>
......@@ -861,7 +861,7 @@
<button class="btn btn-default btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Master.Items.Body.Instance.RefreshList' | translate }}"
ng-click="refreshInstancesInfo(namespace)">
<img src="../../img/refresh.png" />
<img ng-src="{{ '/img/refresh.png' | prefixPath }}" />
</button>
</div>
......@@ -875,7 +875,7 @@
<div class="panel-heading">
<a target="_blank" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Master.Items.Body.Instance.ToSeeItem' | translate }}"
href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{namespace.latestRelease.id}}">
ng-href="{{ '/config/history.html' | prefixPath }}?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{namespace.latestRelease.id}}">
{{namespace.latestRelease.name}}
</a>
</div>
......@@ -925,7 +925,7 @@
<div class="panel-heading">
<a target="_blank" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Master.Items.Body.Instance.ToSeeItem' | translate }}"
href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{release.id}}">
href="{{ '/config/history.html' | prefixPath }}?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{release.id}}">
{{release.name}}
</a>
......
......@@ -14,7 +14,7 @@
<div class="alert alert-warning" role="alert">
{{'Component.Rollback.Tips' | translate }}
<a target="_blank"
href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{toRollbackNamespace.baseInfo.clusterName}}&namespaceName={{toRollbackNamespace.baseInfo.namespaceName}}">{{'Component.Rollback.ClickToView' | translate }}</a>
href="{{ '/config/history.html' | prefixPath }}?#/appid={{appId}}&env={{env}}&clusterName={{toRollbackNamespace.baseInfo.clusterName}}&namespaceName={{toRollbackNamespace.baseInfo.namespaceName}}">{{'Component.Rollback.ClickToView' | translate }}</a>
</div>
<div class="form-group" style="margin-top: 15px;">
......
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