Skip to content

Comments

feat: multi-server support (menu switch + persisted selection)#3

Open
Epichorse wants to merge 1 commit intoZeyuuuChen:mainfrom
Epichorse:feat/multi-server
Open

feat: multi-server support (menu switch + persisted selection)#3
Epichorse wants to merge 1 commit intoZeyuuuChen:mainfrom
Epichorse:feat/multi-server

Conversation

@Epichorse
Copy link

Fixes #2

What

Adds multi-server support for RemoteGPU-Bar:

  • Configure multiple servers in a SERVERS array
  • Switch active server from the SwiftBar dropdown menu
  • Persist selected server locally so it survives refresh/relaunch

Why

Issue #2 requests multi-server support. Instead of SSH-ing all servers every refresh (which may create N SSH connections per interval), this PR refreshes only the currently selected server to keep it lightweight.

How to use

  1. Copy gpu_monitor_multi.1m.sh into SwiftBar plugins folder
  2. Edit SERVERS in the script (name|user@host|/path/to/key)
  3. Use the dropdown “Server:” section to switch servers

Notes

  • Backward-compatible: existing single-server script remains unchanged
  • Menu items use interactive attributes so they render properly (avoid grey text)

新增

为 RemoteGPU-Bar 增加多服务器支持:

  • 支持在脚本中配置多个服务器(SERVERS 列表)
  • SwiftBar 下拉菜单中可切换当前查看的服务器
  • 选择的服务器会持久化到本地(下次刷新/重启仍保持上次选择)

原因

#2 提到希望支持多服务器。为了保持插件轻量并避免每次刷新同时对 N 台服务器发起 SSH(可能带来额外负载/延迟),当前实现采用“按需查看”的方式:每次刷新仅获取当前选中的服务器信息;需要查看其他服务器时在菜单中切换即可。

使用方法

  1. gpu_monitor_multi.1m.sh 放入 SwiftBar 插件目录并赋予可执行权限
  2. 编辑脚本里的 SERVERS(格式:名称|user@host|key 路径)
  3. 在菜单的 “Server:” 区域选择要查看的服务器

兼容性与说明

  • 为避免影响现有单服务器用户:保留原 gpu_monitor.1m.sh 不变,新脚本作为多服务器版本提供
  • 菜单项使用交互属性(如 refresh=true / shell=...)以确保点击后能正确刷新与渲染

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

多服务器支持

1 participant