Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

给新建集群增加备注说明 #5067

Closed
mike-pjj opened this issue Jan 4, 2024 · 2 comments
Closed

给新建集群增加备注说明 #5067

mike-pjj opened this issue Jan 4, 2024 · 2 comments
Labels
feature request Categorizes issue as related to a new feature.

Comments

@mike-pjj
Copy link

mike-pjj commented Jan 4, 2024

你的特性请求和某个问题有关吗?请描述

清晰简洁地描述这个问题是什么。即,当碰到xxx时,总是感觉很麻烦
当集群太多了,多人使用时可能不知道创建名字代表意义。

清晰简洁地描述一下你希望的解决方案
增加备注,将备注显示在集群下方

清晰简洁地描述一下这个特性的备选方案

其它背景

在这里添加和这个特性请求有关的背景说明、截图
image

Copy link

dosubot bot commented Jan 4, 2024

🤖

你好 @mike-pjj!我是Dosu,一个可以帮助你解决问题,回答问题,并成为贡献者的机器人。在等待人类维护者的时候,我在这里为你提供帮助。很高兴遇见你!

您的建议非常好,为新建集群增加备注说明可以帮助用户更好地理解每个集群的用途。这需要在Apollo的代码中进行一些修改,具体如下:

首先,您需要在Cluster类中增加一个新的字段,例如notescomments。以下是如何进行修改的示例:

@Column(name = "`Notes`", nullable = true)
private String notes;

public String getNotes() {
  return notes;
}

public void setNotes(String notes) {
  this.notes = notes;
}

@Override
public String toString() {
  return toStringHelper().add("name", name).add("appId", appId)
      .add("parentClusterId", parentClusterId).add("notes", notes).toString();
}

在上述代码中,我们在Cluster实体中增加了一个新的列Notes。这个列是可以为空的,也就是说如果没有提供备注,它可以为空。getNotessetNotes方法分别用于获取和更新备注。toString方法也被更新,以在其输出中包含notes字段。

请注意,这个改变也需要在数据库模式中进行相应的修改,以及在创建、更新或显示Cluster对象的任何代码中进行修改。

参考源码:

另外,Apollo的代码库当前确实支持向Cluster实体添加额外的字段。在Java中,您可以通过在类体中声明它们来添加额外的字段。提供的上下文中的Cluster类是一个典型的Java实体类,它使用JPA注解进行ORM映射。

最后,Apollo的代码库确实有一个用于显示集群信息的用户界面。它位于文件apollo-portal/src/main/resources/static/cluster.html中。这个HTML文件包含用户界面的结构和元素,包括创建新集群的表单,选择环境,和显示集群名称。这个界面中显示的实际数据是由AngularJS应用程序管理的,特别是在这个文件中引用的ClusterController

参考源码:

希望这些信息对您有所帮助。如果您有任何其他问题或需要进一步的帮助,请随时告诉我。

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@nobodyiam
Copy link
Member

This seems like an excellent idea. It would be possible for users to add comments to the clusters, similarly to how they can for the namespaces. Regarding the display aspect, a more effective approach might be to show these remarks when the mouse hovers over the cluster name, rather than just displaying them underneath the cluster name, which could become overly lengthy.

@nobodyiam nobodyiam added feature request Categorizes issue as related to a new feature. help wanted labels Jan 5, 2024
@shoothzj shoothzj closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Categorizes issue as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants