Skip to content

添加服务器管理界面 - #4962

Open
CaaMoe wants to merge 46 commits into
HMCL-dev:mainfrom
CaaMoe:main
Open

CaaMoe wants to merge 46 commits into
HMCL-dev:mainfrom
CaaMoe:main

Conversation

@CaaMoe

@CaaMoe CaaMoe commented Dec 10, 2025 •

Copy link
Copy Markdown

新增服务器管理界面与状态展示,支持拖拽

本 PR 主要补充服务器管理能力:新增服务器管理界面,支持服务器状态展示与延迟信息显示,并增加拖拽(DnD)支持,提升服务器列表和状态页的使用体验
image
image

close #5246

Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/server/ServerListPage.java Outdated
@CaaMoe
CaaMoe requested a review from zkitefly December 10, 2025 05:30
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/server/ServerListItem.java Outdated
@CaaMoe
CaaMoe requested a review from Mine-diamond December 10, 2025 07:46
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/server/ServerData.java Outdated
@burningtnt

Copy link
Copy Markdown
Member

不要使用 ImageIO 来加载图片。请参阅 FXUtils 以查看图片替代方案

@CaaMoe
CaaMoe requested a review from CiiLu December 11, 2025 02:46
Comment thread HMCL/src/main/resources/assets/lang/I18N.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N_ja.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N.properties Outdated
@3gf8jv4dv

Copy link
Copy Markdown
Contributor

图标可以考虑下这个:

Image

Comment thread HMCL/src/main/resources/assets/lang/I18N_zh.properties Outdated
@CaaMoe
CaaMoe requested a review from 3gf8jv4dv December 11, 2025 08:31
@3gf8jv4dv

Copy link
Copy Markdown
Contributor

假如有多个实例的「版本隔离」为「默认」,且 .minecraft 目录下有 servers.dat文件。

这时候切到另一个实例的「服务器管理」列表,勾选「显示全部」,会显示多个重复的条目。

这种情况是否需要解决?

@CaaMoe

CaaMoe commented Dec 11, 2025

Copy link
Copy Markdown
Author

假如有多个实例的「版本隔离」为「默认」,且 .minecraft 目录下有 servers.dat文件。

这时候切到另一个实例的「服务器管理」列表,勾选「显示全部」,会显示多个重复的条目。

这种情况是否需要解决?

这看起来的确是个问题, 已经整改好了, 确保他们不会重复读取和显示。

@3gf8jv4dv

3gf8jv4dv commented Dec 11, 2025 •

Copy link
Copy Markdown
Contributor

我看了一下。建议:

  1. 对于当前实例会使用的条目,标签显示为「当前实例」或类似内容。
    这样,对于有大量实例用户,可以快速区分。

  2. 说实话, server.tag.public 这个文本语义不明。
    类似于第一条。如果能显示会使用它的实例,那么会更明了。

    以下是我的设想:

    当 .minecraft\servers.dat 存在时:

    • A 实例「版本隔离」为「各版本独立」,附带 servers.dat
    • B 实例「版本隔离」为「默认」
    • C 实例「版本隔离」为「各版本独立」,附带 servers.dat
    • D 实例「版本隔离」为「默认」

    这时在 C 实例的「服务器管理」页,勾选「显示所有」:

    • A 实例附带的 servers.dat 内条目,标签显示为「Name-A」
    • B、D 实例会使用的 .minecraft\servers.dat 内条目,标签不是含糊的「默认」,而是清晰显示「Name-B」「Name-D」两个标签
    • C 实例附带的 servers.dat 内条目,标签显示为「当前实例」

    如果进入 B 实例的「服务器管理」页,勾选「显示所有」:

    • A 实例附带的 servers.dat 内条目,标签显示为「Name-A」
    • B、D 实例会使用的 .minecraft\servers.dat 内条目,标签显示为「当前实例」和「Name-D」
    • C 实例附带的 servers.dat 内条目,标签显示为「Name-C」

@CaaMoe

CaaMoe commented Dec 12, 2025

Copy link
Copy Markdown
Author

我看了一下。建议:

  1. 对于当前实例会使用的条目,标签显示为「当前实例」或类似内容。
    这样,对于有大量实例用户,可以快速区分。

  2. 说实话, server.tag.public 这个文本语义不明。
    类似于第一条。如果能显示会使用它的实例,那么会更明了。
    以下是我的设想:
    当 .minecraft\servers.dat 存在时:

    • A 实例「版本隔离」为「各版本独立」,附带 servers.dat
    • B 实例「版本隔离」为「默认」
    • C 实例「版本隔离」为「各版本独立」,附带 servers.dat
    • D 实例「版本隔离」为「默认」

    这时在 C 实例的「服务器管理」页,勾选「显示所有」:

    • A 实例附带的 servers.dat 内条目,标签显示为「Name-A」
    • B、D 实例会使用的 .minecraft\servers.dat 内条目,标签不是含糊的「默认」,而是清晰显示「Name-B」「Name-D」两个标签
    • C 实例附带的 servers.dat 内条目,标签显示为「当前实例」

    如果进入 B 实例的「服务器管理」页,勾选「显示所有」:

    • A 实例附带的 servers.dat 内条目,标签显示为「Name-A」
    • B、D 实例会使用的 .minecraft\servers.dat 内条目,标签显示为「当前实例」和「Name-D」
    • C 实例附带的 servers.dat 内条目,标签显示为「Name-C」

我根据你的描述重新设计了holder, 这是效果:
image

image

@3gf8jv4dv 3gf8jv4dv left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

图标可以改一下。暂时没其他意见。

Comment thread HMCL/src/main/resources/assets/lang/I18N_zh.properties Outdated
@CaaMoe

CaaMoe commented Jan 31, 2026

Copy link
Copy Markdown
Author

图标可以改一下。暂时没其他意见。

图标还能改成啥样呢,没找到有更好康的

@Calboot

Calboot commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

图标还能改成啥样呢,没找到有更好康的

可以直接尝试获取对应服务器的图标?

@3gf8jv4dv

Copy link
Copy Markdown
Contributor

图标还能改成啥样呢,没找到有更好康的

这个 #4962 (comment)

@github-actions github-actions Bot added the 500+ label Jul 17, 2026
@ToobLac

ToobLac commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

还有动静吗

@CaaMoe

CaaMoe commented Sep 20, 2026

Copy link
Copy Markdown
Author

未同步的改动太多了,我重新调整了一份,相比较于之前的改动添加了方便快速启动并且连接到指定服务器的功能
image

@3gf8jv4dv 3gf8jv4dv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果定稿了,把 server 和 servers 开头的 key 统一下,然后把 I18N.properties 里所有新增 key 按字母排序,执行 ./gradlew checkstyle syncTranslations 同步其他文件

Comment thread HMCL/src/main/resources/assets/lang/I18N_zh_Hans.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh_Hant.properties Outdated
@CaaMoe
CaaMoe requested a review from 3gf8jv4dv September 28, 2026 15:11
Comment thread HMCL/src/main/resources/assets/lang/I18N.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh_Hans.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh_Hant.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh_Hans.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh_Hans.properties Outdated
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>

@3gf8jv4dv 3gf8jv4dv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Static analysis found the following issues (max count 10):

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 添加服务器管理功能

8 participants