phirepass-widgets 0.0.79 → 0.0.81
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/phirepass-rdp.cjs.entry.js +308 -0
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +17 -17
- package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
- package/dist/cjs/phirepass-widgets.cjs.js +1 -1
- package/dist/cjs/{protocol-DC4eLkqJ.js → protocol-DS0qXomZ.js} +25 -26
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/common/protocol.js +1 -0
- package/dist/collection/components/{phirepass-vnc/phirepass-vnc.css → phirepass-rdp/phirepass-rdp.css} +9 -2
- package/dist/collection/components/{phirepass-vnc/phirepass-vnc.js → phirepass-rdp/phirepass-rdp.js} +198 -90
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +16 -16
- package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +1 -1
- package/dist/collection/phirepass-channel_bg.wasm +0 -0
- package/dist/components/p-CWIhN33k.js +1 -0
- package/dist/components/{phirepass-vnc.d.ts → phirepass-rdp.d.ts} +4 -4
- package/dist/components/phirepass-rdp.js +1 -0
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/phirepass-rdp.entry.js +306 -0
- package/dist/esm/phirepass-sftp-client.entry.js +17 -17
- package/dist/esm/phirepass-terminal.entry.js +2 -2
- package/dist/esm/phirepass-widgets.js +1 -1
- package/dist/esm/{protocol-BR2c80mW.js → protocol-CWIhN33k.js} +24 -25
- package/dist/phirepass-widgets/{p-339cd54e.entry.js → p-19789356.entry.js} +1 -1
- package/dist/phirepass-widgets/{p-14c7611f.entry.js → p-2478a6eb.entry.js} +2 -2
- package/dist/phirepass-widgets/p-CWIhN33k.js +1 -0
- package/dist/phirepass-widgets/p-a5528005.entry.js +1 -0
- package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
- package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
- package/dist/types/common/protocol.d.ts +17 -1
- package/dist/types/components/phirepass-rdp/phirepass-rdp.d.ts +90 -0
- package/dist/types/components.d.ts +136 -90
- package/package.json +4 -3
- package/dist/cjs/phirepass-vnc.cjs.entry.js +0 -336
- package/dist/collection/common/channel-socket.js +0 -89
- package/dist/components/p-BR2c80mW.js +0 -1
- package/dist/components/phirepass-vnc.js +0 -1
- package/dist/esm/phirepass-vnc.entry.js +0 -334
- package/dist/phirepass-widgets/p-19e2a30c.entry.js +0 -1
- package/dist/phirepass-widgets/p-BR2c80mW.js +0 -1
- package/dist/types/common/channel-socket.d.ts +0 -47
- package/dist/types/common/novnc.d.ts +0 -53
- package/dist/types/components/phirepass-vnc/phirepass-vnc.d.ts +0 -52
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
"components/phirepass-rdp/phirepass-rdp.js",
|
|
3
4
|
"components/phirepass-sftp-client/phirepass-sftp-client.js",
|
|
4
|
-
"components/phirepass-terminal/phirepass-terminal.js"
|
|
5
|
-
"components/phirepass-vnc/phirepass-vnc.js"
|
|
5
|
+
"components/phirepass-terminal/phirepass-terminal.js"
|
|
6
6
|
],
|
|
7
7
|
"mixins": [],
|
|
8
8
|
"compiler": {
|
|
@@ -6,6 +6,7 @@ export var ProtocolMessageType;
|
|
|
6
6
|
ProtocolMessageType["TunnelOpened"] = "TunnelOpened";
|
|
7
7
|
ProtocolMessageType["TunnelClosed"] = "TunnelClosed";
|
|
8
8
|
ProtocolMessageType["TunnelData"] = "TunnelData";
|
|
9
|
+
ProtocolMessageType["RDPAuthorized"] = "RDPAuthorized";
|
|
9
10
|
ProtocolMessageType["SFTPListItems"] = "SFTPListItems";
|
|
10
11
|
ProtocolMessageType["SFTPDownloadStartResponse"] = "SFTPDownloadStartResponse";
|
|
11
12
|
ProtocolMessageType["SFTPDownloadChunk"] = "SFTPDownloadChunk";
|
|
@@ -14,7 +14,13 @@
|
|
|
14
14
|
height: 100%;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
/*
|
|
17
|
+
/* IronRDP renders into its own canvas; never let it force the page to scroll. */
|
|
18
|
+
.screen iron-remote-desktop {
|
|
19
|
+
display: block;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
.screen canvas {
|
|
19
25
|
max-width: 100%;
|
|
20
26
|
display: block;
|
|
@@ -27,7 +33,7 @@
|
|
|
27
33
|
flex-direction: column;
|
|
28
34
|
align-items: center;
|
|
29
35
|
justify-content: center;
|
|
30
|
-
gap: 0.
|
|
36
|
+
gap: 0.5rem;
|
|
31
37
|
background: rgba(11, 16, 33, 0.92);
|
|
32
38
|
color: #e2e8f0;
|
|
33
39
|
font-family: "Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;
|
|
@@ -50,6 +56,7 @@
|
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
.prompt button {
|
|
59
|
+
margin-top: 0.5rem;
|
|
53
60
|
padding: 0.5rem 1.25rem;
|
|
54
61
|
border: 0;
|
|
55
62
|
border-radius: 0.375rem;
|
package/dist/collection/components/{phirepass-vnc/phirepass-vnc.js → phirepass-rdp/phirepass-rdp.js}
RENAMED
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import init, { Channel as PhirepassChannel } from "phirepass-channel";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { ConnectionState, ProtocolMessageType, } from "../../common/protocol";
|
|
4
|
+
/**
|
|
5
|
+
* Remote desktop over RDP.
|
|
6
|
+
*
|
|
7
|
+
* Unlike the terminal and SFTP widgets this one does not pipe protocol bytes
|
|
8
|
+
* through the phirepass channel. The channel is used only to authorise the
|
|
9
|
+
* session; the actual RDP stream runs on a second WebSocket opened by IronRDP's
|
|
10
|
+
* own client, because that client speaks RDCleanPath and can set neither
|
|
11
|
+
* headers nor a subprotocol on the socket it opens. See `RDP.md` in
|
|
12
|
+
* `phirepass-rs` for why the session is split across two sockets.
|
|
13
|
+
*/
|
|
14
|
+
export class PhirepassRdp {
|
|
6
15
|
channel;
|
|
7
16
|
containerEl;
|
|
8
|
-
|
|
9
|
-
|
|
17
|
+
ironEl;
|
|
18
|
+
userInteraction;
|
|
10
19
|
domReady = false;
|
|
11
20
|
runtimeReady = false;
|
|
12
21
|
connected = false;
|
|
13
22
|
session_id;
|
|
14
|
-
|
|
23
|
+
/** Credentials in force for this session, from props or from the prompt. */
|
|
24
|
+
credentials;
|
|
25
|
+
credentialsPrompt = false;
|
|
15
26
|
statusMessage;
|
|
27
|
+
usernameBuffer = '';
|
|
16
28
|
passwordBuffer = '';
|
|
17
29
|
el;
|
|
18
30
|
serverHost = "phirepass.com";
|
|
@@ -22,10 +34,26 @@ export class PhirepassVnc {
|
|
|
22
34
|
nodeId;
|
|
23
35
|
serviceId;
|
|
24
36
|
token;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Credentials for the remote host. When either is missing the widget
|
|
39
|
+
* prompts for both.
|
|
40
|
+
*
|
|
41
|
+
* They serve two purposes at once: the agent checks them before it
|
|
42
|
+
* authorises the tunnel, and the browser uses them for CredSSP. The agent
|
|
43
|
+
* never logs in with them — it discards them once the tunnel is authorised.
|
|
44
|
+
*/
|
|
45
|
+
username;
|
|
46
|
+
password;
|
|
47
|
+
/**
|
|
48
|
+
* What to name the host in the CredSSP service principal (`TERMSRV/...`).
|
|
49
|
+
*
|
|
50
|
+
* The agent dials whatever the node's service settings say, so this is
|
|
51
|
+
* never used for routing. It matters only because some hosts check the SPN,
|
|
52
|
+
* and the browser has no other way to learn the host's real address.
|
|
53
|
+
*/
|
|
54
|
+
destination;
|
|
55
|
+
/** `fit` scales the desktop to the widget, `real` keeps 1:1 pixels. */
|
|
56
|
+
scale = 'fit';
|
|
29
57
|
onNodeIdChange(newValue, _oldValue) {
|
|
30
58
|
this.reset_session_state();
|
|
31
59
|
if (this.channel && this.channel.is_connected()) {
|
|
@@ -56,7 +84,7 @@ export class PhirepassVnc {
|
|
|
56
84
|
this.open_comms();
|
|
57
85
|
this.runtimeReady = true;
|
|
58
86
|
if (!this.nodeId) {
|
|
59
|
-
console.warn('Prop node_id is not set. Cannot connect to
|
|
87
|
+
console.warn('Prop node_id is not set. Cannot connect to RDP.');
|
|
60
88
|
return;
|
|
61
89
|
}
|
|
62
90
|
this.try_connect();
|
|
@@ -97,11 +125,10 @@ export class PhirepassVnc {
|
|
|
97
125
|
});
|
|
98
126
|
this.channel.on_connection_close(() => {
|
|
99
127
|
this.connectionStateChanged.emit([ConnectionState.Disconnected]);
|
|
100
|
-
this.
|
|
128
|
+
this.teardown_client();
|
|
101
129
|
});
|
|
102
130
|
this.channel.on_connection_error((err) => {
|
|
103
131
|
this.connectionStateChanged.emit([ConnectionState.Error, err]);
|
|
104
|
-
this.socket?.failed(err);
|
|
105
132
|
});
|
|
106
133
|
this.channel.on_connection_message((_raw_) => {
|
|
107
134
|
// raw frames are handled by on_protocol_message below
|
|
@@ -115,22 +142,19 @@ export class PhirepassVnc {
|
|
|
115
142
|
case ProtocolMessageType.AuthSuccess:
|
|
116
143
|
this.handle_auth_success(web);
|
|
117
144
|
break;
|
|
118
|
-
case ProtocolMessageType.
|
|
119
|
-
this.
|
|
145
|
+
case ProtocolMessageType.RDPAuthorized:
|
|
146
|
+
this.handle_rdp_authorized(web);
|
|
120
147
|
break;
|
|
121
148
|
case ProtocolMessageType.TunnelClosed:
|
|
122
149
|
this.handle_tunnel_closed(web);
|
|
123
150
|
break;
|
|
124
|
-
case ProtocolMessageType.TunnelData:
|
|
125
|
-
this.handle_tunnel_data(web);
|
|
126
|
-
break;
|
|
127
151
|
default:
|
|
128
152
|
console.warn('Unknown protocol message type:', web);
|
|
129
153
|
}
|
|
130
154
|
});
|
|
131
155
|
}
|
|
132
156
|
close_comms() {
|
|
133
|
-
this.
|
|
157
|
+
this.teardown_client();
|
|
134
158
|
if (this.channel) {
|
|
135
159
|
this.channel.stop_heartbeat();
|
|
136
160
|
this.channel.disconnect();
|
|
@@ -138,103 +162,150 @@ export class PhirepassVnc {
|
|
|
138
162
|
}
|
|
139
163
|
reset_session_state() {
|
|
140
164
|
this.session_id = undefined;
|
|
141
|
-
this.
|
|
165
|
+
this.credentials = undefined;
|
|
166
|
+
this.credentialsPrompt = false;
|
|
167
|
+
this.usernameBuffer = '';
|
|
142
168
|
this.passwordBuffer = '';
|
|
143
169
|
this.statusMessage = undefined;
|
|
144
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* The channel stays open for the whole session even though no RDP byte ever
|
|
173
|
+
* travels over it: it is what keeps the tunnel registered server-side, and
|
|
174
|
+
* it is where `TunnelClosed` and `Error` arrive.
|
|
175
|
+
*/
|
|
145
176
|
handle_auth_success(_auth_) {
|
|
146
177
|
this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
|
|
147
|
-
|
|
178
|
+
if (this.username && this.password) {
|
|
179
|
+
this.credentials = { username: this.username, password: this.password };
|
|
180
|
+
this.request_tunnel();
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
this.credentialsPrompt = true;
|
|
184
|
+
}
|
|
185
|
+
request_tunnel() {
|
|
186
|
+
if (!this.credentials) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
this.statusMessage = undefined;
|
|
190
|
+
this.channel.open_rdp_tunnel(this.nodeId, this.serviceId, this.credentials.username, this.credentials.password);
|
|
148
191
|
}
|
|
149
192
|
/**
|
|
150
|
-
* The tunnel is
|
|
151
|
-
*
|
|
193
|
+
* The tunnel is authorised but nothing has been dialled yet: the agent only
|
|
194
|
+
* reserves `sid`. Handing the ticket to the RDP client is what triggers the
|
|
195
|
+
* TCP + x224 + TLS hop, and the ticket expires 60s from now.
|
|
152
196
|
*/
|
|
153
|
-
async
|
|
197
|
+
async handle_rdp_authorized(web) {
|
|
154
198
|
this.session_id = web.sid;
|
|
155
|
-
this.statusMessage =
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
//
|
|
165
|
-
|
|
166
|
-
// The element may have gone away while the module was loading.
|
|
167
|
-
if (!this.containerEl || this.socket !== socket) {
|
|
199
|
+
this.statusMessage = 'Connecting…';
|
|
200
|
+
// Loaded on demand: the RDP client carries a multi-megabyte wasm
|
|
201
|
+
// payload that consumers embedding only the terminal or the SFTP client
|
|
202
|
+
// should never download.
|
|
203
|
+
const [backend] = await Promise.all([
|
|
204
|
+
import('@devolutions/iron-remote-desktop-rdp'),
|
|
205
|
+
// Registers the `iron-remote-desktop` element as a side effect.
|
|
206
|
+
import('@devolutions/iron-remote-desktop'),
|
|
207
|
+
]);
|
|
208
|
+
// The element may have gone away while the modules were loading.
|
|
209
|
+
if (!this.containerEl || this.session_id !== web.sid) {
|
|
168
210
|
return;
|
|
169
211
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
212
|
+
await backend.init('info');
|
|
213
|
+
if (!this.containerEl || this.session_id !== web.sid) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
// Built imperatively rather than in `render()` so `module` is set
|
|
217
|
+
// before the element upgrades — it reads its backend on connect.
|
|
218
|
+
const element = document.createElement('iron-remote-desktop');
|
|
219
|
+
element.module = backend.Backend;
|
|
220
|
+
element.scale = this.scale;
|
|
221
|
+
element.flexcenter = true;
|
|
222
|
+
element.verbose = false;
|
|
223
|
+
element.addEventListener('ready', (event) => {
|
|
177
224
|
const detail = event.detail;
|
|
178
|
-
this.
|
|
179
|
-
this.connectionStateChanged.emit([ConnectionState.Error, detail]);
|
|
225
|
+
void this.start_session(detail.irgUserInteraction, web.ticket, backend.enableCredssp(true));
|
|
180
226
|
});
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
});
|
|
184
|
-
this.rfb = rfb;
|
|
185
|
-
// Only now can noVNC start reading: it attaches on construction.
|
|
186
|
-
socket.open();
|
|
227
|
+
this.ironEl = element;
|
|
228
|
+
this.containerEl.appendChild(element);
|
|
187
229
|
}
|
|
188
|
-
|
|
189
|
-
this.
|
|
230
|
+
async start_session(userInteraction, ticket, credssp) {
|
|
231
|
+
this.userInteraction = userInteraction;
|
|
232
|
+
const config = userInteraction
|
|
233
|
+
.configBuilder()
|
|
234
|
+
.withUsername(this.credentials?.username ?? '')
|
|
235
|
+
.withPassword(this.credentials?.password ?? '')
|
|
236
|
+
.withDestination(this.destination ?? this.nodeId)
|
|
237
|
+
.withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`)
|
|
238
|
+
.withAuthToken(ticket)
|
|
239
|
+
.withExtension(credssp)
|
|
240
|
+
.build();
|
|
241
|
+
try {
|
|
242
|
+
const session = await userInteraction.connect(config);
|
|
243
|
+
userInteraction.setVisibility(true);
|
|
244
|
+
this.statusMessage = undefined;
|
|
245
|
+
const termination = await session.run();
|
|
246
|
+
this.statusMessage = termination.reason();
|
|
247
|
+
}
|
|
248
|
+
catch (err) {
|
|
249
|
+
const message = this.describe_error(err);
|
|
250
|
+
this.statusMessage = message;
|
|
251
|
+
this.connectionStateChanged.emit([ConnectionState.Error, err]);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/** IronRDP rejects with its own error shape rather than an `Error`. */
|
|
255
|
+
describe_error(err) {
|
|
256
|
+
const iron = err;
|
|
257
|
+
if (iron && typeof iron.backtrace === 'function') {
|
|
258
|
+
return iron.backtrace();
|
|
259
|
+
}
|
|
260
|
+
return err instanceof Error ? err.message : 'Connection failed.';
|
|
190
261
|
}
|
|
191
262
|
handle_tunnel_closed(_web_) {
|
|
192
263
|
this.session_id = undefined;
|
|
193
|
-
this.statusMessage = 'Connection closed.';
|
|
194
|
-
this.
|
|
264
|
+
this.statusMessage = this.statusMessage ?? 'Connection closed.';
|
|
265
|
+
this.teardown_client();
|
|
195
266
|
this.close_comms();
|
|
196
267
|
}
|
|
197
268
|
handle_error(error) {
|
|
198
269
|
this.statusMessage = error.message;
|
|
199
270
|
this.connectionStateChanged.emit([ConnectionState.Error, error]);
|
|
200
|
-
this.socket?.failed(error);
|
|
201
271
|
}
|
|
202
|
-
|
|
203
|
-
if (this.
|
|
272
|
+
teardown_client() {
|
|
273
|
+
if (this.userInteraction) {
|
|
204
274
|
try {
|
|
205
|
-
this.
|
|
275
|
+
this.userInteraction.shutdown();
|
|
206
276
|
}
|
|
207
277
|
catch (err) {
|
|
208
|
-
console.warn('Failed to
|
|
278
|
+
console.warn('Failed to shut the RDP session down cleanly:', err);
|
|
209
279
|
}
|
|
210
|
-
this.
|
|
211
|
-
}
|
|
212
|
-
if (this.socket) {
|
|
213
|
-
this.socket.closed();
|
|
214
|
-
this.socket = undefined;
|
|
280
|
+
this.userInteraction = undefined;
|
|
215
281
|
}
|
|
216
|
-
this.
|
|
282
|
+
this.ironEl?.remove();
|
|
283
|
+
this.ironEl = undefined;
|
|
284
|
+
this.credentialsPrompt = false;
|
|
285
|
+
this.usernameBuffer = '';
|
|
217
286
|
this.passwordBuffer = '';
|
|
218
287
|
}
|
|
219
|
-
|
|
288
|
+
submit_credentials(event) {
|
|
220
289
|
event.preventDefault();
|
|
221
|
-
this.
|
|
222
|
-
this.
|
|
290
|
+
this.credentialsPrompt = false;
|
|
291
|
+
this.credentials = { username: this.usernameBuffer, password: this.passwordBuffer };
|
|
292
|
+
this.usernameBuffer = '';
|
|
223
293
|
this.passwordBuffer = '';
|
|
294
|
+
this.request_tunnel();
|
|
224
295
|
}
|
|
225
296
|
render() {
|
|
226
|
-
return (h(Host, { key: '
|
|
297
|
+
return (h(Host, { key: '97b198af30e4e4b7ae8cbd0d497dc4f4812615f8' }, h("div", { key: 'f7d01492909a0f3cb6c639345eb70a8e1fbf1b90', class: "screen", ref: (el) => (this.containerEl = el) }), this.credentialsPrompt && (h("form", { key: '1dcfeaa956999dc882943e0d0b49ead8d12840bc', class: "prompt", onSubmit: (event) => this.submit_credentials(event) }, h("label", { key: 'a62e96bfb6b947167f731020c7ab00a1d9a82652', htmlFor: "rdp-username" }, "Windows username"), h("input", { key: '3135d24b62b2b612a11d3cbfd2c19f3cf381e74b', id: "rdp-username", type: "text", autocomplete: "username", autofocus: true, onInput: (event) => (this.usernameBuffer = event.target.value) }), h("label", { key: 'd8b901e0fe81de30e6426f80179d5e8da542effc', htmlFor: "rdp-password" }, "Password"), h("input", { key: '0bfad07c7f5355a8693856b1e6b51df59944a339', id: "rdp-password", type: "password", autocomplete: "current-password", onInput: (event) => (this.passwordBuffer = event.target.value) }), h("button", { key: 'e1cbab525870c34fe85299a8ce883d7069cb4bb8', type: "submit" }, "Connect"))), this.statusMessage && !this.credentialsPrompt && (h("div", { key: '4144cff9e5d6fb637655203bf67a13adaa7feede', class: "status" }, this.statusMessage))));
|
|
227
298
|
}
|
|
228
|
-
static get is() { return "phirepass-
|
|
299
|
+
static get is() { return "phirepass-rdp"; }
|
|
229
300
|
static get encapsulation() { return "shadow"; }
|
|
230
301
|
static get originalStyleUrls() {
|
|
231
302
|
return {
|
|
232
|
-
"$": ["phirepass-
|
|
303
|
+
"$": ["phirepass-rdp.css"]
|
|
233
304
|
};
|
|
234
305
|
}
|
|
235
306
|
static get styleUrls() {
|
|
236
307
|
return {
|
|
237
|
-
"$": ["phirepass-
|
|
308
|
+
"$": ["phirepass-rdp.css"]
|
|
238
309
|
};
|
|
239
310
|
}
|
|
240
311
|
static get properties() {
|
|
@@ -376,45 +447,82 @@ export class PhirepassVnc {
|
|
|
376
447
|
"reflect": false,
|
|
377
448
|
"attribute": "token"
|
|
378
449
|
},
|
|
379
|
-
"
|
|
380
|
-
"type": "
|
|
450
|
+
"username": {
|
|
451
|
+
"type": "string",
|
|
381
452
|
"mutable": false,
|
|
382
453
|
"complexType": {
|
|
383
|
-
"original": "
|
|
384
|
-
"resolved": "
|
|
454
|
+
"original": "string",
|
|
455
|
+
"resolved": "string",
|
|
385
456
|
"references": {}
|
|
386
457
|
},
|
|
387
458
|
"required": false,
|
|
388
|
-
"optional":
|
|
459
|
+
"optional": true,
|
|
389
460
|
"docs": {
|
|
390
461
|
"tags": [],
|
|
391
|
-
"text": "
|
|
462
|
+
"text": "Credentials for the remote host. When either is missing the widget\nprompts for both.\n\nThey serve two purposes at once: the agent checks them before it\nauthorises the tunnel, and the browser uses them for CredSSP. The agent\nnever logs in with them \u2014 it discards them once the tunnel is authorised."
|
|
392
463
|
},
|
|
393
464
|
"getter": false,
|
|
394
465
|
"setter": false,
|
|
395
466
|
"reflect": false,
|
|
396
|
-
"attribute": "
|
|
397
|
-
"defaultValue": "true"
|
|
467
|
+
"attribute": "username"
|
|
398
468
|
},
|
|
399
|
-
"
|
|
400
|
-
"type": "
|
|
469
|
+
"password": {
|
|
470
|
+
"type": "string",
|
|
401
471
|
"mutable": false,
|
|
402
472
|
"complexType": {
|
|
403
|
-
"original": "
|
|
404
|
-
"resolved": "
|
|
473
|
+
"original": "string",
|
|
474
|
+
"resolved": "string",
|
|
475
|
+
"references": {}
|
|
476
|
+
},
|
|
477
|
+
"required": false,
|
|
478
|
+
"optional": true,
|
|
479
|
+
"docs": {
|
|
480
|
+
"tags": [],
|
|
481
|
+
"text": ""
|
|
482
|
+
},
|
|
483
|
+
"getter": false,
|
|
484
|
+
"setter": false,
|
|
485
|
+
"reflect": false,
|
|
486
|
+
"attribute": "password"
|
|
487
|
+
},
|
|
488
|
+
"destination": {
|
|
489
|
+
"type": "string",
|
|
490
|
+
"mutable": false,
|
|
491
|
+
"complexType": {
|
|
492
|
+
"original": "string",
|
|
493
|
+
"resolved": "string",
|
|
494
|
+
"references": {}
|
|
495
|
+
},
|
|
496
|
+
"required": false,
|
|
497
|
+
"optional": true,
|
|
498
|
+
"docs": {
|
|
499
|
+
"tags": [],
|
|
500
|
+
"text": "What to name the host in the CredSSP service principal (`TERMSRV/...`).\n\nThe agent dials whatever the node's service settings say, so this is\nnever used for routing. It matters only because some hosts check the SPN,\nand the browser has no other way to learn the host's real address."
|
|
501
|
+
},
|
|
502
|
+
"getter": false,
|
|
503
|
+
"setter": false,
|
|
504
|
+
"reflect": false,
|
|
505
|
+
"attribute": "destination"
|
|
506
|
+
},
|
|
507
|
+
"scale": {
|
|
508
|
+
"type": "string",
|
|
509
|
+
"mutable": false,
|
|
510
|
+
"complexType": {
|
|
511
|
+
"original": "'fit' | 'full' | 'real'",
|
|
512
|
+
"resolved": "\"fit\" | \"full\" | \"real\"",
|
|
405
513
|
"references": {}
|
|
406
514
|
},
|
|
407
515
|
"required": false,
|
|
408
516
|
"optional": false,
|
|
409
517
|
"docs": {
|
|
410
518
|
"tags": [],
|
|
411
|
-
"text": "
|
|
519
|
+
"text": "`fit` scales the desktop to the widget, `real` keeps 1:1 pixels."
|
|
412
520
|
},
|
|
413
521
|
"getter": false,
|
|
414
522
|
"setter": false,
|
|
415
523
|
"reflect": false,
|
|
416
|
-
"attribute": "
|
|
417
|
-
"defaultValue": "
|
|
524
|
+
"attribute": "scale",
|
|
525
|
+
"defaultValue": "'fit'"
|
|
418
526
|
},
|
|
419
527
|
"serverId": {
|
|
420
528
|
"type": "string",
|
|
@@ -439,7 +547,7 @@ export class PhirepassVnc {
|
|
|
439
547
|
}
|
|
440
548
|
static get states() {
|
|
441
549
|
return {
|
|
442
|
-
"
|
|
550
|
+
"credentialsPrompt": {},
|
|
443
551
|
"statusMessage": {}
|
|
444
552
|
};
|
|
445
553
|
}
|
|
@@ -910,18 +910,18 @@ export class PhirepassSftpClient {
|
|
|
910
910
|
return `${typeChar}${chars.join('')}`;
|
|
911
911
|
}
|
|
912
912
|
render() {
|
|
913
|
-
return (h(Host, { key: '
|
|
913
|
+
return (h(Host, { key: '682152b79b8d22bd7c81299225fb9d1bb0da72db', class: {
|
|
914
914
|
'default': !this.max,
|
|
915
915
|
'max': this.max,
|
|
916
|
-
} }, h("section", { key: '
|
|
917
|
-
h("header", { key: '
|
|
916
|
+
} }, h("section", { key: '5be263e7b380fc61ab70856c6650b5dfb0901795', class: "listing" }, !this.hideHeader &&
|
|
917
|
+
h("header", { key: 'fee0627ccb716ef560e8723496087e1b565f759f' }, h("section", { key: 'b112ebbe9ff73bc80ce84bb47e50769ae45a4ce2', class: "title" }, h("img", { key: '3a0ec7d30cf4cab69ec5f2e236b8e162ea4c2ce5', src: svg, alt: "SFTP Client" }), h("div", { key: '433b5063ca30b4cc04544ff6ef29d94e9dc0a703', class: "text" }, h("div", { key: 'dd354e0b38c4e3d8cc5f9588bbeb2cbb32d476fc', class: "name" }, this.name), h("div", { key: '523829c5a164d755211bc35caf8fdeb44ca8a15e', class: "description" }, this.description))), h("section", { key: '9dd9e2c1f7e43c72d284a67332320f736a81a809', class: "actions" }, h("div", { key: '40a2744abdfadf699cd631684e083ec0dc829a7d', class: "action", onClick: () => this.toggle_max() }, h("img", { key: '3ad551f84dbf56da3d47bd0045748a94c285bc72', src: max, alt: "Maximize" })))), h("main", { key: '770b9372cdb761efb233f73d70afb83f5d5d2c01' }, this.show_navigation && h("nav", { key: 'b9c318e991b2523497e1c6e1cc55d540215fa848', class: "navigation" }, h("div", { key: '9f9e8e06ba65e47979980fc52cdcc73ae494df24', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index, breadcrumbs) => (h("span", { key: index, class: "breadcrumb-container" }, h("span", { key: index, onClick: () => this.list_breadcrumb(crumb.path), class: "breadcrumb" }, crumb.label), index < breadcrumbs.length - 1 && h("img", { class: "arrow", src: chevron }))))), h("section", { key: '21eda2e694e98f40b40e0421c333e8fa582731ff', class: "actions", "aria-label": "SFTP actions" }, h("button", { key: 'e74fdf11191b0d80ba286c4d6a7f613bd7c9d5bb', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, h("img", { key: '2785ac1d0ae7c33123fb924ad030efc4d5e03da0', src: go_up, alt: "Go up" })), h("button", { key: '08b3880df69db41a7bad0278971308e5bbdb5813', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, h("img", { key: '2b00f26ae3b5fc3a923b337a7f2a0a6e641874fa', src: refresh, alt: "Refresh" })), h("button", { key: '4b05f7d304f5a89642dccfa499ab1421890d67c8', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, h("img", { key: 'a95624e723f28b04ab277b82650a2334bd2aa679', src: upload, alt: "Upload" })), h("button", { key: '3277414b28f178d1ba3d6f147ed79bc951a5df29', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), h("input", { key: '5c248ba2c5c001aa2e0196f41f278f70412b5c1b', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && h("div", { key: 'afff360eecca86b4c66a799e8938108a310ccbab', class: "content" }, h("table", { key: '31e9223fab1a5d6a3f797b44efbd6f735551757a' }, h("thead", { key: '16662bfc34dc06207c7d131f067ac257c27c4ed0' }, h("tr", { key: '8a6d2344ae8c71c6ef99fd7c19acf508d1b887d2' }, h("th", { key: 'f7f8759feb03389fe61b1d63394c8557c3d0b209' }, "Name"), h("th", { key: '1342f11d5132c84447f32099661d08723eb62ef7' }, "Size"), h("th", { key: '7e041ba0b6515d8c734ebddd418f17173f9361f1' }, "Permissions"), h("th", { key: '05921d3c7bf7e4dd320d1116f451730346a0a148' }, "Owner"), h("th", { key: '0e7b65094f59b7219f2ef4e9ac1ba87969c6078e' }, "Modified"), h("th", { key: '261be85a5ccbce865b09d0cf8276df408af49e14', class: "action-col", "aria-label": "Actions" }))), h("tbody", { key: '04043d8e6d3151d5d1dcf72b67208967dfcd9dfd' }, this.listing.map((item, index) => (h("tr", { key: index, class: {
|
|
918
918
|
'selected': this.is_selected(item),
|
|
919
919
|
}, onClick: () => this.list_directory(item) }, h("td", null, item.kind === 'Folder' ? h("img", { class: "kind", src: folder, alt: "Folder" }) : h("img", { class: "kind", src: file, alt: "File" }), h("span", { class: `name ${item.kind.toLowerCase()}` }, item.name)), h("td", null, this.format_size(item.attributes.size)), h("td", null, this.format_permissions(item.attributes.permissions, item.kind)), h("td", null, item.attributes.user ?? '-'), h("td", null, new Date(item.attributes.modified * 1000).toLocaleString()), h("td", { class: "action-col" }, item.kind === 'File' &&
|
|
920
|
-
h("div", { class: "file-actions" }, h("button", { type: "button", class: "file-action", onClick: (event) => this.on_file_row_action(item, event), title: "Download", "aria-label": "Download" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), h("polyline", { points: "7 10 12 15 17 10" }), h("line", { x1: "12", x2: "12", y1: "15", y2: "3" }))), h("button", { type: "button", class: "file-action delete", onClick: (event) => this.on_file_delete_action(item, event), title: "Delete", "aria-label": "Delete" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("polyline", { points: "3 6 5 6 21 6" }), h("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), h("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), h("line", { x1: "14", x2: "14", y1: "11", y2: "17" }))))))))))), this.show_loader && h("div", { key: '
|
|
921
|
-
h("section", { key: '
|
|
920
|
+
h("div", { class: "file-actions" }, h("button", { type: "button", class: "file-action", onClick: (event) => this.on_file_row_action(item, event), title: "Download", "aria-label": "Download" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), h("polyline", { points: "7 10 12 15 17 10" }), h("line", { x1: "12", x2: "12", y1: "15", y2: "3" }))), h("button", { type: "button", class: "file-action delete", onClick: (event) => this.on_file_delete_action(item, event), title: "Delete", "aria-label": "Delete" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("polyline", { points: "3 6 5 6 21 6" }), h("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), h("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), h("line", { x1: "14", x2: "14", y1: "11", y2: "17" }))))))))))), this.show_loader && h("div", { key: 'a69008f418c1d9afa2e980ada402a80382ea7fec', class: "loader" }, "Loading..."), this.show_error && h("div", { key: '29875e65941130d5fe0f842ebec0685f69769ecf', class: "error" }, this.error_message)), h("footer", { key: '6dc5eff60f9b6acedff8996aa688b450dcaa2eeb' }, h("section", { key: 'cf1dadc5e03c3480b5c3d7c7fe0547ec087d1ce9', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
|
|
921
|
+
h("section", { key: '0d8b86d8b48fee55504f65f3938fa81b59f8b18f', class: {
|
|
922
922
|
'creds': true,
|
|
923
923
|
'blurred': this.show_login_screen,
|
|
924
|
-
} }, h("form", { key: '
|
|
924
|
+
} }, h("form", { key: 'a5e8c4a877b696edad3b4808c2d325c78d1ff169', class: "auth", onSubmit: (event) => {
|
|
925
925
|
const formData = new FormData(event.target);
|
|
926
926
|
let username = undefined;
|
|
927
927
|
if (this.show_login_screen_username) {
|
|
@@ -938,28 +938,28 @@ export class PhirepassSftpClient {
|
|
|
938
938
|
this.show_loader = true;
|
|
939
939
|
event.stopPropagation();
|
|
940
940
|
event.preventDefault();
|
|
941
|
-
} }, h("div", { key: '
|
|
942
|
-
h("div", { key: '
|
|
943
|
-
h("div", { key: '
|
|
944
|
-
h("section", { key: '
|
|
941
|
+
} }, h("div", { key: '1d2790cefa333a230e01b564673d8d1ce76942ca', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
|
|
942
|
+
h("div", { key: 'a2a43e259b11a526cf288dd2ae49c532440d33b4' }, h("label", { key: '95165a92cb5246188fedce9ba20b0f670bd877e5', htmlFor: "username" }, "Username"), h("input", { key: 'ccf925451b36456f24cdbc13fac1b8575a23a804', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
|
|
943
|
+
h("div", { key: '2a3c49b4f0b2a34b6585ef1cf9a4baa52ef7970c' }, h("label", { key: '4c581797a2d16396a1cf1ab2c65cb5a23572f876', htmlFor: "password" }, "Password"), h("input", { key: '757fa564b1097339c84259e1615f03e0511990a5', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), h("div", { key: '219ed5d8d9c13ec4c0e47218170528e8ae0e9b81' }, h("button", { key: 'ea52ade9fef73f167246c437f37e5ee44d8aa881', type: "submit" }, "Connect")))), this.show_upload_modal &&
|
|
944
|
+
h("section", { key: '91be9acc6c829b65a2cb602884a98add1847b915', class: {
|
|
945
945
|
'upload-modal': true,
|
|
946
946
|
'visible': this.show_upload_modal,
|
|
947
|
-
} }, h("div", { key: '
|
|
947
|
+
} }, h("div", { key: '526462f6a166512cbcaeca9acdf02c7352abf720', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, h("div", { key: '1093b566e4103d84c0537ad0a4eee820dff77d5e', class: "title" }, "Uploading File"), h("div", { key: '1f2c1fcaa97653693162073267db16363f578a5e', class: "file-name", title: this.upload_file_name }, this.upload_file_name), h("div", { key: 'c1ee1c778fda4336c462adce90bf194a021af91f', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, h("div", { key: 'ab1a29dc9134eb917e34df41b38e0b936cd7a1dd', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), h("div", { key: 'a84c897deec8cf324c3a29667989b8aaa3540266', class: "progress-meta" }, h("div", { key: '66447fa44ae2cb5995b3fc08c1411aaffd65102a', class: "progress-speed" }, this.upload_speed), h("div", { key: '66d5b6b40e67af836ff61955d46c63033a663305', class: "progress-value" }, this.format_percent(this.upload_progress))), h("button", { key: '1ea99f4cbd0ab4a9972180029865fc99975511fd', type: "button", class: {
|
|
948
948
|
'cancel': true,
|
|
949
949
|
'finished': this.upload_finished,
|
|
950
950
|
}, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
|
|
951
|
-
h("section", { key: '
|
|
951
|
+
h("section", { key: '0da9656501ff93d682a48a8ae58a72555aa6b713', class: {
|
|
952
952
|
'download-modal': true,
|
|
953
953
|
'visible': this.show_download_modal,
|
|
954
|
-
} }, h("div", { key: '
|
|
954
|
+
} }, h("div", { key: '17d3737bd24412e7bd6d35bfb97f53bb5849bb53', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, h("div", { key: '991c82ce3f4fb403f0f308a66a93763df7c840d4', class: "title" }, "Downloading File"), h("div", { key: '0988219f6118e701570a4829e15f1547dd5df3fd', class: "file-name", title: this.download_file_name }, this.download_file_name), h("div", { key: 'afb70a6f0b2215975e21db7258aec3b7cabbbbde', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, h("div", { key: '4223ef43e1b92db4d9b0af4583f545239f8161ca', class: "progress-fill", style: { width: `${this.download_progress}%` } })), h("div", { key: 'e2fbb4ffe05614e3876e4d5ea7d93f677356f43f', class: "progress-meta" }, h("div", { key: 'b20cdf67680d6ecc7590455700506160e0c85cb9', class: "progress-speed" }, this.download_speed), h("div", { key: '7d174465abaf4f384cba6bfa3a5c10adbcc917b7', class: "progress-value" }, this.format_percent(this.download_progress))), h("button", { key: 'ce0c262e02e9295223308c962e923acff8027561', type: "button", class: {
|
|
955
955
|
'cancel': true,
|
|
956
956
|
'finished': this.download_finished,
|
|
957
957
|
}, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
|
|
958
|
-
h("section", { key: '
|
|
958
|
+
h("section", { key: '7adae3f5add735aad8ca7e53e4e4c423ad651b93', class: {
|
|
959
959
|
'delete-modal': true,
|
|
960
960
|
'visible': this.show_delete_modal,
|
|
961
|
-
} }, h("div", { key: '
|
|
962
|
-
h("div", { key: '
|
|
961
|
+
} }, h("div", { key: '3c7bad705431130db785a5ea0589b046ee031a70', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, h("div", { key: '0f1136b5fd29bb9708bbaed48d0ac1e5d19ee942', class: "title" }, "Delete File"), h("div", { key: 'f32cea38c0fdcbba6753598c2bca19fc1907b44b', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), h("div", { key: '2c11182160f49406cdf8573d107e5e9cd7690e4c', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading &&
|
|
962
|
+
h("div", { key: 'bb3e1fbafffce7ea4a1c1e43b32219973b220848', class: "delete-loader", "aria-hidden": "true" }, h("span", { key: '3521881d7325c02ca6624d1f09bc5e4ab05ecdbd', class: "spinner" })), h("div", { key: 'da492d943dbc6a88f58652c1590eb4095cecc833', class: "modal-actions" }, h("button", { key: '136255109de5cd76b8d3067605f1b2214122272d', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), h("button", { key: '750c19696695c581b08b466f19c07947b637b8bf', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
|
|
963
963
|
}
|
|
964
964
|
static get is() { return "phirepass-sftp-client"; }
|
|
965
965
|
static get encapsulation() { return "shadow"; }
|
|
@@ -483,7 +483,7 @@ export class PhirepassTerminal {
|
|
|
483
483
|
this.usernameBuffer = "";
|
|
484
484
|
}
|
|
485
485
|
render() {
|
|
486
|
-
return (h(Host, { key: '
|
|
486
|
+
return (h(Host, { key: '502a46c25541e7b9eea5b716f3806f6045b19049' }, h("div", { key: 'fae18cfb592bcc346e9203f2491fc661bd7bff5a', id: "ccc", ref: el => (this.containerEl = el) })));
|
|
487
487
|
}
|
|
488
488
|
static get is() { return "phirepass-terminal"; }
|
|
489
489
|
static get encapsulation() { return "shadow"; }
|
|
Binary file
|