feat(remote): 添加 CORS 中间件支持文件跨域访问
This commit is contained in:
@@ -1 +1 @@
|
||||
export type TabType = 'markdown' | 'todo' | 'settings' | 'search' | 'recycle-bin' | 'weread' | 'time-tracking' | 'pydemos' | 'remote' | 'remote-desktop' | 'remote-git' | 'other'
|
||||
export type TabType = 'markdown' | 'todo' | 'settings' | 'search' | 'recycle-bin' | 'weread' | 'time-tracking' | 'pydemos' | 'remote' | 'remote-desktop' | 'remote-git' | 'file-transfer' | 'other'
|
||||
|
||||
@@ -8,6 +8,10 @@ const KNOWN_MODULE_IDS = [
|
||||
export function getTabTypeFromPath(filePath: string | null): TabType {
|
||||
if (!filePath) return 'other'
|
||||
|
||||
if (filePath.startsWith('file-transfer-panel')) {
|
||||
return 'file-transfer'
|
||||
}
|
||||
|
||||
if (filePath.startsWith('remote-git://')) {
|
||||
return 'remote-git'
|
||||
}
|
||||
@@ -43,6 +47,12 @@ export function getTabTypeFromPath(filePath: string | null): TabType {
|
||||
export function getFileNameFromPath(filePath: string | null): string {
|
||||
if (!filePath) return '未知'
|
||||
|
||||
if (filePath.startsWith('file-transfer-panel')) {
|
||||
const params = new URLSearchParams(filePath.split('?')[1] || '')
|
||||
const deviceName = params.get('device') || ''
|
||||
return deviceName ? `文件传输 - ${deviceName}` : '文件传输'
|
||||
}
|
||||
|
||||
for (const moduleId of KNOWN_MODULE_IDS) {
|
||||
if (filePath === `${moduleId}-tab` || filePath === moduleId) {
|
||||
const names: Record<string, string> = {
|
||||
|
||||
Reference in New Issue
Block a user