phirepass-widgets 0.0.48 → 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.
@@ -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],"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"],"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.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);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -19,7 +19,7 @@ const phirepassSftpClientRefreshSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0
19
19
 
20
20
  const phirepassSftpClientUploadSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtdXBsb2FkIHctMy41IGgtMy41Ij4KICAgIDxwYXRoIGQ9Ik0yMSAxNXY0YTIgMiAwIDAgMS0yIDJINWEyIDIgMCAwIDEtMi0ydi00Ij48L3BhdGg+CiAgICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4Ij48L3BvbHlsaW5lPgogICAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIzIiB5Mj0iMTUiPjwvbGluZT4KPC9zdmc+Cg==';
21
21
 
22
- 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:20px;min-width:20px;padding:0 10px}&:hover{&.action-col{color:blue;background-color:red;stroke:red}}}}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:20px;min-width:20px;text-align:center;padding-left:1px;padding-right:1px;.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))}}}.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)}}}}}:host(.max){height:100vh;width:100vw;position:fixed;top:0;left:0;z-index:9999}`;
22
+ 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}`;
23
23
 
24
24
  const PhirepassSftpClient = class {
25
25
  constructor(hostRef) {
@@ -32,6 +32,9 @@ const PhirepassSftpClient = class {
32
32
  runtimeReady = false;
33
33
  connected = false;
34
34
  uploadInputEl;
35
+ uploadProgressHandle;
36
+ downloadProgressHandle;
37
+ deleteLoadingTimeout;
35
38
  // private inputMode: InputMode = InputMode.Default;
36
39
  session_id;
37
40
  // private usernameBuffer = "";
@@ -89,6 +92,17 @@ const PhirepassSftpClient = class {
89
92
  version = '';
90
93
  status = 'Disconnected';
91
94
  selected_item = null;
95
+ show_upload_modal = false;
96
+ upload_progress = 0;
97
+ upload_file_name = '';
98
+ upload_finished = false;
99
+ show_download_modal = false;
100
+ download_progress = 0;
101
+ download_file_name = '';
102
+ download_finished = false;
103
+ show_delete_modal = false;
104
+ delete_file_name = '';
105
+ delete_loading = false;
92
106
  toggle_max() {
93
107
  this.maximizeEvent?.emit(!this.max);
94
108
  }
@@ -119,9 +133,30 @@ const PhirepassSftpClient = class {
119
133
  this.connected = false;
120
134
  this.domReady = false;
121
135
  this.runtimeReady = false;
136
+ this.clear_upload_progress();
137
+ this.clear_download_progress();
138
+ this.clear_delete_loading_timeout();
122
139
  this.close_comms();
123
140
  // this.destroy_terminal();
124
141
  }
142
+ clear_upload_progress() {
143
+ if (this.uploadProgressHandle !== undefined) {
144
+ window.clearInterval(this.uploadProgressHandle);
145
+ this.uploadProgressHandle = undefined;
146
+ }
147
+ }
148
+ clear_download_progress() {
149
+ if (this.downloadProgressHandle !== undefined) {
150
+ window.clearInterval(this.downloadProgressHandle);
151
+ this.downloadProgressHandle = undefined;
152
+ }
153
+ }
154
+ clear_delete_loading_timeout() {
155
+ if (this.deleteLoadingTimeout !== undefined) {
156
+ window.clearTimeout(this.deleteLoadingTimeout);
157
+ this.deleteLoadingTimeout = undefined;
158
+ }
159
+ }
125
160
  connect() {
126
161
  this.connected = true;
127
162
  this.channel.connect();
@@ -327,24 +362,93 @@ const PhirepassSftpClient = class {
327
362
  event.preventDefault();
328
363
  event.stopPropagation();
329
364
  this.selected_item = item;
330
- window.alert(`Download for "${item.name}" is not available yet.`);
365
+ this.download_file_name = item.name;
366
+ this.download_progress = 0;
367
+ this.download_finished = false;
368
+ this.show_download_modal = true;
369
+ this.clear_download_progress();
370
+ this.downloadProgressHandle = window.setInterval(() => {
371
+ if (this.download_progress >= 100) {
372
+ this.clear_download_progress();
373
+ this.download_finished = true;
374
+ return;
375
+ }
376
+ this.download_progress = Math.min(100, this.download_progress + 5);
377
+ }, 180);
378
+ }
379
+ on_file_delete_action(item, event) {
380
+ event.preventDefault();
381
+ event.stopPropagation();
382
+ this.selected_item = item;
383
+ this.delete_file_name = item.name;
384
+ this.delete_loading = false;
385
+ this.show_delete_modal = true;
386
+ }
387
+ cancel_delete() {
388
+ if (this.delete_loading) {
389
+ return;
390
+ }
391
+ this.show_delete_modal = false;
392
+ this.delete_file_name = '';
393
+ this.delete_loading = false;
394
+ }
395
+ confirm_delete() {
396
+ if (this.delete_loading) {
397
+ return;
398
+ }
399
+ this.delete_loading = true;
400
+ const deletingFileName = this.delete_file_name;
401
+ this.clear_delete_loading_timeout();
402
+ this.deleteLoadingTimeout = window.setTimeout(() => {
403
+ this.show_delete_modal = false;
404
+ this.delete_loading = false;
405
+ this.show_error = true;
406
+ this.error_message = `Delete for "${deletingFileName}" is not available yet.`;
407
+ window.setTimeout(() => {
408
+ this.show_error = false;
409
+ }, 2_000);
410
+ this.delete_file_name = '';
411
+ this.deleteLoadingTimeout = undefined;
412
+ }, 1_100);
331
413
  }
332
414
  open_upload_picker() {
333
415
  this.uploadInputEl?.click();
334
416
  }
335
417
  on_upload_selected(event) {
336
418
  const input = event.target;
337
- const file = input.files?.[0];
338
- if (!file) {
419
+ const selectedFile = input.files?.[0];
420
+ if (!selectedFile) {
339
421
  return;
340
422
  }
341
- this.show_error = true;
342
- this.error_message = 'Upload is not available yet in this widget.';
343
- setTimeout(() => {
344
- this.show_error = false;
345
- }, 2_000);
423
+ this.upload_file_name = selectedFile.name;
424
+ this.upload_progress = 0;
425
+ this.upload_finished = false;
426
+ this.show_upload_modal = true;
427
+ this.clear_upload_progress();
428
+ this.uploadProgressHandle = window.setInterval(() => {
429
+ if (this.upload_progress >= 100) {
430
+ this.clear_upload_progress();
431
+ this.upload_finished = true;
432
+ return;
433
+ }
434
+ this.upload_progress = Math.min(100, this.upload_progress + 5);
435
+ }, 180);
346
436
  input.value = '';
347
437
  }
438
+ cancel_upload() {
439
+ this.clear_upload_progress();
440
+ this.show_upload_modal = false;
441
+ this.upload_progress = 0;
442
+ this.upload_file_name = '';
443
+ this.upload_finished = false;
444
+ }
445
+ cancel_download() {
446
+ this.clear_download_progress();
447
+ this.show_download_modal = false;
448
+ this.download_progress = 0;
449
+ this.download_file_name = '';
450
+ this.download_finished = false;
451
+ }
348
452
  is_selected(item) {
349
453
  if (!this.selected_item) {
350
454
  return false;
@@ -375,18 +479,18 @@ const PhirepassSftpClient = class {
375
479
  return [item.path, item.name].join('/');
376
480
  }
377
481
  render() {
378
- return (index.h(index.Host, { key: '84b1bd4b89e4e18be8165b2501af5fcf7bb09b68', class: {
482
+ return (index.h(index.Host, { key: '31a797ab81c687e6aaea760d882e8078d4ab226f', class: {
379
483
  'default': !this.max,
380
484
  'max': this.max,
381
- } }, index.h("section", { key: 'fd8e39bc72055158a7a1daac5f536e4d34393db9', class: "listing" }, !this.hideHeader &&
382
- index.h("header", { key: '5f223331f9e2b5c6570ce80313c121c94ce36805' }, index.h("section", { key: '1314b571f73bbdc07dd46f5015f75789793461e5', class: "title" }, index.h("img", { key: 'e582af1a23c051ddc9e0a44737f4c53a048b85be', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), index.h("div", { key: 'f43bd6e4409b0e353b1224866b0d6ebe55e37705', class: "text" }, index.h("div", { key: 'f84ec4ed31f44b6216cf98fedda2eee3f6d3fae0', class: "name" }, this.name), index.h("div", { key: 'ad6b56a1f9e69b70be8e1906d26538ecf5e81369', class: "description" }, this.description))), index.h("section", { key: '4cc95044e4d7ea1bacb8de579c6d22a29530a124', class: "actions" }, index.h("div", { key: 'fb85bf224c56e874ee7b4c0818ba35bcc06b4c35', class: "action", onClick: () => this.toggle_max() }, index.h("img", { key: '5cfbeafc5bbce5e5b87d75b23113a93c83d48f3b', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), index.h("main", { key: 'f0ed3ecc82981b8352b4908df9bcc7706c07c111' }, this.show_navigation && index.h("nav", { key: '8b790eab0adc12e592b73e6757c1663db88f5a49', class: "navigation" }, index.h("div", { key: '85c62f8b0e15d7aa77572028665d51705f9ef453', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index$1, breadcrumbs) => (index.h(index.h.Fragment, null, 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: '9e1f1b406f3ac7b1a4fdda4081f310bdc054e125', class: "actions", "aria-label": "SFTP actions" }, index.h("button", { key: '1f95decb5addbd8c7c1b48b811e72231afb01491', 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: '888341d92e55f79037ccb8eca6b0eec69ff2f406', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), index.h("button", { key: '41d8256a3c8e7e6810c6f979537be3556de3611a', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, index.h("img", { key: 'e7e2d8feef73e5a77580f311d3248baaa62a44ec', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), index.h("button", { key: '4a1453249181827600e980bfcc5eef10b94c4bd7', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, index.h("img", { key: '66dc18510465e05509ea966b0d48a92dabc5a00d', src: phirepassSftpClientUploadSvg, alt: "Upload" })), index.h("button", { key: 'cbc12df3cb223cf650a12980f2b10db5114b2bff', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), index.h("input", { key: '8b472b4b82995d286127f60e394f6f83b88d05bd', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && index.h("div", { key: '9f4517dfb33071e1d1702c73fcbaaa812049c012', class: "content" }, index.h("table", { key: '841b90ae73e52083478dcccb54d75ef52b208d74' }, index.h("thead", { key: '96f9129791c51bae1f1693b4a77c3866cefe7ada' }, index.h("tr", { key: 'd5d5e032d059751a65305577670f1370c8cb0be5' }, index.h("th", { key: '06a796b795813f286c1823eb053bc21211c7a6c2' }, "Name"), index.h("th", { key: '4ce88c6ceb13af2d9e80a5c733a02ac7a15558ba' }, "Size"), index.h("th", { key: 'b4746be62c9c882f3c335b433486bc094b0fe6c3' }, "Permissions"), index.h("th", { key: '8ab7d1bab01ce229b236d9aceb3ca166b84b2551' }, "Owner"), index.h("th", { key: 'baaf0986f2851903e22d8bb8c5a2aff8c4762bf1' }, "Modified"), index.h("th", { key: 'be874212a04f3e6f9764fb664837e11cacfc9b32', class: "action-col", "aria-label": "Actions" }))), index.h("tbody", { key: 'd14243b3467786b08a3cd8d53b4e365c7c9d644d' }, this.listing.map((item, index$1) => (index.h("tr", { key: index$1, class: {
485
+ } }, index.h("section", { key: '0dd1df187509d0f2c3dc172119f97224a1fb8234', class: "listing" }, !this.hideHeader &&
486
+ index.h("header", { key: 'af24358a2d1d6ec9dc282683b1feff0a29287dd0' }, index.h("section", { key: 'f0195c9b0f99fe3c7ca64c7db04a3b08255bb58e', class: "title" }, index.h("img", { key: 'e04889ab957ccddb181850a5a787b6e40191842e', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), index.h("div", { key: 'dc364ca7481d3b78e99319c66a6a40dc29100ea4', class: "text" }, index.h("div", { key: '7b226fe3a81631656e8fce0b5a69854c3aaeb9c5', class: "name" }, this.name), index.h("div", { key: '8a843a5134ed28a985d2d1787b17ea3c7436bd45', class: "description" }, this.description))), index.h("section", { key: '73aec9dd75115faf4dfbcdfde1a076c960954923', class: "actions" }, index.h("div", { key: 'ce75ef7f9c3433e9d6dfadb41e0716a165666ee8', class: "action", onClick: () => this.toggle_max() }, index.h("img", { key: 'abbba7e239c57a52dfd46ed23aeeac81874f097c', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), index.h("main", { key: 'fbdd529cfb3090f41dba72f7333efe3a1af29aa4' }, this.show_navigation && index.h("nav", { key: '17601f7bf03f76169a14803ad0cc11b21f72df8d', class: "navigation" }, index.h("div", { key: '55fffc7a4686e4978002b9edf6334b07fc57322b', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index$1, breadcrumbs) => (index.h(index.h.Fragment, null, 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: '163eb105d575eddebad721f4e114ea8f5a8e44a1', class: "actions", "aria-label": "SFTP actions" }, index.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" }, index.h("img", { key: '4f1bfd8154df3df70f8892b1f17391f06ac5ea3e', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), index.h("button", { key: '5bcb098f9fcfb61e6af07e9224617e82ce9e8e8b', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, index.h("img", { key: '863997b8a0ad3f465b68c10747739aa6bc123934', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), index.h("button", { key: 'dcae91b637f58f7567709367b4607148ba6c84ce', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, index.h("img", { key: '75baffc951eb5bef65be10e1b77d782048fe19bc', src: phirepassSftpClientUploadSvg, alt: "Upload" })), index.h("button", { key: '7ce741e5e4538bfa50b330128153584cae966865', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), index.h("input", { key: '86686c4eb1f5e56e2828687c8843ac0a0f79028b', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && index.h("div", { key: 'd5be43d27ae7933ad1eea5d9c7d53b3a4fa4d292', class: "content" }, index.h("table", { key: 'e6f57d64703faef89347da8c412eb4b224878a68' }, index.h("thead", { key: '89979dd9702878b6d0bccddb971c1e42353c4515' }, index.h("tr", { key: '9c744d7e8e12bd189ba17f6b2b7a4f371b4932eb' }, index.h("th", { key: '6f29cf58e3000d3d02881d38ca8065ab4174300d' }, "Name"), index.h("th", { key: '79ec3f7d0ac3a12a450f275845360576bd1430c6' }, "Size"), index.h("th", { key: 'ea1718d678f7016472688d7d08d311aad727dcc9' }, "Permissions"), index.h("th", { key: '6272cb391bd19801f9967b704185520799dc8a11' }, "Owner"), index.h("th", { key: '91fec7f7e28354e88a12fc7f92c543172800f0b3' }, "Modified"), index.h("th", { key: '6256a9926941f12ce4807c926e09c3a39c776d2d', class: "action-col", "aria-label": "Actions" }))), index.h("tbody", { key: 'f1e57f678a8381e4dad5c8daab6624849378b012' }, this.listing.map((item, index$1) => (index.h("tr", { key: index$1, class: {
383
487
  'selected': this.is_selected(item),
384
488
  }, 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, item.attributes.size), index.h("td", null, item.attributes.permissions ?? '-'), index.h("td", null, item.attributes.user ?? '-'), index.h("td", null, new Date(item.attributes.mtime * 1000).toLocaleString()), index.h("td", { class: "action-col" }, item.kind === 'File' &&
385
- 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" })))))))))), this.show_loader && index.h("div", { key: 'ee78459b85c3ffaf2583fd79edadc1398a96aa81', class: "loader" }, "Loading..."), this.show_error && index.h("div", { key: 'f658bc7e5fd922d9a9499f2b6402ca3a6453adb8', class: "error" }, this.error_message)), index.h("footer", { key: '8928750efac3a300348a0c2cfd97c735820351c7' }, index.h("section", { key: '2c72adc84a24cf9255219125ad617578d9d4e50d', class: "status" }, index.h("span", { key: '192c7f26e2372e22b8d48d3ce0d6697d20c1ad4a' }, this.status), this.selected_item && index.h("span", { key: '01d1d92290b47332e014b010be7575d9976a61d6', class: "selected-item" }, this.get_full_path(this.selected_item))), index.h("section", { key: '32951e5b9ae53f2d84d90b43820801d1a2caeb65', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
386
- index.h("section", { key: '46ea29aafbc1b4392d5a368534b1fd1f5ca8446a', class: {
489
+ 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: '141c34cb925c0e42fca1e0397b610071b360c0d1', class: "loader" }, "Loading..."), this.show_error && index.h("div", { key: 'ebf97cf4b7307514e724c7778c4a9052ec32c68d', class: "error" }, this.error_message)), index.h("footer", { key: '1f243a6d09afe5380466dec79226bde67679ace8' }, index.h("section", { key: '59f7e3dd679213d76294c347f1af8ca4f3d5b3e6', class: "status" }, index.h("span", { key: '4aaebcfa2fea3e69d02814727c63484fd465dfee' }, this.status), this.selected_item && index.h("span", { key: '5f37d4f9a82a97cd5065651d5f4311104153b8a7', class: "selected-item" }, this.get_full_path(this.selected_item))), index.h("section", { key: '0a75c580bb9ce63e58e4cd3aef76f13f5d8a6c43', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
490
+ index.h("section", { key: 'bf83e07198a7bd7f6b11164261496cee880e8e95', class: {
387
491
  'creds': true,
388
492
  'blurred': this.show_login_screen,
389
- } }, index.h("form", { key: 'c70ab635c91947a722dd203a346ed40b76471a25', class: "auth", onSubmit: (event) => {
493
+ } }, index.h("form", { key: 'c0b3f36031b3d0575e0dfc4d4e5c689a3e86093e', class: "auth", onSubmit: (event) => {
390
494
  const formData = new FormData(event.target);
391
495
  let username = undefined;
392
496
  if (this.show_login_screen_username) {
@@ -403,9 +507,27 @@ const PhirepassSftpClient = class {
403
507
  this.show_loader = true;
404
508
  event.stopPropagation();
405
509
  event.preventDefault();
406
- } }, index.h("div", { key: '498d0374665f404fac6feef40ddcb7bc386e749b', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
407
- index.h("div", { key: '2ff0c7b6bce0dabde50cc73de23ca3068951ef3d' }, index.h("label", { key: 'b6b6fb3d1c645e0ba7f55c420db3077a785cac48', htmlFor: "username" }, "Username"), index.h("input", { key: '42e5c54dcf9ee40fc35c84b44be942b4775a82b4', id: "username", autoComplete: 'off', name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
408
- index.h("div", { key: 'ef4861042d2b239766add5185e8f4d46af526232' }, index.h("label", { key: '901716f1f0f61d9116bdac51cc96581778bf2ebb', htmlFor: "password" }, "Password"), index.h("input", { key: 'da97e27113dfc2e9bb0c0a32e9b94140db1defa7', id: "password", autoComplete: 'off', name: "password", type: "password", placeholder: "" })), index.h("div", { key: 'd8c497d4072f7b3940b483f02a722058c0b8a843' }, index.h("button", { key: 'bd9a920f46b0c48a15936a2249dadc4f04cdcc0f', type: "submit" }, "Connect"))))));
510
+ } }, index.h("div", { key: 'f8f811323c0aaa9d2c6e7c70b39e2bc58073f500', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
511
+ index.h("div", { key: '9d37d47a0c3d7235711964979389e34e7ae909e4' }, index.h("label", { key: '870aefcf5b1052663df6564158f85f0a1a6c14fc', htmlFor: "username" }, "Username"), index.h("input", { key: 'b51ee3b3f4a73c7116ace5d1d111d76e6c2d44a2', id: "username", autoComplete: 'off', name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
512
+ index.h("div", { key: 'f727237549f83c27639f943414665eab507d3e0b' }, index.h("label", { key: 'e0607fbaa128a26ca8a6ce2be5976c2be66cf1a8', htmlFor: "password" }, "Password"), index.h("input", { key: '4458ad7c4927bf21e27c9b979c14d5d3ca377514', id: "password", autoComplete: 'off', name: "password", type: "password", placeholder: "" })), index.h("div", { key: '7e3a5f468cc73a370558d4f447e1e7e91ea9dff2' }, index.h("button", { key: 'c63922f8ffd4377a13c76f51108e8fc9cfa7cdfa', type: "submit" }, "Connect")))), this.show_upload_modal &&
513
+ index.h("section", { key: 'b7935f9ab9e2cbfc8ecb66aff2c212e8f008675f', class: {
514
+ 'upload-modal': true,
515
+ 'visible': this.show_upload_modal,
516
+ } }, index.h("div", { key: 'e7c84c44c5ccec4d7211dd647abee21ba9e4dded', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, index.h("div", { key: '42411ccf81daad3d6f94455ec5f39a2ec8bd32ce', class: "title" }, "Uploading File"), index.h("div", { key: 'd7e6db3d7af27e69533bf2bcc532ab36de241a84', class: "file-name", title: this.upload_file_name }, this.upload_file_name), index.h("div", { key: '3b1e1eb29e1d9b737bf52c3e9d59c33871d661fc', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, index.h("div", { key: '36d23d0a85747aa12f36b05caa4fa047095245b9', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), index.h("div", { key: 'd981d282d1ad7216eee6a6ea8eaf0b48655d6b00', class: "progress-value" }, this.upload_progress, "%"), index.h("button", { key: '1e5eb505505098bc88fadad649da78e4f291e8c3', type: "button", class: {
517
+ 'cancel': true,
518
+ 'finished': this.upload_finished,
519
+ }, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
520
+ index.h("section", { key: 'f2d75e7719e5a5ecad1dc37145da05cedefc53eb', class: {
521
+ 'download-modal': true,
522
+ 'visible': this.show_download_modal,
523
+ } }, index.h("div", { key: '248a10deae9f5869290a362d2ec0dc49480c2f6a', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, index.h("div", { key: '05f2f39b31a59ecb402c8b803b9ba8819d9b41d3', class: "title" }, "Downloading File"), index.h("div", { key: '9979cfdbd9f0ac1888fbce3050ea51f1ac7fbc13', class: "file-name", title: this.download_file_name }, this.download_file_name), index.h("div", { key: '5a0edbdb962e730fb8b4ff6ed06d1826e84d6ee4', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, index.h("div", { key: 'fdb25a6a1a42cb82050b4d6e4da4cae52c09ecc1', class: "progress-fill", style: { width: `${this.download_progress}%` } })), index.h("div", { key: '2b9d47914221aa0537c0317b87cebedeb5c99b57', class: "progress-value" }, this.download_progress, "%"), index.h("button", { key: '15dee8510d3468eb00131248d7c2e6d31349b650', type: "button", class: {
524
+ 'cancel': true,
525
+ 'finished': this.download_finished,
526
+ }, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
527
+ index.h("section", { key: '5b5fd8c394811a4f5a2c285b331ed0a989729fea', class: {
528
+ 'delete-modal': true,
529
+ 'visible': this.show_delete_modal,
530
+ } }, index.h("div", { key: 'db2010aa154ececde47f5a5b4c3da485db786b0e', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, index.h("div", { key: '2fdb21392ad194cf7b72bb07391d6fc469b72cea', class: "title" }, "Delete File"), index.h("div", { key: '28ea5040b1111a888d230fd9aa6c34ada0003132', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), index.h("div", { key: '123138ed8bf191e0dd4d1d9ab0409a15caa2aec2', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading && index.h("div", { key: '7a30da76db24c7ecb56877ab055fca6f84ba995b', class: "delete-loading-bar", "aria-hidden": "true" }), index.h("div", { key: 'c6eda63ce75896cc6540f509c81e895b3317e197', class: "modal-actions" }, index.h("button", { key: '54e7f01e6858f1ac0a73091ed7a6a3666bfad968', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), index.h("button", { key: 'f647a2772cb3a14cb42fc6d654c5068bf9e3f7f1', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
409
531
  }
410
532
  static get watchers() { return {
411
533
  "nodeId": [{
@@ -694,7 +694,7 @@ const PhirepassTerminal = class {
694
694
  this.usernameBuffer = "";
695
695
  }
696
696
  render() {
697
- return (index.h(index.Host, { key: 'e0e73c834bdcafc1bc00cf27a1846893deeafdc6' }, index.h("div", { key: '8db965a7a3356deb0f672470d92521b755f2f165', id: "ccc", ref: el => (this.containerEl = el) })));
697
+ return (index.h(index.Host, { key: '0df9307a490dc566e41be1e1d169f8862f8569b9' }, index.h("div", { key: 'c63a16718ef4a559b880c6058bf482db4aeb6af1', id: "ccc", ref: el => (this.containerEl = el) })));
698
698
  }
699
699
  static get watchers() { return {
700
700
  "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],"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"],"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.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);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -274,18 +274,10 @@
274
274
  line-height: 0.95rem;
275
275
 
276
276
  &.action-col {
277
- width: 20px;
278
- min-width: 20px;
277
+ width: 58px;
278
+ min-width: 58px;
279
279
  padding: 0 10px;
280
280
  }
281
-
282
- &:hover {
283
- &.action-col {
284
- color: blue;
285
- background-color: red;
286
- stroke: red;
287
- }
288
- }
289
281
  }
290
282
  }
291
283
 
@@ -299,12 +291,19 @@
299
291
  color: hsl(var(--muted-foreground));
300
292
 
301
293
  &.action-col {
302
- width: 20px;
303
- min-width: 20px;
294
+ width: 58px;
295
+ min-width: 58px;
304
296
  text-align: center;
305
297
  padding-left: 1px;
306
298
  padding-right: 1px;
307
299
 
300
+ .file-actions {
301
+ display: flex;
302
+ align-items: center;
303
+ justify-content: center;
304
+ gap: 8px;
305
+ }
306
+
308
307
  .file-action {
309
308
  border: none;
310
309
  background: transparent;
@@ -329,6 +328,10 @@
329
328
  &:hover {
330
329
  color: hsl(var(--primary));
331
330
  }
331
+
332
+ &.delete:hover {
333
+ color: hsl(var(--destructive));
334
+ }
332
335
  }
333
336
  }
334
337
 
@@ -495,6 +498,185 @@
495
498
  }
496
499
  }
497
500
  }
501
+
502
+ .upload-modal,
503
+ .download-modal,
504
+ .delete-modal {
505
+ position: absolute;
506
+ inset: 0;
507
+ display: none;
508
+ align-items: center;
509
+ justify-content: center;
510
+ background: rgba(28, 31, 38, 0);
511
+ backdrop-filter: blur(4px);
512
+ z-index: 6;
513
+
514
+ &.visible {
515
+ display: flex;
516
+ }
517
+
518
+ .upload-dialog,
519
+ .download-dialog,
520
+ .delete-dialog {
521
+ width: min(360px, calc(100% - 24px));
522
+ background-color: rgba(21, 24, 30, 0.96);
523
+ border: 1px solid hsl(var(--border));
524
+ border-radius: var(--radius);
525
+ padding: 16px;
526
+ box-shadow:
527
+ rgba(0, 0, 0, 0) 0px 0px 0px 0px,
528
+ rgba(0, 0, 0, 0) 0px 0px 0px 0px,
529
+ rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;
530
+
531
+ .title {
532
+ color: hsl(var(--primary));
533
+ font-size: 0.8rem;
534
+ margin-bottom: 8px;
535
+ }
536
+
537
+ .file-name {
538
+ color: rgb(189, 219, 209);
539
+ font-size: 0.72rem;
540
+ line-height: 1rem;
541
+ margin-bottom: 10px;
542
+ white-space: nowrap;
543
+ overflow: hidden;
544
+ text-overflow: ellipsis;
545
+ }
546
+
547
+ .progress-track {
548
+ width: 100%;
549
+ height: 10px;
550
+ border-radius: 999px;
551
+ background-color: hsl(var(--muted));
552
+ overflow: hidden;
553
+ border: 1px solid hsl(var(--border));
554
+
555
+ .progress-fill {
556
+ height: 100%;
557
+ width: 0;
558
+ background: linear-gradient(90deg, hsl(var(--primary) / 0.7), hsl(var(--primary)));
559
+ transition: width 140ms ease;
560
+ }
561
+ }
562
+
563
+ .progress-value {
564
+ margin-top: 8px;
565
+ color: hsl(var(--muted-foreground));
566
+ font-size: 0.7rem;
567
+ text-align: right;
568
+ }
569
+
570
+ .cancel {
571
+ margin-top: 14px;
572
+ width: 100%;
573
+ height: 2rem;
574
+ border: 1px solid hsl(var(--border));
575
+ border-radius: calc(var(--radius) - 2px);
576
+ background: hsl(var(--muted));
577
+ color: rgb(189, 219, 209);
578
+ font-size: 0.75rem;
579
+ letter-spacing: 0.03em;
580
+ cursor: pointer;
581
+
582
+ &:hover {
583
+ border-color: hsl(var(--primary));
584
+ color: hsl(var(--primary));
585
+ }
586
+
587
+ &.finished {
588
+ background-color: hsl(var(--primary));
589
+ border-color: hsl(var(--primary));
590
+ color: hsl(var(--primary-foreground));
591
+
592
+ &:hover {
593
+ background-color: hsl(var(--primary) / 0.9);
594
+ border-color: hsl(var(--primary) / 0.9);
595
+ color: hsl(var(--primary-foreground));
596
+ }
597
+ }
598
+ }
599
+
600
+ .message {
601
+ color: rgb(189, 219, 209);
602
+ font-size: 0.74rem;
603
+ line-height: 1rem;
604
+ margin-bottom: 8px;
605
+ }
606
+
607
+ .modal-actions {
608
+ margin-top: 14px;
609
+ display: grid;
610
+ grid-template-columns: 1fr 1fr;
611
+ gap: 8px;
612
+
613
+ .btn {
614
+ height: 2rem;
615
+ border: 1px solid hsl(var(--border));
616
+ border-radius: calc(var(--radius) - 2px);
617
+ font-size: 0.75rem;
618
+ letter-spacing: 0.03em;
619
+ cursor: pointer;
620
+
621
+ &:disabled {
622
+ opacity: 0.65;
623
+ cursor: not-allowed;
624
+ }
625
+ }
626
+
627
+ .btn.secondary {
628
+ background: hsl(var(--muted));
629
+ color: rgb(189, 219, 209);
630
+
631
+ &:hover {
632
+ border-color: hsl(var(--primary));
633
+ color: hsl(var(--primary));
634
+ }
635
+ }
636
+
637
+ .btn.destructive {
638
+ background: hsl(var(--destructive));
639
+ border-color: hsl(var(--destructive));
640
+ color: white;
641
+
642
+ &:hover {
643
+ background: hsl(var(--destructive) / 0.9);
644
+ border-color: hsl(var(--destructive) / 0.9);
645
+ }
646
+ }
647
+ }
648
+
649
+ .delete-loading-bar {
650
+ margin-top: 2px;
651
+ width: 100%;
652
+ height: 8px;
653
+ border-radius: 999px;
654
+ border: 1px solid hsl(var(--border));
655
+ background:
656
+ linear-gradient(90deg, hsl(var(--muted)) 0%, hsl(var(--muted)) 100%),
657
+ linear-gradient(90deg, hsl(var(--primary) / 0.3), hsl(var(--primary)), hsl(var(--primary) / 0.3));
658
+ background-repeat: no-repeat;
659
+ background-size:
660
+ 100% 100%,
661
+ 40% 100%;
662
+ animation: delete-loading 1s linear infinite;
663
+ }
664
+ }
665
+ }
666
+ }
667
+
668
+ @keyframes delete-loading {
669
+ from {
670
+ background-position:
671
+ 0 0,
672
+ -45% 0;
673
+ }
674
+
675
+ to {
676
+ background-position:
677
+ 0 0,
678
+ 145% 0;
679
+ }
498
680
  }
499
681
 
500
682
  :host(.max) {