phirepass-widgets 0.0.72 → 0.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +20 -19
- package/dist/cjs/phirepass-terminal.cjs.entry.js +6 -5
- package/dist/cjs/phirepass-widgets.cjs.js +1 -1
- package/dist/cjs/{protocol-IOKYxtd-.js → protocol-Cldo-J8L.js} +23 -17
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +38 -18
- package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +24 -4
- package/dist/collection/phirepass-channel_bg.wasm +0 -0
- package/dist/components/p-DuwTRFG1.js +1 -0
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/phirepass-sftp-client.entry.js +20 -19
- package/dist/esm/phirepass-terminal.entry.js +6 -5
- package/dist/esm/phirepass-widgets.js +1 -1
- package/dist/esm/{protocol-CB680LkG.js → protocol-DuwTRFG1.js} +22 -16
- package/dist/phirepass-widgets/{p-82d89f76.entry.js → p-6da808f9.entry.js} +2 -2
- package/dist/phirepass-widgets/p-804b8045.entry.js +1 -0
- package/dist/phirepass-widgets/p-DuwTRFG1.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 +1 -0
- package/dist/types/components/phirepass-terminal/phirepass-terminal.d.ts +1 -0
- package/dist/types/components.d.ts +8 -2
- package/package.json +2 -2
- package/dist/components/p-CB680LkG.js +0 -1
- package/dist/phirepass-widgets/p-845f353c.entry.js +0 -1
- package/dist/phirepass-widgets/p-CB680LkG.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["phirepass-sftp-client.cjs",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal.cjs",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["phirepass-sftp-client.cjs",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal.cjs",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -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-Cldo-J8L.js');
|
|
5
5
|
|
|
6
6
|
const phirepassSftpClientLogoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==';
|
|
7
7
|
|
|
@@ -53,6 +53,7 @@ const PhirepassSftpClient = class {
|
|
|
53
53
|
allowInsecure = false;
|
|
54
54
|
heartbeatInterval = 30_000;
|
|
55
55
|
nodeId;
|
|
56
|
+
serviceId;
|
|
56
57
|
token;
|
|
57
58
|
onNodeIdChange(newValue, _oldValue) {
|
|
58
59
|
// Handle the change in node_id here
|
|
@@ -350,7 +351,7 @@ const PhirepassSftpClient = class {
|
|
|
350
351
|
this.clear_creds_buffer();
|
|
351
352
|
this.version = auth.version;
|
|
352
353
|
this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
|
|
353
|
-
this.channel.open_sftp_tunnel(this.nodeId);
|
|
354
|
+
this.channel.open_sftp_tunnel(this.nodeId, this.serviceId);
|
|
354
355
|
this.status = 'Connected';
|
|
355
356
|
}
|
|
356
357
|
handle_tunnel_opened(web) {
|
|
@@ -925,18 +926,18 @@ const PhirepassSftpClient = class {
|
|
|
925
926
|
return `${typeChar}${chars.join('')}`;
|
|
926
927
|
}
|
|
927
928
|
render() {
|
|
928
|
-
return (index.h(index.Host, { key: '
|
|
929
|
+
return (index.h(index.Host, { key: '693cdfaab69be7ba55dd7333ac5f8ed5ccb0dbce', class: {
|
|
929
930
|
'default': !this.max,
|
|
930
931
|
'max': this.max,
|
|
931
|
-
} }, index.h("section", { key: '
|
|
932
|
-
index.h("header", { key: '
|
|
932
|
+
} }, index.h("section", { key: '504d57b244dd055f23b81807ef6a397032dcf088', class: "listing" }, !this.hideHeader &&
|
|
933
|
+
index.h("header", { key: 'cef1e0a272851379e6d9ca07092b8078c94e2509' }, index.h("section", { key: '49fe94d69837676a46e3c92f54496c2ffa1e3ecd', class: "title" }, index.h("img", { key: 'cec6b64508c31904b34496cc34b26f81ae3e290e', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), index.h("div", { key: '3331b32275581f9bcf79b4b346e9820018868cbf', class: "text" }, index.h("div", { key: '289f2fef2e14c0a1954a99f6bbd920edbf66bf42', class: "name" }, this.name), index.h("div", { key: '8c88da9841dc39373f94cb313c7897cbc5a828a3', class: "description" }, this.description))), index.h("section", { key: 'f6f7ae566a225586c4a79ba31eecf998a1df010b', class: "actions" }, index.h("div", { key: 'd1a5e9c21e61320035eafe255213e883140815c4', class: "action", onClick: () => this.toggle_max() }, index.h("img", { key: '10f834c7a7846964bc84c2fd6eef39b09fa33e8f', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), index.h("main", { key: 'e17ee5827dc56cea9139697ce9024011a638e5ff' }, this.show_navigation && index.h("nav", { key: '277080aa09d738f21605d95d1bf70adc9156dfbb', class: "navigation" }, index.h("div", { key: '526b99f6b6c1161e41ee6dfcd13b48f8e52f85eb', 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: '61a48831425637dc03662f6a8748619745a13b7b', class: "actions", "aria-label": "SFTP actions" }, index.h("button", { key: '53f150ed1579a653a6f843106ba14534156d46d2', 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: 'dd9853885e3a18882ded99fb28e0e270a9e8bb2b', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), index.h("button", { key: '5a2a2f865b5169d2187cf5c8d5aa876163d708d3', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, index.h("img", { key: '62752fa2e46faf222fedd7f5f8a6e7d81242a089', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), index.h("button", { key: '09fe21b04d27e7e1abd87b14789e6bd8faa68a98', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, index.h("img", { key: '0b4ab6f686c7261844221835836e2dbee86866bf', src: phirepassSftpClientUploadSvg, alt: "Upload" })), index.h("button", { key: 'eab9cf7df64384db2cfb383ba2bc87ff84e9ef63', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), index.h("input", { key: '05609273cfc54c019f801768e560365845c38671', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && index.h("div", { key: 'ed910c6b7c2d5ac17e13fef9fd4597b1406b7d85', class: "content" }, index.h("table", { key: 'c28ed3308bf01665e313e1f8b8fb482f2dc0303a' }, index.h("thead", { key: '187c2e34ed9cbe57ea13083645472f0dc6f2e957' }, index.h("tr", { key: 'd43d3d698ba06cc24bc9fba9946a0bcf382327a1' }, index.h("th", { key: '8128742b1975b1c655e5665256cceb8f63441450' }, "Name"), index.h("th", { key: '35f91f13e38b62dfa97c742f4f23d14495f71462' }, "Size"), index.h("th", { key: '89f10d37b9558aadfc1e10e6729ef0bc63f30216' }, "Permissions"), index.h("th", { key: '51905e8a7d3391119290b59fb0f36420b23b5331' }, "Owner"), index.h("th", { key: 'a2133c42789fb79ec0bfd91c1ffe4f869a8b0acf' }, "Modified"), index.h("th", { key: 'a3b72803212e5ba60249777cdad37341c101a4b5', class: "action-col", "aria-label": "Actions" }))), index.h("tbody", { key: 'e5ee4a1cd8943a4966d33a43ee04df5f355f21e0' }, this.listing.map((item, index$1) => (index.h("tr", { key: index$1, class: {
|
|
933
934
|
'selected': this.is_selected(item),
|
|
934
935
|
}, 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' &&
|
|
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: '
|
|
936
|
-
index.h("section", { key: '
|
|
936
|
+
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: '30777c73738f9c6a5199033428d9033d0cd05b99', class: "loader" }, "Loading..."), this.show_error && index.h("div", { key: '0a5bc583f268e00c1bf17661ea1f49bccaba6ab9', class: "error" }, this.error_message)), index.h("footer", { key: '94aff725f14e25d8c34719cbf2decdd5e17b8e22' }, index.h("section", { key: '6342e9ce4b7fe08e12d62406f203127a0c872055', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
|
|
937
|
+
index.h("section", { key: '039eeae64731e54a5bf0982777815c8ad0df6b49', class: {
|
|
937
938
|
'creds': true,
|
|
938
939
|
'blurred': this.show_login_screen,
|
|
939
|
-
} }, index.h("form", { key: '
|
|
940
|
+
} }, index.h("form", { key: 'b1881dd755b66c392155bb8f670a924f711bd717', class: "auth", onSubmit: (event) => {
|
|
940
941
|
const formData = new FormData(event.target);
|
|
941
942
|
let username = undefined;
|
|
942
943
|
if (this.show_login_screen_username) {
|
|
@@ -946,35 +947,35 @@ const PhirepassSftpClient = class {
|
|
|
946
947
|
if (this.show_login_screen_password) {
|
|
947
948
|
password = formData.get('password');
|
|
948
949
|
}
|
|
949
|
-
this.channel.open_sftp_tunnel(this.nodeId, username, password);
|
|
950
|
+
this.channel.open_sftp_tunnel(this.nodeId, this.serverId, username, password);
|
|
950
951
|
this.show_login_screen_username = false;
|
|
951
952
|
this.show_login_screen_password = false;
|
|
952
953
|
this.show_login_screen = false;
|
|
953
954
|
this.show_loader = true;
|
|
954
955
|
event.stopPropagation();
|
|
955
956
|
event.preventDefault();
|
|
956
|
-
} }, index.h("div", { key: '
|
|
957
|
-
index.h("div", { key: '
|
|
958
|
-
index.h("div", { key: '
|
|
959
|
-
index.h("section", { key: '
|
|
957
|
+
} }, index.h("div", { key: '250b78b4d4f20f0491034d6c261ee55581d93483', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
|
|
958
|
+
index.h("div", { key: '68130dd636c5ae29d4bb344b45ba6b6747b2fdaf' }, index.h("label", { key: '0d3bc72b4ce0581a910f3b702e299e257498d088', htmlFor: "username" }, "Username"), index.h("input", { key: 'fef6876079e4097339549547138bcafc93901a3a', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
|
|
959
|
+
index.h("div", { key: 'ae8d6f4f1d3bee55038dcc6b60899d4ab0ebd5ce' }, index.h("label", { key: '54dc4ff7a8faf76644d9885ea77d75357ac92ff8', htmlFor: "password" }, "Password"), index.h("input", { key: '8a4b35f9daa410d96c424ffae53ba92a793081cb', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), index.h("div", { key: '0c41f3a81ffbd29bba566f6c7ee35234de77e051' }, index.h("button", { key: '5bf5676382c66f032d72e77bc889596c0f851dbe', type: "submit" }, "Connect")))), this.show_upload_modal &&
|
|
960
|
+
index.h("section", { key: 'f37ec9066ef29eba7b79f3db98ee080c48c9ec4e', class: {
|
|
960
961
|
'upload-modal': true,
|
|
961
962
|
'visible': this.show_upload_modal,
|
|
962
|
-
} }, index.h("div", { key: '
|
|
963
|
+
} }, index.h("div", { key: '77b7a1debd316d191ea9bc7e7fa0e914943e7951', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, index.h("div", { key: '614f3abe44943fb8d7d7e1976f82fa3161b66112', class: "title" }, "Uploading File"), index.h("div", { key: 'f2d3b094309ce4cfb4fafb0a289be1f8f116a246', class: "file-name", title: this.upload_file_name }, this.upload_file_name), index.h("div", { key: '7f6e1892490759e62c3dd5acf46dd53017619a6a', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, index.h("div", { key: '605c95beaf914644b5500bcc61b5b44aa71f4af9', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), index.h("div", { key: '2389e2b5d9f719e39d24b40e8083d662864a87db', class: "progress-meta" }, index.h("div", { key: '2464c8db01adee774d35a65bbdb22d175476e19e', class: "progress-speed" }, this.upload_speed), index.h("div", { key: 'c47334ec3967a4269cbdea7c7e4e55726461e797', class: "progress-value" }, this.format_percent(this.upload_progress))), index.h("button", { key: '25d0755fef743af337f7178da1bdd92628f908e2', type: "button", class: {
|
|
963
964
|
'cancel': true,
|
|
964
965
|
'finished': this.upload_finished,
|
|
965
966
|
}, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
|
|
966
|
-
index.h("section", { key: '
|
|
967
|
+
index.h("section", { key: '0e9db491e0475a85eb811ee83ee5f1102b6e6091', class: {
|
|
967
968
|
'download-modal': true,
|
|
968
969
|
'visible': this.show_download_modal,
|
|
969
|
-
} }, index.h("div", { key: '
|
|
970
|
+
} }, index.h("div", { key: 'c177ed66cd9fea215cc3551455243c7cb8ddfe2a', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, index.h("div", { key: '1d4ea586f1598ce83db53c8eab628db8092ceb2c', class: "title" }, "Downloading File"), index.h("div", { key: '64bfbe33ddb139ffb7f6035dc4bdd3fb666e054e', class: "file-name", title: this.download_file_name }, this.download_file_name), index.h("div", { key: '568ca83a87c7f098453fa9d810d894cf32eac728', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, index.h("div", { key: '3a608f280ee43ffb7933f2755021ae655bd2029e', class: "progress-fill", style: { width: `${this.download_progress}%` } })), index.h("div", { key: '4c703f990756d4b3b8c4750d711ff4b9817fe2f1', class: "progress-meta" }, index.h("div", { key: 'd5fe7bc49d1f8f7fcb14c4462244c41140092b87', class: "progress-speed" }, this.download_speed), index.h("div", { key: 'd99c13a9638b7018fead0c6e2ea8df3c1ed7fca0', class: "progress-value" }, this.format_percent(this.download_progress))), index.h("button", { key: '32aa10e73df04f3b6b3f2263608c55e069bc29eb', type: "button", class: {
|
|
970
971
|
'cancel': true,
|
|
971
972
|
'finished': this.download_finished,
|
|
972
973
|
}, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
|
|
973
|
-
index.h("section", { key: '
|
|
974
|
+
index.h("section", { key: '0f142b91f29d4b2474ae0a9d479cec3457414f43', class: {
|
|
974
975
|
'delete-modal': true,
|
|
975
976
|
'visible': this.show_delete_modal,
|
|
976
|
-
} }, index.h("div", { key: '
|
|
977
|
-
index.h("div", { key: '
|
|
977
|
+
} }, index.h("div", { key: '2fa13dec3240b69016e33c2f751af97c5903f693', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, index.h("div", { key: '22742d0f1384acba3f08132d7efad4a78a2357ae', class: "title" }, "Delete File"), index.h("div", { key: '7eaf020753953b82d843d5b4dd8414131906151b', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), index.h("div", { key: 'f4fc23b43a78541d7ab84659d287f5d33dc4be1d', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading &&
|
|
978
|
+
index.h("div", { key: 'ad9fd03a6b983eb87ec37a63bf35d440ce7f908c', class: "delete-loader", "aria-hidden": "true" }, index.h("span", { key: 'e22bfb5dd729a865454cafb23f4d6eee9a2e3838', class: "spinner" })), index.h("div", { key: '730b9aa6e1bd773e8e8e9be5ee75c63ba5f69ad3', class: "modal-actions" }, index.h("button", { key: 'dd7b1ae63736e3c36b9b4894b969433a390e9ee4', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), index.h("button", { key: '113304b503ba82498a26c34b68ec9f217e6372a2', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
|
|
978
979
|
}
|
|
979
980
|
static get watchers() { return {
|
|
980
981
|
"nodeId": [{
|
|
@@ -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-Cldo-J8L.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
@@ -298,6 +298,7 @@ const PhirepassTerminal = class {
|
|
|
298
298
|
allowInsecure = false;
|
|
299
299
|
heartbeatInterval = 30_000;
|
|
300
300
|
nodeId;
|
|
301
|
+
serviceId;
|
|
301
302
|
token;
|
|
302
303
|
onNodeIdChange(newValue, _oldValue) {
|
|
303
304
|
// Handle the change in node_id here
|
|
@@ -554,7 +555,7 @@ const PhirepassTerminal = class {
|
|
|
554
555
|
handle_auth_success(_auth_) {
|
|
555
556
|
this.clear_creds_buffer();
|
|
556
557
|
this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
|
|
557
|
-
this.channel.open_ssh_tunnel(this.nodeId);
|
|
558
|
+
this.channel.open_ssh_tunnel(this.nodeId, this.serviceId);
|
|
558
559
|
}
|
|
559
560
|
handle_tunnel_opened(web) {
|
|
560
561
|
this.session_id = web.sid;
|
|
@@ -649,7 +650,7 @@ const PhirepassTerminal = class {
|
|
|
649
650
|
return;
|
|
650
651
|
}
|
|
651
652
|
this.inputMode = protocol.InputMode.Default;
|
|
652
|
-
this.channel.open_ssh_tunnel(this.nodeId, username);
|
|
653
|
+
this.channel.open_ssh_tunnel(this.nodeId, this.serviceId, username);
|
|
653
654
|
}
|
|
654
655
|
handle_password_input(data) {
|
|
655
656
|
if (data === "\r" || data === "\n") {
|
|
@@ -688,13 +689,13 @@ const PhirepassTerminal = class {
|
|
|
688
689
|
this.inputMode = protocol.InputMode.Default;
|
|
689
690
|
// Assuming there's a method to submit password to the channel
|
|
690
691
|
// You may need to adjust this based on your actual API
|
|
691
|
-
this.channel.open_ssh_tunnel(this.nodeId, this.usernameBuffer.trim(), password);
|
|
692
|
+
this.channel.open_ssh_tunnel(this.nodeId, this.serviceId, this.usernameBuffer.trim(), password);
|
|
692
693
|
// Clear sensitive data
|
|
693
694
|
this.passwordBuffer = "";
|
|
694
695
|
this.usernameBuffer = "";
|
|
695
696
|
}
|
|
696
697
|
render() {
|
|
697
|
-
return (index.h(index.Host, { key: '
|
|
698
|
+
return (index.h(index.Host, { key: '8bc2181d5ca26f6e6552591b7d399f81bece3efa' }, index.h("div", { key: '4c7085ba44cebb23f7712fbfe4ea52a9e8bde6d7', id: "ccc", ref: el => (this.containerEl = el) })));
|
|
698
699
|
}
|
|
699
700
|
static get watchers() { return {
|
|
700
701
|
"nodeId": [{
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["phirepass-sftp-client.cjs",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal.cjs",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["phirepass-sftp-client.cjs",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal.cjs",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -147,33 +147,39 @@ class Channel {
|
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* @param {string} node_id
|
|
150
|
+
* @param {string} service_id
|
|
150
151
|
* @param {string | null} [username]
|
|
151
152
|
* @param {string | null} [password]
|
|
152
153
|
* @param {number | null} [msg_id]
|
|
153
154
|
*/
|
|
154
|
-
open_sftp_tunnel(node_id, username, password, msg_id) {
|
|
155
|
+
open_sftp_tunnel(node_id, service_id, username, password, msg_id) {
|
|
155
156
|
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
156
157
|
const len0 = WASM_VECTOR_LEN;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
var ptr2 = isLikeNone(
|
|
158
|
+
const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
159
|
+
const len1 = WASM_VECTOR_LEN;
|
|
160
|
+
var ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
160
161
|
var len2 = WASM_VECTOR_LEN;
|
|
161
|
-
|
|
162
|
+
var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
163
|
+
var len3 = WASM_VECTOR_LEN;
|
|
164
|
+
wasm.channel_open_sftp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
162
165
|
}
|
|
163
166
|
/**
|
|
164
167
|
* @param {string} node_id
|
|
168
|
+
* @param {string} service_id
|
|
165
169
|
* @param {string | null} [username]
|
|
166
170
|
* @param {string | null} [password]
|
|
167
171
|
* @param {number | null} [msg_id]
|
|
168
172
|
*/
|
|
169
|
-
open_ssh_tunnel(node_id, username, password, msg_id) {
|
|
173
|
+
open_ssh_tunnel(node_id, service_id, username, password, msg_id) {
|
|
170
174
|
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
171
175
|
const len0 = WASM_VECTOR_LEN;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
var ptr2 = isLikeNone(
|
|
176
|
+
const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
177
|
+
const len1 = WASM_VECTOR_LEN;
|
|
178
|
+
var ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
175
179
|
var len2 = WASM_VECTOR_LEN;
|
|
176
|
-
|
|
180
|
+
var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
181
|
+
var len3 = WASM_VECTOR_LEN;
|
|
182
|
+
wasm.channel_open_ssh_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
177
183
|
}
|
|
178
184
|
/**
|
|
179
185
|
* @param {string} node_id
|
|
@@ -427,7 +433,7 @@ function __wbg_get_imports() {
|
|
|
427
433
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
428
434
|
return addHeapObject(ret);
|
|
429
435
|
}, arguments); },
|
|
430
|
-
|
|
436
|
+
__wbg_info_a035e9398ce057dc: function(arg0, arg1) {
|
|
431
437
|
console.info(getStringFromWasm0(arg0, arg1));
|
|
432
438
|
},
|
|
433
439
|
__wbg_instanceof_ArrayBuffer_2a7bb09fee70c2da: function(arg0) {
|
|
@@ -499,7 +505,7 @@ function __wbg_get_imports() {
|
|
|
499
505
|
__wbg_set_onopen_ca8d311fe5282041: function(arg0, arg1) {
|
|
500
506
|
getObject(arg0).onopen = getObject(arg1);
|
|
501
507
|
},
|
|
502
|
-
|
|
508
|
+
__wbg_warn_1087e5a6742be100: function(arg0, arg1) {
|
|
503
509
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
504
510
|
},
|
|
505
511
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
@@ -518,8 +524,8 @@ function __wbg_get_imports() {
|
|
|
518
524
|
return addHeapObject(ret);
|
|
519
525
|
},
|
|
520
526
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
521
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
522
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
527
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
528
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_44);
|
|
523
529
|
return addHeapObject(ret);
|
|
524
530
|
},
|
|
525
531
|
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
@@ -556,8 +562,8 @@ function __wbg_get_imports() {
|
|
|
556
562
|
};
|
|
557
563
|
}
|
|
558
564
|
|
|
559
|
-
function
|
|
560
|
-
wasm.
|
|
565
|
+
function __wasm_bindgen_func_elem_44(arg0, arg1) {
|
|
566
|
+
wasm.__wasm_bindgen_func_elem_44(arg0, arg1);
|
|
561
567
|
}
|
|
562
568
|
|
|
563
569
|
function __wasm_bindgen_func_elem_42(arg0, arg1, arg2) {
|
|
@@ -869,7 +875,7 @@ async function __wbg_init(module_or_path) {
|
|
|
869
875
|
}
|
|
870
876
|
|
|
871
877
|
if (module_or_path === undefined) {
|
|
872
|
-
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-
|
|
878
|
+
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-Cldo-J8L.js', document.baseURI).href)));
|
|
873
879
|
}
|
|
874
880
|
const imports = __wbg_get_imports();
|
|
875
881
|
|
|
@@ -37,6 +37,7 @@ export class PhirepassSftpClient {
|
|
|
37
37
|
allowInsecure = false;
|
|
38
38
|
heartbeatInterval = 30_000;
|
|
39
39
|
nodeId;
|
|
40
|
+
serviceId;
|
|
40
41
|
token;
|
|
41
42
|
onNodeIdChange(newValue, _oldValue) {
|
|
42
43
|
// Handle the change in node_id here
|
|
@@ -334,7 +335,7 @@ export class PhirepassSftpClient {
|
|
|
334
335
|
this.clear_creds_buffer();
|
|
335
336
|
this.version = auth.version;
|
|
336
337
|
this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
|
|
337
|
-
this.channel.open_sftp_tunnel(this.nodeId);
|
|
338
|
+
this.channel.open_sftp_tunnel(this.nodeId, this.serviceId);
|
|
338
339
|
this.status = 'Connected';
|
|
339
340
|
}
|
|
340
341
|
handle_tunnel_opened(web) {
|
|
@@ -909,18 +910,18 @@ export class PhirepassSftpClient {
|
|
|
909
910
|
return `${typeChar}${chars.join('')}`;
|
|
910
911
|
}
|
|
911
912
|
render() {
|
|
912
|
-
return (h(Host, { key: '
|
|
913
|
+
return (h(Host, { key: '693cdfaab69be7ba55dd7333ac5f8ed5ccb0dbce', class: {
|
|
913
914
|
'default': !this.max,
|
|
914
915
|
'max': this.max,
|
|
915
|
-
} }, h("section", { key: '
|
|
916
|
-
h("header", { key: '
|
|
916
|
+
} }, h("section", { key: '504d57b244dd055f23b81807ef6a397032dcf088', class: "listing" }, !this.hideHeader &&
|
|
917
|
+
h("header", { key: 'cef1e0a272851379e6d9ca07092b8078c94e2509' }, h("section", { key: '49fe94d69837676a46e3c92f54496c2ffa1e3ecd', class: "title" }, h("img", { key: 'cec6b64508c31904b34496cc34b26f81ae3e290e', src: svg, alt: "SFTP Client" }), h("div", { key: '3331b32275581f9bcf79b4b346e9820018868cbf', class: "text" }, h("div", { key: '289f2fef2e14c0a1954a99f6bbd920edbf66bf42', class: "name" }, this.name), h("div", { key: '8c88da9841dc39373f94cb313c7897cbc5a828a3', class: "description" }, this.description))), h("section", { key: 'f6f7ae566a225586c4a79ba31eecf998a1df010b', class: "actions" }, h("div", { key: 'd1a5e9c21e61320035eafe255213e883140815c4', class: "action", onClick: () => this.toggle_max() }, h("img", { key: '10f834c7a7846964bc84c2fd6eef39b09fa33e8f', src: max, alt: "Maximize" })))), h("main", { key: 'e17ee5827dc56cea9139697ce9024011a638e5ff' }, this.show_navigation && h("nav", { key: '277080aa09d738f21605d95d1bf70adc9156dfbb', class: "navigation" }, h("div", { key: '526b99f6b6c1161e41ee6dfcd13b48f8e52f85eb', 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: '61a48831425637dc03662f6a8748619745a13b7b', class: "actions", "aria-label": "SFTP actions" }, h("button", { key: '53f150ed1579a653a6f843106ba14534156d46d2', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, h("img", { key: 'dd9853885e3a18882ded99fb28e0e270a9e8bb2b', src: go_up, alt: "Go up" })), h("button", { key: '5a2a2f865b5169d2187cf5c8d5aa876163d708d3', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, h("img", { key: '62752fa2e46faf222fedd7f5f8a6e7d81242a089', src: refresh, alt: "Refresh" })), h("button", { key: '09fe21b04d27e7e1abd87b14789e6bd8faa68a98', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, h("img", { key: '0b4ab6f686c7261844221835836e2dbee86866bf', src: upload, alt: "Upload" })), h("button", { key: 'eab9cf7df64384db2cfb383ba2bc87ff84e9ef63', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), h("input", { key: '05609273cfc54c019f801768e560365845c38671', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && h("div", { key: 'ed910c6b7c2d5ac17e13fef9fd4597b1406b7d85', class: "content" }, h("table", { key: 'c28ed3308bf01665e313e1f8b8fb482f2dc0303a' }, h("thead", { key: '187c2e34ed9cbe57ea13083645472f0dc6f2e957' }, h("tr", { key: 'd43d3d698ba06cc24bc9fba9946a0bcf382327a1' }, h("th", { key: '8128742b1975b1c655e5665256cceb8f63441450' }, "Name"), h("th", { key: '35f91f13e38b62dfa97c742f4f23d14495f71462' }, "Size"), h("th", { key: '89f10d37b9558aadfc1e10e6729ef0bc63f30216' }, "Permissions"), h("th", { key: '51905e8a7d3391119290b59fb0f36420b23b5331' }, "Owner"), h("th", { key: 'a2133c42789fb79ec0bfd91c1ffe4f869a8b0acf' }, "Modified"), h("th", { key: 'a3b72803212e5ba60249777cdad37341c101a4b5', class: "action-col", "aria-label": "Actions" }))), h("tbody", { key: 'e5ee4a1cd8943a4966d33a43ee04df5f355f21e0' }, this.listing.map((item, index) => (h("tr", { key: index, class: {
|
|
917
918
|
'selected': this.is_selected(item),
|
|
918
919
|
}, onClick: () => this.list_directory(item) }, h("td", null, item.kind === 'Folder' ? h("img", { class: "kind", src: folder, alt: "Folder" }) : h("img", { class: "kind", src: file, alt: "File" }), h("span", { class: `name ${item.kind.toLowerCase()}` }, item.name)), h("td", null, this.format_size(item.attributes.size)), h("td", null, this.format_permissions(item.attributes.permissions, item.kind)), h("td", null, item.attributes.user ?? '-'), h("td", null, new Date(item.attributes.modified * 1000).toLocaleString()), h("td", { class: "action-col" }, item.kind === 'File' &&
|
|
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: '
|
|
920
|
-
h("section", { key: '
|
|
920
|
+
h("div", { class: "file-actions" }, h("button", { type: "button", class: "file-action", onClick: (event) => this.on_file_row_action(item, event), title: "Download", "aria-label": "Download" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), h("polyline", { points: "7 10 12 15 17 10" }), h("line", { x1: "12", x2: "12", y1: "15", y2: "3" }))), h("button", { type: "button", class: "file-action delete", onClick: (event) => this.on_file_delete_action(item, event), title: "Delete", "aria-label": "Delete" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("polyline", { points: "3 6 5 6 21 6" }), h("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), h("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), h("line", { x1: "14", x2: "14", y1: "11", y2: "17" }))))))))))), this.show_loader && h("div", { key: '30777c73738f9c6a5199033428d9033d0cd05b99', class: "loader" }, "Loading..."), this.show_error && h("div", { key: '0a5bc583f268e00c1bf17661ea1f49bccaba6ab9', class: "error" }, this.error_message)), h("footer", { key: '94aff725f14e25d8c34719cbf2decdd5e17b8e22' }, h("section", { key: '6342e9ce4b7fe08e12d62406f203127a0c872055', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
|
|
921
|
+
h("section", { key: '039eeae64731e54a5bf0982777815c8ad0df6b49', class: {
|
|
921
922
|
'creds': true,
|
|
922
923
|
'blurred': this.show_login_screen,
|
|
923
|
-
} }, h("form", { key: '
|
|
924
|
+
} }, h("form", { key: 'b1881dd755b66c392155bb8f670a924f711bd717', class: "auth", onSubmit: (event) => {
|
|
924
925
|
const formData = new FormData(event.target);
|
|
925
926
|
let username = undefined;
|
|
926
927
|
if (this.show_login_screen_username) {
|
|
@@ -930,35 +931,35 @@ export class PhirepassSftpClient {
|
|
|
930
931
|
if (this.show_login_screen_password) {
|
|
931
932
|
password = formData.get('password');
|
|
932
933
|
}
|
|
933
|
-
this.channel.open_sftp_tunnel(this.nodeId, username, password);
|
|
934
|
+
this.channel.open_sftp_tunnel(this.nodeId, this.serverId, username, password);
|
|
934
935
|
this.show_login_screen_username = false;
|
|
935
936
|
this.show_login_screen_password = false;
|
|
936
937
|
this.show_login_screen = false;
|
|
937
938
|
this.show_loader = true;
|
|
938
939
|
event.stopPropagation();
|
|
939
940
|
event.preventDefault();
|
|
940
|
-
} }, h("div", { key: '
|
|
941
|
-
h("div", { key: '
|
|
942
|
-
h("div", { key: '
|
|
943
|
-
h("section", { key: '
|
|
941
|
+
} }, h("div", { key: '250b78b4d4f20f0491034d6c261ee55581d93483', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
|
|
942
|
+
h("div", { key: '68130dd636c5ae29d4bb344b45ba6b6747b2fdaf' }, h("label", { key: '0d3bc72b4ce0581a910f3b702e299e257498d088', htmlFor: "username" }, "Username"), h("input", { key: 'fef6876079e4097339549547138bcafc93901a3a', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
|
|
943
|
+
h("div", { key: 'ae8d6f4f1d3bee55038dcc6b60899d4ab0ebd5ce' }, h("label", { key: '54dc4ff7a8faf76644d9885ea77d75357ac92ff8', htmlFor: "password" }, "Password"), h("input", { key: '8a4b35f9daa410d96c424ffae53ba92a793081cb', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), h("div", { key: '0c41f3a81ffbd29bba566f6c7ee35234de77e051' }, h("button", { key: '5bf5676382c66f032d72e77bc889596c0f851dbe', type: "submit" }, "Connect")))), this.show_upload_modal &&
|
|
944
|
+
h("section", { key: 'f37ec9066ef29eba7b79f3db98ee080c48c9ec4e', class: {
|
|
944
945
|
'upload-modal': true,
|
|
945
946
|
'visible': this.show_upload_modal,
|
|
946
|
-
} }, h("div", { key: '
|
|
947
|
+
} }, h("div", { key: '77b7a1debd316d191ea9bc7e7fa0e914943e7951', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, h("div", { key: '614f3abe44943fb8d7d7e1976f82fa3161b66112', class: "title" }, "Uploading File"), h("div", { key: 'f2d3b094309ce4cfb4fafb0a289be1f8f116a246', class: "file-name", title: this.upload_file_name }, this.upload_file_name), h("div", { key: '7f6e1892490759e62c3dd5acf46dd53017619a6a', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, h("div", { key: '605c95beaf914644b5500bcc61b5b44aa71f4af9', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), h("div", { key: '2389e2b5d9f719e39d24b40e8083d662864a87db', class: "progress-meta" }, h("div", { key: '2464c8db01adee774d35a65bbdb22d175476e19e', class: "progress-speed" }, this.upload_speed), h("div", { key: 'c47334ec3967a4269cbdea7c7e4e55726461e797', class: "progress-value" }, this.format_percent(this.upload_progress))), h("button", { key: '25d0755fef743af337f7178da1bdd92628f908e2', type: "button", class: {
|
|
947
948
|
'cancel': true,
|
|
948
949
|
'finished': this.upload_finished,
|
|
949
950
|
}, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
|
|
950
|
-
h("section", { key: '
|
|
951
|
+
h("section", { key: '0e9db491e0475a85eb811ee83ee5f1102b6e6091', class: {
|
|
951
952
|
'download-modal': true,
|
|
952
953
|
'visible': this.show_download_modal,
|
|
953
|
-
} }, h("div", { key: '
|
|
954
|
+
} }, h("div", { key: 'c177ed66cd9fea215cc3551455243c7cb8ddfe2a', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, h("div", { key: '1d4ea586f1598ce83db53c8eab628db8092ceb2c', class: "title" }, "Downloading File"), h("div", { key: '64bfbe33ddb139ffb7f6035dc4bdd3fb666e054e', class: "file-name", title: this.download_file_name }, this.download_file_name), h("div", { key: '568ca83a87c7f098453fa9d810d894cf32eac728', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, h("div", { key: '3a608f280ee43ffb7933f2755021ae655bd2029e', class: "progress-fill", style: { width: `${this.download_progress}%` } })), h("div", { key: '4c703f990756d4b3b8c4750d711ff4b9817fe2f1', class: "progress-meta" }, h("div", { key: 'd5fe7bc49d1f8f7fcb14c4462244c41140092b87', class: "progress-speed" }, this.download_speed), h("div", { key: 'd99c13a9638b7018fead0c6e2ea8df3c1ed7fca0', class: "progress-value" }, this.format_percent(this.download_progress))), h("button", { key: '32aa10e73df04f3b6b3f2263608c55e069bc29eb', type: "button", class: {
|
|
954
955
|
'cancel': true,
|
|
955
956
|
'finished': this.download_finished,
|
|
956
957
|
}, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
|
|
957
|
-
h("section", { key: '
|
|
958
|
+
h("section", { key: '0f142b91f29d4b2474ae0a9d479cec3457414f43', class: {
|
|
958
959
|
'delete-modal': true,
|
|
959
960
|
'visible': this.show_delete_modal,
|
|
960
|
-
} }, h("div", { key: '
|
|
961
|
-
h("div", { key: '
|
|
961
|
+
} }, h("div", { key: '2fa13dec3240b69016e33c2f751af97c5903f693', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, h("div", { key: '22742d0f1384acba3f08132d7efad4a78a2357ae', class: "title" }, "Delete File"), h("div", { key: '7eaf020753953b82d843d5b4dd8414131906151b', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), h("div", { key: 'f4fc23b43a78541d7ab84659d287f5d33dc4be1d', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading &&
|
|
962
|
+
h("div", { key: 'ad9fd03a6b983eb87ec37a63bf35d440ce7f908c', class: "delete-loader", "aria-hidden": "true" }, h("span", { key: 'e22bfb5dd729a865454cafb23f4d6eee9a2e3838', class: "spinner" })), h("div", { key: '730b9aa6e1bd773e8e8e9be5ee75c63ba5f69ad3', class: "modal-actions" }, h("button", { key: 'dd7b1ae63736e3c36b9b4894b969433a390e9ee4', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), h("button", { key: '113304b503ba82498a26c34b68ec9f217e6372a2', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
|
|
962
963
|
}
|
|
963
964
|
static get is() { return "phirepass-sftp-client"; }
|
|
964
965
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1133,6 +1134,25 @@ export class PhirepassSftpClient {
|
|
|
1133
1134
|
"reflect": false,
|
|
1134
1135
|
"attribute": "node-id"
|
|
1135
1136
|
},
|
|
1137
|
+
"serviceId": {
|
|
1138
|
+
"type": "string",
|
|
1139
|
+
"mutable": false,
|
|
1140
|
+
"complexType": {
|
|
1141
|
+
"original": "string",
|
|
1142
|
+
"resolved": "string",
|
|
1143
|
+
"references": {}
|
|
1144
|
+
},
|
|
1145
|
+
"required": true,
|
|
1146
|
+
"optional": false,
|
|
1147
|
+
"docs": {
|
|
1148
|
+
"tags": [],
|
|
1149
|
+
"text": ""
|
|
1150
|
+
},
|
|
1151
|
+
"getter": false,
|
|
1152
|
+
"setter": false,
|
|
1153
|
+
"reflect": false,
|
|
1154
|
+
"attribute": "service-id"
|
|
1155
|
+
},
|
|
1136
1156
|
"token": {
|
|
1137
1157
|
"type": "string",
|
|
1138
1158
|
"mutable": false,
|
|
@@ -86,6 +86,7 @@ export class PhirepassTerminal {
|
|
|
86
86
|
allowInsecure = false;
|
|
87
87
|
heartbeatInterval = 30_000;
|
|
88
88
|
nodeId;
|
|
89
|
+
serviceId;
|
|
89
90
|
token;
|
|
90
91
|
onNodeIdChange(newValue, _oldValue) {
|
|
91
92
|
// Handle the change in node_id here
|
|
@@ -342,7 +343,7 @@ export class PhirepassTerminal {
|
|
|
342
343
|
handle_auth_success(_auth_) {
|
|
343
344
|
this.clear_creds_buffer();
|
|
344
345
|
this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
|
|
345
|
-
this.channel.open_ssh_tunnel(this.nodeId);
|
|
346
|
+
this.channel.open_ssh_tunnel(this.nodeId, this.serviceId);
|
|
346
347
|
}
|
|
347
348
|
handle_tunnel_opened(web) {
|
|
348
349
|
this.session_id = web.sid;
|
|
@@ -437,7 +438,7 @@ export class PhirepassTerminal {
|
|
|
437
438
|
return;
|
|
438
439
|
}
|
|
439
440
|
this.inputMode = InputMode.Default;
|
|
440
|
-
this.channel.open_ssh_tunnel(this.nodeId, username);
|
|
441
|
+
this.channel.open_ssh_tunnel(this.nodeId, this.serviceId, username);
|
|
441
442
|
}
|
|
442
443
|
handle_password_input(data) {
|
|
443
444
|
if (data === "\r" || data === "\n") {
|
|
@@ -476,13 +477,13 @@ export class PhirepassTerminal {
|
|
|
476
477
|
this.inputMode = InputMode.Default;
|
|
477
478
|
// Assuming there's a method to submit password to the channel
|
|
478
479
|
// You may need to adjust this based on your actual API
|
|
479
|
-
this.channel.open_ssh_tunnel(this.nodeId, this.usernameBuffer.trim(), password);
|
|
480
|
+
this.channel.open_ssh_tunnel(this.nodeId, this.serviceId, this.usernameBuffer.trim(), password);
|
|
480
481
|
// Clear sensitive data
|
|
481
482
|
this.passwordBuffer = "";
|
|
482
483
|
this.usernameBuffer = "";
|
|
483
484
|
}
|
|
484
485
|
render() {
|
|
485
|
-
return (h(Host, { key: '
|
|
486
|
+
return (h(Host, { key: '8bc2181d5ca26f6e6552591b7d399f81bece3efa' }, h("div", { key: '4c7085ba44cebb23f7712fbfe4ea52a9e8bde6d7', id: "ccc", ref: el => (this.containerEl = el) })));
|
|
486
487
|
}
|
|
487
488
|
static get is() { return "phirepass-terminal"; }
|
|
488
489
|
static get encapsulation() { return "shadow"; }
|
|
@@ -615,6 +616,25 @@ export class PhirepassTerminal {
|
|
|
615
616
|
"reflect": false,
|
|
616
617
|
"attribute": "node-id"
|
|
617
618
|
},
|
|
619
|
+
"serviceId": {
|
|
620
|
+
"type": "string",
|
|
621
|
+
"mutable": false,
|
|
622
|
+
"complexType": {
|
|
623
|
+
"original": "string",
|
|
624
|
+
"resolved": "string",
|
|
625
|
+
"references": {}
|
|
626
|
+
},
|
|
627
|
+
"required": true,
|
|
628
|
+
"optional": false,
|
|
629
|
+
"docs": {
|
|
630
|
+
"tags": [],
|
|
631
|
+
"text": ""
|
|
632
|
+
},
|
|
633
|
+
"getter": false,
|
|
634
|
+
"setter": false,
|
|
635
|
+
"reflect": false,
|
|
636
|
+
"attribute": "service-id"
|
|
637
|
+
},
|
|
618
638
|
"token": {
|
|
619
639
|
"type": "string",
|
|
620
640
|
"mutable": false,
|
|
Binary file
|