feat(remote): 新增文件传输专用端口配置
- 添加 fileTransferPort 字段到 RemoteDevice 类型 - 新增 frp 穿透配置: 3003 -> 8083 - 文件传输功能改用专用端口,避免与远程桌面端口共用 - 配置对话框新增文件传输端口设置
This commit is contained in:
@@ -40,6 +40,7 @@ const createEmptyDevice = (): RemoteDevice => ({
|
||||
desktopPort: 3000,
|
||||
gitPort: 3001,
|
||||
openCodePort: 3002,
|
||||
fileTransferPort: 3003,
|
||||
})
|
||||
|
||||
export const RemotePage: React.FC = () => {
|
||||
@@ -88,6 +89,7 @@ export const RemotePage: React.FC = () => {
|
||||
openCodePort: device.openCodePort || 3002,
|
||||
desktopPort: device.desktopPort || 3000,
|
||||
gitPort: device.gitPort || 3001,
|
||||
fileTransferPort: device.fileTransferPort || 3003,
|
||||
}))
|
||||
setConfig(configWithDevices)
|
||||
if (configWithDevices.devices.length > 0 && !selectedDeviceId) {
|
||||
@@ -198,7 +200,7 @@ export const RemotePage: React.FC = () => {
|
||||
setShowConfig(true)
|
||||
return
|
||||
}
|
||||
let url = `file-transfer-panel?host=${encodeURIComponent(selectedConfig.serverHost)}&port=${selectedConfig.desktopPort}&device=${encodeURIComponent(selectedConfig.deviceName || '')}`
|
||||
let url = `file-transfer-panel?host=${encodeURIComponent(selectedConfig.serverHost)}&port=${selectedConfig.fileTransferPort}&device=${encodeURIComponent(selectedConfig.deviceName || '')}`
|
||||
if (selectedConfig.password) {
|
||||
url += `&password=${encodeURIComponent(selectedConfig.password)}`
|
||||
}
|
||||
|
||||
@@ -168,6 +168,19 @@ export const ConfigDialog: React.FC<ConfigDialogProps> = ({
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
文件传输端口
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
value={formData.fileTransferPort}
|
||||
onChange={(e) => handleChange('fileTransferPort', parseInt(e.target.value) || 3003)}
|
||||
placeholder="默认: 3003"
|
||||
className="w-full px-3 py-2 bg-gray-50 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-900 dark:focus:ring-gray-100 focus:border-transparent transition-colors"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
访问密码
|
||||
|
||||
@@ -15,6 +15,7 @@ export interface RemoteDevice {
|
||||
desktopPort: number
|
||||
gitPort: number
|
||||
openCodePort: number
|
||||
fileTransferPort: number
|
||||
password?: string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user