fix(web): use standard small remote connection controls
This commit is contained in:
1 parent
871b79ca2a
commit
d5620f9c2e
5 files changed
+8
-15
No files matched your search
@@ -55,7 +55,7 @@ async function assertAddressLayout(section: Locator, available: boolean): Promis
|
||||
const codeBox = await code.boundingBox()
|
||||
expect(fieldBox).not.toBeNull()
|
||||
expect(codeBox).not.toBeNull()
|
||||
expect(fieldBox!.height).toBe(32)
|
||||
expect(fieldBox!.height).toBe(28)
|
||||
expect(Math.abs(codeBox!.y + codeBox!.height / 2 - fieldBox!.y - fieldBox!.height / 2)).toBeLessThanOrEqual(1)
|
||||
const copyBox = await address.getByRole('button', { name: '复制链接', exact: true }).boundingBox()
|
||||
expect(copyBox).not.toBeNull()
|
||||
@@ -75,7 +75,7 @@ async function assertAddressLayout(section: Locator, available: boolean): Promis
|
||||
const text = range.getBoundingClientRect()
|
||||
return { height: box.height, textOffset: Math.abs(text.y + text.height / 2 - box.y - box.height / 2) }
|
||||
})
|
||||
expect(geometry.height).toBe(32)
|
||||
expect(geometry.height).toBe(28)
|
||||
expect(geometry.textOffset).toBeLessThanOrEqual(1)
|
||||
}
|
||||
}
|
||||
@@ -383,7 +383,7 @@ describe('web e2e: one-use QR browser login', () => {
|
||||
expect(await failure.textContent()).toBe('无法加载远程连接设置,请重试')
|
||||
const retry = address.getByRole('button', { name: '重试', exact: true })
|
||||
expect(await retry.isEnabled()).toBe(true)
|
||||
expect((await retry.boundingBox())!.height).toBe(32)
|
||||
expect((await retry.boundingBox())!.height).toBe(28)
|
||||
expect(await section.getByRole('region', { name: '二维码登录', exact: true }).count()).toBe(0)
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'unreachable-load-failed.expected.md'),
|
||||
await captureStableAria(page, 'section[aria-label="远程连接"]', scaffold.workspaceCwd), MODE)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
en: ee070d32177b96d9
|
||||
zh: f946b0eba6746ffd
|
||||
/deepseek-ai-dsh-client-remote-connection/use-this-package:
|
||||
en: 6fc3ce2ea90c7bef
|
||||
zh: 81c7f391c3f0d0ae
|
||||
en: 320d7308af6950b3
|
||||
zh: 7d693f286b341804
|
||||
/deepseek-ai-dsh-client-remote-connection/authentication-and-failures:
|
||||
en: e504f8415dea0fc3
|
||||
zh: 0a11e6f2217cce29
|
||||
|
||||
@@ -23,7 +23,7 @@ Settings shows shared sign-in guidance, then access-address and QR login cards.
|
||||
|
||||
## Use this package
|
||||
|
||||
The Web bundle mounts this plugin. Its Host half requires `connection`, `connection.authentication`, `credentials`, `webServer`, and `webApp`; its Client half contributes the panel through `settings.section`. Removing the plugin removes its page, endpoints, outstanding invitation, and Remote Peer. Already-issued Remote cookies require this provider to be active; valid cookies can be used again after the plugin reloads with the same credential record. The settings panel supports all eight shipped UI languages; the anonymous login page supports English and Chinese. Both cards enclose their titles. The section heading and introductory text match the Models settings typography and spacing. QR actions share the title row on wide cards and stack at full width below the title on narrow cards. QR buttons, buttons in the address card, and the URL field are 32px high, with the address text centered vertically. On narrow cards, the copy button keeps its natural width and aligns to the leading edge. The copy button keeps its label and disables only during a clipboard write. The expiry banner sits below the QR header and spans the card's content width. The countdown is centered below the QR code, with an additional 16px bottom margin before the credential warning. Regenerating a visible code replaces only the QR image with a spinner; the countdown, warning, and link controls stay in place. Cancelling closes the preview and restores **Create QR code** without a success message.
|
||||
The Web bundle mounts this plugin. Its Host half requires `connection`, `connection.authentication`, `credentials`, `webServer`, and `webApp`; its Client half contributes the panel through `settings.section`. Removing the plugin removes its page, endpoints, outstanding invitation, and Remote Peer. Already-issued Remote cookies require this provider to be active; valid cookies can be used again after the plugin reloads with the same credential record. The settings panel supports all eight shipped UI languages; the anonymous login page supports English and Chinese. Both cards enclose their titles. The section heading and introductory text match the Models settings typography and spacing. QR actions share the title row on wide cards and stack at full width below the title on narrow cards. The panel uses standard small buttons. The URL field matches the copy button’s 28px height and centers the address text vertically. On narrow cards, the copy button keeps its natural width and aligns to the leading edge. The copy button keeps its label and disables only during a clipboard write. The expiry banner sits below the QR header and spans the card's content width. The countdown is centered below the QR code, with an additional 16px bottom margin before the credential warning. Regenerating a visible code replaces only the QR image with a spinner; the countdown, warning, and link controls stay in place. Cancelling closes the preview and restores **Create QR code** without a success message.
|
||||
|
||||
The advertised application URL supports HTTP and HTTPS, must name a non-loopback address reachable by the phone, and must pass Connection's trusted-host checks. Configure the listener, optional certificate or reverse proxy, `publicUrl`, and trusted hosts through the existing [Web application](../../bundle/web-app/README.md) configuration. This plugin never changes the listening interface or discovers a network address. A reverse proxy must preserve the external Host, remove its configured path prefix, and protect its upstream connection. A plain HTTP listener issuing a cookie for an HTTP public URL omits `Secure`; HTTPS listeners and HTTPS public URLs behind a TLS-terminating proxy retain `Secure`. An HTTPS proxy must enforce HTTPS for its public origin. The settings panel allows HTTP login and reminds the user that HTTP transmits login credentials without encryption.
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ kind: "package-reference"
|
||||
<a id="use-this-package"></a>
|
||||
## 使用本包
|
||||
|
||||
Web bundle 挂载此插件。Host 端依赖 `connection`、`connection.authentication`、`credentials`、`webServer` 和 `webApp`,Client 端通过 `settings.section` 提供面板。移除插件会移除页面、端点、待使用的邀请和 Remote Peer。已签发的 Remote cookie 需要该提供者处于活动状态;插件使用同一凭据记录重新加载后,有效 cookie 可以继续使用。设置面板支持产品提供的全部八种界面语言;匿名登录页支持英文和中文。两张卡片的标题均位于边框内。页面标题和说明文字采用与模型设置页一致的字体和间距。宽卡片中的二维码操作与标题同行,窄卡片中则在标题下方纵向排列并占满宽度。二维码按钮、访问地址卡片按钮和链接框高度均为 32px,地址文字垂直居中。窄卡片中的复制按钮保持自然宽度并靠起始边缘对齐。复制按钮保持固定文案,仅在写入剪贴板时禁用。过期 banner 位于二维码卡片标题栏下方,占满卡片内容宽度。倒计时居中位于二维码下方,并在凭据告警上方增加 16px 下边距。重新生成正在显示的二维码时,仅用加载状态替换二维码图像;倒计时、告警和链接操作保持原位。取消后直接收起二维码预览,按钮恢复为**生成二维码**,不显示成功提示。
|
||||
Web bundle 挂载此插件。Host 端依赖 `connection`、`connection.authentication`、`credentials`、`webServer` 和 `webApp`,Client 端通过 `settings.section` 提供面板。移除插件会移除页面、端点、待使用的邀请和 Remote Peer。已签发的 Remote cookie 需要该提供者处于活动状态;插件使用同一凭据记录重新加载后,有效 cookie 可以继续使用。设置面板支持产品提供的全部八种界面语言;匿名登录页支持英文和中文。两张卡片的标题均位于边框内。页面标题和说明文字采用与模型设置页一致的字体和间距。宽卡片中的二维码操作与标题同行,窄卡片中则在标题下方纵向排列并占满宽度。面板使用标准小号按钮。链接框与复制按钮同为 28px 高,地址文字垂直居中。窄卡片中的复制按钮保持自然宽度并靠起始边缘对齐。复制按钮保持固定文案,仅在写入剪贴板时禁用。过期 banner 位于二维码卡片标题栏下方,占满卡片内容宽度。倒计时居中位于二维码下方,并在凭据告警上方增加 16px 下边距。重新生成正在显示的二维码时,仅用加载状态替换二维码图像;倒计时、告警和链接操作保持原位。取消后直接收起二维码预览,按钮恢复为**生成二维码**,不显示成功提示。
|
||||
|
||||
公布的应用 URL 支持 HTTP 和 HTTPS,必须指向手机可访问的非回环地址,并通过 Connection 的可信 Host 检查。通过现有 [Web 应用](../../bundle/web-app/README.zh.md) 配置设置监听器、可选证书或反向代理、`publicUrl` 和可信 Host。此插件不会更改监听接口或发现网络地址。反向代理必须保留外部 Host、移除配置的路径前缀,并保护上游连接。普通 HTTP 监听器为 HTTP 公布地址签发的 cookie 不带 `Secure`;HTTPS 监听器以及终止 TLS 的代理后的 HTTPS 公布地址仍使用 `Secure`。HTTPS 代理必须对外部源强制使用 HTTPS。设置面板允许 HTTP 登录,并提醒用户 HTTP 会明文传输登录凭据。
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
}
|
||||
|
||||
.section {
|
||||
--remote-connection-control-height: 32px;
|
||||
container-type: inline-size;
|
||||
gap: 12px;
|
||||
}
|
||||
@@ -137,12 +136,6 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.cardHeader > .qrActions > button,
|
||||
.linkRow > button,
|
||||
.actions > button {
|
||||
height: var(--remote-connection-control-height);
|
||||
}
|
||||
|
||||
.linkRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -155,7 +148,7 @@
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
box-sizing: border-box;
|
||||
height: var(--remote-connection-control-height);
|
||||
height: 28px;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
padding: 0 10px;
|
||||
|
||||
Reference in new issue
Block a user