phirepass-widgets 0.0.62 → 0.0.64
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/phirepass-sftp-client.cjs.entry.js +23 -31
- package/dist/cjs/phirepass-terminal.cjs.entry.js +1 -1
- package/dist/cjs/{protocol-DyJEM8Jw.js → protocol-BdryFC2F.js} +21 -7
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +22 -30
- package/dist/collection/phirepass-channel_bg.wasm +0 -0
- package/dist/components/p-DdpMFZgO.js +1 -0
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +1 -1
- package/dist/esm/phirepass-sftp-client.entry.js +23 -31
- package/dist/esm/phirepass-terminal.entry.js +1 -1
- package/dist/esm/{protocol-LG7CaFKT.js → protocol-DdpMFZgO.js} +20 -6
- package/dist/phirepass-widgets/{p-72195aec.entry.js → p-01d1a490.entry.js} +1 -1
- package/dist/phirepass-widgets/p-DdpMFZgO.js +1 -0
- package/dist/phirepass-widgets/p-c55b1d98.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/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +0 -1
- package/package.json +3 -3
- package/dist/components/p-LG7CaFKT.js +0 -1
- package/dist/phirepass-widgets/p-12b2e978.entry.js +0 -1
- package/dist/phirepass-widgets/p-LG7CaFKT.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-D-l8xaCI.js');
|
|
4
|
-
var protocol = require('./protocol-
|
|
4
|
+
var protocol = require('./protocol-BdryFC2F.js');
|
|
5
5
|
|
|
6
6
|
const phirepassSftpClientLogoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==';
|
|
7
7
|
|
|
@@ -424,14 +424,6 @@ const PhirepassSftpClient = class {
|
|
|
424
424
|
});
|
|
425
425
|
this.pendingDownloadStarts.delete(web.msg_id);
|
|
426
426
|
}
|
|
427
|
-
request_next_download_chunk(msgId) {
|
|
428
|
-
const download = this.activeDownloads.get(msgId);
|
|
429
|
-
if (!download || !this.session_id) {
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
this.channel.send_sftp_download_chunk(this.nodeId, this.session_id, download.download_id, download.nextChunkToRequest, msgId);
|
|
433
|
-
download.nextChunkToRequest += 1;
|
|
434
|
-
}
|
|
435
427
|
finalize_download(msgId) {
|
|
436
428
|
const download = this.activeDownloads.get(msgId);
|
|
437
429
|
if (!download) {
|
|
@@ -463,18 +455,19 @@ const PhirepassSftpClient = class {
|
|
|
463
455
|
return;
|
|
464
456
|
}
|
|
465
457
|
const download = this.activeDownloads.get(web.msg_id);
|
|
466
|
-
if (!download) {
|
|
458
|
+
if (!download || !this.session_id) {
|
|
467
459
|
return;
|
|
468
460
|
}
|
|
469
461
|
const chunkData = new Uint8Array(web.chunk.data);
|
|
470
462
|
download.chunks.set(web.chunk.chunk_index, chunkData);
|
|
471
463
|
const receivedBytes = Array.from(download.chunks.values()).reduce((sum, data) => sum + data.length, 0);
|
|
472
464
|
this.update_download_progress(receivedBytes, download.total_size, download.startTime);
|
|
465
|
+
// Pipeline ACK: advance the agent's sliding window so it can push the next
|
|
466
|
+
// batch of chunks without waiting for an explicit per-chunk request.
|
|
467
|
+
this.channel.send_sftp_download_ack(this.nodeId, this.session_id, download.download_id, web.chunk.chunk_index);
|
|
473
468
|
if (download.chunks.size >= download.total_chunks) {
|
|
474
469
|
this.finalize_download(web.msg_id);
|
|
475
|
-
return;
|
|
476
470
|
}
|
|
477
|
-
this.request_next_download_chunk(web.msg_id);
|
|
478
471
|
}
|
|
479
472
|
async start_download(item) {
|
|
480
473
|
if (!this.session_id) {
|
|
@@ -495,7 +488,6 @@ const PhirepassSftpClient = class {
|
|
|
495
488
|
total_chunks: 0,
|
|
496
489
|
total_size: 0,
|
|
497
490
|
download_id: 0,
|
|
498
|
-
nextChunkToRequest: 0,
|
|
499
491
|
startTime: Date.now(),
|
|
500
492
|
});
|
|
501
493
|
const downloadStart = new Promise((resolve, reject) => {
|
|
@@ -519,8 +511,8 @@ const PhirepassSftpClient = class {
|
|
|
519
511
|
download.download_id = download_id;
|
|
520
512
|
download.total_chunks = total_chunks;
|
|
521
513
|
download.total_size = total_size;
|
|
522
|
-
|
|
523
|
-
|
|
514
|
+
// Pipelined: agent pushes chunks immediately after SFTPDownloadStartResponse;
|
|
515
|
+
// no explicit per-chunk request is needed to start the flow.
|
|
524
516
|
}
|
|
525
517
|
catch (err) {
|
|
526
518
|
this.activeDownloads.delete(msgId);
|
|
@@ -933,18 +925,18 @@ const PhirepassSftpClient = class {
|
|
|
933
925
|
return `${typeChar}${chars.join('')}`;
|
|
934
926
|
}
|
|
935
927
|
render() {
|
|
936
|
-
return (index.h(index.Host, { key: '
|
|
928
|
+
return (index.h(index.Host, { key: '733fe85191c976aa3f1a1888aaf6b8ac66b78bce', class: {
|
|
937
929
|
'default': !this.max,
|
|
938
930
|
'max': this.max,
|
|
939
|
-
} }, index.h("section", { key: '
|
|
940
|
-
index.h("header", { key: '
|
|
931
|
+
} }, index.h("section", { key: 'd2282996dfa3970f6e60713417872958b0273257', class: "listing" }, !this.hideHeader &&
|
|
932
|
+
index.h("header", { key: 'c270d12cf1da32374f0bdcb650f3ad4f6e6701c1' }, index.h("section", { key: '670335955f4f453d687c5315fe4e9b4b64c69ff7', class: "title" }, index.h("img", { key: '9c4be4e7366ff1e3cd11d633b31beb625671be2b', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), index.h("div", { key: 'bcb3764dc20d9d6b01fca4b3d9a7d4371a621403', class: "text" }, index.h("div", { key: 'bf036e8de51caf4fb468051edd0625e30ade4f62', class: "name" }, this.name), index.h("div", { key: '9f042ed7412611dde5cacf7e66a7373049175da3', class: "description" }, this.description))), index.h("section", { key: '46028c58138f41f8cfb0f355fd403cfbeada8559', class: "actions" }, index.h("div", { key: '2613d4578a05d5b4ba5a27a6d7f0bb199692305c', class: "action", onClick: () => this.toggle_max() }, index.h("img", { key: 'afbd51291e77e0a34bc429eacc3f92aafa72e65e', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), index.h("main", { key: '200d355da53b9a777d870d472c279dc93cfae8ee' }, this.show_navigation && index.h("nav", { key: 'a2a6d1f87818c9abfb8be2fbe7198ef3986efab5', class: "navigation" }, index.h("div", { key: 'b6d8104e7063e4011efd6510fc6f3fa33ad0c28d', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index$1, breadcrumbs) => (index.h("span", { key: index$1, class: "breadcrumb-container" }, index.h("span", { key: index$1, onClick: () => this.list_breadcrumb(crumb.path), class: "breadcrumb" }, crumb.label), index$1 < breadcrumbs.length - 1 && index.h("img", { class: "arrow", src: phirepassSftpClientChevronSvg }))))), index.h("section", { key: '86b69b8d759e1fc8a52c7f3f1cd90c318d1d413d', class: "actions", "aria-label": "SFTP actions" }, index.h("button", { key: 'c69af8d208771d2788d055fa92fb396f567972e1', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, index.h("img", { key: 'e7c0eaf4d8983369a68506084e77f20cc29184c8', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), index.h("button", { key: '0e8b47e93b2825bc0e60b0c75d961609c2b98158', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, index.h("img", { key: '1a8d0178825ac27fb85584a36bd2d660fe09c135', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), index.h("button", { key: 'fddbb65e05c0a9d800dc901bea49c9352099085d', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, index.h("img", { key: 'cbb5517d854064846a05ee56ef959ed79308b9ad', src: phirepassSftpClientUploadSvg, alt: "Upload" })), index.h("button", { key: '15f521ad9359057a75fc13ab0336fd9803b9c432', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), index.h("input", { key: '48f7a635ea1e93a60e5b64042e730b3af5816ce9', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && index.h("div", { key: '7a977051ab3ccd46524a53c590e52c33904375e4', class: "content" }, index.h("table", { key: '0ac3ae940c7ae094ca99a1c07b37980a9d5a06c4' }, index.h("thead", { key: 'f8141383e987cd435a4f89b9d85b5d373559ec1c' }, index.h("tr", { key: '88479b89f19e1364afaf284b7947c754457c2aa5' }, index.h("th", { key: '1ad5c30387a14041ff7f45e1caaffe39c4972b3f' }, "Name"), index.h("th", { key: 'b80c51a07e6e144b8d21698b1a4e6116eb36cb3a' }, "Size"), index.h("th", { key: '9265bd2250aeb15ff19224f3247b0ec4c8678d7c' }, "Permissions"), index.h("th", { key: '6c9488fced66224aee51e9193b7beb4d0ea05a04' }, "Owner"), index.h("th", { key: 'b741ca68c2ec44243160d5e9f64271c488381713' }, "Modified"), index.h("th", { key: 'a6717e7f50003dc7cb14c2c46b5141afaca3eef1', class: "action-col", "aria-label": "Actions" }))), index.h("tbody", { key: '2406bf5112dff02abcb4952a19718398b43e6635' }, this.listing.map((item, index$1) => (index.h("tr", { key: index$1, class: {
|
|
941
933
|
'selected': this.is_selected(item),
|
|
942
934
|
}, onClick: () => this.list_directory(item) }, index.h("td", null, item.kind === 'Folder' ? index.h("img", { class: "kind", src: phirepassSftpClientFolderSvg, alt: "Folder" }) : index.h("img", { class: "kind", src: phirepassSftpClientFileSvg, alt: "File" }), index.h("span", { class: `name ${item.kind.toLowerCase()}` }, item.name)), index.h("td", null, this.format_size(item.attributes.size)), index.h("td", null, this.format_permissions(item.attributes.permissions, item.kind)), index.h("td", null, item.attributes.user ?? '-'), index.h("td", null, new Date(item.attributes.modified * 1000).toLocaleString()), index.h("td", { class: "action-col" }, item.kind === 'File' &&
|
|
943
|
-
index.h("div", { class: "file-actions" }, index.h("button", { type: "button", class: "file-action", onClick: (event) => this.on_file_row_action(item, event), title: "Download", "aria-label": "Download" }, index.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" }, index.h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), index.h("polyline", { points: "7 10 12 15 17 10" }), index.h("line", { x1: "12", x2: "12", y1: "15", y2: "3" }))), index.h("button", { type: "button", class: "file-action delete", onClick: (event) => this.on_file_delete_action(item, event), title: "Delete", "aria-label": "Delete" }, index.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" }, index.h("polyline", { points: "3 6 5 6 21 6" }), index.h("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), index.h("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), index.h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), index.h("line", { x1: "14", x2: "14", y1: "11", y2: "17" }))))))))))), this.show_loader && index.h("div", { key: '
|
|
944
|
-
index.h("section", { key: '
|
|
935
|
+
index.h("div", { class: "file-actions" }, index.h("button", { type: "button", class: "file-action", onClick: (event) => this.on_file_row_action(item, event), title: "Download", "aria-label": "Download" }, index.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" }, index.h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), index.h("polyline", { points: "7 10 12 15 17 10" }), index.h("line", { x1: "12", x2: "12", y1: "15", y2: "3" }))), index.h("button", { type: "button", class: "file-action delete", onClick: (event) => this.on_file_delete_action(item, event), title: "Delete", "aria-label": "Delete" }, index.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" }, index.h("polyline", { points: "3 6 5 6 21 6" }), index.h("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), index.h("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), index.h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), index.h("line", { x1: "14", x2: "14", y1: "11", y2: "17" }))))))))))), this.show_loader && index.h("div", { key: 'aa63f480151a0143183f8769413bbf1d8bad517a', class: "loader" }, "Loading..."), this.show_error && index.h("div", { key: '3ca7fe377368a520de804391d8939627e956e3d0', class: "error" }, this.error_message)), index.h("footer", { key: '71a1233b255561b5e0cf4408c268ab399982cb7f' }, index.h("section", { key: '5533f9b423be66da41ff7128b903e09bcd447c4c', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
|
|
936
|
+
index.h("section", { key: '6dc948c828b479b6d706dbcca3b3075e58757cef', class: {
|
|
945
937
|
'creds': true,
|
|
946
938
|
'blurred': this.show_login_screen,
|
|
947
|
-
} }, index.h("form", { key: '
|
|
939
|
+
} }, index.h("form", { key: 'a7f60c3dcc672cc18f1ec67a45495eb756ae9c92', class: "auth", onSubmit: (event) => {
|
|
948
940
|
const formData = new FormData(event.target);
|
|
949
941
|
let username = undefined;
|
|
950
942
|
if (this.show_login_screen_username) {
|
|
@@ -961,28 +953,28 @@ const PhirepassSftpClient = class {
|
|
|
961
953
|
this.show_loader = true;
|
|
962
954
|
event.stopPropagation();
|
|
963
955
|
event.preventDefault();
|
|
964
|
-
} }, index.h("div", { key: '
|
|
965
|
-
index.h("div", { key: '
|
|
966
|
-
index.h("div", { key: '
|
|
967
|
-
index.h("section", { key: '
|
|
956
|
+
} }, index.h("div", { key: 'b0f3c4b74c59590624d4944b8d6ccd5a45b6065c', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
|
|
957
|
+
index.h("div", { key: '2d6d9424cd170e087cc6f17d55c8cf1461a06988' }, index.h("label", { key: 'e420f513abc053a99c0e61c27716ff39f0527827', htmlFor: "username" }, "Username"), index.h("input", { key: 'c50aff8ff53e8ed3b3dbb5d0cc85055b247864cf', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
|
|
958
|
+
index.h("div", { key: '8f49b0425783375996484b536c58f07414215b44' }, index.h("label", { key: 'ed739b253b2bfa7dc6bab37dbf184b0c9eacf657', htmlFor: "password" }, "Password"), index.h("input", { key: 'd1be51c537fb0461678ede0e940fd312d96c1517', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), index.h("div", { key: '66da4c8d32459483a1b0329473287e89a82c5e4c' }, index.h("button", { key: 'cf5a2534f2a6abc344e999520bb4328c4dadd090', type: "submit" }, "Connect")))), this.show_upload_modal &&
|
|
959
|
+
index.h("section", { key: 'b678714eff09b18b7932e936ae4dee366aa98b4e', class: {
|
|
968
960
|
'upload-modal': true,
|
|
969
961
|
'visible': this.show_upload_modal,
|
|
970
|
-
} }, index.h("div", { key: '
|
|
962
|
+
} }, index.h("div", { key: 'c4fa4e401c192e705207df634d2f93943ce77af5', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, index.h("div", { key: '18ff3a246aa39f28474ced7cce76ace778922a2f', class: "title" }, "Uploading File"), index.h("div", { key: 'b08fa6b79f6080e9d60f361021b8bac6a5ed7424', class: "file-name", title: this.upload_file_name }, this.upload_file_name), index.h("div", { key: '9efc45e387d8156a18afb90d5531df4ebfa64328', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, index.h("div", { key: 'c988402fedde675d04bc7b2054da4e319c2af082', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), index.h("div", { key: '1d0d8f845d3bfa817aec865598cffa59f55505f4', class: "progress-meta" }, index.h("div", { key: '5b983ed819d48105c3fb0a71b2d2d62f7f46003c', class: "progress-speed" }, this.upload_speed), index.h("div", { key: '859bb76ff953d69ddaa710574bb1c72b92968f5a', class: "progress-value" }, this.format_percent(this.upload_progress))), index.h("button", { key: '41d970d2112e63f931c5a5513bb580559f9e619b', type: "button", class: {
|
|
971
963
|
'cancel': true,
|
|
972
964
|
'finished': this.upload_finished,
|
|
973
965
|
}, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
|
|
974
|
-
index.h("section", { key: '
|
|
966
|
+
index.h("section", { key: 'd9bfadbc2d3a164bc05811a7f2e9024a914ecbc8', class: {
|
|
975
967
|
'download-modal': true,
|
|
976
968
|
'visible': this.show_download_modal,
|
|
977
|
-
} }, index.h("div", { key: '
|
|
969
|
+
} }, index.h("div", { key: '1f874ba0e526b99d2b41beaf8023cbada567ecc8', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, index.h("div", { key: 'ac2b5f65423e7e2b20ffecf864477e849b737259', class: "title" }, "Downloading File"), index.h("div", { key: '639d6fe5a64db1aa53b077eb318fa21d72a551ed', class: "file-name", title: this.download_file_name }, this.download_file_name), index.h("div", { key: 'e90546d4dceab157f4599b2ffd31f1eb4eb9d18c', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, index.h("div", { key: 'eeb597904e31a6aa9717cc4e6fc534ae68924dee', class: "progress-fill", style: { width: `${this.download_progress}%` } })), index.h("div", { key: '1bbf952144d17c374de6948ad94bc4deed7ae8a0', class: "progress-meta" }, index.h("div", { key: '049f748019b11cea95f236202cd48c758e99411a', class: "progress-speed" }, this.download_speed), index.h("div", { key: '01b8d063a3fdfe8cc9df21e75833df3a6c2eda49', class: "progress-value" }, this.format_percent(this.download_progress))), index.h("button", { key: 'a87560c1555bf8a6dea73a424792b3af25e06a68', type: "button", class: {
|
|
978
970
|
'cancel': true,
|
|
979
971
|
'finished': this.download_finished,
|
|
980
972
|
}, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
|
|
981
|
-
index.h("section", { key: '
|
|
973
|
+
index.h("section", { key: '7e547c5f320acc9920020a4bcafc21ca57d6ad66', class: {
|
|
982
974
|
'delete-modal': true,
|
|
983
975
|
'visible': this.show_delete_modal,
|
|
984
|
-
} }, index.h("div", { key: '
|
|
985
|
-
index.h("div", { key: '
|
|
976
|
+
} }, index.h("div", { key: 'b79c2be285b8e2af00189cd69143950f133f5722', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, index.h("div", { key: 'b25d1669edded42eae34ac15887428d85a3e8577', class: "title" }, "Delete File"), index.h("div", { key: 'da2a16b8f85ae7dc7d09aa2ffe4562124642233f', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), index.h("div", { key: '702dfa13f1e9b828c2d956cab0c1fcc557c80bb1', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading &&
|
|
977
|
+
index.h("div", { key: '1e2b57c73dad6f463c3377c16ae407cc553232e3', class: "delete-loader", "aria-hidden": "true" }, index.h("span", { key: '40338e85202b89cb8b2fea8adddf10323fa91a25', class: "spinner" })), index.h("div", { key: 'e0b264439056ab3e7f49f5dd221b5f58ea720d2e', class: "modal-actions" }, index.h("button", { key: 'ee6932fa56c02bca43c6ce914cec55ca9dbfd48a', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), index.h("button", { key: '2c26e30cc0942f532996a3b485ad77fb11c2d214', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
|
|
986
978
|
}
|
|
987
979
|
static get watchers() { return {
|
|
988
980
|
"nodeId": [{
|
|
@@ -192,6 +192,20 @@ class Channel {
|
|
|
192
192
|
const len2 = WASM_VECTOR_LEN;
|
|
193
193
|
wasm.channel_send_sftp_delete(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, ptr2, len2, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
194
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Send a pipelining ACK to the agent: acknowledges all chunks with index ≤ ack_up_to
|
|
197
|
+
* so the agent's sliding window advances and it can push the next batch.
|
|
198
|
+
* Call this after processing each received SFTPDownloadChunk (or every N chunks).
|
|
199
|
+
* @param {string} node_id
|
|
200
|
+
* @param {number} sid
|
|
201
|
+
* @param {number} download_id
|
|
202
|
+
* @param {number} ack_up_to
|
|
203
|
+
*/
|
|
204
|
+
send_sftp_download_ack(node_id, sid, download_id, ack_up_to) {
|
|
205
|
+
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
206
|
+
const len0 = WASM_VECTOR_LEN;
|
|
207
|
+
wasm.channel_send_sftp_download_ack(this.__wbg_ptr, ptr0, len0, sid, download_id, ack_up_to);
|
|
208
|
+
}
|
|
195
209
|
/**
|
|
196
210
|
* @param {string} node_id
|
|
197
211
|
* @param {number} sid
|
|
@@ -380,7 +394,7 @@ function __wbg_get_imports() {
|
|
|
380
394
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
381
395
|
return addHeapObject(ret);
|
|
382
396
|
}, arguments); },
|
|
383
|
-
|
|
397
|
+
__wbg_info_7e60b0839637b648: function(arg0, arg1) {
|
|
384
398
|
console.info(getStringFromWasm0(arg0, arg1));
|
|
385
399
|
},
|
|
386
400
|
__wbg_instanceof_ArrayBuffer_8f49811467741499: function(arg0) {
|
|
@@ -452,7 +466,7 @@ function __wbg_get_imports() {
|
|
|
452
466
|
__wbg_set_onopen_db452f4233e99d7d: function(arg0, arg1) {
|
|
453
467
|
getObject(arg0).onopen = getObject(arg1);
|
|
454
468
|
},
|
|
455
|
-
|
|
469
|
+
__wbg_warn_175986b719b7c712: function(arg0, arg1) {
|
|
456
470
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
457
471
|
},
|
|
458
472
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
@@ -471,8 +485,8 @@ function __wbg_get_imports() {
|
|
|
471
485
|
return addHeapObject(ret);
|
|
472
486
|
},
|
|
473
487
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
474
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
475
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
488
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
489
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_44);
|
|
476
490
|
return addHeapObject(ret);
|
|
477
491
|
},
|
|
478
492
|
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
@@ -509,8 +523,8 @@ function __wbg_get_imports() {
|
|
|
509
523
|
};
|
|
510
524
|
}
|
|
511
525
|
|
|
512
|
-
function
|
|
513
|
-
wasm.
|
|
526
|
+
function __wasm_bindgen_func_elem_44(arg0, arg1) {
|
|
527
|
+
wasm.__wasm_bindgen_func_elem_44(arg0, arg1);
|
|
514
528
|
}
|
|
515
529
|
|
|
516
530
|
function __wasm_bindgen_func_elem_42(arg0, arg1, arg2) {
|
|
@@ -822,7 +836,7 @@ async function __wbg_init(module_or_path) {
|
|
|
822
836
|
}
|
|
823
837
|
|
|
824
838
|
if (module_or_path === undefined) {
|
|
825
|
-
module_or_path = new URL('phirepass-channel_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('protocol-
|
|
839
|
+
module_or_path = new URL('phirepass-channel_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('protocol-BdryFC2F.js', document.baseURI).href)));
|
|
826
840
|
}
|
|
827
841
|
const imports = __wbg_get_imports();
|
|
828
842
|
|
|
@@ -408,14 +408,6 @@ export class PhirepassSftpClient {
|
|
|
408
408
|
});
|
|
409
409
|
this.pendingDownloadStarts.delete(web.msg_id);
|
|
410
410
|
}
|
|
411
|
-
request_next_download_chunk(msgId) {
|
|
412
|
-
const download = this.activeDownloads.get(msgId);
|
|
413
|
-
if (!download || !this.session_id) {
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
this.channel.send_sftp_download_chunk(this.nodeId, this.session_id, download.download_id, download.nextChunkToRequest, msgId);
|
|
417
|
-
download.nextChunkToRequest += 1;
|
|
418
|
-
}
|
|
419
411
|
finalize_download(msgId) {
|
|
420
412
|
const download = this.activeDownloads.get(msgId);
|
|
421
413
|
if (!download) {
|
|
@@ -447,18 +439,19 @@ export class PhirepassSftpClient {
|
|
|
447
439
|
return;
|
|
448
440
|
}
|
|
449
441
|
const download = this.activeDownloads.get(web.msg_id);
|
|
450
|
-
if (!download) {
|
|
442
|
+
if (!download || !this.session_id) {
|
|
451
443
|
return;
|
|
452
444
|
}
|
|
453
445
|
const chunkData = new Uint8Array(web.chunk.data);
|
|
454
446
|
download.chunks.set(web.chunk.chunk_index, chunkData);
|
|
455
447
|
const receivedBytes = Array.from(download.chunks.values()).reduce((sum, data) => sum + data.length, 0);
|
|
456
448
|
this.update_download_progress(receivedBytes, download.total_size, download.startTime);
|
|
449
|
+
// Pipeline ACK: advance the agent's sliding window so it can push the next
|
|
450
|
+
// batch of chunks without waiting for an explicit per-chunk request.
|
|
451
|
+
this.channel.send_sftp_download_ack(this.nodeId, this.session_id, download.download_id, web.chunk.chunk_index);
|
|
457
452
|
if (download.chunks.size >= download.total_chunks) {
|
|
458
453
|
this.finalize_download(web.msg_id);
|
|
459
|
-
return;
|
|
460
454
|
}
|
|
461
|
-
this.request_next_download_chunk(web.msg_id);
|
|
462
455
|
}
|
|
463
456
|
async start_download(item) {
|
|
464
457
|
if (!this.session_id) {
|
|
@@ -479,7 +472,6 @@ export class PhirepassSftpClient {
|
|
|
479
472
|
total_chunks: 0,
|
|
480
473
|
total_size: 0,
|
|
481
474
|
download_id: 0,
|
|
482
|
-
nextChunkToRequest: 0,
|
|
483
475
|
startTime: Date.now(),
|
|
484
476
|
});
|
|
485
477
|
const downloadStart = new Promise((resolve, reject) => {
|
|
@@ -503,8 +495,8 @@ export class PhirepassSftpClient {
|
|
|
503
495
|
download.download_id = download_id;
|
|
504
496
|
download.total_chunks = total_chunks;
|
|
505
497
|
download.total_size = total_size;
|
|
506
|
-
|
|
507
|
-
|
|
498
|
+
// Pipelined: agent pushes chunks immediately after SFTPDownloadStartResponse;
|
|
499
|
+
// no explicit per-chunk request is needed to start the flow.
|
|
508
500
|
}
|
|
509
501
|
catch (err) {
|
|
510
502
|
this.activeDownloads.delete(msgId);
|
|
@@ -917,18 +909,18 @@ export class PhirepassSftpClient {
|
|
|
917
909
|
return `${typeChar}${chars.join('')}`;
|
|
918
910
|
}
|
|
919
911
|
render() {
|
|
920
|
-
return (h(Host, { key: '
|
|
912
|
+
return (h(Host, { key: '733fe85191c976aa3f1a1888aaf6b8ac66b78bce', class: {
|
|
921
913
|
'default': !this.max,
|
|
922
914
|
'max': this.max,
|
|
923
|
-
} }, h("section", { key: '
|
|
924
|
-
h("header", { key: '
|
|
915
|
+
} }, h("section", { key: 'd2282996dfa3970f6e60713417872958b0273257', class: "listing" }, !this.hideHeader &&
|
|
916
|
+
h("header", { key: 'c270d12cf1da32374f0bdcb650f3ad4f6e6701c1' }, h("section", { key: '670335955f4f453d687c5315fe4e9b4b64c69ff7', class: "title" }, h("img", { key: '9c4be4e7366ff1e3cd11d633b31beb625671be2b', src: svg, alt: "SFTP Client" }), h("div", { key: 'bcb3764dc20d9d6b01fca4b3d9a7d4371a621403', class: "text" }, h("div", { key: 'bf036e8de51caf4fb468051edd0625e30ade4f62', class: "name" }, this.name), h("div", { key: '9f042ed7412611dde5cacf7e66a7373049175da3', class: "description" }, this.description))), h("section", { key: '46028c58138f41f8cfb0f355fd403cfbeada8559', class: "actions" }, h("div", { key: '2613d4578a05d5b4ba5a27a6d7f0bb199692305c', class: "action", onClick: () => this.toggle_max() }, h("img", { key: 'afbd51291e77e0a34bc429eacc3f92aafa72e65e', src: max, alt: "Maximize" })))), h("main", { key: '200d355da53b9a777d870d472c279dc93cfae8ee' }, this.show_navigation && h("nav", { key: 'a2a6d1f87818c9abfb8be2fbe7198ef3986efab5', class: "navigation" }, h("div", { key: 'b6d8104e7063e4011efd6510fc6f3fa33ad0c28d', 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: '86b69b8d759e1fc8a52c7f3f1cd90c318d1d413d', class: "actions", "aria-label": "SFTP actions" }, h("button", { key: 'c69af8d208771d2788d055fa92fb396f567972e1', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, h("img", { key: 'e7c0eaf4d8983369a68506084e77f20cc29184c8', src: go_up, alt: "Go up" })), h("button", { key: '0e8b47e93b2825bc0e60b0c75d961609c2b98158', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, h("img", { key: '1a8d0178825ac27fb85584a36bd2d660fe09c135', src: refresh, alt: "Refresh" })), h("button", { key: 'fddbb65e05c0a9d800dc901bea49c9352099085d', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, h("img", { key: 'cbb5517d854064846a05ee56ef959ed79308b9ad', src: upload, alt: "Upload" })), h("button", { key: '15f521ad9359057a75fc13ab0336fd9803b9c432', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), h("input", { key: '48f7a635ea1e93a60e5b64042e730b3af5816ce9', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && h("div", { key: '7a977051ab3ccd46524a53c590e52c33904375e4', class: "content" }, h("table", { key: '0ac3ae940c7ae094ca99a1c07b37980a9d5a06c4' }, h("thead", { key: 'f8141383e987cd435a4f89b9d85b5d373559ec1c' }, h("tr", { key: '88479b89f19e1364afaf284b7947c754457c2aa5' }, h("th", { key: '1ad5c30387a14041ff7f45e1caaffe39c4972b3f' }, "Name"), h("th", { key: 'b80c51a07e6e144b8d21698b1a4e6116eb36cb3a' }, "Size"), h("th", { key: '9265bd2250aeb15ff19224f3247b0ec4c8678d7c' }, "Permissions"), h("th", { key: '6c9488fced66224aee51e9193b7beb4d0ea05a04' }, "Owner"), h("th", { key: 'b741ca68c2ec44243160d5e9f64271c488381713' }, "Modified"), h("th", { key: 'a6717e7f50003dc7cb14c2c46b5141afaca3eef1', class: "action-col", "aria-label": "Actions" }))), h("tbody", { key: '2406bf5112dff02abcb4952a19718398b43e6635' }, this.listing.map((item, index) => (h("tr", { key: index, class: {
|
|
925
917
|
'selected': this.is_selected(item),
|
|
926
918
|
}, 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' &&
|
|
927
|
-
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: '
|
|
928
|
-
h("section", { key: '
|
|
919
|
+
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: 'aa63f480151a0143183f8769413bbf1d8bad517a', class: "loader" }, "Loading..."), this.show_error && h("div", { key: '3ca7fe377368a520de804391d8939627e956e3d0', class: "error" }, this.error_message)), h("footer", { key: '71a1233b255561b5e0cf4408c268ab399982cb7f' }, h("section", { key: '5533f9b423be66da41ff7128b903e09bcd447c4c', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
|
|
920
|
+
h("section", { key: '6dc948c828b479b6d706dbcca3b3075e58757cef', class: {
|
|
929
921
|
'creds': true,
|
|
930
922
|
'blurred': this.show_login_screen,
|
|
931
|
-
} }, h("form", { key: '
|
|
923
|
+
} }, h("form", { key: 'a7f60c3dcc672cc18f1ec67a45495eb756ae9c92', class: "auth", onSubmit: (event) => {
|
|
932
924
|
const formData = new FormData(event.target);
|
|
933
925
|
let username = undefined;
|
|
934
926
|
if (this.show_login_screen_username) {
|
|
@@ -945,28 +937,28 @@ export class PhirepassSftpClient {
|
|
|
945
937
|
this.show_loader = true;
|
|
946
938
|
event.stopPropagation();
|
|
947
939
|
event.preventDefault();
|
|
948
|
-
} }, h("div", { key: '
|
|
949
|
-
h("div", { key: '
|
|
950
|
-
h("div", { key: '
|
|
951
|
-
h("section", { key: '
|
|
940
|
+
} }, h("div", { key: 'b0f3c4b74c59590624d4944b8d6ccd5a45b6065c', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
|
|
941
|
+
h("div", { key: '2d6d9424cd170e087cc6f17d55c8cf1461a06988' }, h("label", { key: 'e420f513abc053a99c0e61c27716ff39f0527827', htmlFor: "username" }, "Username"), h("input", { key: 'c50aff8ff53e8ed3b3dbb5d0cc85055b247864cf', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
|
|
942
|
+
h("div", { key: '8f49b0425783375996484b536c58f07414215b44' }, h("label", { key: 'ed739b253b2bfa7dc6bab37dbf184b0c9eacf657', htmlFor: "password" }, "Password"), h("input", { key: 'd1be51c537fb0461678ede0e940fd312d96c1517', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), h("div", { key: '66da4c8d32459483a1b0329473287e89a82c5e4c' }, h("button", { key: 'cf5a2534f2a6abc344e999520bb4328c4dadd090', type: "submit" }, "Connect")))), this.show_upload_modal &&
|
|
943
|
+
h("section", { key: 'b678714eff09b18b7932e936ae4dee366aa98b4e', class: {
|
|
952
944
|
'upload-modal': true,
|
|
953
945
|
'visible': this.show_upload_modal,
|
|
954
|
-
} }, h("div", { key: '
|
|
946
|
+
} }, h("div", { key: 'c4fa4e401c192e705207df634d2f93943ce77af5', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, h("div", { key: '18ff3a246aa39f28474ced7cce76ace778922a2f', class: "title" }, "Uploading File"), h("div", { key: 'b08fa6b79f6080e9d60f361021b8bac6a5ed7424', class: "file-name", title: this.upload_file_name }, this.upload_file_name), h("div", { key: '9efc45e387d8156a18afb90d5531df4ebfa64328', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, h("div", { key: 'c988402fedde675d04bc7b2054da4e319c2af082', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), h("div", { key: '1d0d8f845d3bfa817aec865598cffa59f55505f4', class: "progress-meta" }, h("div", { key: '5b983ed819d48105c3fb0a71b2d2d62f7f46003c', class: "progress-speed" }, this.upload_speed), h("div", { key: '859bb76ff953d69ddaa710574bb1c72b92968f5a', class: "progress-value" }, this.format_percent(this.upload_progress))), h("button", { key: '41d970d2112e63f931c5a5513bb580559f9e619b', type: "button", class: {
|
|
955
947
|
'cancel': true,
|
|
956
948
|
'finished': this.upload_finished,
|
|
957
949
|
}, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
|
|
958
|
-
h("section", { key: '
|
|
950
|
+
h("section", { key: 'd9bfadbc2d3a164bc05811a7f2e9024a914ecbc8', class: {
|
|
959
951
|
'download-modal': true,
|
|
960
952
|
'visible': this.show_download_modal,
|
|
961
|
-
} }, h("div", { key: '
|
|
953
|
+
} }, h("div", { key: '1f874ba0e526b99d2b41beaf8023cbada567ecc8', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, h("div", { key: 'ac2b5f65423e7e2b20ffecf864477e849b737259', class: "title" }, "Downloading File"), h("div", { key: '639d6fe5a64db1aa53b077eb318fa21d72a551ed', class: "file-name", title: this.download_file_name }, this.download_file_name), h("div", { key: 'e90546d4dceab157f4599b2ffd31f1eb4eb9d18c', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, h("div", { key: 'eeb597904e31a6aa9717cc4e6fc534ae68924dee', class: "progress-fill", style: { width: `${this.download_progress}%` } })), h("div", { key: '1bbf952144d17c374de6948ad94bc4deed7ae8a0', class: "progress-meta" }, h("div", { key: '049f748019b11cea95f236202cd48c758e99411a', class: "progress-speed" }, this.download_speed), h("div", { key: '01b8d063a3fdfe8cc9df21e75833df3a6c2eda49', class: "progress-value" }, this.format_percent(this.download_progress))), h("button", { key: 'a87560c1555bf8a6dea73a424792b3af25e06a68', type: "button", class: {
|
|
962
954
|
'cancel': true,
|
|
963
955
|
'finished': this.download_finished,
|
|
964
956
|
}, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
|
|
965
|
-
h("section", { key: '
|
|
957
|
+
h("section", { key: '7e547c5f320acc9920020a4bcafc21ca57d6ad66', class: {
|
|
966
958
|
'delete-modal': true,
|
|
967
959
|
'visible': this.show_delete_modal,
|
|
968
|
-
} }, h("div", { key: '
|
|
969
|
-
h("div", { key: '
|
|
960
|
+
} }, h("div", { key: 'b79c2be285b8e2af00189cd69143950f133f5722', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, h("div", { key: 'b25d1669edded42eae34ac15887428d85a3e8577', class: "title" }, "Delete File"), h("div", { key: 'da2a16b8f85ae7dc7d09aa2ffe4562124642233f', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), h("div", { key: '702dfa13f1e9b828c2d956cab0c1fcc557c80bb1', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading &&
|
|
961
|
+
h("div", { key: '1e2b57c73dad6f463c3377c16ae407cc553232e3', class: "delete-loader", "aria-hidden": "true" }, h("span", { key: '40338e85202b89cb8b2fea8adddf10323fa91a25', class: "spinner" })), h("div", { key: 'e0b264439056ab3e7f49f5dd221b5f58ea720d2e', class: "modal-actions" }, h("button", { key: 'ee6932fa56c02bca43c6ce914cec55ca9dbfd48a', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), h("button", { key: '2c26e30cc0942f532996a3b485ad77fb11c2d214', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
|
|
970
962
|
}
|
|
971
963
|
static get is() { return "phirepass-sftp-client"; }
|
|
972
964
|
static get encapsulation() { return "shadow"; }
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class n{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,_.unregister(this),n}free(){const n=this.__destroy_into_raw();O.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(t,O.__wbindgen_export,O.__wbindgen_export2);O.channel_authenticate(this.__wbg_ptr,r,o,c,P,A(e)?Number.MAX_SAFE_INTEGER:e>>>0)}connect(){O.channel_connect(this.__wbg_ptr)}disable_service(n,t,e,r,o,c,i){const s=S(n,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(t,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=S(e,O.__wbindgen_export,O.__wbindgen_export2),b=P;var l=A(o)?0:S(o,O.__wbindgen_export,O.__wbindgen_export2),d=P,w=A(c)?0:S(c,O.__wbindgen_export,O.__wbindgen_export2);O.channel_disable_service(this.__wbg_ptr,s,_,u,a,f,b,r,l,d,w,P,A(i)?Number.MAX_SAFE_INTEGER:i>>>0)}disconnect(){O.channel_disconnect(this.__wbg_ptr)}enable_service(n,t,e,r,o,c,i){const s=S(n,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(t,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=S(e,O.__wbindgen_export,O.__wbindgen_export2),b=P;var l=A(o)?0:S(o,O.__wbindgen_export,O.__wbindgen_export2),d=P,w=A(c)?0:S(c,O.__wbindgen_export,O.__wbindgen_export2);O.channel_enable_service(this.__wbg_ptr,s,_,u,a,f,b,r,l,d,w,P,A(i)?Number.MAX_SAFE_INTEGER:i>>>0)}is_connected(){return 0!==O.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==O.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(t,O.__wbindgen_export,O.__wbindgen_export2),i=P;var s=A(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2);const u=O.channel_new(r,o,c,i,s,P);return this.__wbg_ptr=u,_.register(this,this.__wbg_ptr,this),this}on_connection_close(n){O.channel_on_connection_close(this.__wbg_ptr,A(n)?0:u(n))}on_connection_error(n){O.channel_on_connection_error(this.__wbg_ptr,A(n)?0:u(n))}on_connection_message(n){O.channel_on_connection_message(this.__wbg_ptr,A(n)?0:u(n))}on_connection_open(n){O.channel_on_connection_open(this.__wbg_ptr,A(n)?0:u(n))}on_protocol_message(n){O.channel_on_protocol_message(this.__wbg_ptr,A(n)?0:u(n))}on_protocol_message_type(n,t){const e=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_on_protocol_message_type(this.__wbg_ptr,e,P,A(t)?0:u(t))}open_sftp_tunnel(n,t,e,r){const o=S(n,O.__wbindgen_export,O.__wbindgen_export2),c=P;var i=A(t)?0:S(t,O.__wbindgen_export,O.__wbindgen_export2),s=P,_=A(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2);O.channel_open_sftp_tunnel(this.__wbg_ptr,o,c,i,s,_,P,A(r)?Number.MAX_SAFE_INTEGER:r>>>0)}open_ssh_tunnel(n,t,e,r){const o=S(n,O.__wbindgen_export,O.__wbindgen_export2),c=P;var i=A(t)?0:S(t,O.__wbindgen_export,O.__wbindgen_export2),s=P,_=A(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2);O.channel_open_ssh_tunnel(this.__wbg_ptr,o,c,i,s,_,P,A(r)?Number.MAX_SAFE_INTEGER:r>>>0)}send_sftp_delete(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(e,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_delete(this.__wbg_ptr,c,i,t,s,_,u,P,A(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_download_ack(n,t,e,r){const o=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_download_ack(this.__wbg_ptr,o,P,t,e,r)}send_sftp_download_chunk(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_download_chunk(this.__wbg_ptr,c,P,t,e,r,A(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_download_start(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(e,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_download_start(this.__wbg_ptr,c,i,t,s,_,u,P,A(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_list_data(n,t,e,r){const o=S(n,O.__wbindgen_export,O.__wbindgen_export2),c=P,i=S(e,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_list_data(this.__wbg_ptr,o,c,t,i,P,A(r)?Number.MAX_SAFE_INTEGER:r>>>0)}send_sftp_upload_chunk(n,t,e,r,o,c,i){const s=S(n,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=function(n){const t=(0,O.__wbindgen_export)(1*n.length,1)>>>0;return h().set(n,t/1),P=n.length,t}(c);O.channel_send_sftp_upload_chunk(this.__wbg_ptr,s,_,t,e,r,o,u,P,A(i)?Number.MAX_SAFE_INTEGER:i>>>0)}send_sftp_upload_start(n,t,e,r,o,c,i){const s=S(n,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(e,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_upload_start(this.__wbg_ptr,s,_,t,u,a,f,P,o,c,A(i)?Number.MAX_SAFE_INTEGER:i>>>0)}send_ssh_terminal_resize(n,t,e,r,o,c){const i=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_ssh_terminal_resize(this.__wbg_ptr,i,P,t,e,r,o,c)}send_ssh_tunnel_data(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(e,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_ssh_tunnel_data(this.__wbg_ptr,r,o,t,c,P)}start_heartbeat(n){O.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){O.channel_stop_heartbeat(this.__wbg_ptr)}}Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);const t=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(){const n={__proto__:null,__wbg_Error_ef53bc310eb298a0:function(n,t){return u(Error(w(n,t)))},__wbg_String_8564e559799eccda:function(n,t){const e=S(String(p(t)),O.__wbindgen_export,O.__wbindgen_export2),r=P;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_debug_string_0accd80f45e5faa2:function(n,t){const e=S(f(p(t)),O.__wbindgen_export,O.__wbindgen_export2),r=P;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_string_get_72bdf95d3ae505b1:function(n,t){const e=p(t),r="string"==typeof e?e:void 0;var o=A(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2),c=P;d().setInt32(n+4,c,!0),d().setInt32(n+0,o,!0)},__wbg___wbindgen_throw_1506f2235d1bdba0:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_61db23ac97f16c31:function(n){p(n)._wbg_cb_unref()},__wbg_call_40e4174f169eaca7:function(){return y((function(n,t,e,r){return u(p(n).call(p(t),p(e),p(r)))}),arguments)},__wbg_call_8a89609d89f6608a:function(){return y((function(n,t){return u(p(n).call(p(t)))}),arguments)},__wbg_call_9c758de292015997:function(){return y((function(n,t,e){return u(p(n).call(p(t),p(e)))}),arguments)},__wbg_clearInterval_26ba580547547579:function(n){return u(clearInterval(T(n)))},__wbg_close_9acc00cbca310439:function(){return y((function(n){p(n).close()}),arguments)},__wbg_data_bd354b70c783c66e:function(n){return u(p(n).data)},__wbg_from_d300fe49deab18f5:function(n){return u(Array.from(p(n)))},__wbg_get_de6a0f7d4d18a304:function(){return y((function(n,t){return u(Reflect.get(p(n),p(t)))}),arguments)},__wbg_info_7e60b0839637b648:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_8f49811467741499:function(n){let t;try{t=p(n)instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_length_4a591ecaa01354d9:function(n){return p(n).length},__wbg_new_578aeef4b6b94378:function(n){return u(new Uint8Array(p(n)))},__wbg_new_ce1ab61c1c2b300d:function(){return u(new Object)},__wbg_new_d90091b82fdf5b91:function(){return u(new Array)},__wbg_new_with_str_sequence_9ed2327430efed8d:function(){return y((function(n,t,e){return u(new WebSocket(w(n,t),p(e)))}),arguments)},__wbg_prototypesetcall_3249fc62a0fafa30:function(n,t,e){Uint8Array.prototype.set.call(b(n,t),p(e))},__wbg_push_a6822215aa43e71c:function(n,t){return p(n).push(p(t))},__wbg_readyState_490503c1fa8f8dd6:function(n){return p(n).readyState},__wbg_send_4a773f523104d75e:function(){return y((function(n,t,e){p(n).send(b(t,e))}),arguments)},__wbg_setInterval_cbf1c35c6a692d37:function(){return y((function(n,t){return u(setInterval(p(n),t))}),arguments)},__wbg_set_6be42768c690e380:function(n,t,e){p(n)[T(t)]=T(e)},__wbg_set_binaryType_41994c453b95bdd2:function(n,t){p(n).binaryType=s[t]},__wbg_set_dca99999bba88a9a:function(n,t,e){p(n)[t>>>0]=T(e)},__wbg_set_onclose_13787fb31ae8aefd:function(n,t){p(n).onclose=p(t)},__wbg_set_onerror_5a45265839edf1b1:function(n,t){p(n).onerror=p(t)},__wbg_set_onmessage_9c6b4cb14e244b7f:function(n,t){p(n).onmessage=p(t)},__wbg_set_onopen_db452f4233e99d7d:function(n,t){p(n).onopen=p(t)},__wbg_warn_175986b719b7c712:function(n,t){console.warn(w(n,t))},__wbindgen_cast_0000000000000001:function(n,t){return u(R(n,t,o))},__wbindgen_cast_0000000000000002:function(n,t){return u(R(n,t,c))},__wbindgen_cast_0000000000000003:function(n,t){return u(R(n,t,i))},__wbindgen_cast_0000000000000004:function(n,t){return u(R(n,t,r))},__wbindgen_cast_0000000000000005:function(n){return u(n)},__wbindgen_cast_0000000000000006:function(n,t){return u(b(n,t))},__wbindgen_cast_0000000000000007:function(n,t){return u(w(n,t))},__wbindgen_cast_0000000000000008:function(n){return u(BigInt.asUintN(64,n))},__wbindgen_object_clone_ref:function(n){return u(p(n))},__wbindgen_object_drop_ref:function(n){T(n)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}function r(n,t){O.__wasm_bindgen_func_elem_44(n,t)}function o(n,t,e){O.__wasm_bindgen_func_elem_42(n,t,u(e))}function c(n,t,e){O.__wasm_bindgen_func_elem_42_1(n,t,u(e))}function i(n,t,e){O.__wasm_bindgen_func_elem_42_2(n,t,u(e))}const s=["blob","arraybuffer"],_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>O.__wbg_channel_free(n,1)));function u(n){v===m.length&&m.push(m.length+1);const t=v;return v=m[t],m[t]=n,t}const a="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>O.__wbindgen_export4(n.a,n.b)));function f(n){const t=typeof n;if("number"==t||"boolean"==t||null==n)return`${n}`;if("string"==t)return`"${n}"`;if("symbol"==t){const t=n.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=n.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(n)){const t=n.length;let e="[";t>0&&(e+=f(n[0]));for(let r=1;r<t;r++)e+=", "+f(n[r]);return e+="]",e}const e=/\[object ([^\]]+)\]/.exec(toString.call(n));let r;if(!(e&&e.length>1))return toString.call(n);if(r=e[1],"Object"==r)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}function b(n,t){return n>>>=0,h().subarray(n/1,n/1+t)}let l=null;function d(){return(null===l||!0===l.buffer.detached||void 0===l.buffer.detached&&l.buffer!==O.memory.buffer)&&(l=new DataView(O.memory.buffer)),l}function w(n,t){return function(n,t){return F+=t,F>=j&&(U=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),U.decode(),F=t),U.decode(h().subarray(n,n+t))}(n>>>0,t)}let g=null;function h(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(O.memory.buffer)),g}function p(n){return m[n]}function y(n,t){try{return n.apply(this,t)}catch(n){O.__wbindgen_export3(u(n))}}let m=new Array(1024).fill(void 0);m.push(void 0,null,!0,!1);let v=m.length;function A(n){return null==n}function R(n,t,e){const r={a:n,b:t,cnt:1},o=(...n)=>{r.cnt++;const t=r.a;r.a=0;try{return e(t,r.b,...n)}finally{r.a=t,o._wbg_cb_unref()}};return o._wbg_cb_unref=()=>{0==--r.cnt&&(O.__wbindgen_export4(r.a,r.b),r.a=0,a.unregister(r))},a.register(o,r,r),o}function S(n,t,e){if(void 0===e){const e=N.encode(n),r=t(e.length,1)>>>0;return h().subarray(r,r+e.length).set(e),P=e.length,r}let r=n.length,o=t(r,1)>>>0;const c=h();let i=0;for(;i<r;i++){const t=n.charCodeAt(i);if(t>127)break;c[o+i]=t}if(i!==r){0!==i&&(n=n.slice(i)),o=e(o,r,r=i+3*n.length,1)>>>0;const t=h().subarray(o+i,o+r);i+=N.encodeInto(n,t).written,o=e(o,r,i,1)>>>0}return P=i,o}function T(n){const t=p(n);return function(n){n<1028||(m[n]=v,v=n)}(n),t}let U=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});U.decode();const j=2146435072;let F=0;const N=new TextEncoder;"encodeInto"in N||(N.encodeInto=function(n,t){const e=N.encode(n);return t.set(e),{read:n.length,written:e.length}});let O,P=0;async function k(n){if(void 0!==O)return O;void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("phirepass-channel_bg.wasm",import.meta.url));const t=e();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:r}=await async function(n,t){if("function"==typeof Response&&n instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!n.ok||!function(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}(n.type)||"application/wasm"===n.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}(await n,t);return function(n){return O=n.exports,l=null,g=null,O}(r)}var q,I,W;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData",n.SFTPListItems="SFTPListItems",n.SFTPDownloadStartResponse="SFTPDownloadStartResponse",n.SFTPDownloadChunk="SFTPDownloadChunk",n.SFTPUploadStartResponse="SFTPUploadStartResponse",n.SFTPUploadChunkAck="SFTPUploadChunkAck"}(q||(q={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}(I||(I={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}(W||(W={}));export{n as C,t as E,I,q as P,k as _,W as a}
|