From 63a68f5df29907fa717e726bbe54f0d4583b73f7 Mon Sep 17 00:00:00 2001 From: Luke0125 <348358584@qq.com> Date: Sat, 13 Jan 2024 19:30:50 +0800 Subject: [PATCH] Add comment for clusters and UI display (#5072) * Complete the feature initially * reformat ui terms from 'comment' to 'remarks' * add brackets for RemarksTips * update CHANGES.md --- CHANGES.md | 1 + .../framework/apollo/biz/entity/Cluster.java | 13 +++++++++++- .../apollo/common/dto/ClusterDTO.java | 10 +++++++++ .../src/main/resources/static/cluster.html | 9 ++++++++ .../src/main/resources/static/i18n/en.json | 2 ++ .../src/main/resources/static/i18n/zh-CN.json | 2 ++ .../scripts/controller/ClusterController.js | 2 ++ .../config/ConfigBaseInfoController.js | 12 +++++++++++ scripts/sql/apolloconfigdb.sql | 1 + .../v220-v230/apolloconfigdb-v220-v230.sql | 21 +++++++++++++++++++ 10 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 scripts/sql/delta/v220-v230/apolloconfigdb-v220-v230.sql 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 }} +
+