refactor: convert openRemoteFolder to a static method, and adjust the sort of parameters

This commit is contained in:
Levi Yan
2025-02-19 09:58:31 +08:00
parent 7439f63079
commit 858e77a19a
2 changed files with 3 additions and 3 deletions

View File

@@ -68,12 +68,12 @@ export default class DSHome {
.then((_res) => {
if (_res == 'success') {
// only success then open folder
this.remoteContainer.openRemoteFolder(data.host, data.username, data.port, data.path);
RemoteContainer.openRemoteFolder(data.host, data.port, data.username, data.path);
}
})
break;
case 'openRemoteFolder':
this.remoteContainer.openRemoteFolder(data.host, data.username, data.port, data.path);
RemoteContainer.openRemoteFolder(data.host, data.port, data.username, data.path);
break;
case 'getDevstarDomain':
panel.webview.postMessage({ command: 'getDevstarDomain', data: { devstarDomain: this.devstarDomain } })

View File

@@ -137,7 +137,7 @@ export default class RemoteContainer {
}
openRemoteFolder(host: string, username: string, port: number, path: string): void {
static openRemoteFolder(host: string, port: number, username: string, path: string): void {
var host = `${host}-${port}`
const command = `code --remote ssh-remote+${username}@${host} ${path} --reuse-window`
let terminal = vscode.window.activeTerminal || vscode.window.createTerminal(`Ext Terminal`);