diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/WebMvcConfig.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/WebMvcConfig.java index bb0394dbc60a3d76f558d921c8fc9155952bfe27..a965b4323dd21366976996bf13c0d9cb68f39e8f 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/WebMvcConfig.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/WebMvcConfig.java @@ -45,7 +45,6 @@ public class WebMvcConfig implements WebMvcConfigurer, WebServerFactoryCustomize addCacheControl(registry, "scripts", 86400); addCacheControl(registry, "styles", 86400); addCacheControl(registry, "views", 86400); - addCacheControl(registry, "i18n", 86400); } private void addCacheControl(ResourceHandlerRegistry registry, String folder, int cachePeriod) { diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/AppDTO.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/AppDTO.java index 0bd77b0eccb20989c74b7e4c8ec2464d5a11456e..675be19f0c662b93a98a062157ab98d7e179b16d 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/AppDTO.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/AppDTO.java @@ -11,7 +11,7 @@ public class AppDTO extends BaseDTO{ @Pattern( regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR, - message = "Invalid AppId format: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + message = "AppId格式错误: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE ) private String appId; diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/ClusterDTO.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/ClusterDTO.java index 647a7c6973465a2be2d14f368fedbe678334a4a7..10a5fe2e0533382f352d32ecfdb7362d2fc5ce57 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/ClusterDTO.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/ClusterDTO.java @@ -11,7 +11,7 @@ public class ClusterDTO extends BaseDTO{ @NotBlank(message = "cluster name cannot be blank") @Pattern( regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR, - message = "Invalid Cluster format: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + message = "Cluster格式错误: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE ) private String name; diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/NamespaceDTO.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/NamespaceDTO.java index e44e8603d01207cd55b473c97f65c46884ee442a..9281e37aa6f89ccb6a722eb33e4c11e700b323eb 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/NamespaceDTO.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/NamespaceDTO.java @@ -12,7 +12,7 @@ public class NamespaceDTO extends BaseDTO{ @Pattern( regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR, - message = "Invalid Namespace format: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + message = "Namespace格式错误: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE ) private String namespaceName; diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java index 5f554648b7fec79345cd6c28e42e208a86e9c9b2..ddb0a88cc6543321a02e4bf8d96f0c8fc525b6f4 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java @@ -22,7 +22,7 @@ public class AppNamespace extends BaseEntity { @NotBlank(message = "AppNamespace Name cannot be blank") @Pattern( regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR, - message = "Invalid Namespace format: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + " & " + InputValidator.INVALID_NAMESPACE_NAMESPACE_MESSAGE + message = "Namespace格式错误: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + " & " + InputValidator.INVALID_NAMESPACE_NAMESPACE_MESSAGE ) @Column(name = "Name", nullable = false) private String name; diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/InputValidator.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/InputValidator.java index e20cae47d9f08b833f50c962542a652cf6284351..bec9b9f905690a55376199d3233ebcd9c045b1c5 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/InputValidator.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/InputValidator.java @@ -8,8 +8,8 @@ import java.util.regex.Pattern; * @author Jason Song(song_s@ctrip.com) */ public class InputValidator { - public static final String INVALID_CLUSTER_NAMESPACE_MESSAGE = "Only digits, alphabets and symbol - _ . are allowed"; - public static final String INVALID_NAMESPACE_NAMESPACE_MESSAGE = "not allowed to end with .json, .yml, .yaml, .xml, .properties"; + public static final String INVALID_CLUSTER_NAMESPACE_MESSAGE = "只允许输入数字,字母和符号 - _ ."; + public static final String INVALID_NAMESPACE_NAMESPACE_MESSAGE = "不允许以.json, .yml, .yaml, .xml, .properties结尾"; public static final String CLUSTER_NAMESPACE_VALIDATOR = "[0-9a-zA-Z_.-]+"; private static final String APP_NAMESPACE_VALIDATOR = "[a-zA-Z0-9._-]+(? assignedUser = rolePermissionService.assignRoleToUsers(RoleUtils.buildNamespaceRoleName(appId, namespaceName, roleType, env), Sets.newHashSet(user), userInfoHolder.getUser().getUserId()); if (CollectionUtils.isEmpty(assignedUser)) { - throw new BadRequestException(user + " already authorized"); + throw new BadRequestException(user + "已授权"); } return ResponseEntity.ok().build(); @@ -209,7 +209,7 @@ public class PermissionController { Set assignedUser = rolePermissionService.assignRoleToUsers(RoleUtils.buildNamespaceRoleName(appId, namespaceName, roleType), Sets.newHashSet(user), userInfoHolder.getUser().getUserId()); if (CollectionUtils.isEmpty(assignedUser)) { - throw new BadRequestException(user + " already authorized"); + throw new BadRequestException(user + "已授权"); } return ResponseEntity.ok().build(); @@ -253,7 +253,7 @@ public class PermissionController { Set assignedUsers = rolePermissionService.assignRoleToUsers(RoleUtils.buildAppRoleName(appId, roleType), Sets.newHashSet(user), userInfoHolder.getUser().getUserId()); if (CollectionUtils.isEmpty(assignedUsers)) { - throw new BadRequestException(user + " already authorized"); + throw new BadRequestException(user + "已授权"); } return ResponseEntity.ok().build(); diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/model/AppModel.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/model/AppModel.java index 96a3337011894394e379bf901af2055d00ab837a..0134bb72b20079924c84d86a4c59428cf18ece2c 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/model/AppModel.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/model/AppModel.java @@ -14,7 +14,7 @@ public class AppModel { @NotBlank(message = "appId cannot be blank") @Pattern( regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR, - message = "Invalid AppId format: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + message = "AppId格式错误: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE ) private String appId; diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java index 8770235ee8a29cde6eff4e51ac1016a091a9bbb8..c32e6fa7e13d4b54314f3ea98a93178ebb911c06 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java @@ -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/**").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/**").permitAll() .antMatchers("/**").authenticated(); http.formLogin().loginPage("/signin").defaultSuccessUrl("/", true).permitAll().failureUrl("/signin?#/error").and() .httpBasic(); diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/util/RelativeDateFormat.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/util/RelativeDateFormat.java index 379fac106652abaf78ee856da3d2d72c31792163..2f899be192d0e49b25adcdf5faaafecda8b5216b 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/util/RelativeDateFormat.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/util/RelativeDateFormat.java @@ -12,11 +12,11 @@ public class RelativeDateFormat { private static final long ONE_HOUR = 3600000L; private static final long ONE_DAY = 86400000L; - private static final String ONE_SECOND_AGO = " seconds ago"; - private static final String ONE_MINUTE_AGO = " minutes ago"; - private static final String ONE_HOUR_AGO = " hours ago"; - private static final String ONE_DAY_AGO = " days ago"; - private static final String ONE_MONTH_AGO = " months ago"; + private static final String ONE_SECOND_AGO = "秒前"; + private static final String ONE_MINUTE_AGO = "分钟前"; + private static final String ONE_HOUR_AGO = "小时前"; + private static final String ONE_DAY_AGO = "天前"; + private static final String ONE_MONTH_AGO = "月前"; public static String format(Date date) { if (date.after(new Date())) { @@ -39,11 +39,11 @@ public class RelativeDateFormat { Date lastDayBeginTime = getDateOffset(-1); if (date.after(lastDayBeginTime)) { - return "yesterday"; + return "昨天"; } Date lastTwoDaysBeginTime = getDateOffset(-2); if (date.after(lastTwoDaysBeginTime)) { - return "the day before yesterday"; + return "前天"; } if (delta < 30L * ONE_DAY) { long days = toDays(delta); diff --git a/apollo-portal/src/main/resources/static/app.html b/apollo-portal/src/main/resources/static/app.html index c16b8a55ed6acc7e447112d5213757a78ae4af2c..0b6e10a17423baeb42e031062d16acc6c6265489 100644 --- a/apollo-portal/src/main/resources/static/app.html +++ b/apollo-portal/src/main/resources/static/app.html @@ -10,7 +10,7 @@ - {{'App.CreateProject' | translate }} + 新建项目 @@ -22,7 +22,7 @@
- {{'App.CreateProject' | translate }} + 创建项目
+ 部门
- {{'App.AppIdTips' | translate }} - + (应用唯一标识)
+ 应用名称
- {{'App.AppNameTips' | translate }} + (建议格式 xx-yy-zz 例:apollo-server)
+ 应用负责人
- {{'App.AppOwnerTips' | translate }} + (开启项目管理员分配权限控制后,应用负责人和项目管理员默认为本账号,不可选择)
-
@@ -87,7 +86,7 @@
@@ -105,11 +104,6 @@ - - - - - diff --git a/apollo-portal/src/main/resources/static/app/setting.html b/apollo-portal/src/main/resources/static/app/setting.html index dbc11c4fe0b75392f67a134ddc8940bde27c5ac1..1702934ca38f1e3c91385d3aecee2644f4714ca0 100644 --- a/apollo-portal/src/main/resources/static/app/setting.html +++ b/apollo-portal/src/main/resources/static/app/setting.html @@ -1,6 +1,5 @@ - @@ -10,198 +9,192 @@ - {{'App.Setting.Title' | translate }} + 项目管理 - + -
- - -
-
{{'App.Setting.BasicInfo' | translate }}
-
-
+
-
-
+ -
-
-

-
-
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - \ No newline at end of file +
+
+

您没有权限操作,请找 [{{admins.join(',')}}] 开通权限

+
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apollo-portal/src/main/resources/static/cluster.html b/apollo-portal/src/main/resources/static/cluster.html index a9feec5ff8823e9010115420607f379267c7c755..3c94a30b115a56fda1efc9b6f7130a0bf0066c3e 100644 --- a/apollo-portal/src/main/resources/static/cluster.html +++ b/apollo-portal/src/main/resources/static/cluster.html @@ -9,7 +9,7 @@ - {{'Cluster.CreateCluster' | translate }} + 新建集群 @@ -23,10 +23,10 @@
-

{{'Cluster.CreateCluster' | translate }}

+

创建集群

@@ -39,10 +39,13 @@
+ 应用AppId
@@ -58,16 +61,16 @@
+ 集群名称
- {{'Cluster.CreateNameTips' | translate }} + (部署集群如:SHAJQ,SHAOY 或自定义集群如:SHAJQ-xx,SHAJQ-yy)
+ 选择环境
@@ -86,14 +89,14 @@
-

{{'Common.Created' | translate }}!

+

创建成功!

@@ -108,11 +111,6 @@ - - - - - diff --git a/apollo-portal/src/main/resources/static/config.html b/apollo-portal/src/main/resources/static/config.html index d4b0e511876a7c87160ab21631606f4994d3e75d..9f4a5274b8c9e7dfca158f29ae96b4e35a3d4d6c 100644 --- a/apollo-portal/src/main/resources/static/config.html +++ b/apollo-portal/src/main/resources/static/config.html @@ -3,7 +3,7 @@ - {{'Config.Title' | translate }} + Apollo配置中心 @@ -15,417 +15,437 @@ - - -
-
- + + +
+
+ -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{'Common.Department' | translate }}:
{{'Common.AppName' | translate }}: - -
{{'Common.Department' | translate }}:
{{'Common.AppOwner' | translate }}:
{{'Common.Email' | translate }}: - -
{{'Config.MissEnv' | translate }}: - - -
{{'Config.MissNamespace' | translate }}: - - -
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AppId:
应用名: + +
部门:
负责人:
邮箱: + +
缺失的环境: + + +
缺失的Namespace: + + +
+
+ + + +
+ + + +
+

补缺环境

-
- - -
- - - -
-

{{'Config.CreateAppMissEnv' | translate }}

-
-
- - -
-

{{'Config.CreateAppMissNamespace' | translate }}

-
-
- - - -
-
-

{{'Config.AddCluster' | translate }}

-
+ + + +
+

补缺Namespace

+
- + -
-
-

{{'Config.AddNamespace' | translate }}

-
+
+
+

添加集群

+
+ -
+
+
+

添加Namespace

+
+
- - - - - -
- -

- {{'Config.CurrentlyOperatorEnv' | translate }}:{{pageContext.env}}, - {{'Common.Cluster' | translate }}:{{pageContext.clusterName}} -

- +
+ + + +
+ +

+ 当前操作环境:{{pageContext.env}}, 集群:{{pageContext.clusterName}} +

+