@theia/remote 1.51.0 → 1.53.0-next.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -61
- package/lib/electron-node/setup/remote-setup-script-service.js +11 -11
- package/package.json +5 -5
- package/src/electron-browser/port-forwarding/port-forwading-contribution.ts +33 -33
- package/src/electron-browser/port-forwarding/port-forwarding-service.ts +92 -92
- package/src/electron-browser/port-forwarding/port-forwarding-widget.tsx +140 -140
- package/src/electron-browser/remote-electron-file-dialog-service.ts +47 -47
- package/src/electron-browser/remote-frontend-contribution.ts +143 -143
- package/src/electron-browser/remote-frontend-module.ts +68 -68
- package/src/electron-browser/remote-preferences.ts +62 -62
- package/src/electron-browser/remote-registry-contribution.ts +73 -73
- package/src/electron-browser/remote-service.ts +31 -31
- package/src/electron-browser/remote-ssh-contribution.ts +102 -102
- package/src/electron-browser/style/port-forwarding-widget.css +44 -44
- package/src/electron-common/remote-port-forwarding-provider.ts +30 -30
- package/src/electron-common/remote-ssh-connection-provider.ts +29 -29
- package/src/electron-common/remote-status-service.ts +35 -35
- package/src/electron-node/backend-remote-service-impl.ts +45 -45
- package/src/electron-node/remote-backend-module.ts +87 -87
- package/src/electron-node/remote-connection-service.ts +56 -56
- package/src/electron-node/remote-connection-socket-provider.ts +34 -34
- package/src/electron-node/remote-port-forwarding-provider.ts +66 -66
- package/src/electron-node/remote-proxy-server-provider.ts +37 -37
- package/src/electron-node/remote-status-service.ts +41 -41
- package/src/electron-node/remote-types.ts +64 -64
- package/src/electron-node/setup/app-native-dependency-contribution.ts +48 -48
- package/src/electron-node/setup/main-copy-contribution.ts +28 -28
- package/src/electron-node/setup/remote-copy-contribution.ts +74 -74
- package/src/electron-node/setup/remote-copy-service.ts +116 -116
- package/src/electron-node/setup/remote-native-dependency-contribution.ts +63 -63
- package/src/electron-node/setup/remote-native-dependency-service.ts +111 -111
- package/src/electron-node/setup/remote-node-setup-service.ts +123 -123
- package/src/electron-node/setup/remote-setup-script-service.ts +146 -146
- package/src/electron-node/setup/remote-setup-service.ts +220 -220
- package/src/electron-node/ssh/remote-ssh-connection-provider.ts +358 -358
- package/src/electron-node/ssh/ssh-identity-file-collector.ts +137 -137
- package/src/package.spec.ts +29 -29
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { Command, CommandContribution, CommandRegistry, ContributionProvider, nls, QuickInputService, QuickPickInput } from '@theia/core';
|
|
18
|
-
import { FrontendApplicationContribution, StatusBar, StatusBarAlignment, StatusBarEntry } from '@theia/core/lib/browser';
|
|
19
|
-
import { inject, injectable, named, optional } from '@theia/core/shared/inversify';
|
|
20
|
-
import { RemoteStatus, RemoteStatusService } from '../electron-common/remote-status-service';
|
|
21
|
-
import { RemoteRegistry, RemoteRegistryContribution } from './remote-registry-contribution';
|
|
22
|
-
import { RemoteService } from './remote-service';
|
|
23
|
-
import { WindowService } from '@theia/core/lib/browser/window/window-service';
|
|
24
|
-
|
|
25
|
-
export namespace RemoteCommands {
|
|
26
|
-
export const REMOTE_SELECT: Command = {
|
|
27
|
-
id: 'remote.select'
|
|
28
|
-
};
|
|
29
|
-
export const REMOTE_DISCONNECT: Command = Command.toDefaultLocalizedCommand({
|
|
30
|
-
id: 'remote.disconnect',
|
|
31
|
-
label: 'Close Remote Connection',
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@injectable()
|
|
36
|
-
export class RemoteFrontendContribution implements CommandContribution, FrontendApplicationContribution {
|
|
37
|
-
|
|
38
|
-
@inject(StatusBar)
|
|
39
|
-
protected readonly statusBar: StatusBar;
|
|
40
|
-
|
|
41
|
-
@inject(QuickInputService) @optional()
|
|
42
|
-
protected readonly quickInputService?: QuickInputService;
|
|
43
|
-
|
|
44
|
-
@inject(CommandRegistry)
|
|
45
|
-
protected readonly commandRegistry: CommandRegistry;
|
|
46
|
-
|
|
47
|
-
@inject(RemoteService)
|
|
48
|
-
protected readonly remoteService: RemoteService;
|
|
49
|
-
|
|
50
|
-
@inject(RemoteStatusService)
|
|
51
|
-
protected readonly remoteStatusService: RemoteStatusService;
|
|
52
|
-
|
|
53
|
-
@inject(WindowService)
|
|
54
|
-
protected readonly windowService: WindowService;
|
|
55
|
-
|
|
56
|
-
@inject(ContributionProvider) @named(RemoteRegistryContribution)
|
|
57
|
-
protected readonly remoteRegistryContributions: ContributionProvider<RemoteRegistryContribution>;
|
|
58
|
-
|
|
59
|
-
protected remoteRegistry = new RemoteRegistry();
|
|
60
|
-
|
|
61
|
-
async configure(): Promise<void> {
|
|
62
|
-
const port = new URLSearchParams(location.search).get('port');
|
|
63
|
-
if (port) {
|
|
64
|
-
const status = await this.remoteStatusService.getStatus(Number(port));
|
|
65
|
-
await this.setStatusBar(status);
|
|
66
|
-
} else {
|
|
67
|
-
await this.setStatusBar({
|
|
68
|
-
alive: false
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
protected async setStatusBar(info: RemoteStatus): Promise<void> {
|
|
74
|
-
this.remoteService.setConnected(info.alive);
|
|
75
|
-
const entry: StatusBarEntry = {
|
|
76
|
-
alignment: StatusBarAlignment.LEFT,
|
|
77
|
-
command: RemoteCommands.REMOTE_SELECT.id,
|
|
78
|
-
backgroundColor: 'var(--theia-statusBarItem-remoteBackground)',
|
|
79
|
-
color: 'var(--theia-statusBarItem-remoteForeground)',
|
|
80
|
-
priority: 10000,
|
|
81
|
-
...(info.alive
|
|
82
|
-
? {
|
|
83
|
-
text: `$(codicon-remote) ${info.type}: ${info.name.length > 35 ? info.name.substring(0, 32) + '...' : info.name}`,
|
|
84
|
-
tooltip: nls.localizeByDefault('Editing on {0}', info.name),
|
|
85
|
-
} : {
|
|
86
|
-
text: '$(codicon-remote)',
|
|
87
|
-
tooltip: nls.localizeByDefault('Open a Remote Window'),
|
|
88
|
-
})
|
|
89
|
-
};
|
|
90
|
-
this.statusBar.setElement('remoteStatus', entry);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
registerCommands(commands: CommandRegistry): void {
|
|
94
|
-
this.remoteRegistry.onDidRegisterCommand(([command, handler]) => {
|
|
95
|
-
commands.registerCommand(command, handler);
|
|
96
|
-
});
|
|
97
|
-
for (const contribution of this.remoteRegistryContributions.getContributions()) {
|
|
98
|
-
contribution.registerRemoteCommands(this.remoteRegistry);
|
|
99
|
-
}
|
|
100
|
-
commands.registerCommand(RemoteCommands.REMOTE_SELECT, {
|
|
101
|
-
execute: () => this.selectRemote()
|
|
102
|
-
});
|
|
103
|
-
commands.registerCommand(RemoteCommands.REMOTE_DISCONNECT, {
|
|
104
|
-
execute: () => this.disconnectRemote()
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
protected disconnectRemote(): void {
|
|
109
|
-
const port = new URLSearchParams(location.search).get('localPort');
|
|
110
|
-
if (port) {
|
|
111
|
-
this.windowService.reload({ search: { port } });
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
protected async selectRemote(): Promise<void> {
|
|
116
|
-
const commands = [...this.remoteRegistry.commands];
|
|
117
|
-
if (this.remoteService.isConnected()) {
|
|
118
|
-
commands.push(RemoteCommands.REMOTE_DISCONNECT);
|
|
119
|
-
}
|
|
120
|
-
const quickPicks: QuickPickInput[] = [];
|
|
121
|
-
let previousCategory: string | undefined = undefined;
|
|
122
|
-
for (const command of commands) {
|
|
123
|
-
if (previousCategory !== command.category) {
|
|
124
|
-
quickPicks.push({
|
|
125
|
-
type: 'separator',
|
|
126
|
-
label: command.category
|
|
127
|
-
});
|
|
128
|
-
previousCategory = command.category;
|
|
129
|
-
}
|
|
130
|
-
quickPicks.push({
|
|
131
|
-
label: command.label!,
|
|
132
|
-
id: command.id
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
const selection = await this.quickInputService?.showQuickPick(quickPicks, {
|
|
136
|
-
placeholder: nls.localizeByDefault('Select an option to open a Remote Window')
|
|
137
|
-
});
|
|
138
|
-
if (selection) {
|
|
139
|
-
this.commandRegistry.executeCommand(selection.id!);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { Command, CommandContribution, CommandRegistry, ContributionProvider, nls, QuickInputService, QuickPickInput } from '@theia/core';
|
|
18
|
+
import { FrontendApplicationContribution, StatusBar, StatusBarAlignment, StatusBarEntry } from '@theia/core/lib/browser';
|
|
19
|
+
import { inject, injectable, named, optional } from '@theia/core/shared/inversify';
|
|
20
|
+
import { RemoteStatus, RemoteStatusService } from '../electron-common/remote-status-service';
|
|
21
|
+
import { RemoteRegistry, RemoteRegistryContribution } from './remote-registry-contribution';
|
|
22
|
+
import { RemoteService } from './remote-service';
|
|
23
|
+
import { WindowService } from '@theia/core/lib/browser/window/window-service';
|
|
24
|
+
|
|
25
|
+
export namespace RemoteCommands {
|
|
26
|
+
export const REMOTE_SELECT: Command = {
|
|
27
|
+
id: 'remote.select'
|
|
28
|
+
};
|
|
29
|
+
export const REMOTE_DISCONNECT: Command = Command.toDefaultLocalizedCommand({
|
|
30
|
+
id: 'remote.disconnect',
|
|
31
|
+
label: 'Close Remote Connection',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@injectable()
|
|
36
|
+
export class RemoteFrontendContribution implements CommandContribution, FrontendApplicationContribution {
|
|
37
|
+
|
|
38
|
+
@inject(StatusBar)
|
|
39
|
+
protected readonly statusBar: StatusBar;
|
|
40
|
+
|
|
41
|
+
@inject(QuickInputService) @optional()
|
|
42
|
+
protected readonly quickInputService?: QuickInputService;
|
|
43
|
+
|
|
44
|
+
@inject(CommandRegistry)
|
|
45
|
+
protected readonly commandRegistry: CommandRegistry;
|
|
46
|
+
|
|
47
|
+
@inject(RemoteService)
|
|
48
|
+
protected readonly remoteService: RemoteService;
|
|
49
|
+
|
|
50
|
+
@inject(RemoteStatusService)
|
|
51
|
+
protected readonly remoteStatusService: RemoteStatusService;
|
|
52
|
+
|
|
53
|
+
@inject(WindowService)
|
|
54
|
+
protected readonly windowService: WindowService;
|
|
55
|
+
|
|
56
|
+
@inject(ContributionProvider) @named(RemoteRegistryContribution)
|
|
57
|
+
protected readonly remoteRegistryContributions: ContributionProvider<RemoteRegistryContribution>;
|
|
58
|
+
|
|
59
|
+
protected remoteRegistry = new RemoteRegistry();
|
|
60
|
+
|
|
61
|
+
async configure(): Promise<void> {
|
|
62
|
+
const port = new URLSearchParams(location.search).get('port');
|
|
63
|
+
if (port) {
|
|
64
|
+
const status = await this.remoteStatusService.getStatus(Number(port));
|
|
65
|
+
await this.setStatusBar(status);
|
|
66
|
+
} else {
|
|
67
|
+
await this.setStatusBar({
|
|
68
|
+
alive: false
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
protected async setStatusBar(info: RemoteStatus): Promise<void> {
|
|
74
|
+
this.remoteService.setConnected(info.alive);
|
|
75
|
+
const entry: StatusBarEntry = {
|
|
76
|
+
alignment: StatusBarAlignment.LEFT,
|
|
77
|
+
command: RemoteCommands.REMOTE_SELECT.id,
|
|
78
|
+
backgroundColor: 'var(--theia-statusBarItem-remoteBackground)',
|
|
79
|
+
color: 'var(--theia-statusBarItem-remoteForeground)',
|
|
80
|
+
priority: 10000,
|
|
81
|
+
...(info.alive
|
|
82
|
+
? {
|
|
83
|
+
text: `$(codicon-remote) ${info.type}: ${info.name.length > 35 ? info.name.substring(0, 32) + '...' : info.name}`,
|
|
84
|
+
tooltip: nls.localizeByDefault('Editing on {0}', info.name),
|
|
85
|
+
} : {
|
|
86
|
+
text: '$(codicon-remote)',
|
|
87
|
+
tooltip: nls.localizeByDefault('Open a Remote Window'),
|
|
88
|
+
})
|
|
89
|
+
};
|
|
90
|
+
this.statusBar.setElement('remoteStatus', entry);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
registerCommands(commands: CommandRegistry): void {
|
|
94
|
+
this.remoteRegistry.onDidRegisterCommand(([command, handler]) => {
|
|
95
|
+
commands.registerCommand(command, handler);
|
|
96
|
+
});
|
|
97
|
+
for (const contribution of this.remoteRegistryContributions.getContributions()) {
|
|
98
|
+
contribution.registerRemoteCommands(this.remoteRegistry);
|
|
99
|
+
}
|
|
100
|
+
commands.registerCommand(RemoteCommands.REMOTE_SELECT, {
|
|
101
|
+
execute: () => this.selectRemote()
|
|
102
|
+
});
|
|
103
|
+
commands.registerCommand(RemoteCommands.REMOTE_DISCONNECT, {
|
|
104
|
+
execute: () => this.disconnectRemote()
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
protected disconnectRemote(): void {
|
|
109
|
+
const port = new URLSearchParams(location.search).get('localPort');
|
|
110
|
+
if (port) {
|
|
111
|
+
this.windowService.reload({ search: { port } });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
protected async selectRemote(): Promise<void> {
|
|
116
|
+
const commands = [...this.remoteRegistry.commands];
|
|
117
|
+
if (this.remoteService.isConnected()) {
|
|
118
|
+
commands.push(RemoteCommands.REMOTE_DISCONNECT);
|
|
119
|
+
}
|
|
120
|
+
const quickPicks: QuickPickInput[] = [];
|
|
121
|
+
let previousCategory: string | undefined = undefined;
|
|
122
|
+
for (const command of commands) {
|
|
123
|
+
if (previousCategory !== command.category) {
|
|
124
|
+
quickPicks.push({
|
|
125
|
+
type: 'separator',
|
|
126
|
+
label: command.category
|
|
127
|
+
});
|
|
128
|
+
previousCategory = command.category;
|
|
129
|
+
}
|
|
130
|
+
quickPicks.push({
|
|
131
|
+
label: command.label!,
|
|
132
|
+
id: command.id
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const selection = await this.quickInputService?.showQuickPick(quickPicks, {
|
|
136
|
+
placeholder: nls.localizeByDefault('Select an option to open a Remote Window')
|
|
137
|
+
});
|
|
138
|
+
if (selection) {
|
|
139
|
+
this.commandRegistry.executeCommand(selection.id!);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
}
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { bindContributionProvider, CommandContribution } from '@theia/core';
|
|
18
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
19
|
-
import { bindViewContribution, FrontendApplicationContribution, WidgetFactory } from '@theia/core/lib/browser';
|
|
20
|
-
import { RemoteSSHContribution } from './remote-ssh-contribution';
|
|
21
|
-
import { RemoteSSHConnectionProvider, RemoteSSHConnectionProviderPath } from '../electron-common/remote-ssh-connection-provider';
|
|
22
|
-
import { RemoteFrontendContribution } from './remote-frontend-contribution';
|
|
23
|
-
import { RemoteRegistryContribution } from './remote-registry-contribution';
|
|
24
|
-
import { RemoteService } from './remote-service';
|
|
25
|
-
import { RemoteStatusService, RemoteStatusServicePath } from '../electron-common/remote-status-service';
|
|
26
|
-
import { ElectronFileDialogService } from '@theia/filesystem/lib/electron-browser/file-dialog/electron-file-dialog-service';
|
|
27
|
-
import { RemoteElectronFileDialogService } from './remote-electron-file-dialog-service';
|
|
28
|
-
import { bindRemotePreferences } from './remote-preferences';
|
|
29
|
-
import { PortForwardingWidget, PORT_FORWARDING_WIDGET_ID } from './port-forwarding/port-forwarding-widget';
|
|
30
|
-
import { PortForwardingContribution } from './port-forwarding/port-forwading-contribution';
|
|
31
|
-
import { PortForwardingService } from './port-forwarding/port-forwarding-service';
|
|
32
|
-
import { RemotePortForwardingProvider, RemoteRemotePortForwardingProviderPath } from '../electron-common/remote-port-forwarding-provider';
|
|
33
|
-
import { ServiceConnectionProvider } from '@theia/core/lib/browser/messaging/service-connection-provider';
|
|
34
|
-
import '../../src/electron-browser/style/port-forwarding-widget.css';
|
|
35
|
-
|
|
36
|
-
export default new ContainerModule((bind, _, __, rebind) => {
|
|
37
|
-
bind(RemoteFrontendContribution).toSelf().inSingletonScope();
|
|
38
|
-
bind(FrontendApplicationContribution).toService(RemoteFrontendContribution);
|
|
39
|
-
bind(CommandContribution).toService(RemoteFrontendContribution);
|
|
40
|
-
|
|
41
|
-
bindContributionProvider(bind, RemoteRegistryContribution);
|
|
42
|
-
bind(RemoteSSHContribution).toSelf().inSingletonScope();
|
|
43
|
-
bind(RemoteRegistryContribution).toService(RemoteSSHContribution);
|
|
44
|
-
|
|
45
|
-
bindRemotePreferences(bind);
|
|
46
|
-
|
|
47
|
-
rebind(ElectronFileDialogService).to(RemoteElectronFileDialogService).inSingletonScope();
|
|
48
|
-
|
|
49
|
-
bind(RemoteService).toSelf().inSingletonScope();
|
|
50
|
-
|
|
51
|
-
bind(PortForwardingWidget).toSelf();
|
|
52
|
-
bind(WidgetFactory).toDynamicValue(context => ({
|
|
53
|
-
id: PORT_FORWARDING_WIDGET_ID,
|
|
54
|
-
createWidget: () => context.container.get<PortForwardingWidget>(PortForwardingWidget)
|
|
55
|
-
}));
|
|
56
|
-
|
|
57
|
-
bindViewContribution(bind, PortForwardingContribution);
|
|
58
|
-
bind(PortForwardingService).toSelf().inSingletonScope();
|
|
59
|
-
|
|
60
|
-
bind(RemoteSSHConnectionProvider).toDynamicValue(ctx =>
|
|
61
|
-
ServiceConnectionProvider.createLocalProxy<RemoteSSHConnectionProvider>(ctx.container, RemoteSSHConnectionProviderPath)).inSingletonScope();
|
|
62
|
-
bind(RemoteStatusService).toDynamicValue(ctx =>
|
|
63
|
-
ServiceConnectionProvider.createLocalProxy<RemoteStatusService>(ctx.container, RemoteStatusServicePath)).inSingletonScope();
|
|
64
|
-
|
|
65
|
-
bind(RemotePortForwardingProvider).toDynamicValue(ctx =>
|
|
66
|
-
ServiceConnectionProvider.createLocalProxy<RemotePortForwardingProvider>(ctx.container, RemoteRemotePortForwardingProviderPath)).inSingletonScope();
|
|
67
|
-
|
|
68
|
-
});
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { bindContributionProvider, CommandContribution } from '@theia/core';
|
|
18
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
19
|
+
import { bindViewContribution, FrontendApplicationContribution, WidgetFactory } from '@theia/core/lib/browser';
|
|
20
|
+
import { RemoteSSHContribution } from './remote-ssh-contribution';
|
|
21
|
+
import { RemoteSSHConnectionProvider, RemoteSSHConnectionProviderPath } from '../electron-common/remote-ssh-connection-provider';
|
|
22
|
+
import { RemoteFrontendContribution } from './remote-frontend-contribution';
|
|
23
|
+
import { RemoteRegistryContribution } from './remote-registry-contribution';
|
|
24
|
+
import { RemoteService } from './remote-service';
|
|
25
|
+
import { RemoteStatusService, RemoteStatusServicePath } from '../electron-common/remote-status-service';
|
|
26
|
+
import { ElectronFileDialogService } from '@theia/filesystem/lib/electron-browser/file-dialog/electron-file-dialog-service';
|
|
27
|
+
import { RemoteElectronFileDialogService } from './remote-electron-file-dialog-service';
|
|
28
|
+
import { bindRemotePreferences } from './remote-preferences';
|
|
29
|
+
import { PortForwardingWidget, PORT_FORWARDING_WIDGET_ID } from './port-forwarding/port-forwarding-widget';
|
|
30
|
+
import { PortForwardingContribution } from './port-forwarding/port-forwading-contribution';
|
|
31
|
+
import { PortForwardingService } from './port-forwarding/port-forwarding-service';
|
|
32
|
+
import { RemotePortForwardingProvider, RemoteRemotePortForwardingProviderPath } from '../electron-common/remote-port-forwarding-provider';
|
|
33
|
+
import { ServiceConnectionProvider } from '@theia/core/lib/browser/messaging/service-connection-provider';
|
|
34
|
+
import '../../src/electron-browser/style/port-forwarding-widget.css';
|
|
35
|
+
|
|
36
|
+
export default new ContainerModule((bind, _, __, rebind) => {
|
|
37
|
+
bind(RemoteFrontendContribution).toSelf().inSingletonScope();
|
|
38
|
+
bind(FrontendApplicationContribution).toService(RemoteFrontendContribution);
|
|
39
|
+
bind(CommandContribution).toService(RemoteFrontendContribution);
|
|
40
|
+
|
|
41
|
+
bindContributionProvider(bind, RemoteRegistryContribution);
|
|
42
|
+
bind(RemoteSSHContribution).toSelf().inSingletonScope();
|
|
43
|
+
bind(RemoteRegistryContribution).toService(RemoteSSHContribution);
|
|
44
|
+
|
|
45
|
+
bindRemotePreferences(bind);
|
|
46
|
+
|
|
47
|
+
rebind(ElectronFileDialogService).to(RemoteElectronFileDialogService).inSingletonScope();
|
|
48
|
+
|
|
49
|
+
bind(RemoteService).toSelf().inSingletonScope();
|
|
50
|
+
|
|
51
|
+
bind(PortForwardingWidget).toSelf();
|
|
52
|
+
bind(WidgetFactory).toDynamicValue(context => ({
|
|
53
|
+
id: PORT_FORWARDING_WIDGET_ID,
|
|
54
|
+
createWidget: () => context.container.get<PortForwardingWidget>(PortForwardingWidget)
|
|
55
|
+
}));
|
|
56
|
+
|
|
57
|
+
bindViewContribution(bind, PortForwardingContribution);
|
|
58
|
+
bind(PortForwardingService).toSelf().inSingletonScope();
|
|
59
|
+
|
|
60
|
+
bind(RemoteSSHConnectionProvider).toDynamicValue(ctx =>
|
|
61
|
+
ServiceConnectionProvider.createLocalProxy<RemoteSSHConnectionProvider>(ctx.container, RemoteSSHConnectionProviderPath)).inSingletonScope();
|
|
62
|
+
bind(RemoteStatusService).toDynamicValue(ctx =>
|
|
63
|
+
ServiceConnectionProvider.createLocalProxy<RemoteStatusService>(ctx.container, RemoteStatusServicePath)).inSingletonScope();
|
|
64
|
+
|
|
65
|
+
bind(RemotePortForwardingProvider).toDynamicValue(ctx =>
|
|
66
|
+
ServiceConnectionProvider.createLocalProxy<RemotePortForwardingProvider>(ctx.container, RemoteRemotePortForwardingProviderPath)).inSingletonScope();
|
|
67
|
+
|
|
68
|
+
});
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { interfaces } from '@theia/core/shared/inversify';
|
|
18
|
-
import {
|
|
19
|
-
PreferenceProxy,
|
|
20
|
-
PreferenceSchema,
|
|
21
|
-
PreferenceContribution
|
|
22
|
-
} from '@theia/core/lib/browser/preferences';
|
|
23
|
-
import { nls } from '@theia/core/lib/common/nls';
|
|
24
|
-
import { PreferenceProxyFactory } from '@theia/core/lib/browser/preferences/injectable-preference-proxy';
|
|
25
|
-
|
|
26
|
-
const nodeDownloadTemplateParts = [
|
|
27
|
-
nls.localize('theia/remote/nodeDownloadTemplateVersion', '`{version}` for the used node version'),
|
|
28
|
-
nls.localize('theia/remote/nodeDownloadTemplateOS', '`{os}` for the remote operating system. Either `win`, `linux` or `darwin`.'),
|
|
29
|
-
nls.localize('theia/remote/nodeDownloadTemplateArch', '`{arch}` for the remote system architecture.'),
|
|
30
|
-
nls.localize('theia/remote/nodeDownloadTemplateExt', '`{ext}` for the file extension. Either `zip`, `tar.xz` or `tar.xz`, depending on the operating system.')
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
export const RemotePreferenceSchema: PreferenceSchema = {
|
|
34
|
-
'type': 'object',
|
|
35
|
-
properties: {
|
|
36
|
-
'remote.nodeDownloadTemplate': {
|
|
37
|
-
type: 'string',
|
|
38
|
-
default: '',
|
|
39
|
-
markdownDescription: nls.localize(
|
|
40
|
-
'theia/remote/nodeDownloadTemplate',
|
|
41
|
-
'Controls the template used to download the node.js binaries for the remote backend. Points to the official node.js website by default. Uses multiple placeholders:'
|
|
42
|
-
) + '\n- ' + nodeDownloadTemplateParts.join('\n- ')
|
|
43
|
-
},
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export interface RemoteConfiguration {
|
|
48
|
-
'remote.nodeDownloadTemplate': string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export const RemotePreferenceContribution = Symbol('RemotePreferenceContribution');
|
|
52
|
-
export const RemotePreferences = Symbol('GettingStartedPreferences');
|
|
53
|
-
export type RemotePreferences = PreferenceProxy<RemoteConfiguration>;
|
|
54
|
-
|
|
55
|
-
export function bindRemotePreferences(bind: interfaces.Bind): void {
|
|
56
|
-
bind(RemotePreferences).toDynamicValue(ctx => {
|
|
57
|
-
const factory = ctx.container.get<PreferenceProxyFactory>(PreferenceProxyFactory);
|
|
58
|
-
return factory(RemotePreferenceSchema);
|
|
59
|
-
}).inSingletonScope();
|
|
60
|
-
bind(RemotePreferenceContribution).toConstantValue({ schema: RemotePreferenceSchema });
|
|
61
|
-
bind(PreferenceContribution).toService(RemotePreferenceContribution);
|
|
62
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
18
|
+
import {
|
|
19
|
+
PreferenceProxy,
|
|
20
|
+
PreferenceSchema,
|
|
21
|
+
PreferenceContribution
|
|
22
|
+
} from '@theia/core/lib/browser/preferences';
|
|
23
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
24
|
+
import { PreferenceProxyFactory } from '@theia/core/lib/browser/preferences/injectable-preference-proxy';
|
|
25
|
+
|
|
26
|
+
const nodeDownloadTemplateParts = [
|
|
27
|
+
nls.localize('theia/remote/nodeDownloadTemplateVersion', '`{version}` for the used node version'),
|
|
28
|
+
nls.localize('theia/remote/nodeDownloadTemplateOS', '`{os}` for the remote operating system. Either `win`, `linux` or `darwin`.'),
|
|
29
|
+
nls.localize('theia/remote/nodeDownloadTemplateArch', '`{arch}` for the remote system architecture.'),
|
|
30
|
+
nls.localize('theia/remote/nodeDownloadTemplateExt', '`{ext}` for the file extension. Either `zip`, `tar.xz` or `tar.xz`, depending on the operating system.')
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
export const RemotePreferenceSchema: PreferenceSchema = {
|
|
34
|
+
'type': 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
'remote.nodeDownloadTemplate': {
|
|
37
|
+
type: 'string',
|
|
38
|
+
default: '',
|
|
39
|
+
markdownDescription: nls.localize(
|
|
40
|
+
'theia/remote/nodeDownloadTemplate',
|
|
41
|
+
'Controls the template used to download the node.js binaries for the remote backend. Points to the official node.js website by default. Uses multiple placeholders:'
|
|
42
|
+
) + '\n- ' + nodeDownloadTemplateParts.join('\n- ')
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export interface RemoteConfiguration {
|
|
48
|
+
'remote.nodeDownloadTemplate': string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const RemotePreferenceContribution = Symbol('RemotePreferenceContribution');
|
|
52
|
+
export const RemotePreferences = Symbol('GettingStartedPreferences');
|
|
53
|
+
export type RemotePreferences = PreferenceProxy<RemoteConfiguration>;
|
|
54
|
+
|
|
55
|
+
export function bindRemotePreferences(bind: interfaces.Bind): void {
|
|
56
|
+
bind(RemotePreferences).toDynamicValue(ctx => {
|
|
57
|
+
const factory = ctx.container.get<PreferenceProxyFactory>(PreferenceProxyFactory);
|
|
58
|
+
return factory(RemotePreferenceSchema);
|
|
59
|
+
}).inSingletonScope();
|
|
60
|
+
bind(RemotePreferenceContribution).toConstantValue({ schema: RemotePreferenceSchema });
|
|
61
|
+
bind(PreferenceContribution).toService(RemotePreferenceContribution);
|
|
62
|
+
}
|