Feature: double-click file preview in the classic file manager #10
No files matched your search
@@ -86,6 +86,8 @@
|
|||||||
| 磁盘/目录浏览 | ✓ | ✓ | ✓ | ✓ |
|
| 磁盘/目录浏览 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| 上传/下载 | ✓ | ✓ | ✓ | ✓ |
|
| 上传/下载 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| V2 文件传输通道 | ✓ | ✓ | ✓ | ✓ |
|
| V2 文件传输通道 | ✓ | ✓ | ✓ | ✓ |
|
||||||
|
| 双击远程文件预览(≤8 MiB) | ✓ | ✓ | ✓ | ✓ |
|
||||||
|
| 远程文件 SHA-256 查询(`COMMAND_FILE_HASH`) | ✓ | ✓ | ✓ | ✓ |
|
||||||
| 断点续传 | ✓ | — | — | — |
|
| 断点续传 | ✓ | — | — | — |
|
||||||
| 删除/重命名/新建目录 | ✓ | ✓ | ✓ | ✓ |
|
| 删除/重命名/新建目录 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| 文件搜索 | ✓ | — | — | ✓ |
|
| 文件搜索 | ✓ | — | — | ✓ |
|
||||||
@@ -97,6 +99,7 @@
|
|||||||
| 插件文件管理(SimplePlugins) | ✓ | — | — | — |
|
| 插件文件管理(SimplePlugins) | ✓ | — | — | — |
|
||||||
|
|
||||||
说明:
|
说明:
|
||||||
|
- 双击预览:由服务端把远程文件经 V2 拉回 `Preview\<clientKey>\` 并打开;客户端只要求 V2 通道(≤8 MiB)。P1 按列表的精确 size+mtime 命中缓存,P2 用 `COMMAND_FILE_HASH` 按内容哈希命中。
|
||||||
- 断点续传:仅 Windows 客户端处理 `COMMAND_FILE_QUERY_RESUME` / `COMMAND_FILE_RESUME`;其他平台走 V2 普通传输,不响应续传查询。
|
- 断点续传:仅 Windows 客户端处理 `COMMAND_FILE_QUERY_RESUME` / `COMMAND_FILE_RESUME`;其他平台走 V2 普通传输,不响应续传查询。
|
||||||
- C2C 文件:Windows 支持发送(`CLIENT_CAP_C2C_PATHS`)与接收(`COMMAND_C2C_PREPARE/_RESP`);Linux/macOS 只做接收端并在落盘后回执(`CLIENT_CAP_C2C_RECV_ACK`);Android 未实现。C2C 需要收发两端能力配合,单端具备能力不等于任意两平台之间都能直传。
|
- C2C 文件:Windows 支持发送(`CLIENT_CAP_C2C_PATHS`)与接收(`COMMAND_C2C_PREPARE/_RESP`);Linux/macOS 只做接收端并在落盘后回执(`CLIENT_CAP_C2C_RECV_ACK`);Android 未实现。C2C 需要收发两端能力配合,单端具备能力不等于任意两平台之间都能直传。
|
||||||
- C2C 剪贴板文本(`COMMAND_C2C_TEXT`):Windows 能发送也能接收;Linux/macOS 只处理接收端(服务端下发文本后写入本机剪贴板,Linux 需要 `xclip`/`xsel`);Android 未实现。
|
- C2C 剪贴板文本(`COMMAND_C2C_TEXT`):Windows 能发送也能接收;Linux/macOS 只处理接收端(服务端下发文本后写入本机剪贴板,Linux 需要 `xclip`/`xsel`);Android 未实现。
|
||||||
@@ -171,9 +174,9 @@
|
|||||||
|
|
||||||
| 平台 | 默认能力位 | 运行时追加 |
|
| 平台 | 默认能力位 | 运行时追加 |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| Windows | V2、UTF8、SCREEN_PREVIEW、C2C_PATHS、PROTO_SWITCH、VIRTUAL_DESKTOP、WINDOW_INFO、SCREEN_REGION | 仅当本次连接走 TLS 且使用内嵌锚时追加 EMBEDDED_ANCHOR |
|
| Windows | V2、UTF8、SCREEN_PREVIEW、C2C_PATHS、PROTO_SWITCH、VIRTUAL_DESKTOP、WINDOW_INFO、SCREEN_REGION、FILE_HASH | 仅当本次连接走 TLS 且使用内嵌锚时追加 EMBEDDED_ANCHOR |
|
||||||
| Linux | V2、UTF8、C2C_RECV_ACK、PROCESS | SCREEN_PREVIEW(有可抓 X11 桌面时) |
|
| Linux | V2、UTF8、C2C_RECV_ACK、PROCESS、FILE_HASH | SCREEN_PREVIEW(有可抓 X11 桌面时) |
|
||||||
| macOS | V2、UTF8、TERMINAL、SCREEN_CLIPBOARD、PROCESS、C2C_RECV_ACK | SCREEN_PREVIEW(已授录屏权限时) |
|
| macOS | V2、UTF8、TERMINAL、SCREEN_CLIPBOARD、PROCESS、C2C_RECV_ACK、FILE_HASH | SCREEN_PREVIEW(已授录屏权限时) |
|
||||||
| Android | V2、UTF8、APK_UPDATE、SCREEN_CLIPBOARD、UNINSTALL、REMOTE_CHAT、TERMINAL | SCREEN_PREVIEW、LOCK_SCREEN、PRIVACY_OVERLAY、PROCESS(按无障碍/API/root 状态) |
|
| Android | V2、UTF8、APK_UPDATE、SCREEN_CLIPBOARD、UNINSTALL、REMOTE_CHAT、TERMINAL、FILE_HASH | SCREEN_PREVIEW、LOCK_SCREEN、PRIVACY_OVERLAY、PROCESS(按无障碍/API/root 状态) |
|
||||||
|
|
||||||
注意:Windows 的终端、进程、聊天、剪贴板、卸载等能力虽未在能力位中声明,但客户端实际实现并被服务端按平台放行;其他平台的能力位缺失会被服务端提前拒绝。
|
注意:Windows 的终端、进程、聊天、剪贴板、卸载等能力虽未在能力位中声明,但客户端实际实现并被服务端按平台放行;其他平台的能力位缺失会被服务端提前拒绝。
|
||||||
@@ -1330,14 +1330,14 @@ void CFileManagerDlg::BeginRemotePreview(const CString& fullPath)
|
|||||||
std::string basename = (pos == std::string::npos) ? remotePath : remotePath.substr(pos + 1);
|
std::string basename = (pos == std::string::npos) ? remotePath : remotePath.substr(pos + 1);
|
||||||
std::string clientKey = GetPreviewClientKey(clientID);
|
std::string clientKey = GetPreviewClientKey(clientID);
|
||||||
|
|
||||||
std::string outPath, error;
|
std::string outPath, error, cachedSha;
|
||||||
CFilePreviewMgr::PrepareResult pr = CFilePreviewMgr::Instance().Prepare(
|
CFilePreviewMgr::PrepareResult pr = CFilePreviewMgr::Instance().Prepare(
|
||||||
clientID, clientKey, remotePath, basename, meta.size, meta.mtimeMs,
|
clientID, clientKey, remotePath, basename, meta.size, meta.mtimeMs,
|
||||||
std::string(), m_hWnd, outPath, error);
|
std::string(), m_hWnd, outPath, error, &cachedSha);
|
||||||
Mprintf("[Preview] prepare result=%d out=%s err=%s\n", (int)pr, outPath.c_str(), error.c_str());
|
Mprintf("[Preview] prepare result=%d out=%s err=%s\n", (int)pr, outPath.c_str(), error.c_str());
|
||||||
|
|
||||||
if (pr == CFilePreviewMgr::PrepareCached) {
|
if (pr == CFilePreviewMgr::PrepareCached) {
|
||||||
CFilePreviewMgr::OpenLocalFile(m_hWnd, outPath, remotePath, meta.size, std::string());
|
CFilePreviewMgr::OpenLocalFile(m_hWnd, outPath, remotePath, meta.size, cachedSha);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pr != CFilePreviewMgr::PrepareTransfer) {
|
if (pr != CFilePreviewMgr::PrepareTransfer) {
|
||||||
|
|||||||
@@ -121,10 +121,12 @@ CFilePreviewMgr::PrepareResult CFilePreviewMgr::Prepare(
|
|||||||
uint64_t clientID, const std::string& clientKey,
|
uint64_t clientID, const std::string& clientKey,
|
||||||
const std::string& remotePath, const std::string& basename,
|
const std::string& remotePath, const std::string& basename,
|
||||||
uint64_t size, uint64_t mtimeMs, const std::string& sha256,
|
uint64_t size, uint64_t mtimeMs, const std::string& sha256,
|
||||||
HWND notifyHwnd, std::string& outPath, std::string& error)
|
HWND notifyHwnd, std::string& outPath, std::string& error,
|
||||||
|
std::string* outSha)
|
||||||
{
|
{
|
||||||
outPath.clear();
|
outPath.clear();
|
||||||
error.clear();
|
error.clear();
|
||||||
|
if (outSha) outSha->clear();
|
||||||
|
|
||||||
std::string root = RootDir();
|
std::string root = RootDir();
|
||||||
if (root.empty()) {
|
if (root.empty()) {
|
||||||
@@ -157,6 +159,7 @@ CFilePreviewMgr::PrepareResult CFilePreviewMgr::Prepare(
|
|||||||
}
|
}
|
||||||
SaveIndex(clientDir, index);
|
SaveIndex(clientDir, index);
|
||||||
outPath = localPath;
|
outPath = localPath;
|
||||||
|
if (outSha) *outSha = hit.sha256;
|
||||||
return PrepareCached;
|
return PrepareCached;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,6 +188,7 @@ CFilePreviewMgr::PrepareResult CFilePreviewMgr::Prepare(
|
|||||||
SaveIndex(clientDir, index);
|
SaveIndex(clientDir, index);
|
||||||
EnforceCacheLimits(clientDir, index);
|
EnforceCacheLimits(clientDir, index);
|
||||||
outPath = localPath;
|
outPath = localPath;
|
||||||
|
if (outSha) *outSha = sha;
|
||||||
return PrepareCached;
|
return PrepareCached;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1122,7 +1126,7 @@ bool CFilePreviewMgr::OpenLocalFile(HWND owner, const std::string& localPath,
|
|||||||
|
|
||||||
if (IsExecutableExtension(localPath)) {
|
if (IsExecutableExtension(localPath)) {
|
||||||
CString msg;
|
CString msg;
|
||||||
msg.Format(_TR("远程文件可能执行代码,确定要打开吗?\n\n远程路径:%s\n大小:%llu 字节\nSHA-256:%s"),
|
msg.Format(_TR("远程文件可能执行代码,确定要打开吗?(%s,%llu 字节,SHA-256 %s)"),
|
||||||
CString(remotePath.c_str()),
|
CString(remotePath.c_str()),
|
||||||
(unsigned long long)size,
|
(unsigned long long)size,
|
||||||
CString(sha256.size() >= 16 ? sha256.substr(0, 16).c_str() : sha256.c_str()));
|
CString(sha256.size() >= 16 ? sha256.substr(0, 16).c_str() : sha256.c_str()));
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ public:
|
|||||||
PrepareResult Prepare(uint64_t clientID, const std::string& clientKey,
|
PrepareResult Prepare(uint64_t clientID, const std::string& clientKey,
|
||||||
const std::string& remotePath, const std::string& basename,
|
const std::string& remotePath, const std::string& basename,
|
||||||
uint64_t size, uint64_t mtimeMs, const std::string& sha256,
|
uint64_t size, uint64_t mtimeMs, const std::string& sha256,
|
||||||
HWND notifyHwnd, std::string& outPath, std::string& error);
|
HWND notifyHwnd, std::string& outPath, std::string& error,
|
||||||
|
std::string* outSha = nullptr);
|
||||||
|
|
||||||
// UI 线程:对话框关闭时放弃本窗口的所有预览请求。
|
// UI 线程:对话框关闭时放弃本窗口的所有预览请求。
|
||||||
void CancelForHwnd(HWND hwnd);
|
void CancelForHwnd(HWND hwnd);
|
||||||
|
|||||||
@@ -2352,3 +2352,21 @@ MCP
|
|||||||
\n剩余天数包含到期当天;已过期时主控功能可能受限。=\nDie verbleibenden Tage schliessen den Ablauftag ein; nach Ablauf koennen Funktionen eingeschraenkt sein.
|
\n剩余天数包含到期当天;已过期时主控功能可能受限。=\nDie verbleibenden Tage schliessen den Ablauftag ein; nach Ablauf koennen Funktionen eingeschraenkt sein.
|
||||||
重置=Zuruecksetzen
|
重置=Zuruecksetzen
|
||||||
已清空语言包目录设置,已恢复内置语言,重启程序后生效。=Sprachpaketordner-Einstellung geleert; integrierte Sprache wiederhergestellt. Neustart des Programms erforderlich.
|
已清空语言包目录设置,已恢复内置语言,重启程序后生效。=Sprachpaketordner-Einstellung geleert; integrierte Sprache wiederhergestellt. Neustart des Programms erforderlich.
|
||||||
|
无法创建预览缓存目录=Vorschau-Cache-Verzeichnis konnte nicht erstellt werden
|
||||||
|
无法生成预览请求 ID=Vorschau-Anfrage-ID konnte nicht erzeugt werden
|
||||||
|
正在预览另一个文件,请稍候=Eine andere Vorschau laeuft bereits, bitte warten
|
||||||
|
预览文件名越界=Vorschau-Dateiname verlaesst das temporaere Verzeichnis
|
||||||
|
文件较大或不支持预览=Datei ist zu gross oder kann nicht angezeigt werden
|
||||||
|
预览文件校验失败=Vorschau-Datei konnte nicht verifiziert werden
|
||||||
|
文件在传输过程中发生变化,请重试=Datei wurde waehrend der Uebertragung geaendert, bitte erneut versuchen
|
||||||
|
预览传输停滞,已取消=Vorschau-Uebertragung stockte und wurde abgebrochen
|
||||||
|
预览传输超时,已取消=Vorschau-Uebertragung ist abgelaufen und wurde abgebrochen
|
||||||
|
无法写入预览缓存文件=Vorschau-Cache-Datei konnte nicht geschrieben werden
|
||||||
|
无法打开文件:%s(文件不存在)=Datei kann nicht geoeffnet werden: %s (nicht gefunden)
|
||||||
|
远程文件可能执行代码,确定要打开吗?(%s,%llu 字节,SHA-256 %s)=Die entfernte Datei kann Code ausfuehren. Trotzdem oeffnen? (%s, %llu Bytes, SHA-256 %s)
|
||||||
|
安全确认=Sicherheitsbestaetigung
|
||||||
|
无法打开文件:%s(可能没有关联程序)=Datei kann nicht geoeffnet werden: %s (kein zugeordnetes Programm)
|
||||||
|
客户端或 V2 开关不支持文件预览(参数 → 文件传输 V2)=Dieser Client oder der V2-Schalter unterstuetzt keine Vorschau (Einstellungen -> Dateiuebertragung V2)
|
||||||
|
无法获取文件信息,请刷新目录后重试=Dateiinformationen nicht verfuegbar; Verzeichnis aktualisieren und erneut versuchen
|
||||||
|
文件较大,不支持预览:%s(%llu MB,上限 %u MB)=Datei zu gross fuer die Vorschau: %s (%llu MB, Grenze %u MB)
|
||||||
|
正在预览 %s ...=Vorschau von %s ...
|
||||||
@@ -2363,3 +2363,21 @@ MCP
|
|||||||
\n剩余天数包含到期当天;已过期时主控功能可能受限。=\nRemaining days include the expiry day; some features may be restricted after expiry.
|
\n剩余天数包含到期当天;已过期时主控功能可能受限。=\nRemaining days include the expiry day; some features may be restricted after expiry.
|
||||||
重置=Reset
|
重置=Reset
|
||||||
已清空语言包目录设置,已恢复内置语言,重启程序后生效。=Language pack folder setting cleared; built-in language restored. Restart the program to apply.
|
已清空语言包目录设置,已恢复内置语言,重启程序后生效。=Language pack folder setting cleared; built-in language restored. Restart the program to apply.
|
||||||
|
无法创建预览缓存目录=Failed to create the preview cache directory
|
||||||
|
无法生成预览请求 ID=Failed to create a preview request ID
|
||||||
|
正在预览另一个文件,请稍候=Another preview is in progress, please wait
|
||||||
|
预览文件名越界=Preview filename escapes the temporary directory
|
||||||
|
文件较大或不支持预览=File is too large or cannot be previewed
|
||||||
|
预览文件校验失败=Preview file verification failed
|
||||||
|
文件在传输过程中发生变化,请重试=File changed during transfer, please retry
|
||||||
|
预览传输停滞,已取消=Preview transfer stalled and was cancelled
|
||||||
|
预览传输超时,已取消=Preview transfer timed out and was cancelled
|
||||||
|
无法写入预览缓存文件=Failed to write the preview cache file
|
||||||
|
无法打开文件:%s(文件不存在)=Cannot open file: %s (file not found)
|
||||||
|
远程文件可能执行代码,确定要打开吗?(%s,%llu 字节,SHA-256 %s)=The remote file may execute code. Open it anyway? (%s, %llu bytes, SHA-256 %s)
|
||||||
|
安全确认=Security confirmation
|
||||||
|
无法打开文件:%s(可能没有关联程序)=Cannot open file: %s (no associated program)
|
||||||
|
客户端或 V2 开关不支持文件预览(参数 → 文件传输 V2)=This client or the V2 switch does not support preview (Settings -> File Transfer V2)
|
||||||
|
无法获取文件信息,请刷新目录后重试=Cannot get file information; refresh the directory and retry
|
||||||
|
文件较大,不支持预览:%s(%llu MB,上限 %u MB)=File too large to preview: %s (%llu MB, limit %u MB)
|
||||||
|
正在预览 %s ...=Previewing %s ...
|
||||||
@@ -2356,3 +2356,21 @@ MCP
|
|||||||
\n剩余天数包含到期当天;已过期时主控功能可能受限。=\n剩餘天數包含到期當天;已過期時主控功能可能受限。
|
\n剩余天数包含到期当天;已过期时主控功能可能受限。=\n剩餘天數包含到期當天;已過期時主控功能可能受限。
|
||||||
重置=重設
|
重置=重設
|
||||||
已清空语言包目录设置,已恢复内置语言,重启程序后生效。=已清空語言包目錄設定,已恢復內建語言,重新啟動程式後生效。
|
已清空语言包目录设置,已恢复内置语言,重启程序后生效。=已清空語言包目錄設定,已恢復內建語言,重新啟動程式後生效。
|
||||||
|
无法创建预览缓存目录=無法建立預覽快取目錄
|
||||||
|
无法生成预览请求 ID=無法產生預覽請求 ID
|
||||||
|
正在预览另一个文件,请稍候=正在預覽另一個檔案,請稍候
|
||||||
|
预览文件名越界=預覽檔名越界
|
||||||
|
文件较大或不支持预览=檔案過大或不支援預覽
|
||||||
|
预览文件校验失败=預覽檔案校驗失敗
|
||||||
|
文件在传输过程中发生变化,请重试=檔案在傳輸過程中發生變化,請重試
|
||||||
|
预览传输停滞,已取消=預覽傳輸停滯,已取消
|
||||||
|
预览传输超时,已取消=預覽傳輸逾時,已取消
|
||||||
|
无法写入预览缓存文件=無法寫入預覽快取檔案
|
||||||
|
无法打开文件:%s(文件不存在)=無法開啟檔案:%s(檔案不存在)
|
||||||
|
远程文件可能执行代码,确定要打开吗?(%s,%llu 字节,SHA-256 %s)=遠端檔案可能執行代碼,確定要開啟嗎?(%s,%llu 位元組,SHA-256 %s)
|
||||||
|
安全确认=安全確認
|
||||||
|
无法打开文件:%s(可能没有关联程序)=無法開啟檔案:%s(可能沒有關聯程式)
|
||||||
|
客户端或 V2 开关不支持文件预览(参数 → 文件传输 V2)=此客戶端或 V2 開關不支援檔案預覽(參數 → 檔案傳輸 V2)
|
||||||
|
无法获取文件信息,请刷新目录后重试=無法取得檔案資訊,請重新整理目錄後重試
|
||||||
|
文件较大,不支持预览:%s(%llu MB,上限 %u MB)=檔案過大,不支援預覽:%s(%llu MB,上限 %u MB)
|
||||||
|
正在预览 %s ...=正在預覽 %s ...
|
||||||
Reference in new issue
Block a user