phirepass-widgets 0.0.47 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-BiurVooY.js → index-DqslB2R4.js} +27 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +157 -19
- package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
- package/dist/cjs/phirepass-widgets.cjs.js +2 -2
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.css +243 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.download.svg +7 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +167 -18
- package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +1 -1
- package/dist/esm/{index-zZMsduaU.js → index-jdexunMF.js} +27 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/phirepass-sftp-client.entry.js +157 -19
- package/dist/esm/phirepass-terminal.entry.js +2 -2
- package/dist/esm/phirepass-widgets.js +3 -3
- package/dist/phirepass-widgets/p-11d53a8d.entry.js +1 -0
- package/dist/phirepass-widgets/{p-5b21bc31.entry.js → p-282d5896.entry.js} +5 -5
- package/dist/phirepass-widgets/p-jdexunMF.js +2 -0
- package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
- package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +23 -0
- package/package.json +1 -1
- package/dist/phirepass-widgets/p-32ca8ca5.entry.js +0 -1
- package/dist/phirepass-widgets/p-zZMsduaU.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-jdexunMF.js';
|
|
2
2
|
import { _ as __wbg_init, E as ErrorType, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-BcIhGXR0.js';
|
|
3
3
|
|
|
4
4
|
const phirepassSftpClientLogoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==';
|
|
@@ -17,7 +17,7 @@ const phirepassSftpClientRefreshSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0
|
|
|
17
17
|
|
|
18
18
|
const phirepassSftpClientUploadSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtdXBsb2FkIHctMy41IGgtMy41Ij4KICAgIDxwYXRoIGQ9Ik0yMSAxNXY0YTIgMiAwIDAgMS0yIDJINWEyIDIgMCAwIDEtMi0ydi00Ij48L3BhdGg+CiAgICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4Ij48L3BvbHlsaW5lPgogICAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIzIiB5Mj0iMTUiPjwvbGluZT4KPC9zdmc+Cg==';
|
|
19
19
|
|
|
20
|
-
const phirepassSftpClientCss = () => `:host{--radius:0.375rem;--card:220 18% 10%;--border:220 15% 18%;--primary:160 60% 45%;--radius:0.375rem;--destructive:0 70% 50%;--muted:220 15% 13%;--muted-foreground:220 10% 50%;--primary-foreground:220 20% 7%;--scroll-track:220 16% 12%;--scroll-thumb:220 12% 34%;--scroll-thumb-hover:160 45% 44%;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;height:100%;width:100%;border:1px solid hsl(var(--border));background-color:hsl(var(--card));border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;position:relative;.listing{flex:1;display:flex;flex-direction:column;justify-content:space-between;min-height:0;header{height:30px;background:rgba(28, 31, 38, 0.6);border-bottom:1px solid hsl(var(--border));display:flex;align-items:center;justify-content:space-between;.actions{display:flex;align-items:center;.action{cursor:pointer;padding:4px;display:flex;align-items:center;z-index:1;img{height:14px;padding:4px;border-radius:4px}&:hover{background-color:hsl(var(--border) / 0.6)}}}.title{color:hsl(var(--primary));height:14px;padding:0 12px;display:flex;align-items:center;font-size:0.75rem;line-height:1rem;img{height:14px;margin-right:5px}.text{display:flex;flex-direction:row;justify-content:center;margin-top:2px;.name{margin-right:10px}.description{color:hsl(var(--muted-foreground))}}}}main{flex:1;display:flex;flex-direction:column;position:relative;min-height:0;overflow:hidden;.loader{color:hsl(var(--muted-foreground));font-size:13px;animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;text-align:center;display:flex;align-items:center;justify-content:center;position:absolute;height:100%;width:100%;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.error{font-size:13px;text-align:center;color:hsl(var(--destructive));height:100%;display:flex;align-items:center;justify-content:center}.navigation{height:25px;padding:10px;font-size:0.75rem;line-height:1rem;background-color:hsl(var(--card));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid hsl(var(--border));position:sticky;top:0;z-index:3;.breadcrumbs{display:flex;align-items:center;margin-right:10px;.breadcrumb{color:hsl(var(--primary));margin-right:4px;cursor:pointer;&:after{margin-left:4px}&:hover{color:rgb(189, 219, 209)}&:last-child{margin-right:0;color:rgb(189, 219, 209);cursor:default}}.arrow{height:12px;width:12px;opacity:0.6;top:2px;margin-right:4px;position:relative}}.actions{display:flex;align-items:center;gap:8px}.action{border:none;background:transparent;color:rgb(189, 219, 209);font-size:1.1rem;line-height:1;padding:2px 4px;border-radius:4px;cursor:pointer;&:hover{background-color:hsl(var(--border) / 0.6)}img{height:14px;width:14px;display:block}}.action.disconnect{color:#ff4d5f;font-size:0.65rem;letter-spacing:0.08em;padding:4px 8px;&:hover{color:#ff6b7a;background-color:hsl(var(--destructive) / 0.12)}}}.content{flex:1;min-height:0;overflow:auto;font-size:0.75rem;line-height:1rem;scrollbar-width:thin;scrollbar-color:hsl(var(--scroll-thumb)) hsl(var(--scroll-track));&::-webkit-scrollbar{width:10px;height:10px}&::-webkit-scrollbar-track{background:hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb{background:hsl(var(--scroll-thumb));border-radius:999px;border:2px solid hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb:hover{background:hsl(var(--scroll-thumb-hover))}table{width:100%;border-collapse:separate;border-spacing:0;thead{background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));th{padding:8px 10px;text-align:left;color:hsl(var(--muted-foreground));position:sticky;top:0;z-index:2;background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));line-height:0.95rem}}tbody{padding:10px 10px;tr{border-bottom:1px solid hsl(var(--border) / 0.4);td{padding:10px 10px 9px;color:hsl(var(--muted-foreground));.name{&.file{color:rgb(189, 219, 209)}&.folder{color:hsl(var(--primary))}}.kind{height:14px;width:14px;margin-right:5px;top:3px;position:relative}}&:hover{cursor:pointer;background-color:hsl(var(--muted) / 0.4)}&.selected{background-color:hsl(var(--primary) / 0.3)
|
|
20
|
+
const phirepassSftpClientCss = () => `:host{--radius:0.375rem;--card:220 18% 10%;--border:220 15% 18%;--primary:160 60% 45%;--radius:0.375rem;--destructive:0 70% 50%;--muted:220 15% 13%;--muted-foreground:220 10% 50%;--primary-foreground:220 20% 7%;--scroll-track:220 16% 12%;--scroll-thumb:220 12% 34%;--scroll-thumb-hover:160 45% 44%;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;height:100%;width:100%;border:1px solid hsl(var(--border));background-color:hsl(var(--card));border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;position:relative;.listing{flex:1;display:flex;flex-direction:column;justify-content:space-between;min-height:0;header{height:30px;background:rgba(28, 31, 38, 0.6);border-bottom:1px solid hsl(var(--border));display:flex;align-items:center;justify-content:space-between;.actions{display:flex;align-items:center;.action{cursor:pointer;padding:4px;display:flex;align-items:center;z-index:1;img{height:14px;padding:4px;border-radius:4px}&:hover{background-color:hsl(var(--border) / 0.6)}}}.title{color:hsl(var(--primary));height:14px;padding:0 12px;display:flex;align-items:center;font-size:0.75rem;line-height:1rem;img{height:14px;margin-right:5px}.text{display:flex;flex-direction:row;justify-content:center;margin-top:2px;.name{margin-right:10px}.description{color:hsl(var(--muted-foreground))}}}}main{flex:1;display:flex;flex-direction:column;position:relative;min-height:0;overflow:hidden;.loader{color:hsl(var(--muted-foreground));font-size:13px;animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;text-align:center;display:flex;align-items:center;justify-content:center;position:absolute;height:100%;width:100%;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.error{font-size:13px;text-align:center;color:hsl(var(--destructive));height:100%;display:flex;align-items:center;justify-content:center}.navigation{height:25px;padding:10px;font-size:0.75rem;line-height:1rem;background-color:hsl(var(--card));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid hsl(var(--border));position:sticky;top:0;z-index:3;.breadcrumbs{display:flex;align-items:center;margin-right:10px;.breadcrumb{color:hsl(var(--primary));margin-right:4px;cursor:pointer;&:after{margin-left:4px}&:hover{color:rgb(189, 219, 209)}&:last-child{margin-right:0;color:rgb(189, 219, 209);cursor:default}}.arrow{height:12px;width:12px;opacity:0.6;top:2px;margin-right:4px;position:relative}}.actions{display:flex;align-items:center;gap:8px}.action{border:none;background:transparent;color:rgb(189, 219, 209);font-size:1.1rem;line-height:1;padding:2px 4px;border-radius:4px;cursor:pointer;&:hover{background-color:hsl(var(--border) / 0.6)}img{height:14px;width:14px;display:block}}.action.disconnect{color:#ff4d5f;font-size:0.65rem;letter-spacing:0.08em;padding:4px 8px;&:hover{color:#ff6b7a;background-color:hsl(var(--destructive) / 0.12)}}}.content{flex:1;min-height:0;overflow:auto;font-size:0.75rem;line-height:1rem;scrollbar-width:thin;scrollbar-color:hsl(var(--scroll-thumb)) hsl(var(--scroll-track));&::-webkit-scrollbar{width:10px;height:10px}&::-webkit-scrollbar-track{background:hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb{background:hsl(var(--scroll-thumb));border-radius:999px;border:2px solid hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb:hover{background:hsl(var(--scroll-thumb-hover))}table{width:100%;border-collapse:separate;border-spacing:0;thead{background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));th{padding:8px 10px;text-align:left;color:hsl(var(--muted-foreground));position:sticky;top:0;z-index:2;background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));line-height:0.95rem;&.action-col{width:58px;min-width:58px;padding:0 10px}}}tbody{padding:10px 10px;tr{border-bottom:1px solid hsl(var(--border) / 0.4);td{padding:10px 10px 9px;color:hsl(var(--muted-foreground));&.action-col{width:58px;min-width:58px;text-align:center;padding-left:1px;padding-right:1px;.file-actions{display:flex;align-items:center;justify-content:center;gap:8px}.file-action{border:none;background:transparent;color:hsl(var(--muted-foreground));width:16px;height:16px;border-radius:3px;cursor:pointer;opacity:0;visibility:hidden;pointer-events:none;transition:opacity 120ms ease;padding:0;svg{width:12px;height:12px;display:block;margin:0 auto}&:hover{color:hsl(var(--primary))}&.delete:hover{color:hsl(var(--destructive))}}}.name{&.file{color:rgb(189, 219, 209)}&.folder{color:hsl(var(--primary))}}.kind{height:14px;width:14px;margin-right:5px;top:3px;position:relative}}&:hover{cursor:pointer;background-color:hsl(var(--muted) / 0.4);td.action-col .file-action{opacity:1;visibility:visible;pointer-events:auto;color:hsl(var(--primary))}}&.selected{background-color:hsl(var(--primary) / 0.3);td.action-col .file-action{opacity:1;visibility:visible;pointer-events:auto}&:hover{background-color:hsl(var(--primary) / 0.4)}}}}}}}footer{height:25px;background:rgba(28, 31, 38, 0.6);border-top:1px solid hsl(var(--border));font-size:0.75rem;line-height:1rem;display:flex;align-items:center;justify-content:space-between;padding:0 10px;.status{font-size:0.65rem;color:hsl(var(--muted-foreground));.selected-item{margin-left:10px;color:hsl(var(--primary))}}.version{font-size:0.65rem;color:hsl(var(--muted-foreground))}}}.creds{position:absolute;top:0;left:0;height:100%;width:100%;display:flex;justify-content:center;align-items:center;;&.blurred{background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.auth{display:flex;flex-direction:column;background:hsl(var(--card));position:relative;background-color:rgba(21, 24, 30, 0.95);border:1px solid hsl(var(--border));padding:30px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;border-radius:var(--radius);.title{margin-bottom:12px;color:hsl(var(--primary))}label{font-size:0.75rem;line-height:1rem;margin-bottom:1rem;color:hsl(var(--muted-foreground))}input{font-size:0.875rem;line-height:1.25rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;background-color:rgb(28, 31, 38);border-color:rgb(39, 44, 53);border-width:1px;border-radius:calc(var(--radius) - 2px);width:100%;margin-bottom:12px;color:rgb(189, 219, 209);box-sizing:border-box;&:focus{outline:none;border-color:hsl(var(--primary));box-shadow:0 0 0 1px hsl(var(--primary))}}button[type='submit']{margin-top:12px;width:100%;background-color:hsl(var(--primary));color:hsl(var(--primary-foreground));letter-spacing:0.05em;font-size:13px;font-weight:500;padding:0.5rem 1rem;border-radius:calc(var(--radius) - 2px);height:2rem;cursor:pointer;border:none;&:hover{background-color:hsl(var(--primary) / 0.9)}}}}.upload-modal,.download-modal,.delete-modal{position:absolute;inset:0;display:none;align-items:center;justify-content:center;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px);z-index:6;&.visible{display:flex}.upload-dialog,.download-dialog,.delete-dialog{width:min(360px, calc(100% - 24px));background-color:rgba(21, 24, 30, 0.96);border:1px solid hsl(var(--border));border-radius:var(--radius);padding:16px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;.title{color:hsl(var(--primary));font-size:0.8rem;margin-bottom:8px}.file-name{color:rgb(189, 219, 209);font-size:0.72rem;line-height:1rem;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.progress-track{width:100%;height:10px;border-radius:999px;background-color:hsl(var(--muted));overflow:hidden;border:1px solid hsl(var(--border));.progress-fill{height:100%;width:0;background:linear-gradient(90deg, hsl(var(--primary) / 0.7), hsl(var(--primary)));transition:width 140ms ease}}.progress-value{margin-top:8px;color:hsl(var(--muted-foreground));font-size:0.7rem;text-align:right}.cancel{margin-top:14px;width:100%;height:2rem;border:1px solid hsl(var(--border));border-radius:calc(var(--radius) - 2px);background:hsl(var(--muted));color:rgb(189, 219, 209);font-size:0.75rem;letter-spacing:0.03em;cursor:pointer;&:hover{border-color:hsl(var(--primary));color:hsl(var(--primary))}&.finished{background-color:hsl(var(--primary));border-color:hsl(var(--primary));color:hsl(var(--primary-foreground));&:hover{background-color:hsl(var(--primary) / 0.9);border-color:hsl(var(--primary) / 0.9);color:hsl(var(--primary-foreground))}}}.message{color:rgb(189, 219, 209);font-size:0.74rem;line-height:1rem;margin-bottom:8px}.modal-actions{margin-top:14px;display:grid;grid-template-columns:1fr 1fr;gap:8px;.btn{height:2rem;border:1px solid hsl(var(--border));border-radius:calc(var(--radius) - 2px);font-size:0.75rem;letter-spacing:0.03em;cursor:pointer;&:disabled{opacity:0.65;cursor:not-allowed}}.btn.secondary{background:hsl(var(--muted));color:rgb(189, 219, 209);&:hover{border-color:hsl(var(--primary));color:hsl(var(--primary))}}.btn.destructive{background:hsl(var(--destructive));border-color:hsl(var(--destructive));color:white;&:hover{background:hsl(var(--destructive) / 0.9);border-color:hsl(var(--destructive) / 0.9)}}}.delete-loading-bar{margin-top:2px;width:100%;height:8px;border-radius:999px;border:1px solid hsl(var(--border));background:linear-gradient(90deg, hsl(var(--muted)) 0%, hsl(var(--muted)) 100%), linear-gradient(90deg, hsl(var(--primary) / 0.3), hsl(var(--primary)), hsl(var(--primary) / 0.3));background-repeat:no-repeat;background-size:100% 100%, 40% 100%;animation:delete-loading 1s linear infinite}}}}@keyframes delete-loading{from{background-position:0 0, -45% 0}to{background-position:0 0, 145% 0}}:host(.max){height:100vh;width:100vw;position:fixed;top:0;left:0;z-index:9999}`;
|
|
21
21
|
|
|
22
22
|
const PhirepassSftpClient = class {
|
|
23
23
|
constructor(hostRef) {
|
|
@@ -30,6 +30,9 @@ const PhirepassSftpClient = class {
|
|
|
30
30
|
runtimeReady = false;
|
|
31
31
|
connected = false;
|
|
32
32
|
uploadInputEl;
|
|
33
|
+
uploadProgressHandle;
|
|
34
|
+
downloadProgressHandle;
|
|
35
|
+
deleteLoadingTimeout;
|
|
33
36
|
// private inputMode: InputMode = InputMode.Default;
|
|
34
37
|
session_id;
|
|
35
38
|
// private usernameBuffer = "";
|
|
@@ -87,6 +90,17 @@ const PhirepassSftpClient = class {
|
|
|
87
90
|
version = '';
|
|
88
91
|
status = 'Disconnected';
|
|
89
92
|
selected_item = null;
|
|
93
|
+
show_upload_modal = false;
|
|
94
|
+
upload_progress = 0;
|
|
95
|
+
upload_file_name = '';
|
|
96
|
+
upload_finished = false;
|
|
97
|
+
show_download_modal = false;
|
|
98
|
+
download_progress = 0;
|
|
99
|
+
download_file_name = '';
|
|
100
|
+
download_finished = false;
|
|
101
|
+
show_delete_modal = false;
|
|
102
|
+
delete_file_name = '';
|
|
103
|
+
delete_loading = false;
|
|
90
104
|
toggle_max() {
|
|
91
105
|
this.maximizeEvent?.emit(!this.max);
|
|
92
106
|
}
|
|
@@ -117,9 +131,30 @@ const PhirepassSftpClient = class {
|
|
|
117
131
|
this.connected = false;
|
|
118
132
|
this.domReady = false;
|
|
119
133
|
this.runtimeReady = false;
|
|
134
|
+
this.clear_upload_progress();
|
|
135
|
+
this.clear_download_progress();
|
|
136
|
+
this.clear_delete_loading_timeout();
|
|
120
137
|
this.close_comms();
|
|
121
138
|
// this.destroy_terminal();
|
|
122
139
|
}
|
|
140
|
+
clear_upload_progress() {
|
|
141
|
+
if (this.uploadProgressHandle !== undefined) {
|
|
142
|
+
window.clearInterval(this.uploadProgressHandle);
|
|
143
|
+
this.uploadProgressHandle = undefined;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
clear_download_progress() {
|
|
147
|
+
if (this.downloadProgressHandle !== undefined) {
|
|
148
|
+
window.clearInterval(this.downloadProgressHandle);
|
|
149
|
+
this.downloadProgressHandle = undefined;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
clear_delete_loading_timeout() {
|
|
153
|
+
if (this.deleteLoadingTimeout !== undefined) {
|
|
154
|
+
window.clearTimeout(this.deleteLoadingTimeout);
|
|
155
|
+
this.deleteLoadingTimeout = undefined;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
123
158
|
connect() {
|
|
124
159
|
this.connected = true;
|
|
125
160
|
this.channel.connect();
|
|
@@ -309,25 +344,109 @@ const PhirepassSftpClient = class {
|
|
|
309
344
|
disconnect_session() {
|
|
310
345
|
this.close_comms();
|
|
311
346
|
this.session_id = undefined;
|
|
312
|
-
this.status = 'Disconnected';
|
|
313
347
|
this.show_loader = false;
|
|
348
|
+
this.show_content = false;
|
|
349
|
+
this.breadcrumbs = [];
|
|
350
|
+
this.current_dir = '.';
|
|
351
|
+
this.listing = [];
|
|
352
|
+
this.show_navigation = false;
|
|
353
|
+
this.show_login_screen_username = false;
|
|
354
|
+
this.show_login_screen_password = false;
|
|
355
|
+
this.show_login_screen = false;
|
|
356
|
+
this.version = '';
|
|
357
|
+
this.status = 'Disconnected';
|
|
358
|
+
}
|
|
359
|
+
on_file_row_action(item, event) {
|
|
360
|
+
event.preventDefault();
|
|
361
|
+
event.stopPropagation();
|
|
362
|
+
this.selected_item = item;
|
|
363
|
+
this.download_file_name = item.name;
|
|
364
|
+
this.download_progress = 0;
|
|
365
|
+
this.download_finished = false;
|
|
366
|
+
this.show_download_modal = true;
|
|
367
|
+
this.clear_download_progress();
|
|
368
|
+
this.downloadProgressHandle = window.setInterval(() => {
|
|
369
|
+
if (this.download_progress >= 100) {
|
|
370
|
+
this.clear_download_progress();
|
|
371
|
+
this.download_finished = true;
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
this.download_progress = Math.min(100, this.download_progress + 5);
|
|
375
|
+
}, 180);
|
|
376
|
+
}
|
|
377
|
+
on_file_delete_action(item, event) {
|
|
378
|
+
event.preventDefault();
|
|
379
|
+
event.stopPropagation();
|
|
380
|
+
this.selected_item = item;
|
|
381
|
+
this.delete_file_name = item.name;
|
|
382
|
+
this.delete_loading = false;
|
|
383
|
+
this.show_delete_modal = true;
|
|
384
|
+
}
|
|
385
|
+
cancel_delete() {
|
|
386
|
+
if (this.delete_loading) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
this.show_delete_modal = false;
|
|
390
|
+
this.delete_file_name = '';
|
|
391
|
+
this.delete_loading = false;
|
|
392
|
+
}
|
|
393
|
+
confirm_delete() {
|
|
394
|
+
if (this.delete_loading) {
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
this.delete_loading = true;
|
|
398
|
+
const deletingFileName = this.delete_file_name;
|
|
399
|
+
this.clear_delete_loading_timeout();
|
|
400
|
+
this.deleteLoadingTimeout = window.setTimeout(() => {
|
|
401
|
+
this.show_delete_modal = false;
|
|
402
|
+
this.delete_loading = false;
|
|
403
|
+
this.show_error = true;
|
|
404
|
+
this.error_message = `Delete for "${deletingFileName}" is not available yet.`;
|
|
405
|
+
window.setTimeout(() => {
|
|
406
|
+
this.show_error = false;
|
|
407
|
+
}, 2_000);
|
|
408
|
+
this.delete_file_name = '';
|
|
409
|
+
this.deleteLoadingTimeout = undefined;
|
|
410
|
+
}, 1_100);
|
|
314
411
|
}
|
|
315
412
|
open_upload_picker() {
|
|
316
413
|
this.uploadInputEl?.click();
|
|
317
414
|
}
|
|
318
415
|
on_upload_selected(event) {
|
|
319
416
|
const input = event.target;
|
|
320
|
-
const
|
|
321
|
-
if (!
|
|
417
|
+
const selectedFile = input.files?.[0];
|
|
418
|
+
if (!selectedFile) {
|
|
322
419
|
return;
|
|
323
420
|
}
|
|
324
|
-
this.
|
|
325
|
-
this.
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
421
|
+
this.upload_file_name = selectedFile.name;
|
|
422
|
+
this.upload_progress = 0;
|
|
423
|
+
this.upload_finished = false;
|
|
424
|
+
this.show_upload_modal = true;
|
|
425
|
+
this.clear_upload_progress();
|
|
426
|
+
this.uploadProgressHandle = window.setInterval(() => {
|
|
427
|
+
if (this.upload_progress >= 100) {
|
|
428
|
+
this.clear_upload_progress();
|
|
429
|
+
this.upload_finished = true;
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
this.upload_progress = Math.min(100, this.upload_progress + 5);
|
|
433
|
+
}, 180);
|
|
329
434
|
input.value = '';
|
|
330
435
|
}
|
|
436
|
+
cancel_upload() {
|
|
437
|
+
this.clear_upload_progress();
|
|
438
|
+
this.show_upload_modal = false;
|
|
439
|
+
this.upload_progress = 0;
|
|
440
|
+
this.upload_file_name = '';
|
|
441
|
+
this.upload_finished = false;
|
|
442
|
+
}
|
|
443
|
+
cancel_download() {
|
|
444
|
+
this.clear_download_progress();
|
|
445
|
+
this.show_download_modal = false;
|
|
446
|
+
this.download_progress = 0;
|
|
447
|
+
this.download_file_name = '';
|
|
448
|
+
this.download_finished = false;
|
|
449
|
+
}
|
|
331
450
|
is_selected(item) {
|
|
332
451
|
if (!this.selected_item) {
|
|
333
452
|
return false;
|
|
@@ -358,17 +477,18 @@ const PhirepassSftpClient = class {
|
|
|
358
477
|
return [item.path, item.name].join('/');
|
|
359
478
|
}
|
|
360
479
|
render() {
|
|
361
|
-
return (h(Host, { key: '
|
|
480
|
+
return (h(Host, { key: '31a797ab81c687e6aaea760d882e8078d4ab226f', class: {
|
|
362
481
|
'default': !this.max,
|
|
363
482
|
'max': this.max,
|
|
364
|
-
} }, h("section", { key: '
|
|
365
|
-
h("header", { key: '
|
|
483
|
+
} }, h("section", { key: '0dd1df187509d0f2c3dc172119f97224a1fb8234', class: "listing" }, !this.hideHeader &&
|
|
484
|
+
h("header", { key: 'af24358a2d1d6ec9dc282683b1feff0a29287dd0' }, h("section", { key: 'f0195c9b0f99fe3c7ca64c7db04a3b08255bb58e', class: "title" }, h("img", { key: 'e04889ab957ccddb181850a5a787b6e40191842e', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), h("div", { key: 'dc364ca7481d3b78e99319c66a6a40dc29100ea4', class: "text" }, h("div", { key: '7b226fe3a81631656e8fce0b5a69854c3aaeb9c5', class: "name" }, this.name), h("div", { key: '8a843a5134ed28a985d2d1787b17ea3c7436bd45', class: "description" }, this.description))), h("section", { key: '73aec9dd75115faf4dfbcdfde1a076c960954923', class: "actions" }, h("div", { key: 'ce75ef7f9c3433e9d6dfadb41e0716a165666ee8', class: "action", onClick: () => this.toggle_max() }, h("img", { key: 'abbba7e239c57a52dfd46ed23aeeac81874f097c', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), h("main", { key: 'fbdd529cfb3090f41dba72f7333efe3a1af29aa4' }, this.show_navigation && h("nav", { key: '17601f7bf03f76169a14803ad0cc11b21f72df8d', class: "navigation" }, h("div", { key: '55fffc7a4686e4978002b9edf6334b07fc57322b', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index, breadcrumbs) => (h(h.Fragment, null, h("span", { key: index, onClick: () => this.list_breadcrumb(crumb.path), class: "breadcrumb" }, crumb.label), index < breadcrumbs.length - 1 && h("img", { class: "arrow", src: phirepassSftpClientChevronSvg }))))), h("section", { key: '163eb105d575eddebad721f4e114ea8f5a8e44a1', class: "actions", "aria-label": "SFTP actions" }, h("button", { key: 'ad9cbebffdc46ba08b3d05adc33a18ad027f1b3d', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, h("img", { key: '4f1bfd8154df3df70f8892b1f17391f06ac5ea3e', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), h("button", { key: '5bcb098f9fcfb61e6af07e9224617e82ce9e8e8b', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, h("img", { key: '863997b8a0ad3f465b68c10747739aa6bc123934', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), h("button", { key: 'dcae91b637f58f7567709367b4607148ba6c84ce', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, h("img", { key: '75baffc951eb5bef65be10e1b77d782048fe19bc', src: phirepassSftpClientUploadSvg, alt: "Upload" })), h("button", { key: '7ce741e5e4538bfa50b330128153584cae966865', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), h("input", { key: '86686c4eb1f5e56e2828687c8843ac0a0f79028b', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && h("div", { key: 'd5be43d27ae7933ad1eea5d9c7d53b3a4fa4d292', class: "content" }, h("table", { key: 'e6f57d64703faef89347da8c412eb4b224878a68' }, h("thead", { key: '89979dd9702878b6d0bccddb971c1e42353c4515' }, h("tr", { key: '9c744d7e8e12bd189ba17f6b2b7a4f371b4932eb' }, h("th", { key: '6f29cf58e3000d3d02881d38ca8065ab4174300d' }, "Name"), h("th", { key: '79ec3f7d0ac3a12a450f275845360576bd1430c6' }, "Size"), h("th", { key: 'ea1718d678f7016472688d7d08d311aad727dcc9' }, "Permissions"), h("th", { key: '6272cb391bd19801f9967b704185520799dc8a11' }, "Owner"), h("th", { key: '91fec7f7e28354e88a12fc7f92c543172800f0b3' }, "Modified"), h("th", { key: '6256a9926941f12ce4807c926e09c3a39c776d2d', class: "action-col", "aria-label": "Actions" }))), h("tbody", { key: 'f1e57f678a8381e4dad5c8daab6624849378b012' }, this.listing.map((item, index) => (h("tr", { key: index, class: {
|
|
366
485
|
'selected': this.is_selected(item),
|
|
367
|
-
}, onClick: () => this.list_directory(item) }, h("td", null, item.kind === 'Folder' ? h("img", { class: "kind", src: phirepassSftpClientFolderSvg, alt: "Folder" }) : h("img", { class: "kind", src: phirepassSftpClientFileSvg, alt: "File" }), h("span", { class: `name ${item.kind.toLowerCase()}` }, item.name)), h("td", null, item.attributes.size), h("td", null, item.attributes.permissions ?? '-'), h("td", null, item.attributes.user ?? '-'), h("td", null, new Date(item.attributes.mtime * 1000).toLocaleString())
|
|
368
|
-
h("section", { key: '
|
|
486
|
+
}, onClick: () => this.list_directory(item) }, h("td", null, item.kind === 'Folder' ? h("img", { class: "kind", src: phirepassSftpClientFolderSvg, alt: "Folder" }) : h("img", { class: "kind", src: phirepassSftpClientFileSvg, alt: "File" }), h("span", { class: `name ${item.kind.toLowerCase()}` }, item.name)), h("td", null, item.attributes.size), h("td", null, item.attributes.permissions ?? '-'), h("td", null, item.attributes.user ?? '-'), h("td", null, new Date(item.attributes.mtime * 1000).toLocaleString()), h("td", { class: "action-col" }, item.kind === 'File' &&
|
|
487
|
+
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: '141c34cb925c0e42fca1e0397b610071b360c0d1', class: "loader" }, "Loading..."), this.show_error && h("div", { key: 'ebf97cf4b7307514e724c7778c4a9052ec32c68d', class: "error" }, this.error_message)), h("footer", { key: '1f243a6d09afe5380466dec79226bde67679ace8' }, h("section", { key: '59f7e3dd679213d76294c347f1af8ca4f3d5b3e6', class: "status" }, h("span", { key: '4aaebcfa2fea3e69d02814727c63484fd465dfee' }, this.status), this.selected_item && h("span", { key: '5f37d4f9a82a97cd5065651d5f4311104153b8a7', class: "selected-item" }, this.get_full_path(this.selected_item))), h("section", { key: '0a75c580bb9ce63e58e4cd3aef76f13f5d8a6c43', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
|
|
488
|
+
h("section", { key: 'bf83e07198a7bd7f6b11164261496cee880e8e95', class: {
|
|
369
489
|
'creds': true,
|
|
370
490
|
'blurred': this.show_login_screen,
|
|
371
|
-
} }, h("form", { key: '
|
|
491
|
+
} }, h("form", { key: 'c0b3f36031b3d0575e0dfc4d4e5c689a3e86093e', class: "auth", onSubmit: (event) => {
|
|
372
492
|
const formData = new FormData(event.target);
|
|
373
493
|
let username = undefined;
|
|
374
494
|
if (this.show_login_screen_username) {
|
|
@@ -385,9 +505,27 @@ const PhirepassSftpClient = class {
|
|
|
385
505
|
this.show_loader = true;
|
|
386
506
|
event.stopPropagation();
|
|
387
507
|
event.preventDefault();
|
|
388
|
-
} }, h("div", { key: '
|
|
389
|
-
h("div", { key: '
|
|
390
|
-
h("div", { key: '
|
|
508
|
+
} }, h("div", { key: 'f8f811323c0aaa9d2c6e7c70b39e2bc58073f500', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
|
|
509
|
+
h("div", { key: '9d37d47a0c3d7235711964979389e34e7ae909e4' }, h("label", { key: '870aefcf5b1052663df6564158f85f0a1a6c14fc', htmlFor: "username" }, "Username"), h("input", { key: 'b51ee3b3f4a73c7116ace5d1d111d76e6c2d44a2', id: "username", autoComplete: 'off', name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
|
|
510
|
+
h("div", { key: 'f727237549f83c27639f943414665eab507d3e0b' }, h("label", { key: 'e0607fbaa128a26ca8a6ce2be5976c2be66cf1a8', htmlFor: "password" }, "Password"), h("input", { key: '4458ad7c4927bf21e27c9b979c14d5d3ca377514', id: "password", autoComplete: 'off', name: "password", type: "password", placeholder: "" })), h("div", { key: '7e3a5f468cc73a370558d4f447e1e7e91ea9dff2' }, h("button", { key: 'c63922f8ffd4377a13c76f51108e8fc9cfa7cdfa', type: "submit" }, "Connect")))), this.show_upload_modal &&
|
|
511
|
+
h("section", { key: 'b7935f9ab9e2cbfc8ecb66aff2c212e8f008675f', class: {
|
|
512
|
+
'upload-modal': true,
|
|
513
|
+
'visible': this.show_upload_modal,
|
|
514
|
+
} }, h("div", { key: 'e7c84c44c5ccec4d7211dd647abee21ba9e4dded', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, h("div", { key: '42411ccf81daad3d6f94455ec5f39a2ec8bd32ce', class: "title" }, "Uploading File"), h("div", { key: 'd7e6db3d7af27e69533bf2bcc532ab36de241a84', class: "file-name", title: this.upload_file_name }, this.upload_file_name), h("div", { key: '3b1e1eb29e1d9b737bf52c3e9d59c33871d661fc', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, h("div", { key: '36d23d0a85747aa12f36b05caa4fa047095245b9', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), h("div", { key: 'd981d282d1ad7216eee6a6ea8eaf0b48655d6b00', class: "progress-value" }, this.upload_progress, "%"), h("button", { key: '1e5eb505505098bc88fadad649da78e4f291e8c3', type: "button", class: {
|
|
515
|
+
'cancel': true,
|
|
516
|
+
'finished': this.upload_finished,
|
|
517
|
+
}, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
|
|
518
|
+
h("section", { key: 'f2d75e7719e5a5ecad1dc37145da05cedefc53eb', class: {
|
|
519
|
+
'download-modal': true,
|
|
520
|
+
'visible': this.show_download_modal,
|
|
521
|
+
} }, h("div", { key: '248a10deae9f5869290a362d2ec0dc49480c2f6a', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, h("div", { key: '05f2f39b31a59ecb402c8b803b9ba8819d9b41d3', class: "title" }, "Downloading File"), h("div", { key: '9979cfdbd9f0ac1888fbce3050ea51f1ac7fbc13', class: "file-name", title: this.download_file_name }, this.download_file_name), h("div", { key: '5a0edbdb962e730fb8b4ff6ed06d1826e84d6ee4', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, h("div", { key: 'fdb25a6a1a42cb82050b4d6e4da4cae52c09ecc1', class: "progress-fill", style: { width: `${this.download_progress}%` } })), h("div", { key: '2b9d47914221aa0537c0317b87cebedeb5c99b57', class: "progress-value" }, this.download_progress, "%"), h("button", { key: '15dee8510d3468eb00131248d7c2e6d31349b650', type: "button", class: {
|
|
522
|
+
'cancel': true,
|
|
523
|
+
'finished': this.download_finished,
|
|
524
|
+
}, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
|
|
525
|
+
h("section", { key: '5b5fd8c394811a4f5a2c285b331ed0a989729fea', class: {
|
|
526
|
+
'delete-modal': true,
|
|
527
|
+
'visible': this.show_delete_modal,
|
|
528
|
+
} }, h("div", { key: 'db2010aa154ececde47f5a5b4c3da485db786b0e', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, h("div", { key: '2fdb21392ad194cf7b72bb07391d6fc469b72cea', class: "title" }, "Delete File"), h("div", { key: '28ea5040b1111a888d230fd9aa6c34ada0003132', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), h("div", { key: '123138ed8bf191e0dd4d1d9ab0409a15caa2aec2', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading && h("div", { key: '7a30da76db24c7ecb56877ab055fca6f84ba995b', class: "delete-loading-bar", "aria-hidden": "true" }), h("div", { key: 'c6eda63ce75896cc6540f509c81e895b3317e197', class: "modal-actions" }, h("button", { key: '54e7f01e6858f1ac0a73091ed7a6a3666bfad968', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), h("button", { key: 'f647a2772cb3a14cb42fc6d654c5068bf9e3f7f1', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
|
|
391
529
|
}
|
|
392
530
|
static get watchers() { return {
|
|
393
531
|
"nodeId": [{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, g as getElement, h as h$1, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement, h as h$1, H as Host } from './index-jdexunMF.js';
|
|
2
2
|
import { I as InputMode, _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType, E as ErrorType } from './protocol-BcIhGXR0.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -692,7 +692,7 @@ const PhirepassTerminal = class {
|
|
|
692
692
|
this.usernameBuffer = "";
|
|
693
693
|
}
|
|
694
694
|
render() {
|
|
695
|
-
return (h$1(Host, { key: '
|
|
695
|
+
return (h$1(Host, { key: '0df9307a490dc566e41be1e1d169f8862f8569b9' }, h$1("div", { key: 'c63a16718ef4a559b880c6058bf482db4aeb6af1', id: "ccc", ref: el => (this.containerEl = el) })));
|
|
696
696
|
}
|
|
697
697
|
static get watchers() { return {
|
|
698
698
|
"nodeId": [{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-jdexunMF.js';
|
|
2
|
+
export { s as setNonce } from './index-jdexunMF.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["phirepass-sftp-client",[[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],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal",[[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);
|
|
20
|
+
return bootstrapLazy([["phirepass-sftp-client",[[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_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[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",[[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);
|
|
21
21
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as i,h as a,H as t}from"./p-jdexunMF.js";import{_ as s,E as o,C as r,a as d,P as l}from"./p-BcIhGXR0.js";const c=class{constructor(a){e(this,a),this.maximizeEvent=i(this,"maximize"),this.connectionStateChanged=i(this,"connectionStateChanged")}channel;domReady=!1;runtimeReady=!1;connected=!1;uploadInputEl;uploadProgressHandle;downloadProgressHandle;deleteLoadingTimeout;session_id;name="SFTP";description="Client";hideHeader=!1;serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;token;onNodeIdChange(e,i){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),e&&(this.open_comms(),this.channel.connect(),this.status="Connecting...")}serverId;onServerIdChange(e,i){this.onNodeIdChange(this.nodeId,this.nodeId)}maximizeEvent;async maximize(){this.max=!this.max}async minimize(){this.max=!1}connectionStateChanged;max=!1;show_login_screen=!1;show_login_screen_username=!1;show_error=!1;error_message="";show_login_screen_password=!1;show_navigation=!1;breadcrumbs=[];current_dir=".";listing=[];show_content=!1;show_loader=!1;version="";status="Disconnected";selected_item=null;show_upload_modal=!1;upload_progress=0;upload_file_name="";upload_finished=!1;show_download_modal=!1;download_progress=0;download_file_name="";download_finished=!1;show_delete_modal=!1;delete_file_name="";delete_loading=!1;toggle_max(){this.maximizeEvent?.emit(!this.max)}async connectedCallback(){await s(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to terminal.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.clear_upload_progress(),this.clear_download_progress(),this.clear_delete_loading_timeout(),this.close_comms()}clear_upload_progress(){void 0!==this.uploadProgressHandle&&(window.clearInterval(this.uploadProgressHandle),this.uploadProgressHandle=void 0)}clear_download_progress(){void 0!==this.downloadProgressHandle&&(window.clearInterval(this.downloadProgressHandle),this.downloadProgressHandle=void 0)}clear_delete_loading_timeout(){void 0!==this.deleteLoadingTimeout&&(window.clearTimeout(this.deleteLoadingTimeout),this.deleteLoadingTimeout=void 0)}connect(){this.connected=!0,this.channel.connect(),this.status="Connecting..."}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.channel&&this.connect()}create_web_socket_endpoint(){const e=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${e}://${this.serverHost}`:`${e}://${this.serverHost}:${this.serverPort}`:`${e}://${this.serverHost}`}handle_error(e){switch(e.kind){case o.Generic:case o.Authentication:this.error_message=e.message||"An unknown error occurred.";break;case o.RequiresUsername:this.show_login_screen_username=!0,this.show_login_screen_password=!1,this.show_login_screen=!0;break;case o.RequiresPassword:this.show_login_screen_username=!1,this.show_login_screen_password=!0,this.show_login_screen=!0;break;case o.RequiresUsernamePassword:this.show_login_screen_username=!0,this.show_login_screen_password=!0,this.show_login_screen=!0}setTimeout((()=>{this.show_loader=!1}),1e3)}handle_auth_success(e){this.clear_creds_buffer(),this.version=e.version,this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.channel.open_sftp_tunnel(this.nodeId),this.status="Connected"}handle_tunnel_opened(e){this.session_id=e.sid,this.channel.send_sftp_list_data(this.nodeId,this.session_id,this.current_dir)}handle_sftp_list_items(e){setTimeout((()=>{this.show_loader=!1}),500),this.listing=e.dir.items,this.current_dir=e.path,this.breadcrumbs=e.path.split("/").map(((e,i,a)=>""===e&&0===i?{label:"/",path:"/"}:{label:e,path:a.slice(0,i+1).join("/")})),this.show_content=!0,this.show_navigation=!0}handle_tunnel_data(e){console.log("received tunnel data:",e)}handle_tunnel_closed(e){this.clear_creds_buffer(),this.close_comms()}open_comms(){this.channel=this.serverId?new r(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId):new r(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([d.Connected]),this.channel.authenticate(this.token,this.nodeId),this.status="Authenticating..."})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([d.Disconnected]),this.status="Disconnected"})),this.channel.on_connection_error((e=>{this.connectionStateChanged.emit([d.Error,e]),this.status="Error "+e.message})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((e=>{const{web:i}=e.data;switch(i.type){case l.Error:this.handle_error(i);break;case l.AuthSuccess:this.handle_auth_success(i);break;case l.TunnelOpened:this.handle_tunnel_opened(i);break;case l.TunnelClosed:this.handle_tunnel_closed(i);break;case l.TunnelData:this.handle_tunnel_data(i);break;case l.SFTPListItems:this.handle_sftp_list_items(i);break;default:console.warn("Unhandled protocol message type:",i)}}))}close_comms(){this.channel.stop_heartbeat(),this.channel.disconnect()}clear_creds_buffer(){}reset_session_state(){this.clear_creds_buffer()}list_breadcrumb(e){this.show_loader=!0,this.selected_item=null,this.channel.send_sftp_list_data(this.nodeId,this.session_id,e)}go_to_parent_directory(){this.session_id&&"/"!==this.current_dir&&this.list_breadcrumb(this.breadcrumbs[this.breadcrumbs.length-2]?.path||"/")}refresh_directory(){this.session_id&&this.list_breadcrumb(this.current_dir)}disconnect_session(){this.close_comms(),this.session_id=void 0,this.show_loader=!1,this.show_content=!1,this.breadcrumbs=[],this.current_dir=".",this.listing=[],this.show_navigation=!1,this.show_login_screen_username=!1,this.show_login_screen_password=!1,this.show_login_screen=!1,this.version="",this.status="Disconnected"}on_file_row_action(e,i){i.preventDefault(),i.stopPropagation(),this.selected_item=e,this.download_file_name=e.name,this.download_progress=0,this.download_finished=!1,this.show_download_modal=!0,this.clear_download_progress(),this.downloadProgressHandle=window.setInterval((()=>{if(this.download_progress>=100)return this.clear_download_progress(),void(this.download_finished=!0);this.download_progress=Math.min(100,this.download_progress+5)}),180)}on_file_delete_action(e,i){i.preventDefault(),i.stopPropagation(),this.selected_item=e,this.delete_file_name=e.name,this.delete_loading=!1,this.show_delete_modal=!0}cancel_delete(){this.delete_loading||(this.show_delete_modal=!1,this.delete_file_name="",this.delete_loading=!1)}confirm_delete(){if(this.delete_loading)return;this.delete_loading=!0;const e=this.delete_file_name;this.clear_delete_loading_timeout(),this.deleteLoadingTimeout=window.setTimeout((()=>{this.show_delete_modal=!1,this.delete_loading=!1,this.show_error=!0,this.error_message=`Delete for "${e}" is not available yet.`,window.setTimeout((()=>{this.show_error=!1}),2e3),this.delete_file_name="",this.deleteLoadingTimeout=void 0}),1100)}open_upload_picker(){this.uploadInputEl?.click()}on_upload_selected(e){const i=e.target,a=i.files?.[0];a&&(this.upload_file_name=a.name,this.upload_progress=0,this.upload_finished=!1,this.show_upload_modal=!0,this.clear_upload_progress(),this.uploadProgressHandle=window.setInterval((()=>{if(this.upload_progress>=100)return this.clear_upload_progress(),void(this.upload_finished=!0);this.upload_progress=Math.min(100,this.upload_progress+5)}),180),i.value="")}cancel_upload(){this.clear_upload_progress(),this.show_upload_modal=!1,this.upload_progress=0,this.upload_file_name="",this.upload_finished=!1}cancel_download(){this.clear_download_progress(),this.show_download_modal=!1,this.download_progress=0,this.download_file_name="",this.download_finished=!1}is_selected(e){return!!this.selected_item&&this.selected_item.path===e.path&&this.selected_item.name===e.name}list_directory(e){if(!this.session_id)return void console.warn("No active session. Cannot list directory.");if("File"===e.kind)return console.warn("Cannot list directory of a file. Ignoring click."),void(this.selected_item=e);const i=[e.path,e.name].join("/");i!==this.current_dir?(this.show_loader=!0,this.selected_item=null,this.channel.send_sftp_list_data(this.nodeId,this.session_id,i)):console.warn("Already in this directory. Ignoring click.")}get_full_path(e){return[e.path,e.name].join("/")}render(){return a(t,{key:"31a797ab81c687e6aaea760d882e8078d4ab226f",class:{default:!this.max,max:this.max}},a("section",{key:"0dd1df187509d0f2c3dc172119f97224a1fb8234",class:"listing"},!this.hideHeader&&a("header",{key:"af24358a2d1d6ec9dc282683b1feff0a29287dd0"},a("section",{key:"f0195c9b0f99fe3c7ca64c7db04a3b08255bb58e",class:"title"},a("img",{key:"e04889ab957ccddb181850a5a787b6e40191842e",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==",alt:"SFTP Client"}),a("div",{key:"dc364ca7481d3b78e99319c66a6a40dc29100ea4",class:"text"},a("div",{key:"7b226fe3a81631656e8fce0b5a69854c3aaeb9c5",class:"name"},this.name),a("div",{key:"8a843a5134ed28a985d2d1787b17ea3c7436bd45",class:"description"},this.description))),a("section",{key:"73aec9dd75115faf4dfbcdfde1a076c960954923",class:"actions"},a("div",{key:"ce75ef7f9c3433e9d6dfadb41e0716a165666ee8",class:"action",onClick:()=>this.toggle_max()},a("img",{key:"abbba7e239c57a52dfd46ed23aeeac81874f097c",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtbWF4aW1pemUyIHctMyBoLTMiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iMTUgMyAyMSAzIDIxIDkiPjwvcG9seWxpbmU+CiAgICA8cG9seWxpbmUgcG9pbnRzPSI5IDIxIDMgMjEgMyAxNSI+PC9wb2x5bGluZT4KICAgIDxsaW5lIHgxPSIyMSIgeDI9IjE0IiB5MT0iMyIgeTI9IjEwIj48L2xpbmU+CiAgICA8bGluZSB4MT0iMyIgeDI9IjEwIiB5MT0iMjEiIHkyPSIxNCI+PC9saW5lPgo8L3N2Zz4K",alt:"Maximize"})))),a("main",{key:"fbdd529cfb3090f41dba72f7333efe3a1af29aa4"},this.show_navigation&&a("nav",{key:"17601f7bf03f76169a14803ad0cc11b21f72df8d",class:"navigation"},a("div",{key:"55fffc7a4686e4978002b9edf6334b07fc57322b",class:"breadcrumbs"},this.breadcrumbs.map(((e,i,t)=>a(a.Fragment,null,a("span",{key:i,onClick:()=>this.list_breadcrumb(e.path),class:"breadcrumb"},e.label),i<t.length-1&&a("img",{class:"arrow",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogICAgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIKICAgIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQgdy0zIGgtMyB0ZXh0LW11dGVkLWZvcmVncm91bmQvNTAgc2hyaW5rLTAiPgogICAgPHBhdGggZD0ibTkgMTggNi02LTYtNiI+PC9wYXRoPgo8L3N2Zz4K"}))))),a("section",{key:"163eb105d575eddebad721f4e114ea8f5a8e44a1",class:"actions","aria-label":"SFTP actions"},a("button",{key:"ad9cbebffdc46ba08b3d05adc33a18ad027f1b3d",type:"button",class:"action",onClick:()=>this.go_to_parent_directory(),title:"Go to parent directory","aria-label":"Go to parent directory"},a("img",{key:"4f1bfd8154df3df70f8892b1f17391f06ac5ea3e",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtYXJyb3ctdXAgdy0zLjUgaC0zLjUiPgogICAgPHBhdGggZD0ibTUgMTIgNy03IDcgNyI+PC9wYXRoPgogICAgPHBhdGggZD0iTTEyIDE5VjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Go up"})),a("button",{key:"5bcb098f9fcfb61e6af07e9224617e82ce9e8e8b",type:"button",class:"action",onClick:()=>this.refresh_directory(),title:"Refresh","aria-label":"Refresh"},a("img",{key:"863997b8a0ad3f465b68c10747739aa6bc123934",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtcmVmcmVzaC1jdyB3LTMuNSBoLTMuNSI+CiAgICA8cGF0aCBkPSJNMyAxMmE5IDkgMCAwIDEgOS05IDkuNzUgOS43NSAwIDAgMSA2Ljc0IDIuNzRMMjEgOCI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDN2NWgtNSI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDEyYTkgOSAwIDAgMS05IDkgOS43NSA5Ljc1IDAgMCAxLTYuNzQtMi43NEwzIDE2Ij48L3BhdGg+CiAgICA8cGF0aCBkPSJNOCAxNkgzdjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Refresh"})),a("button",{key:"dcae91b637f58f7567709367b4607148ba6c84ce",type:"button",class:"action",onClick:()=>this.open_upload_picker(),title:"Upload","aria-label":"Upload"},a("img",{key:"75baffc951eb5bef65be10e1b77d782048fe19bc",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtdXBsb2FkIHctMy41IGgtMy41Ij4KICAgIDxwYXRoIGQ9Ik0yMSAxNXY0YTIgMiAwIDAgMS0yIDJINWEyIDIgMCAwIDEtMi0ydi00Ij48L3BhdGg+CiAgICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4Ij48L3BvbHlsaW5lPgogICAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIzIiB5Mj0iMTUiPjwvbGluZT4KPC9zdmc+Cg==",alt:"Upload"})),a("button",{key:"7ce741e5e4538bfa50b330128153584cae966865",type:"button",class:"action disconnect",onClick:()=>this.disconnect_session(),title:"Disconnect","aria-label":"Disconnect"},"DISCONNECT"))),a("input",{key:"86686c4eb1f5e56e2828687c8843ac0a0f79028b",type:"file",ref:e=>this.uploadInputEl=e,onChange:e=>this.on_upload_selected(e),style:{display:"none"}}),this.show_content&&a("div",{key:"d5be43d27ae7933ad1eea5d9c7d53b3a4fa4d292",class:"content"},a("table",{key:"e6f57d64703faef89347da8c412eb4b224878a68"},a("thead",{key:"89979dd9702878b6d0bccddb971c1e42353c4515"},a("tr",{key:"9c744d7e8e12bd189ba17f6b2b7a4f371b4932eb"},a("th",{key:"6f29cf58e3000d3d02881d38ca8065ab4174300d"},"Name"),a("th",{key:"79ec3f7d0ac3a12a450f275845360576bd1430c6"},"Size"),a("th",{key:"ea1718d678f7016472688d7d08d311aad727dcc9"},"Permissions"),a("th",{key:"6272cb391bd19801f9967b704185520799dc8a11"},"Owner"),a("th",{key:"91fec7f7e28354e88a12fc7f92c543172800f0b3"},"Modified"),a("th",{key:"6256a9926941f12ce4807c926e09c3a39c776d2d",class:"action-col","aria-label":"Actions"}))),a("tbody",{key:"f1e57f678a8381e4dad5c8daab6624849378b012"},this.listing.map(((e,i)=>a("tr",{key:i,class:{selected:this.is_selected(e)},onClick:()=>this.list_directory(e)},a("td",null,a("img","Folder"===e.kind?{class:"kind",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1mb2xkZXIgdy0zLjUgaC0zLjUgdGV4dC1wcmltYXJ5IHNocmluay0wIj4KICAgIDxwYXRoCiAgICAgICAgZD0iTTIwIDIwYTIgMiAwIDAgMCAyLTJWOGEyIDIgMCAwIDAtMi0yaC03LjlhMiAyIDAgMCAxLTEuNjktLjlMOS42IDMuOUEyIDIgMCAwIDAgNy45MyAzSDRhMiAyIDAgMCAwLTIgMnYxM2EyIDIgMCAwIDAgMiAyWiI+PC9wYXRoPgo8L3N2Zz4K",alt:"Folder"}:{class:"kind",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtZmlsZSB3LTMuNSBoLTMuNSB0ZXh0LW11dGVkLWZvcmVncm91bmQgc2hyaW5rLTAiPgogICAgPHBhdGggZD0iTTE1IDJINmEyIDIgMCAwIDAtMiAydjE2YTIgMiAwIDAgMCAyIDJoMTJhMiAyIDAgMCAwIDItMlY3WiI+PC9wYXRoPgogICAgPHBhdGggZD0iTTE0IDJ2NGEyIDIgMCAwIDAgMiAyaDQiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"File"}),a("span",{class:`name ${e.kind.toLowerCase()}`},e.name)),a("td",null,e.attributes.size),a("td",null,e.attributes.permissions??"-"),a("td",null,e.attributes.user??"-"),a("td",null,new Date(1e3*e.attributes.mtime).toLocaleString()),a("td",{class:"action-col"},"File"===e.kind&&a("div",{class:"file-actions"},a("button",{type:"button",class:"file-action",onClick:i=>this.on_file_row_action(e,i),title:"Download","aria-label":"Download"},a("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"},a("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),a("polyline",{points:"7 10 12 15 17 10"}),a("line",{x1:"12",x2:"12",y1:"15",y2:"3"}))),a("button",{type:"button",class:"file-action delete",onClick:i=>this.on_file_delete_action(e,i),title:"Delete","aria-label":"Delete"},a("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"},a("polyline",{points:"3 6 5 6 21 6"}),a("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),a("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),a("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),a("line",{x1:"14",x2:"14",y1:"11",y2:"17"}))))))))))),this.show_loader&&a("div",{key:"141c34cb925c0e42fca1e0397b610071b360c0d1",class:"loader"},"Loading..."),this.show_error&&a("div",{key:"ebf97cf4b7307514e724c7778c4a9052ec32c68d",class:"error"},this.error_message)),a("footer",{key:"1f243a6d09afe5380466dec79226bde67679ace8"},a("section",{key:"59f7e3dd679213d76294c347f1af8ca4f3d5b3e6",class:"status"},a("span",{key:"4aaebcfa2fea3e69d02814727c63484fd465dfee"},this.status),this.selected_item&&a("span",{key:"5f37d4f9a82a97cd5065651d5f4311104153b8a7",class:"selected-item"},this.get_full_path(this.selected_item))),a("section",{key:"0a75c580bb9ce63e58e4cd3aef76f13f5d8a6c43",class:"version"},this.version?`Version: ${this.version}`:""))),this.show_login_screen&&a("section",{key:"bf83e07198a7bd7f6b11164261496cee880e8e95",class:{creds:!0,blurred:this.show_login_screen}},a("form",{key:"c0b3f36031b3d0575e0dfc4d4e5c689a3e86093e",class:"auth",onSubmit:e=>{const i=new FormData(e.target);let a,t;this.show_login_screen_username&&(a=i.get("username")),this.show_login_screen_password&&(t=i.get("password")),this.channel.open_sftp_tunnel(this.nodeId,a,t),this.show_login_screen_username=!1,this.show_login_screen_password=!1,this.show_login_screen=!1,this.show_loader=!0,e.stopPropagation(),e.preventDefault()}},a("div",{key:"f8f811323c0aaa9d2c6e7c70b39e2bc58073f500",class:"title"},"SFTP Connection"),this.show_login_screen_username&&a("div",{key:"9d37d47a0c3d7235711964979389e34e7ae909e4"},a("label",{key:"870aefcf5b1052663df6564158f85f0a1a6c14fc",htmlFor:"username"},"Username"),a("input",{key:"b51ee3b3f4a73c7116ace5d1d111d76e6c2d44a2",id:"username",autoComplete:"off",name:"username",type:"text",placeholder:""})),this.show_login_screen_password&&a("div",{key:"f727237549f83c27639f943414665eab507d3e0b"},a("label",{key:"e0607fbaa128a26ca8a6ce2be5976c2be66cf1a8",htmlFor:"password"},"Password"),a("input",{key:"4458ad7c4927bf21e27c9b979c14d5d3ca377514",id:"password",autoComplete:"off",name:"password",type:"password",placeholder:""})),a("div",{key:"7e3a5f468cc73a370558d4f447e1e7e91ea9dff2"},a("button",{key:"c63922f8ffd4377a13c76f51108e8fc9cfa7cdfa",type:"submit"},"Connect")))),this.show_upload_modal&&a("section",{key:"b7935f9ab9e2cbfc8ecb66aff2c212e8f008675f",class:{"upload-modal":!0,visible:this.show_upload_modal}},a("div",{key:"e7c84c44c5ccec4d7211dd647abee21ba9e4dded",class:"upload-dialog",role:"dialog","aria-modal":"true","aria-label":"Upload progress"},a("div",{key:"42411ccf81daad3d6f94455ec5f39a2ec8bd32ce",class:"title"},"Uploading File"),a("div",{key:"d7e6db3d7af27e69533bf2bcc532ab36de241a84",class:"file-name",title:this.upload_file_name},this.upload_file_name),a("div",{key:"3b1e1eb29e1d9b737bf52c3e9d59c33871d661fc",class:"progress-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":this.upload_progress},a("div",{key:"36d23d0a85747aa12f36b05caa4fa047095245b9",class:"progress-fill",style:{width:`${this.upload_progress}%`}})),a("div",{key:"d981d282d1ad7216eee6a6ea8eaf0b48655d6b00",class:"progress-value"},this.upload_progress,"%"),a("button",{key:"1e5eb505505098bc88fadad649da78e4f291e8c3",type:"button",class:{cancel:!0,finished:this.upload_finished},onClick:()=>this.cancel_upload()},this.upload_finished?"Close":"Cancel"))),this.show_download_modal&&a("section",{key:"f2d75e7719e5a5ecad1dc37145da05cedefc53eb",class:{"download-modal":!0,visible:this.show_download_modal}},a("div",{key:"248a10deae9f5869290a362d2ec0dc49480c2f6a",class:"download-dialog",role:"dialog","aria-modal":"true","aria-label":"Download progress"},a("div",{key:"05f2f39b31a59ecb402c8b803b9ba8819d9b41d3",class:"title"},"Downloading File"),a("div",{key:"9979cfdbd9f0ac1888fbce3050ea51f1ac7fbc13",class:"file-name",title:this.download_file_name},this.download_file_name),a("div",{key:"5a0edbdb962e730fb8b4ff6ed06d1826e84d6ee4",class:"progress-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":this.download_progress},a("div",{key:"fdb25a6a1a42cb82050b4d6e4da4cae52c09ecc1",class:"progress-fill",style:{width:`${this.download_progress}%`}})),a("div",{key:"2b9d47914221aa0537c0317b87cebedeb5c99b57",class:"progress-value"},this.download_progress,"%"),a("button",{key:"15dee8510d3468eb00131248d7c2e6d31349b650",type:"button",class:{cancel:!0,finished:this.download_finished},onClick:()=>this.cancel_download()},this.download_finished?"Close":"Cancel"))),this.show_delete_modal&&a("section",{key:"5b5fd8c394811a4f5a2c285b331ed0a989729fea",class:{"delete-modal":!0,visible:this.show_delete_modal}},a("div",{key:"db2010aa154ececde47f5a5b4c3da485db786b0e",class:"delete-dialog",role:"dialog","aria-modal":"true","aria-label":"Delete confirmation"},a("div",{key:"2fdb21392ad194cf7b72bb07391d6fc469b72cea",class:"title"},"Delete File"),a("div",{key:"28ea5040b1111a888d230fd9aa6c34ada0003132",class:"message"},this.delete_loading?"Deleting file...":"Are you sure you want to delete this file?"),a("div",{key:"123138ed8bf191e0dd4d1d9ab0409a15caa2aec2",class:"file-name",title:this.delete_file_name},this.delete_file_name),this.delete_loading&&a("div",{key:"7a30da76db24c7ecb56877ab055fca6f84ba995b",class:"delete-loading-bar","aria-hidden":"true"}),a("div",{key:"c6eda63ce75896cc6540f509c81e895b3317e197",class:"modal-actions"},a("button",{key:"54e7f01e6858f1ac0a73091ed7a6a3666bfad968",type:"button",class:"btn secondary",onClick:()=>this.cancel_delete(),disabled:this.delete_loading},"Cancel"),a("button",{key:"f647a2772cb3a14cb42fc6d654c5068bf9e3f7f1",type:"button",class:"btn destructive",onClick:()=>this.confirm_delete(),disabled:this.delete_loading},this.delete_loading?"Deleting...":"Delete")))))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}};c.style=":host{--radius:0.375rem;--card:220 18% 10%;--border:220 15% 18%;--primary:160 60% 45%;--radius:0.375rem;--destructive:0 70% 50%;--muted:220 15% 13%;--muted-foreground:220 10% 50%;--primary-foreground:220 20% 7%;--scroll-track:220 16% 12%;--scroll-thumb:220 12% 34%;--scroll-thumb-hover:160 45% 44%;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;height:100%;width:100%;border:1px solid hsl(var(--border));background-color:hsl(var(--card));border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;position:relative;.listing{flex:1;display:flex;flex-direction:column;justify-content:space-between;min-height:0;header{height:30px;background:rgba(28, 31, 38, 0.6);border-bottom:1px solid hsl(var(--border));display:flex;align-items:center;justify-content:space-between;.actions{display:flex;align-items:center;.action{cursor:pointer;padding:4px;display:flex;align-items:center;z-index:1;img{height:14px;padding:4px;border-radius:4px}&:hover{background-color:hsl(var(--border) / 0.6)}}}.title{color:hsl(var(--primary));height:14px;padding:0 12px;display:flex;align-items:center;font-size:0.75rem;line-height:1rem;img{height:14px;margin-right:5px}.text{display:flex;flex-direction:row;justify-content:center;margin-top:2px;.name{margin-right:10px}.description{color:hsl(var(--muted-foreground))}}}}main{flex:1;display:flex;flex-direction:column;position:relative;min-height:0;overflow:hidden;.loader{color:hsl(var(--muted-foreground));font-size:13px;animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;text-align:center;display:flex;align-items:center;justify-content:center;position:absolute;height:100%;width:100%;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.error{font-size:13px;text-align:center;color:hsl(var(--destructive));height:100%;display:flex;align-items:center;justify-content:center}.navigation{height:25px;padding:10px;font-size:0.75rem;line-height:1rem;background-color:hsl(var(--card));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid hsl(var(--border));position:sticky;top:0;z-index:3;.breadcrumbs{display:flex;align-items:center;margin-right:10px;.breadcrumb{color:hsl(var(--primary));margin-right:4px;cursor:pointer;&:after{margin-left:4px}&:hover{color:rgb(189, 219, 209)}&:last-child{margin-right:0;color:rgb(189, 219, 209);cursor:default}}.arrow{height:12px;width:12px;opacity:0.6;top:2px;margin-right:4px;position:relative}}.actions{display:flex;align-items:center;gap:8px}.action{border:none;background:transparent;color:rgb(189, 219, 209);font-size:1.1rem;line-height:1;padding:2px 4px;border-radius:4px;cursor:pointer;&:hover{background-color:hsl(var(--border) / 0.6)}img{height:14px;width:14px;display:block}}.action.disconnect{color:#ff4d5f;font-size:0.65rem;letter-spacing:0.08em;padding:4px 8px;&:hover{color:#ff6b7a;background-color:hsl(var(--destructive) / 0.12)}}}.content{flex:1;min-height:0;overflow:auto;font-size:0.75rem;line-height:1rem;scrollbar-width:thin;scrollbar-color:hsl(var(--scroll-thumb)) hsl(var(--scroll-track));&::-webkit-scrollbar{width:10px;height:10px}&::-webkit-scrollbar-track{background:hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb{background:hsl(var(--scroll-thumb));border-radius:999px;border:2px solid hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb:hover{background:hsl(var(--scroll-thumb-hover))}table{width:100%;border-collapse:separate;border-spacing:0;thead{background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));th{padding:8px 10px;text-align:left;color:hsl(var(--muted-foreground));position:sticky;top:0;z-index:2;background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));line-height:0.95rem;&.action-col{width:58px;min-width:58px;padding:0 10px}}}tbody{padding:10px 10px;tr{border-bottom:1px solid hsl(var(--border) / 0.4);td{padding:10px 10px 9px;color:hsl(var(--muted-foreground));&.action-col{width:58px;min-width:58px;text-align:center;padding-left:1px;padding-right:1px;.file-actions{display:flex;align-items:center;justify-content:center;gap:8px}.file-action{border:none;background:transparent;color:hsl(var(--muted-foreground));width:16px;height:16px;border-radius:3px;cursor:pointer;opacity:0;visibility:hidden;pointer-events:none;transition:opacity 120ms ease;padding:0;svg{width:12px;height:12px;display:block;margin:0 auto}&:hover{color:hsl(var(--primary))}&.delete:hover{color:hsl(var(--destructive))}}}.name{&.file{color:rgb(189, 219, 209)}&.folder{color:hsl(var(--primary))}}.kind{height:14px;width:14px;margin-right:5px;top:3px;position:relative}}&:hover{cursor:pointer;background-color:hsl(var(--muted) / 0.4);td.action-col .file-action{opacity:1;visibility:visible;pointer-events:auto;color:hsl(var(--primary))}}&.selected{background-color:hsl(var(--primary) / 0.3);td.action-col .file-action{opacity:1;visibility:visible;pointer-events:auto}&:hover{background-color:hsl(var(--primary) / 0.4)}}}}}}}footer{height:25px;background:rgba(28, 31, 38, 0.6);border-top:1px solid hsl(var(--border));font-size:0.75rem;line-height:1rem;display:flex;align-items:center;justify-content:space-between;padding:0 10px;.status{font-size:0.65rem;color:hsl(var(--muted-foreground));.selected-item{margin-left:10px;color:hsl(var(--primary))}}.version{font-size:0.65rem;color:hsl(var(--muted-foreground))}}}.creds{position:absolute;top:0;left:0;height:100%;width:100%;display:flex;justify-content:center;align-items:center;;&.blurred{background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.auth{display:flex;flex-direction:column;background:hsl(var(--card));position:relative;background-color:rgba(21, 24, 30, 0.95);border:1px solid hsl(var(--border));padding:30px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;border-radius:var(--radius);.title{margin-bottom:12px;color:hsl(var(--primary))}label{font-size:0.75rem;line-height:1rem;margin-bottom:1rem;color:hsl(var(--muted-foreground))}input{font-size:0.875rem;line-height:1.25rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;background-color:rgb(28, 31, 38);border-color:rgb(39, 44, 53);border-width:1px;border-radius:calc(var(--radius) - 2px);width:100%;margin-bottom:12px;color:rgb(189, 219, 209);box-sizing:border-box;&:focus{outline:none;border-color:hsl(var(--primary));box-shadow:0 0 0 1px hsl(var(--primary))}}button[type='submit']{margin-top:12px;width:100%;background-color:hsl(var(--primary));color:hsl(var(--primary-foreground));letter-spacing:0.05em;font-size:13px;font-weight:500;padding:0.5rem 1rem;border-radius:calc(var(--radius) - 2px);height:2rem;cursor:pointer;border:none;&:hover{background-color:hsl(var(--primary) / 0.9)}}}}.upload-modal,.download-modal,.delete-modal{position:absolute;inset:0;display:none;align-items:center;justify-content:center;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px);z-index:6;&.visible{display:flex}.upload-dialog,.download-dialog,.delete-dialog{width:min(360px, calc(100% - 24px));background-color:rgba(21, 24, 30, 0.96);border:1px solid hsl(var(--border));border-radius:var(--radius);padding:16px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;.title{color:hsl(var(--primary));font-size:0.8rem;margin-bottom:8px}.file-name{color:rgb(189, 219, 209);font-size:0.72rem;line-height:1rem;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.progress-track{width:100%;height:10px;border-radius:999px;background-color:hsl(var(--muted));overflow:hidden;border:1px solid hsl(var(--border));.progress-fill{height:100%;width:0;background:linear-gradient(90deg, hsl(var(--primary) / 0.7), hsl(var(--primary)));transition:width 140ms ease}}.progress-value{margin-top:8px;color:hsl(var(--muted-foreground));font-size:0.7rem;text-align:right}.cancel{margin-top:14px;width:100%;height:2rem;border:1px solid hsl(var(--border));border-radius:calc(var(--radius) - 2px);background:hsl(var(--muted));color:rgb(189, 219, 209);font-size:0.75rem;letter-spacing:0.03em;cursor:pointer;&:hover{border-color:hsl(var(--primary));color:hsl(var(--primary))}&.finished{background-color:hsl(var(--primary));border-color:hsl(var(--primary));color:hsl(var(--primary-foreground));&:hover{background-color:hsl(var(--primary) / 0.9);border-color:hsl(var(--primary) / 0.9);color:hsl(var(--primary-foreground))}}}.message{color:rgb(189, 219, 209);font-size:0.74rem;line-height:1rem;margin-bottom:8px}.modal-actions{margin-top:14px;display:grid;grid-template-columns:1fr 1fr;gap:8px;.btn{height:2rem;border:1px solid hsl(var(--border));border-radius:calc(var(--radius) - 2px);font-size:0.75rem;letter-spacing:0.03em;cursor:pointer;&:disabled{opacity:0.65;cursor:not-allowed}}.btn.secondary{background:hsl(var(--muted));color:rgb(189, 219, 209);&:hover{border-color:hsl(var(--primary));color:hsl(var(--primary))}}.btn.destructive{background:hsl(var(--destructive));border-color:hsl(var(--destructive));color:white;&:hover{background:hsl(var(--destructive) / 0.9);border-color:hsl(var(--destructive) / 0.9)}}}.delete-loading-bar{margin-top:2px;width:100%;height:8px;border-radius:999px;border:1px solid hsl(var(--border));background:linear-gradient(90deg, hsl(var(--muted)) 0%, hsl(var(--muted)) 100%), linear-gradient(90deg, hsl(var(--primary) / 0.3), hsl(var(--primary)), hsl(var(--primary) / 0.3));background-repeat:no-repeat;background-size:100% 100%, 40% 100%;animation:delete-loading 1s linear infinite}}}}@keyframes delete-loading{from{background-position:0 0, -45% 0}to{background-position:0 0, 145% 0}}:host(.max){height:100vh;width:100vw;position:fixed;top:0;left:0;z-index:9999}";export{c as phirepass_sftp_client}
|