This commit is contained in:
root
2025-11-25 09:56:15 +03:00
commit 68c8f0e80d
23717 changed files with 3200521 additions and 0 deletions

View File

@ -0,0 +1 @@
import{r as n,l as c,j as e}from"./main-D-T5fPSb.js";function w({machine:t,connectionUrl:m,enableSftp:y,onError:l,onDisconnect:h}){const[p,d]=n.useState(!0),[k,x]=n.useState(null),[r,o]=n.useState(!1),s=n.useRef(null),f=n.useRef(null);return n.useEffect(()=>((async()=>{try{if(d(!0),x(null),c.info("guacamole-viewer","Initializing Guacamole session",{machineId:t.id,machineName:t.name,connectionUrl:m}),s.current)if(!s.current.src||s.current.src==="about:blank")c.debug("guacamole-viewer","Loading connection URL",{url:m}),s.current.src=m;else{c.debug("guacamole-viewer","iframe already loaded, keeping existing session"),d(!1);return}const a=()=>{d(!1),c.info("guacamole-viewer","Guacamole session loaded",{machineId:t.id}),setTimeout(()=>{s.current&&(s.current.focus(),o(!0))},500)},i=()=>{const u=new Error("Failed to load Guacamole session");x(u),d(!1),l==null||l(u)};if(s.current)return s.current.addEventListener("load",a),s.current.addEventListener("error",i),()=>{var u,b;(u=s.current)==null||u.removeEventListener("load",a),(b=s.current)==null||b.removeEventListener("error",i)}}catch(a){const i=a instanceof Error?a:new Error("Unknown error occurred");c.error("guacamole-viewer","Connection failed",{machineId:t.id,error:i.message}),x(i),l==null||l(i),d(!1)}})(),()=>{c.info("guacamole-viewer","Cleaning up connection",{machineId:t.id}),o(!1)}),[t.id]),n.useEffect(()=>{const g=a=>{f.current&&!f.current.contains(a.target)&&r&&(o(!1),s.current&&s.current.blur())};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[r]),k?e.jsx("div",{className:"flex-1 flex items-center justify-center bg-red-50 text-red-600 p-4 rounded-kaspersky",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"font-medium mb-2",children:"Connection Error"}),e.jsx("p",{className:"text-sm mb-4",children:k.message}),e.jsxs("div",{className:"flex gap-2 justify-center",children:[e.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-red-600 text-white rounded-kaspersky hover:bg-red-700 transition-colors",children:"Retry"}),e.jsx("button",{onClick:h,className:"px-4 py-2 bg-gray-600 text-white rounded-kaspersky hover:bg-gray-700 transition-colors",children:"Disconnect"})]})]})}):e.jsx("div",{className:"w-full h-full flex flex-col bg-kaspersky-bg",children:e.jsxs("div",{ref:f,className:`flex-1 relative bg-kaspersky-bg overflow-hidden ${r?"ring-2 ring-kaspersky-primary ring-opacity-50":""}`,children:[p&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-kaspersky-bg bg-opacity-75 z-10",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-8 h-8 border-4 border-kaspersky-base border-t-transparent rounded-full animate-spin mx-auto"}),e.jsxs("p",{className:"mt-2 text-kaspersky-text",children:["Connecting to ",t.name,"..."]})]})}),!p&&!r&&e.jsx("div",{className:"absolute inset-0 z-10 cursor-pointer",onClick:()=>{s.current&&(s.current.focus(),o(!0))},title:"Click to activate console"}),!p&&e.jsx("div",{className:"absolute top-4 left-1/2 transform -translate-x-1/2 z-20 pointer-events-none select-none",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxs("div",{className:`flex items-center gap-3 px-4 py-2 rounded-lg text-sm font-semibold transition-all duration-300 ${r?"bg-kaspersky-primary text-white shadow-kaspersky-lg":"bg-kaspersky-secondary bg-opacity-90 text-kaspersky-text-white"}`,children:[e.jsx("div",{className:`w-3 h-3 rounded-full transition-all duration-300 ${r?"bg-kaspersky-danger animate-pulse":"bg-kaspersky-text-lighter"}`}),e.jsx("span",{children:r?"Console Active":"Console Inactive"})]}),e.jsx("div",{className:"bg-kaspersky-secondary bg-opacity-75 backdrop-blur-sm text-kaspersky-text-white px-3 py-1.5 rounded-md text-xs font-medium",children:y?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"opacity-75",children:"Settings & SFTP:"}),e.jsx("kbd",{className:"px-1.5 py-0.5 bg-kaspersky-base bg-opacity-50 rounded text-[10px] font-mono",children:"Ctrl+Shift+Alt"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"opacity-75",children:"Settings:"}),e.jsx("kbd",{className:"px-1.5 py-0.5 bg-kaspersky-base bg-opacity-50 rounded text-[10px] font-mono",children:"Ctrl+Shift+Alt"})]})})]})}),e.jsx("iframe",{ref:s,className:"w-full h-full border-0",title:`Remote Desktop - ${t.name}`,allow:"clipboard-read; clipboard-write; keyboard-map *; pointer-lock",sandbox:"allow-same-origin allow-scripts allow-forms allow-popups allow-pointer-lock allow-modals allow-downloads",onFocus:()=>o(!0),onBlur:()=>o(!1)})]})})}export{w as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

309
mc_test/dist/renderer/assets/main-D-T5fPSb.js vendored Executable file

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

44
mc_test/dist/renderer/index.html vendored Executable file
View File

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Machine Control Center</title>
<!-- Content Security Policy - DISABLED for debugging -->
<!--
<meta http-equiv="Content-Security-Policy" content="
default-src 'self' 'unsafe-inline' 'unsafe-eval';
script-src 'self' 'unsafe-inline' 'unsafe-eval' http://localhost:* ws://localhost:*;
style-src 'self' 'unsafe-inline' http://localhost:*;
img-src 'self' data: blob: http://localhost:*;
font-src 'self' data: http://localhost:*;
connect-src 'self' http://localhost:* https://localhost:* ws://localhost:* wss://localhost:*;
frame-src 'self' http://localhost:* https://localhost:*;
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
">
-->
<script type="module" crossorigin src="./assets/main-D-T5fPSb.js"></script>
<link rel="stylesheet" crossorigin href="./assets/main-CnaqftHU.css">
</head>
<body>
<div id="root">Loading...</div>
<script>
console.log('🔍 HTML загружен, начинаем отладку...');
console.log('📍 Root element:', document.getElementById('root'));
</script>
<script>
// Добавляем обработчик ошибок
window.addEventListener('error', (e) => {
console.error('❌ JavaScript Error:', e.error);
});
window.addEventListener('unhandledrejection', (e) => {
console.error('❌ Unhandled Promise Rejection:', e.reason);
});
</script>
</body>