diff --git a/CHANGES.md b/CHANGES.md index ec4d138378b..6a4930af5d0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Apollo 2.3.0 ------------------ * [Fix circular references on LdapAutoConfiguration](https://github.com/apolloconfig/apollo/pull/5055) +* [Add comment for clusters and UI display](https://github.com/apolloconfig/apollo/pull/5072) ------------------ diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Cluster.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Cluster.java index af41b1951dd..e69b8019e66 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Cluster.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Cluster.java @@ -43,6 +43,9 @@ public class Cluster extends BaseEntity implements Comparable { @Column(name = "`ParentClusterId`", nullable = false) private long parentClusterId; + @Column(name = "`Comment`") + private String comment; + public String getAppId() { return appId; } @@ -67,9 +70,17 @@ public void setParentClusterId(long parentClusterId) { this.parentClusterId = parentClusterId; } + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + public String toString() { return toStringHelper().add("name", name).add("appId", appId) - .add("parentClusterId", parentClusterId).toString(); + .add("parentClusterId", parentClusterId).add("comment", comment).toString(); } @Override 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 f78dd56ca01..ac2ae3fc662 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 @@ -36,6 +36,8 @@ public class ClusterDTO extends BaseDTO{ private long parentClusterId; + private String comment; + public long getId() { return id; } @@ -67,4 +69,12 @@ public long getParentClusterId() { public void setParentClusterId(long parentClusterId) { this.parentClusterId = parentClusterId; } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } } diff --git a/apollo-portal/src/main/resources/static/cluster.html b/apollo-portal/src/main/resources/static/cluster.html index 825e7aa8760..ed1a01a5a60 100644 --- a/apollo-portal/src/main/resources/static/cluster.html +++ b/apollo-portal/src/main/resources/static/cluster.html @@ -80,6 +80,15 @@

{{'Cluster.CreateCluster' | translate }}

{{'Cluster.CreateNameTips' | translate }} +
+ +
+ + {{'Cluster.CreateRemarksTips' | translate }} +
+