phirepass-widgets 0.0.81 → 0.0.83
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/{index-D-l8xaCI.js → index-Dtiw2goq.js} +28 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/phirepass-rdp.cjs.entry.js +378 -17
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +18 -18
- package/dist/cjs/phirepass-terminal.cjs.entry.js +3 -3
- package/dist/cjs/phirepass-widgets.cjs.js +2 -2
- package/dist/cjs/{protocol-DS0qXomZ.js → protocol-CLPcBss-.js} +3 -3
- package/dist/collection/components/phirepass-rdp/phirepass-rdp.css +16 -5
- package/dist/collection/components/phirepass-rdp/phirepass-rdp.js +263 -14
- package/dist/collection/components/phirepass-rdp/phirepass-rdp.keyboard.js +88 -0
- package/dist/collection/components/phirepass-rdp/phirepass-rdp.viewport.js +119 -0
- 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/index.js +1 -1
- package/dist/{phirepass-widgets/p-CWIhN33k.js → components/p-B29jN5hK.js} +1 -1
- package/dist/components/phirepass-rdp.js +1 -1
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +2 -2
- package/dist/esm/{index-DovZQ7sb.js → index-Buu-IaNK.js} +28 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/phirepass-rdp.entry.js +378 -17
- package/dist/esm/phirepass-sftp-client.entry.js +18 -18
- package/dist/esm/phirepass-terminal.entry.js +3 -3
- package/dist/esm/phirepass-widgets.js +3 -3
- package/dist/esm/{protocol-CWIhN33k.js → protocol-B29jN5hK.js} +2 -2
- package/dist/phirepass-widgets/{p-19789356.entry.js → p-72791b1f.entry.js} +1 -1
- package/dist/{components/p-CWIhN33k.js → phirepass-widgets/p-B29jN5hK.js} +1 -1
- package/dist/phirepass-widgets/p-Buu-IaNK.js +2 -0
- package/dist/phirepass-widgets/p-b23756c5.entry.js +1 -0
- package/dist/phirepass-widgets/{p-2478a6eb.entry.js → p-ddd48131.entry.js} +2 -2
- package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
- package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
- package/dist/types/components/phirepass-rdp/phirepass-rdp.d.ts +80 -0
- package/dist/types/components/phirepass-rdp/phirepass-rdp.keyboard.d.ts +42 -0
- package/dist/types/components/phirepass-rdp/phirepass-rdp.viewport.d.ts +47 -0
- package/dist/types/components.d.ts +34 -0
- package/package.json +2 -2
- package/dist/phirepass-widgets/p-DovZQ7sb.js +0 -2
- package/dist/phirepass-widgets/p-a5528005.entry.js +0 -1
|
@@ -1,7 +1,216 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-
|
|
2
|
-
import { _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-Buu-IaNK.js';
|
|
2
|
+
import { _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-B29jN5hK.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* RDP's display-control PDU describes a monitor in whole, even pixels within
|
|
6
|
+
* these bounds. A layout outside them is refused by the host rather than
|
|
7
|
+
* negotiated down, and the client reports nothing when that happens — so the
|
|
8
|
+
* clamping has to be done here, before the request leaves.
|
|
9
|
+
*/
|
|
10
|
+
const MIN_DIMENSION = 200;
|
|
11
|
+
const MAX_DIMENSION = 8192;
|
|
12
|
+
/**
|
|
13
|
+
* The size requested at *connect* time travels in the Client Core Data, whose
|
|
14
|
+
* desktop dimensions the protocol caps at 4096 — half what the display-control
|
|
15
|
+
* PDU above allows. A host does not negotiate an out-of-range value down; it
|
|
16
|
+
* drops the connection partway through the sequence, which the client can only
|
|
17
|
+
* report as a truncated stream.
|
|
18
|
+
*/
|
|
19
|
+
const MAX_CONNECT_DIMENSION = 4096;
|
|
20
|
+
/** How long a drag has to settle before the host is asked for a new size. */
|
|
21
|
+
const RESIZE_DEBOUNCE_MS = 250;
|
|
22
|
+
function clamp(value) {
|
|
23
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
24
|
+
return MIN_DIMENSION;
|
|
25
|
+
}
|
|
26
|
+
return Math.min(MAX_DIMENSION, Math.max(MIN_DIMENSION, Math.floor(value)));
|
|
27
|
+
}
|
|
28
|
+
function even(value) {
|
|
29
|
+
return value - (value % 2);
|
|
30
|
+
}
|
|
31
|
+
function clamp_desktop_size(width, height) {
|
|
32
|
+
return { width: even(clamp(width)), height: even(clamp(height)) };
|
|
33
|
+
}
|
|
34
|
+
/** The size the remote desktop would need to be to fill `element` exactly. */
|
|
35
|
+
function measure_desktop_size(element) {
|
|
36
|
+
const rect = element.getBoundingClientRect();
|
|
37
|
+
return clamp_desktop_size(rect.width, rect.height);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The size to open a session at, or `undefined` when the widget has no usable
|
|
41
|
+
* layout yet — in which case the host should choose and [`ViewportSync`] will
|
|
42
|
+
* correct it as soon as the client is visible.
|
|
43
|
+
*
|
|
44
|
+
* This is deliberately not [`measure_desktop_size`]. That function clamps, which
|
|
45
|
+
* is right for a resize — a host asked for something silly should get the
|
|
46
|
+
* nearest legal size — but wrong here, because the widget legitimately measures
|
|
47
|
+
* 0×0 before connecting: it sits in a `display: none` tab, or in a container
|
|
48
|
+
* that has not been laid out, or is simply still hidden. Clamping turns that
|
|
49
|
+
* into a request to open the desktop at 200×200, and "the smallest legal
|
|
50
|
+
* desktop" is not what a zero-sized box meant. Asking for nothing is.
|
|
51
|
+
*/
|
|
52
|
+
function measure_initial_desktop_size(element) {
|
|
53
|
+
const rect = element.getBoundingClientRect();
|
|
54
|
+
if (!Number.isFinite(rect.width) || !Number.isFinite(rect.height)) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
if (rect.width < MIN_DIMENSION || rect.height < MIN_DIMENSION) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
width: even(Math.min(Math.floor(rect.width), MAX_CONNECT_DIMENSION)),
|
|
62
|
+
height: even(Math.min(Math.floor(rect.height), MAX_CONNECT_DIMENSION)),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function same_desktop_size(a, b) {
|
|
66
|
+
return !!a && !!b && a.width === b.width && a.height === b.height;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Reports the widget's size to whoever can act on it, as the widget is resized.
|
|
70
|
+
*
|
|
71
|
+
* Two behaviours are deliberate. It **debounces**, because dragging a panel
|
|
72
|
+
* edge emits a resize per frame while every report costs a display-control
|
|
73
|
+
* round trip to the host — and a host that is still applying one layout ignores
|
|
74
|
+
* the next. And it **drops repeats**, because a resize observer also fires for
|
|
75
|
+
* changes that do not move the desktop at all (a scrollbar appearing, the
|
|
76
|
+
* canvas being re-laid-out in response to the resize this class just asked for,
|
|
77
|
+
* which would otherwise loop).
|
|
78
|
+
*/
|
|
79
|
+
class ViewportSync {
|
|
80
|
+
onResize;
|
|
81
|
+
debounceMs;
|
|
82
|
+
observer;
|
|
83
|
+
handle;
|
|
84
|
+
reported;
|
|
85
|
+
constructor(onResize, debounceMs = RESIZE_DEBOUNCE_MS) {
|
|
86
|
+
this.onResize = onResize;
|
|
87
|
+
this.debounceMs = debounceMs;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Starts watching `element`. The current size is reported immediately, so a
|
|
91
|
+
* widget that was resized while disconnected catches up on reconnect.
|
|
92
|
+
*/
|
|
93
|
+
observe(element) {
|
|
94
|
+
this.disconnect();
|
|
95
|
+
this.report(measure_desktop_size(element));
|
|
96
|
+
// Absent under the spec test environment, and on nothing else worth
|
|
97
|
+
// supporting — a missing observer costs the dynamic resize, not the
|
|
98
|
+
// session.
|
|
99
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
this.observer = new ResizeObserver(() => {
|
|
103
|
+
clearTimeout(this.handle);
|
|
104
|
+
this.handle = setTimeout(() => this.report(measure_desktop_size(element)), this.debounceMs);
|
|
105
|
+
});
|
|
106
|
+
this.observer.observe(element);
|
|
107
|
+
}
|
|
108
|
+
disconnect() {
|
|
109
|
+
clearTimeout(this.handle);
|
|
110
|
+
this.handle = undefined;
|
|
111
|
+
this.observer?.disconnect();
|
|
112
|
+
this.observer = undefined;
|
|
113
|
+
this.reported = undefined;
|
|
114
|
+
}
|
|
115
|
+
report(size) {
|
|
116
|
+
if (same_desktop_size(size, this.reported)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
this.reported = size;
|
|
120
|
+
this.onResize(size);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Keyboard capture for the RDP widget, in two layers.
|
|
126
|
+
*
|
|
127
|
+
* **Ordinary keys** are IronRDP's own doing: it listens on `window` and
|
|
128
|
+
* forwards a key event only while its element is `document.activeElement`. That
|
|
129
|
+
* check is why the client element is mounted in the widget's *light* DOM — see
|
|
130
|
+
* the note on `mount_client` in the component — and why it has to be focused,
|
|
131
|
+
* which `focus_client` below is for.
|
|
132
|
+
*
|
|
133
|
+
* **Keys the browser reserves** (Ctrl+W, Ctrl+T, Ctrl+N, Alt+Tab, F11, Escape)
|
|
134
|
+
* never reach the page at all, so no amount of focus will forward them. The
|
|
135
|
+
* only way to have them is the Keyboard Lock API, and browsers grant that only
|
|
136
|
+
* to a document that is already fullscreen. So "capture my keyboard" is really
|
|
137
|
+
* "go fullscreen, then lock" — hence `toggle_fullscreen`.
|
|
138
|
+
*/
|
|
139
|
+
function keyboard_api() {
|
|
140
|
+
return navigator.keyboard;
|
|
141
|
+
}
|
|
142
|
+
/** Chromium-only at the time of writing; Firefox and Safari have no equivalent. */
|
|
143
|
+
function keyboard_lock_supported() {
|
|
144
|
+
return typeof keyboard_api()?.lock === 'function';
|
|
145
|
+
}
|
|
146
|
+
/** Strictly this element — what deciding whether to enter or exit turns on. */
|
|
147
|
+
function is_fullscreen(element) {
|
|
148
|
+
return document.fullscreenElement === element;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* This element *or* something around it. The lock is granted per document, so
|
|
152
|
+
* a host app that made a whole panel fullscreen should get it too.
|
|
153
|
+
*/
|
|
154
|
+
function shown_fullscreen(element) {
|
|
155
|
+
return document.fullscreenElement?.contains(element) ?? false;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Takes every key the browser is willing to give up. Called with no arguments
|
|
159
|
+
* `lock()` claims the lot, including Escape — which is also the key that leaves
|
|
160
|
+
* fullscreen, so the browser substitutes a press-and-hold gesture for it.
|
|
161
|
+
*/
|
|
162
|
+
async function lock_keyboard(element) {
|
|
163
|
+
// There is no capability query, and the request rejects outside fullscreen,
|
|
164
|
+
// so the caller's state is the only guard available.
|
|
165
|
+
if (!keyboard_lock_supported() || !shown_fullscreen(element)) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
try {
|
|
169
|
+
await keyboard_api().lock();
|
|
170
|
+
}
|
|
171
|
+
catch (err) {
|
|
172
|
+
console.warn('Failed to lock the keyboard for the RDP session:', err);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function unlock_keyboard() {
|
|
176
|
+
if (!keyboard_lock_supported()) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
try {
|
|
180
|
+
keyboard_api().unlock();
|
|
181
|
+
}
|
|
182
|
+
catch (err) {
|
|
183
|
+
console.warn('Failed to release the keyboard lock:', err);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/** Returns whether `element` is fullscreen once the request has settled. */
|
|
187
|
+
async function toggle_fullscreen(element) {
|
|
188
|
+
try {
|
|
189
|
+
if (is_fullscreen(element)) {
|
|
190
|
+
await document.exitFullscreen();
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
await element.requestFullscreen({ navigationUI: 'hide' });
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
catch (err) {
|
|
197
|
+
console.warn('Failed to change the fullscreen state of the RDP session:', err);
|
|
198
|
+
return is_fullscreen(element);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Gives the client element focus so IronRDP starts forwarding keys.
|
|
203
|
+
*
|
|
204
|
+
* The element's shadow root is opened with `delegatesFocus`, so focusing the
|
|
205
|
+
* host lands on the canvas inside it; the canvas is what IronRDP watches. Doing
|
|
206
|
+
* this on connect saves the user the mouse-over that would otherwise be needed
|
|
207
|
+
* before the first keystroke lands.
|
|
208
|
+
*/
|
|
209
|
+
function focus_client(element) {
|
|
210
|
+
element?.focus({ preventScroll: true });
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const phirepassRdpCss = () => `:host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021}.screen{width:100%;height:100%;display:flex}::slotted(iron-remote-desktop){display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}:host(:fullscreen){width:100vw;height:100vh;background:#000}.prompt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.875rem}.prompt input{padding:0.5rem 0.75rem;border:1px solid #334155;border-radius:0.375rem;background:#0f172a;color:inherit;font:inherit;min-width:16rem}.prompt input:focus{outline:2px solid #67e8f9;outline-offset:1px}.prompt button{margin-top:0.5rem;padding:0.5rem 1.25rem;border:0;border-radius:0.375rem;background:#67e8f9;color:#0b1021;font:inherit;font-weight:600;cursor:pointer}.status{position:absolute;inset-inline:0;bottom:0;padding:0.5rem 0.75rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.8125rem;text-align:center}`;
|
|
5
214
|
|
|
6
215
|
const PhirepassRdp = class {
|
|
7
216
|
constructor(hostRef) {
|
|
@@ -12,10 +221,13 @@ const PhirepassRdp = class {
|
|
|
12
221
|
containerEl;
|
|
13
222
|
ironEl;
|
|
14
223
|
userInteraction;
|
|
224
|
+
viewport;
|
|
15
225
|
domReady = false;
|
|
16
226
|
runtimeReady = false;
|
|
17
227
|
connected = false;
|
|
228
|
+
disposed = false;
|
|
18
229
|
session_id;
|
|
230
|
+
onFullscreenChange = () => this.sync_keyboard_lock();
|
|
19
231
|
/** Credentials in force for this session, from props or from the prompt. */
|
|
20
232
|
credentials;
|
|
21
233
|
credentialsPrompt = false;
|
|
@@ -50,6 +262,26 @@ const PhirepassRdp = class {
|
|
|
50
262
|
destination;
|
|
51
263
|
/** `fit` scales the desktop to the widget, `real` keeps 1:1 pixels. */
|
|
52
264
|
scale = 'fit';
|
|
265
|
+
/**
|
|
266
|
+
* Ask the remote host to change its resolution to match the widget whenever
|
|
267
|
+
* the widget is resized, so the desktop is rendered at native size rather
|
|
268
|
+
* than scaled.
|
|
269
|
+
*
|
|
270
|
+
* The host has the last word: this needs the display-control channel, and a
|
|
271
|
+
* host that does not offer it simply keeps the resolution it started with —
|
|
272
|
+
* which `scale` then fits into the widget, as before.
|
|
273
|
+
*/
|
|
274
|
+
dynamicResize = true;
|
|
275
|
+
/**
|
|
276
|
+
* While the widget is fullscreen, take the keys the browser normally keeps
|
|
277
|
+
* for itself (Ctrl+W, Ctrl+T, Alt+Tab, F11) and send them to the remote
|
|
278
|
+
* host instead. Escape is taken too, so leaving fullscreen becomes a
|
|
279
|
+
* press-and-hold.
|
|
280
|
+
*
|
|
281
|
+
* Ordinary keys do not depend on this — they are forwarded whenever the
|
|
282
|
+
* desktop has focus.
|
|
283
|
+
*/
|
|
284
|
+
captureKeyboard = true;
|
|
53
285
|
onNodeIdChange(newValue, _oldValue) {
|
|
54
286
|
this.reset_session_state();
|
|
55
287
|
if (this.channel && this.channel.is_connected()) {
|
|
@@ -76,6 +308,10 @@ const PhirepassRdp = class {
|
|
|
76
308
|
return `${protocol}://${this.serverHost}:${this.serverPort}`;
|
|
77
309
|
}
|
|
78
310
|
async connectedCallback() {
|
|
311
|
+
document.addEventListener('fullscreenchange', this.onFullscreenChange);
|
|
312
|
+
// A widget can be moved in the DOM rather than destroyed, which
|
|
313
|
+
// disconnects and reconnects it; the second life is a real one.
|
|
314
|
+
this.disposed = false;
|
|
79
315
|
await __wbg_init();
|
|
80
316
|
this.open_comms();
|
|
81
317
|
this.runtimeReady = true;
|
|
@@ -89,12 +325,42 @@ const PhirepassRdp = class {
|
|
|
89
325
|
this.domReady = true;
|
|
90
326
|
this.try_connect();
|
|
91
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* Closing an RDP tab unmounts the widget, and this is the only notice we
|
|
330
|
+
* get. Everything the session is made of has to go with it — including the
|
|
331
|
+
* parts that are still being built: the tunnel can be authorised, or the RDP
|
|
332
|
+
* client's own WebSocket already open, while the modules it needs are still
|
|
333
|
+
* loading. `disposed` is what those in-flight steps check before carrying
|
|
334
|
+
* on, and clearing `session_id` invalidates any answer still on its way.
|
|
335
|
+
*/
|
|
92
336
|
async disconnectedCallback() {
|
|
337
|
+
document.removeEventListener('fullscreenchange', this.onFullscreenChange);
|
|
338
|
+
this.disposed = true;
|
|
339
|
+
this.session_id = undefined;
|
|
93
340
|
this.connected = false;
|
|
94
341
|
this.domReady = false;
|
|
95
342
|
this.runtimeReady = false;
|
|
96
343
|
this.close_comms();
|
|
97
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* Puts the widget in and out of fullscreen, returning the state it settled
|
|
347
|
+
* in. Fullscreen is also what makes `captureKeyboard` possible, so a host
|
|
348
|
+
* app wanting the browser's own shortcuts to reach the remote desktop has
|
|
349
|
+
* to come through here.
|
|
350
|
+
*/
|
|
351
|
+
async toggleFullscreen() {
|
|
352
|
+
const fullscreen = await toggle_fullscreen(this.el);
|
|
353
|
+
this.focus_desktop();
|
|
354
|
+
return fullscreen;
|
|
355
|
+
}
|
|
356
|
+
/** Whether the browser can hand over its reserved keys at all. */
|
|
357
|
+
async keyboardLockSupported() {
|
|
358
|
+
return keyboard_lock_supported();
|
|
359
|
+
}
|
|
360
|
+
/** Directs keystrokes at the remote desktop without waiting for a click. */
|
|
361
|
+
async focusDesktop() {
|
|
362
|
+
this.focus_desktop();
|
|
363
|
+
}
|
|
98
364
|
try_connect() {
|
|
99
365
|
if (this.connected || !this.domReady || !this.runtimeReady) {
|
|
100
366
|
return;
|
|
@@ -202,11 +468,11 @@ const PhirepassRdp = class {
|
|
|
202
468
|
import('@devolutions/iron-remote-desktop'),
|
|
203
469
|
]);
|
|
204
470
|
// The element may have gone away while the modules were loading.
|
|
205
|
-
if (!this.containerEl || this.session_id !== web.sid) {
|
|
471
|
+
if (this.disposed || !this.containerEl || this.session_id !== web.sid) {
|
|
206
472
|
return;
|
|
207
473
|
}
|
|
208
474
|
await backend.init('info');
|
|
209
|
-
if (!this.containerEl || this.session_id !== web.sid) {
|
|
475
|
+
if (this.disposed || !this.containerEl || this.session_id !== web.sid) {
|
|
210
476
|
return;
|
|
211
477
|
}
|
|
212
478
|
// Built imperatively rather than in `render()` so `module` is set
|
|
@@ -221,23 +487,63 @@ const PhirepassRdp = class {
|
|
|
221
487
|
void this.start_session(detail.irgUserInteraction, web.ticket, backend.enableCredssp(true));
|
|
222
488
|
});
|
|
223
489
|
this.ironEl = element;
|
|
224
|
-
this.
|
|
490
|
+
this.mount_client(element);
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Mounts the client in the widget's **light** DOM, slotted into `.screen`,
|
|
494
|
+
* rather than as a child of the shadow root.
|
|
495
|
+
*
|
|
496
|
+
* This is what makes the keyboard work. IronRDP forwards a key event only
|
|
497
|
+
* while `document.activeElement` is its own element, and `activeElement`
|
|
498
|
+
* retargets focus to the outermost shadow host: with the client inside this
|
|
499
|
+
* widget's shadow root the answer is always `<phirepass-rdp>`, the check
|
|
500
|
+
* never passes, and not one keystroke reaches the remote host — while the
|
|
501
|
+
* mouse, which is bound to the canvas directly, works fine. Slotting the
|
|
502
|
+
* client leaves it in the document tree, so `activeElement` resolves to the
|
|
503
|
+
* client itself.
|
|
504
|
+
*/
|
|
505
|
+
mount_client(element) {
|
|
506
|
+
this.el.appendChild(element);
|
|
225
507
|
}
|
|
226
508
|
async start_session(userInteraction, ticket, credssp) {
|
|
227
509
|
this.userInteraction = userInteraction;
|
|
228
|
-
const
|
|
510
|
+
const builder = userInteraction
|
|
229
511
|
.configBuilder()
|
|
230
512
|
.withUsername(this.credentials?.username ?? '')
|
|
231
513
|
.withPassword(this.credentials?.password ?? '')
|
|
232
514
|
.withDestination(this.destination ?? this.nodeId)
|
|
233
515
|
.withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`)
|
|
234
516
|
.withAuthToken(ticket)
|
|
235
|
-
.withExtension(credssp)
|
|
236
|
-
|
|
517
|
+
.withExtension(credssp);
|
|
518
|
+
// Asking for the widget's size up front saves the remote host a
|
|
519
|
+
// resolution change immediately after logon — but only when the widget
|
|
520
|
+
// has been laid out. An unmeasurable widget asks for nothing and lets
|
|
521
|
+
// `start_viewport_sync` correct the size once the client is visible;
|
|
522
|
+
// sending a size derived from a zero-sized box is how a host ends up
|
|
523
|
+
// refusing the connection outright.
|
|
524
|
+
if (this.dynamicResize) {
|
|
525
|
+
const size = measure_initial_desktop_size(this.el);
|
|
526
|
+
if (size) {
|
|
527
|
+
builder.withDesktopSize(size);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
237
530
|
try {
|
|
238
|
-
const session = await userInteraction.connect(
|
|
531
|
+
const session = await userInteraction.connect(builder.build());
|
|
532
|
+
// The tab can be closed while this handshake is in flight. The
|
|
533
|
+
// session owns the RDP WebSocket and nothing else can close it, so
|
|
534
|
+
// the socket is only released by letting the session loop start and
|
|
535
|
+
// see the shutdown it was already handed — terminate first, then
|
|
536
|
+
// run, and never make the widget visible.
|
|
537
|
+
if (this.disposed) {
|
|
538
|
+
this.shutdown_session(userInteraction);
|
|
539
|
+
await session.run();
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
239
542
|
userInteraction.setVisibility(true);
|
|
240
543
|
this.statusMessage = undefined;
|
|
544
|
+
this.focus_desktop();
|
|
545
|
+
this.start_viewport_sync();
|
|
546
|
+
void this.sync_keyboard_lock();
|
|
241
547
|
const termination = await session.run();
|
|
242
548
|
this.statusMessage = termination.reason();
|
|
243
549
|
}
|
|
@@ -247,6 +553,51 @@ const PhirepassRdp = class {
|
|
|
247
553
|
this.connectionStateChanged.emit([ConnectionState.Error, err]);
|
|
248
554
|
}
|
|
249
555
|
}
|
|
556
|
+
/**
|
|
557
|
+
* Keeps the remote resolution equal to the widget's size.
|
|
558
|
+
*
|
|
559
|
+
* `setVisibility(true)` is what gives the widget its layout, so the first
|
|
560
|
+
* measurement has to happen after it — measuring earlier reads a hidden,
|
|
561
|
+
* zero-sized box.
|
|
562
|
+
*/
|
|
563
|
+
start_viewport_sync() {
|
|
564
|
+
if (!this.dynamicResize) {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
this.viewport = new ViewportSync((size) => this.resize_desktop(size));
|
|
568
|
+
this.viewport.observe(this.el);
|
|
569
|
+
}
|
|
570
|
+
stop_viewport_sync() {
|
|
571
|
+
this.viewport?.disconnect();
|
|
572
|
+
this.viewport = undefined;
|
|
573
|
+
}
|
|
574
|
+
resize_desktop(size) {
|
|
575
|
+
try {
|
|
576
|
+
this.userInteraction?.resize(size.width, size.height);
|
|
577
|
+
}
|
|
578
|
+
catch (err) {
|
|
579
|
+
// A host without the display-control channel refuses the request;
|
|
580
|
+
// the session carries on at the resolution it already has.
|
|
581
|
+
console.warn('The remote host would not resize its desktop:', err);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
focus_desktop() {
|
|
585
|
+
focus_client(this.ironEl);
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Holds the keyboard lock exactly while the widget is fullscreen. Both
|
|
589
|
+
* edges matter: the browser drops the lock on its own when fullscreen ends,
|
|
590
|
+
* but not when the session does, and a lock left behind would keep
|
|
591
|
+
* swallowing shortcuts for the rest of the page.
|
|
592
|
+
*/
|
|
593
|
+
async sync_keyboard_lock() {
|
|
594
|
+
if (!this.captureKeyboard || !shown_fullscreen(this.el)) {
|
|
595
|
+
unlock_keyboard();
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
await lock_keyboard(this.el);
|
|
599
|
+
this.focus_desktop();
|
|
600
|
+
}
|
|
250
601
|
/** IronRDP rejects with its own error shape rather than an `Error`. */
|
|
251
602
|
describe_error(err) {
|
|
252
603
|
const iron = err;
|
|
@@ -265,14 +616,24 @@ const PhirepassRdp = class {
|
|
|
265
616
|
this.statusMessage = error.message;
|
|
266
617
|
this.connectionStateChanged.emit([ConnectionState.Error, error]);
|
|
267
618
|
}
|
|
619
|
+
/**
|
|
620
|
+
* Asks the RDP client to end its session, which is also what closes the
|
|
621
|
+
* socket it opened. Failing here is not worth propagating: the caller is
|
|
622
|
+
* already tearing the widget down and has nothing else to try.
|
|
623
|
+
*/
|
|
624
|
+
shutdown_session(userInteraction) {
|
|
625
|
+
try {
|
|
626
|
+
userInteraction.shutdown();
|
|
627
|
+
}
|
|
628
|
+
catch (err) {
|
|
629
|
+
console.warn('Failed to shut the RDP session down cleanly:', err);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
268
632
|
teardown_client() {
|
|
633
|
+
this.stop_viewport_sync();
|
|
634
|
+
unlock_keyboard();
|
|
269
635
|
if (this.userInteraction) {
|
|
270
|
-
|
|
271
|
-
this.userInteraction.shutdown();
|
|
272
|
-
}
|
|
273
|
-
catch (err) {
|
|
274
|
-
console.warn('Failed to shut the RDP session down cleanly:', err);
|
|
275
|
-
}
|
|
636
|
+
this.shutdown_session(this.userInteraction);
|
|
276
637
|
this.userInteraction = undefined;
|
|
277
638
|
}
|
|
278
639
|
this.ironEl?.remove();
|
|
@@ -290,7 +651,7 @@ const PhirepassRdp = class {
|
|
|
290
651
|
this.request_tunnel();
|
|
291
652
|
}
|
|
292
653
|
render() {
|
|
293
|
-
return (h(Host, { key: '
|
|
654
|
+
return (h(Host, { key: '892fd55fb84abf180866dd7af4e44adc9c23f338' }, h("div", { key: 'fd6ac08295b6ce9e3bd3932abea271c9c6fc8a00', class: "screen", ref: (el) => (this.containerEl = el) }, h("slot", { key: 'b9240f804177898f29598b0c7ec7b4f4d2e8d6c6' })), this.credentialsPrompt && (h("form", { key: '49ce099f575a30c0bb326a64de74d30cf599418f', class: "prompt", onSubmit: (event) => this.submit_credentials(event) }, h("label", { key: '1a12eb01993f858bbbc2498cc8d896b1dd1dbf88', htmlFor: "rdp-username" }, "Windows username"), h("input", { key: '79c8482390211b3ba3d253e8485e7895fc52b393', id: "rdp-username", type: "text", autocomplete: "username", autofocus: true, onInput: (event) => (this.usernameBuffer = event.target.value) }), h("label", { key: '3c07473b2d85ddb4e13a45f3d771b23749570c2e', htmlFor: "rdp-password" }, "Password"), h("input", { key: '8740ab5c45186bac0f452931d9e6ccec6c4fdeab', id: "rdp-password", type: "password", autocomplete: "current-password", onInput: (event) => (this.passwordBuffer = event.target.value) }), h("button", { key: 'df366feb5122cd0bcf0d0a07a034f18302e0f9e3', type: "submit" }, "Connect"))), this.statusMessage && !this.credentialsPrompt && (h("div", { key: '1823a89de1c881121fa8dee61af053ff1ac3e5e3', class: "status" }, this.statusMessage))));
|
|
294
655
|
}
|
|
295
656
|
static get watchers() { return {
|
|
296
657
|
"nodeId": [{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
2
|
-
import { _ as __wbg_init, E as ErrorType, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-Buu-IaNK.js';
|
|
2
|
+
import { _ as __wbg_init, E as ErrorType, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-B29jN5hK.js';
|
|
3
3
|
|
|
4
4
|
const phirepassSftpClientLogoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==';
|
|
5
5
|
|
|
@@ -924,18 +924,18 @@ const PhirepassSftpClient = class {
|
|
|
924
924
|
return `${typeChar}${chars.join('')}`;
|
|
925
925
|
}
|
|
926
926
|
render() {
|
|
927
|
-
return (h(Host, { key: '
|
|
927
|
+
return (h(Host, { key: '6f830eb2cea173cb081eabdd7d3d418e8c831b4a', class: {
|
|
928
928
|
'default': !this.max,
|
|
929
929
|
'max': this.max,
|
|
930
|
-
} }, h("section", { key: '
|
|
931
|
-
h("header", { key: '
|
|
930
|
+
} }, h("section", { key: '0c028222f80a6783f4f457dd9dbb4f276c7e75cc', class: "listing" }, !this.hideHeader &&
|
|
931
|
+
h("header", { key: 'bf4260a4f13173ff003885c39167177c17fb138f' }, h("section", { key: '6025f57ee11cda79928158fc86be88588aeda5c1', class: "title" }, h("img", { key: '1a1fc770118c2d1c027248b65c110ad948ce5860', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), h("div", { key: '5c71b597edfd27b5d79966281cada602604ed849', class: "text" }, h("div", { key: '600e8073d2d240cb599a76426a296a396201f70e', class: "name" }, this.name), h("div", { key: '6d40ba59e26818071ab0f110651c8da1cbe8794c', class: "description" }, this.description))), h("section", { key: 'a90afbb3729ac3dc40cc16eda959a5b9028a14f3', class: "actions" }, h("div", { key: '97b8b948b8bbe521cfbc91279e84ccc9e9c5b151', class: "action", onClick: () => this.toggle_max() }, h("img", { key: '6f7881d837d5b5e4f79d1dead0d53df733205899', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), h("main", { key: '58db45bcafab4c55e257831e9693591724fc9848' }, this.show_navigation && h("nav", { key: '9b0c06d3afd36a32845334375c0ec0f0f4e363ea', class: "navigation" }, h("div", { key: '5b84ca2d3a55afb383fe27ed9b955d24560b0283', 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: phirepassSftpClientChevronSvg }))))), h("section", { key: '66dd6ce5d4d85c089a869a371208c98582a33e87', class: "actions", "aria-label": "SFTP actions" }, h("button", { key: '105c5d93be38f4ceb1da058f5f57855decf3aa8f', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, h("img", { key: '8b425e80e9aa707607822b9e4ae3828ae01e4202', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), h("button", { key: 'd0f01c462c3e6f52155e1307f048c5027202819b', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, h("img", { key: '11e66f738f80032018bbe796eb8f7f42001f4b5f', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), h("button", { key: 'a39aed27376480e5e2dc68fc4b1ef57b8c4b0b40', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, h("img", { key: 'fac80ba8c1283eed058e017efc45904658f91f43', src: phirepassSftpClientUploadSvg, alt: "Upload" })), h("button", { key: '281854c1ac21ac8be51a22da7a5e6ac7f902f74b', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), h("input", { key: '9daf263acc61a2241c10817056cdb3cd8da81c9e', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && h("div", { key: '6611808a8f69b06bb66e2b7e82bb06e0c6469d18', class: "content" }, h("table", { key: '46d758f6b01f1e48acf99d0b797c5ec538717ea0' }, h("thead", { key: '7f3b4f05a2538d20efd43d21ec2d425a286d1b35' }, h("tr", { key: 'b9c8584bc98a5e9d24fd17346e325ccf511a109c' }, h("th", { key: '93220b4f6a1f7a7ca79978f8a98fb7218eb4a353' }, "Name"), h("th", { key: 'a25c5948ab02ed467ba4f71314f5ebb0756e7678' }, "Size"), h("th", { key: '27f32a431f5e20b4331b79ae358d7a077681a548' }, "Permissions"), h("th", { key: 'a3ae189c7161a3237dd2f07c50a965a0b5a51058' }, "Owner"), h("th", { key: 'ddc31efb5d7d3746875590ef4e52dd61375f963c' }, "Modified"), h("th", { key: '590b952ac4c16a9abdb4bcce432818ef9ddb1687', class: "action-col", "aria-label": "Actions" }))), h("tbody", { key: '5a35c2357ad4ff9e99dcd499ec894bc89466b4ba' }, this.listing.map((item, index) => (h("tr", { key: index, class: {
|
|
932
932
|
'selected': this.is_selected(item),
|
|
933
933
|
}, onClick: () => this.list_directory(item) }, h("td", null, item.kind === 'Folder' ? h("img", { class: "kind", src: phirepassSftpClientFolderSvg, alt: "Folder" }) : h("img", { class: "kind", src: phirepassSftpClientFileSvg, 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' &&
|
|
934
|
-
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: '
|
|
935
|
-
h("section", { key: '
|
|
934
|
+
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: '137cf80c05c6fa389cf9bd3bd9003d8f4796419b', class: "loader" }, "Loading..."), this.show_error && h("div", { key: '1ba1fad888b61e18f6dfb2bcbd7bd22e0f911c6c', class: "error" }, this.error_message)), h("footer", { key: '247a9ed330ff6f465cca3cae91dd045f1183d6d4' }, h("section", { key: '16691e17293b7f2181d080ecb68f283110b5a887', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
|
|
935
|
+
h("section", { key: '8df665b59da590cd5a4c684a9eb3a772f9265cbb', class: {
|
|
936
936
|
'creds': true,
|
|
937
937
|
'blurred': this.show_login_screen,
|
|
938
|
-
} }, h("form", { key: '
|
|
938
|
+
} }, h("form", { key: 'efffd5be69a1ac3f2df26c174be2ebb6aa989850', class: "auth", onSubmit: (event) => {
|
|
939
939
|
const formData = new FormData(event.target);
|
|
940
940
|
let username = undefined;
|
|
941
941
|
if (this.show_login_screen_username) {
|
|
@@ -952,28 +952,28 @@ const PhirepassSftpClient = class {
|
|
|
952
952
|
this.show_loader = true;
|
|
953
953
|
event.stopPropagation();
|
|
954
954
|
event.preventDefault();
|
|
955
|
-
} }, h("div", { key: '
|
|
956
|
-
h("div", { key: '
|
|
957
|
-
h("div", { key: '
|
|
958
|
-
h("section", { key: '
|
|
955
|
+
} }, h("div", { key: '6ece35409f1cb33e953857e908b5c251265f9b7a', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
|
|
956
|
+
h("div", { key: 'd2e6a109f1d68ffb21fd709f9f761b7a097973ce' }, h("label", { key: 'df54f92649e1e3535b368bcbdb53e2061e008d9d', htmlFor: "username" }, "Username"), h("input", { key: '09724a6b262408825babdf1855daf97dd6e48274', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
|
|
957
|
+
h("div", { key: 'b67d7fdf364616217cf0fe7493db87f368a0e00b' }, h("label", { key: '1a4f81e403e8048980848a22753dff7922a25eb8', htmlFor: "password" }, "Password"), h("input", { key: 'd7a806e065f81c07a682d0ace085dd80f96bb2e2', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), h("div", { key: 'eb184e90d5a99411c0c68c63c0f58b74e2b3a454' }, h("button", { key: '92014931e757553af1fc785fa89dc859fed6421d', type: "submit" }, "Connect")))), this.show_upload_modal &&
|
|
958
|
+
h("section", { key: 'b730e0680f0e5325f506104438e30e9f3dc6ec18', class: {
|
|
959
959
|
'upload-modal': true,
|
|
960
960
|
'visible': this.show_upload_modal,
|
|
961
|
-
} }, h("div", { key: '
|
|
961
|
+
} }, h("div", { key: '80205240d2af805bede0d6d42ffefad176d0b6f6', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, h("div", { key: 'ee11974c49a3597eaee6b588c328c5d77659c2b4', class: "title" }, "Uploading File"), h("div", { key: 'cf24d8f350325bf9cd6f128dc5ad2b2467ff4adb', class: "file-name", title: this.upload_file_name }, this.upload_file_name), h("div", { key: 'e36c4cf5785166c1d9b5121066210d87cc09d4e5', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, h("div", { key: 'f1db022f2d3fb92fb9686d50e4aa0366e80da8ca', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), h("div", { key: '515bdf6caf6a3d0c04badc923bc8a1f24d388cfe', class: "progress-meta" }, h("div", { key: '00935d340635aaa36004444b627e25732f7c17ab', class: "progress-speed" }, this.upload_speed), h("div", { key: '369e5c294ac99e1f25fceb3575838e50ce5c0cb4', class: "progress-value" }, this.format_percent(this.upload_progress))), h("button", { key: 'c9694acf8f7cb316a9e60bf33c80279fba7f3676', type: "button", class: {
|
|
962
962
|
'cancel': true,
|
|
963
963
|
'finished': this.upload_finished,
|
|
964
964
|
}, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
|
|
965
|
-
h("section", { key: '
|
|
965
|
+
h("section", { key: 'c54157cf02112940304bd5d107e442626cbc3a3a', class: {
|
|
966
966
|
'download-modal': true,
|
|
967
967
|
'visible': this.show_download_modal,
|
|
968
|
-
} }, h("div", { key: '
|
|
968
|
+
} }, h("div", { key: '51cc07975f3cb4d8d5dd29a457a2cb56d58c2bc3', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, h("div", { key: 'fa15597119c5656530b136a0796ba498d05f7ba3', class: "title" }, "Downloading File"), h("div", { key: 'a12e3b257a91a30323c018dcd0117ddcfde7ec9d', class: "file-name", title: this.download_file_name }, this.download_file_name), h("div", { key: '788db1afcf3506ee26dc7965060b5213b1285379', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, h("div", { key: '9842d1e20a24bcbb5185918b2373818414a86bb6', class: "progress-fill", style: { width: `${this.download_progress}%` } })), h("div", { key: '26347a189b2fc3b0594a548cb15aeaa6e1ca2901', class: "progress-meta" }, h("div", { key: 'c2acfab8ec6d6c74df299f7b7b1f8bdcb88702db', class: "progress-speed" }, this.download_speed), h("div", { key: '853c8b4b8fb5d9d13cd5c654bfdeda02b4f4e097', class: "progress-value" }, this.format_percent(this.download_progress))), h("button", { key: '40a339398d29082b1532cd1d13fec2027a5c0c84', type: "button", class: {
|
|
969
969
|
'cancel': true,
|
|
970
970
|
'finished': this.download_finished,
|
|
971
971
|
}, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
|
|
972
|
-
h("section", { key: '
|
|
972
|
+
h("section", { key: '07ca147451fe3063aa418ee46af09d5d037752cc', class: {
|
|
973
973
|
'delete-modal': true,
|
|
974
974
|
'visible': this.show_delete_modal,
|
|
975
|
-
} }, h("div", { key: '
|
|
976
|
-
h("div", { key: '
|
|
975
|
+
} }, h("div", { key: '5c11193b4808d43d33151cb5eebf8efa54ec75bd', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, h("div", { key: '858d54eddbb5ed0b72176494ac515fc4c7b16dfc', class: "title" }, "Delete File"), h("div", { key: 'df347ceded9b6e8b44285e0b4122cd363c2504a2', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), h("div", { key: 'c547c48ba66daabb9bed82d220d87b8b0eef25b3', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading &&
|
|
976
|
+
h("div", { key: 'a3fd5cf9a93a5d2937a10d8333bb2dd6abe73254', class: "delete-loader", "aria-hidden": "true" }, h("span", { key: 'ca4414ae7183139b1ff8b36630e330f05896c0fd', class: "spinner" })), h("div", { key: 'e229b2804e7cbed6edbbd1b6542b7a33ac1c0575', class: "modal-actions" }, h("button", { key: 'eedf2e90f7896fcce7db6bad995c890d79ec9361', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), h("button", { key: '010e0b6468eb7522f7131e2a37d4b25fad828837', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
|
|
977
977
|
}
|
|
978
978
|
static get watchers() { return {
|
|
979
979
|
"nodeId": [{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, g as getElement, h as h$1, H as Host } from './index-
|
|
2
|
-
import { I as InputMode, _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType, E as ErrorType } from './protocol-
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement, h as h$1, H as Host } from './index-Buu-IaNK.js';
|
|
2
|
+
import { I as InputMode, _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType, E as ErrorType } from './protocol-B29jN5hK.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
@@ -693,7 +693,7 @@ const PhirepassTerminal = class {
|
|
|
693
693
|
this.usernameBuffer = "";
|
|
694
694
|
}
|
|
695
695
|
render() {
|
|
696
|
-
return (h$1(Host, { key: '
|
|
696
|
+
return (h$1(Host, { key: '5e05e1ea65ffcaa21b3e819008fa5c7d7949d15d' }, h$1("div", { key: '9b8b336caff03d4456bc072ecaaa490325089ced', id: "ccc", ref: el => (this.containerEl = el) })));
|
|
697
697
|
}
|
|
698
698
|
static get watchers() { return {
|
|
699
699
|
"nodeId": [{
|