Skip to content

Remote Desktop Manager

Remote Desktop Manager 是一款远程桌面和连接管理应用。Protocol Launcher 允许你生成官方 Remote Desktop Manager rdm:// protocol handler URL。

使用

有两种方式使用这个库:

  • 按需从子路径导入,支持 tree-shaking 并保持 bundle 更小。
  • 从根包完整导入,适合快速脚本或 demo,但会包含所有 app 模块。

生产构建建议使用按需导入;完整导入适合快速脚本或演示。

选择安装方式

按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。

说明

本模块只封装 Devolutions 为 Remote Desktop Manager protocol handler 记录的 action 和参数:openfindeditviewOpenWithMacroselect,以及 DataSourceSessionTemplateHostPortUsernamePasswordDomainTitleFilterTabpage 参数。

Devolutions 文档说明 URL 需要 action 和至少一个参数。DataSourceSession 足以打开连接。使用 Template 时需要 HostTabpage 在文档中标注为仅适用于 Select action,列出的取值是 OverviewDocumentationMacros/Scripts/ToolsManagement ToolsInformationAttachmentsLogsRecordings;本模块同时保留 Devolutions 精确给出的 rdm://open?Filter=RDP&Tabpage=Dashboard 示例。

示例使用假 ID、保留主机和占位凭据。不要公开真实 workspace ID、session ID、template ID、主机名、用户名、密码、域名或涉及许可证的敏感信息。

URL 方法

打开

打开 Remote Desktop Manager 并填充 Search 字段,与官方示例一致。

On-Demand
ts
import { open } from 'protocol-launcher/remote-desktop-manager'

const url = open({
  filter: 'RDP',
  tabpage: 'Dashboard',
})

使用 DataSourceSession 打开指定 session。

On-Demand
ts
import { open } from 'protocol-launcher/remote-desktop-manager'

const url = open({
  dataSource: 'd4cb6537-0471-4c07-a91b-43a5e1f1f007',
  session: 'f368d57a-d6ac-4b84-a79e-6e4f6cb3d2e1',
})

使用 template 和 host 打开,并附带官方记录的连接覆盖参数。

On-Demand
ts
import { open } from 'protocol-launcher/remote-desktop-manager'

const url = open({
  template: 'b32e4f20-7c1e-4872-b5cb-c893cc2fc272',
  host: 'server.example.com',
  port: 3389,
  username: 'admin',
  domain: 'EXAMPLE',
  title: 'Support Session',
})

查找

按 host 查找 sessions。

On-Demand
ts
import { find } from 'protocol-launcher/remote-desktop-manager'

const url = find({
  host: 'server.example.com',
})

编辑

编辑指定连接。

On-Demand
ts
import { edit } from 'protocol-launcher/remote-desktop-manager'

const url = edit({
  session: 'f368d57a-d6ac-4b84-a79e-6e4f6cb3d2e1',
})

查看

查看指定 entry 的密码。

On-Demand
ts
import { view } from 'protocol-launcher/remote-desktop-manager'

const url = view({
  session: 'f368d57a-d6ac-4b84-a79e-6e4f6cb3d2e1',
})

Open With Macro

使用 macro 打开指定 entry。

On-Demand
ts
import { openWithMacro } from 'protocol-launcher/remote-desktop-manager'

const url = openWithMacro({
  session: 'f368d57a-d6ac-4b84-a79e-6e4f6cb3d2e1',
})

选择

在 navigation pane 中选择连接,并聚焦 dashboard tab。

On-Demand
ts
import { select } from 'protocol-launcher/remote-desktop-manager'

const url = select({
  session: 'f368d57a-d6ac-4b84-a79e-6e4f6cb3d2e1',
  tabpage: 'Overview',
})

生成的 URL

ts
open(openSearchParams)
// => 'rdm://open?Filter=RDP&Tabpage=Dashboard'

open(openSessionParams)
// => 'rdm://open?DataSource=d4cb6537-0471-4c07-a91b-43a5e1f1f007&Session=f368d57a-d6ac-4b84-a79e-6e4f6cb3d2e1'

open(openTemplateParams)
// => 'rdm://open?Template=b32e4f20-7c1e-4872-b5cb-c893cc2fc272&Host=server.example.com&Port=3389&Username=admin&Domain=EXAMPLE&Title=Support%20Session'

find(findParams)
// => 'rdm://find?Host=server.example.com'

edit(editParams)
// => 'rdm://edit?Session=f368d57a-d6ac-4b84-a79e-6e4f6cb3d2e1'

view(viewParams)
// => 'rdm://view?Session=f368d57a-d6ac-4b84-a79e-6e4f6cb3d2e1'

openWithMacro(openWithMacroParams)
// => 'rdm://OpenWithMacro?Session=f368d57a-d6ac-4b84-a79e-6e4f6cb3d2e1'

select(selectParams)
// => 'rdm://select?Session=f368d57a-d6ac-4b84-a79e-6e4f6cb3d2e1&Tabpage=Overview'

这些示例不会渲染可直接点击的启动按钮,因为官方 handler 可能打开 sessions、显示密码或启动 macro 驱动的工作流。

官方文档