mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 20:30:45 +08:00
Fix WebCRT copy/paste on HTTP LAN by falling back off Clipboard API.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
4ea3b737f2
commit
ba33ab5c4f
6 changed files with 227 additions and 40 deletions
|
|
@ -33,6 +33,7 @@ import {
|
|||
type WebcrtSftpItem,
|
||||
} from "../services/api";
|
||||
import { pageCount } from "../utils/display";
|
||||
import { writeClipboardText } from "../utils/clipboard";
|
||||
import type { CliTargetItem, ManagedNeItem } from "../types";
|
||||
import {
|
||||
defaultKeywordHighlightConfig,
|
||||
|
|
@ -1374,8 +1375,9 @@ export function WebcrtPage() {
|
|||
return;
|
||||
}
|
||||
try {
|
||||
await navigator.clipboard.writeText(ip);
|
||||
showOk(t("webcrt.tabMenu.copyIpOk", { ip }));
|
||||
const ok = await writeClipboardText(ip);
|
||||
if (ok) showOk(t("webcrt.tabMenu.copyIpOk", { ip }));
|
||||
else showError(t("webcrt.actions.copyFailed"));
|
||||
} catch {
|
||||
showError(t("webcrt.actions.copyFailed"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue