| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <title>openhop 3.1.1 · openhop.cfd</title> |
| <style> |
| |
| @font-face { |
| font-family: "Inter"; |
| font-style: normal; |
| font-weight: 400 700; |
| font-display: swap; |
| src: local("Inter"), local("Inter Variable"), url(data:font/woff2;base64,d09GMgABAAAAALyAABUAAAAB4CAAALwFAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoZeG4KyRBzVcD9IVkFSi2k/TVZBUl4GYD9TVEFUgU4nJgCFNi9sEQgKgbtAgaEUC4gOADCCnD4BNgIkA5AYBCAFhi4HoQQMB1tzzZFCvBvP7u3DbGpQpdsQgMqps1L7r3ADN3ekcLpSd3VjDvdRxlSwXT24HeDivrPV7P/////PTiZjjG6zbhuAgIaVWf//oFG6m0fKpZa1GtEM3hHeiRiGTOHDNEtW1uphm9xD8Yfsc845xSOllI6MZ0bgBa6OXQbsGPkQKYlQqD3X9YVVvH2KntB6YJwvZMXkp+C5yraOrUrG4lPZsKGIy79I0v3UzBZt9SM6yqcJLyKfWogpGCTMhFHtxxQ74e+iXfmlkqJiNbeKZ4KLcfByGbnFit+pfrn4okou/l1zuyzDbEtoImSSXDLgSfrNakEiSjNkyuNXIhj2Rtg8HXFaJ1HMmcuGV+Se8CUCw/bq3NAqMQ78EUkhmkVBNNkIe66aFY24EF5FxJKmvYhLeZu+817KeHDRANVOdSZTE0mx05wGy3iIsAUf0f92lq9M9/vv/v/fb8Oa8yVqT0nuI2nTGlyeDouviNs9inRBSSqDf7jIJKu0nX6r99J6jx/12cSUdscJp/KxG3QT7RY/9SEwOBbgQ6oeY7Wz9aQv/8DXVf25LyKzMVb1gPyyV/Vl7QRt6Yojsq2qemYjy5LWBREQDCugh4gIihyuKEEw4qrLEgyHmBCRJ4m6LkFU2IMVOZKIiIiYOEQeMxhxWTBhSKjoeZiRLHLKDI9u9i8BQgghYQQIEEKYUxQFUXDWDq/aau0aNzrutm2vd78V8cbevb39PbuWZ+c8x6yKiPAv2cH/SXIzsw/6FFq5J1BCrkRshmBunSgGwlBJAxEEpGLApFwUq2DBGCNGjNwYg41Bb8RokWEBgmRpAypG/w8j8yOHxzn7l6YGDJgwUT8nKWxnYvunm0dKKkBbSk3TVKjTFqliMpggPjnuPrMz5WTD46b9o6Xicz8RK9tuu7tvrowTla6+VY2ikiAhJBCHQEhQ+fE36//kJECQUp/ObldcunvvM5Mvk9KrX8/F1mREaYECwcJRbVYVmlQxSMieub9uWxgmi8RIlphMT53AF76nKsiZ0PP9fv+5+lz6NKMTYVIxFkhYYhkun/JxgkCrUW8HgAHfZv5wV/Vceo2IEwFWEZPFfBFfSpOnX/qnojXxvfbOns7sUMptOJJCQsyoiP+evOentnLVv/qvc+q3CjpUOcAOsAPo0KMDOG0kq58AOljNltFOGB3g1Wk39AQ+xS8O8/f2tb0KFOBgKOMZL1U4wNeMYxxsv9E/WGcJZSGtFOEB7fTCvnubsV0HO3elSVt20/zFnBL… 62,939 more characters on this line, see Raw |
| } |
| |
| |
| |
| |
| |
| |
| :root { |
| --bg: #151619; |
| --bg-deep: #101113; |
| --surface: #1d1f23; |
| --surface-2: #24262b; |
| --surface-3: #2c2f35; |
| --line: rgba(236, 233, 222, 0.075); |
| --line-strong: rgba(236, 233, 222, 0.14); |
| --line-hard: rgba(236, 233, 222, 0.24); |
| --text: #ecebe4; |
| --muted: #a8a59b; |
| --dim: #7a776f; |
| |
| --amber: #f2b318; |
| --amber-hi: #ffc535; |
| --amber-lo: #d99f0e; |
| --amber-text: #f7cc5c; |
| --amber-soft: rgba(242, 179, 24, 0.10); |
| --amber-line: rgba(242, 179, 24, 0.45); |
| --ink: #1f2125; |
| --paper: #efede6; |
| |
| |
| --ok: #3fb97a; --ok-text: #8edcb1; --ok-soft: rgba(63, 185, 122, 0.11); --ok-line: rgba(63, 185, 122, 0.40); |
| --warn: #f07d3a; --warn-text: #ffb185; --warn-soft: rgba(240, 125, 58, 0.11); --warn-line: rgba(240, 125, 58, 0.42); |
| --bad: #e5534b; --bad-text: #ffa29b; --bad-soft: rgba(229, 83, 75, 0.12); --bad-line: rgba(229, 83, 75, 0.48); |
| --info: #6fa8d6; --info-text: #b4d4ef; --info-soft: rgba(111, 168, 214, 0.11); --info-line: rgba(111, 168, 214, 0.42); |
| |
| |
| --g-app: radial-gradient(1400px 520px at 50% -12%, rgba(242, 179, 24, 0.05), rgba(242, 179, 24, 0) 62%), |
| linear-gradient(180deg, #17181b 0%, #131416 100%); |
| --g-bar: linear-gradient(180deg, #17181b 0%, #0f1012 100%); |
| --g-surface: linear-gradient(180deg, #222428 0%, #1c1e22 100%); |
| --g-raised: linear-gradient(180deg, #2b2d32 0%, #232529 100%); |
| --g-raised-hi: linear-gradient(180deg, #34363c 0%, #2b2d32 100%); |
| --g-sunken: linear-gradient(180deg, #0e0f11 0%, #131416 100%); |
| --g-amber: linear-gradient(180deg, #f9c537 0%, #f2b318 52%, #e4a60f 100%); |
| --g-amber-hi: linear-gradient(180deg, #ffd34f 0%, #f9bf22 55%, #eeae14 100%); |
| --g-green: linear-gradient(180deg, #4cc988 0%, #3fb97a 55%, #34a56b 100%); |
| --sheen: inset 0 1px 0 rgba(255, 255, 255, 0.045); |
| |
| |
| |
| --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1); |
| --ease-in: cubic-bezier(0.5, 0, 0.75, 0); |
| --ease-in-out: cubic-bezier(0.45, 0, 0.25, 1); |
| --t-press: 70ms; |
| --t-fast: 120ms; |
| --t: 170ms; |
| --t-panel: 280ms; |
| |
| --r: 4px; |
| --r-sm: 3px; |
| --c: 10px; |
| --mono: "Cascadia Mono", "Cascadia Code", Consolas, monospace; |
| --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; |
| --display: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif; |
| |
| |
| --i-monitor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='3' width='20' height='14' rx='1.5'/><path d='M8 21h8M12 17v4'/></svg>"); |
| --i-terminal: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m4 17 6-6-6-6M12 19h8'/></svg>"); |
| --i-rotate: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/><path d='M21 3v5h-5'/><path d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/><path d='M8 16H3v5'/></svg>"); |
| --i-hop: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 20c1-8 6-12 10-12s6.5 3 7.5 7'/><path d='M21.5 9.5 20.5 15l-5.3-1.6'/><path d='M2 20h4'/></svg>"); |
| --i-power: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2v10'/><path d='M18.4 6.6a9 9 0 1 1-12.77.04'/></svg>"); |
| --i-zap: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M13 2 3 14h9l-1 8 10-12h-9l1-8z'/></svg>"); |
| --i-wrench: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/></svg>"); |
| --i-plug: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22v-5M9 8V2M15 8V2M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8z'/></svg>"); |
| --i-layers: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m12 2 10 5-10 5L2 7z'/><path d='m2 17 10 5 10-5'/><path d='m2 12 10 5 10-5'/></svg>"); |
| --i-globe: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/></svg>"); |
| --i-shield: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/></svg>"); |
| --i-target: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><circle cx='12' cy='12' r='6'/><circle cx='12' cy='12' r='2'/></svg>"); |
| --i-shuffle: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 3h5v5M4 20 21 3M21 16v5h-5M15 15l6 6M4 4l5 5'/></svg>"); |
| --i-activity: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12h-4l-3 9L9 3l-3 9H2'/></svg>"); |
| --i-check: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='square' stroke-linejoin='miter'><path d='M20 6 9 17l-5-5'/></svg>"); |
| --i-alert: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='square' stroke-linejoin='miter'><path d='M12 3 2 20h20z'/><path d='M12 10v4M12 17v.5'/></svg>"); |
| --i-stop: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='square' stroke-linejoin='miter'><path d='M8 2h8l6 6v8l-6 6H8l-6-6V8z'/><path d='m9 9 6 6M15 9l-6 6'/></svg>"); |
| --i-x: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><path d='M6 6l12 12M18 6 6 18'/></svg>"); |
| --i-info: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><circle cx='12' cy='12' r='10'/><path d='M12 11v6M12 7.5v.5'/></svg>"); |
| --i-arrow: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14M13 6l6 6-6 6'/></svg>"); |
| --i-sparkle: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l1.9 5.8L20 10.5l-6.1 1.8L12 18l-1.9-5.7L4 10.5l6.1-1.7z'/><path d='M19 3v4M17 5h4'/></svg>"); |
| --i-undo: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/><path d='M3 3v5h5'/></svg>"); |
| --i-copy: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='9' y='9' width='13' height='13' rx='1.5'/><path d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/></svg>"); |
| --i-folder: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z'/></svg>"); |
| --i-download: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/></svg>"); |
| --i-clipboard: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='8' y='2' width='8' height='4' rx='1'/><path d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/></svg>"); |
| --i-trash: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/></svg>"); |
| --i-dice: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='18' rx='2'/><circle cx='8.5' cy='8.5' r='1.2' fill='black'/><circle cx='12' cy='12' r='1.2' fill='black'/><circle cx='15.5' cy='15.5' r='1.2' fill='black'/></svg>"); |
| --i-spin: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><path d='M21 12a9 9 0 1 1-6.22-8.56'/></svg>"); |
| } |
| |
| @property --tone { syntax: "<color>"; inherits: true; initial-value: #6fa8d6; } |
| @property --tone-soft { syntax: "<color>"; inherits: true; initial-value: rgba(111, 168, 214, 0.11); } |
| |
| * { box-sizing: border-box; margin: 0; padding: 0; } |
| html { background: var(--bg); } |
| |
| body { |
| font-family: var(--sans); |
| font-size: 13px; |
| line-height: 1.4; |
| background: var(--g-app), var(--bg); |
| color: var(--text); |
| height: 100vh; |
| display: flex; |
| flex-direction: column; |
| overflow: hidden; |
| user-select: none; |
| -webkit-font-smoothing: antialiased; |
| font-feature-settings: "cv11", "ss01"; |
| } |
| |
| ::selection { background: rgba(242, 179, 24, 0.32); color: var(--paper); } |
| :focus { outline: none; } |
| :focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; } |
| |
| |
| body[data-view="simple"] [data-view="advanced"], |
| body[data-view="advanced"] [data-view="simple"] { display: none !important; } |
| |
| |
| .chamfer { |
| clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); |
| } |
| |
| .mono { font-family: var(--mono); } |
| |
| |
| [data-icon]::before { |
| content: ""; |
| width: 15px; |
| height: 15px; |
| flex-shrink: 0; |
| background: currentColor; |
| -webkit-mask: var(--icon) center / contain no-repeat; |
| mask: var(--icon) center / contain no-repeat; |
| } |
| [data-icon="monitor"] { --icon: var(--i-monitor); } |
| [data-icon="terminal"] { --icon: var(--i-terminal); } |
| [data-icon="rotate"] { --icon: var(--i-rotate); } |
| [data-icon="hop"] { --icon: var(--i-hop); } |
| [data-icon="power"] { --icon: var(--i-power); } |
| [data-icon="zap"] { --icon: var(--i-zap); } |
| [data-icon="wrench"] { --icon: var(--i-wrench); } |
| [data-icon="plug"] { --icon: var(--i-plug); } |
| [data-icon="layers"] { --icon: var(--i-layers); } |
| [data-icon="globe"] { --icon: var(--i-globe); } |
| [data-icon="shield"] { --icon: var(--i-shield); } |
| [data-icon="target"] { --icon: var(--i-target); } |
| [data-icon="shuffle"] { --icon: var(--i-shuffle); } |
| [data-icon="activity"] { --icon: var(--i-activity); } |
| [data-icon="check"] { --icon: var(--i-check); } |
| [data-icon="arrow"] { --icon: var(--i-arrow); } |
| [data-icon="sparkle"] { --icon: var(--i-sparkle); } |
| [data-icon="undo"] { --icon: var(--i-undo); } |
| [data-icon="copy"] { --icon: var(--i-copy); } |
| [data-icon="folder"] { --icon: var(--i-folder); } |
| [data-icon="download"] { --icon: var(--i-download); } |
| [data-icon="clipboard"] { --icon: var(--i-clipboard); } |
| [data-icon="trash"] { --icon: var(--i-trash); } |
| [data-icon="dice"] { --icon: var(--i-dice); } |
| |
| |
| .btn:disabled[data-icon]::before, |
| .action:disabled[data-icon]::before, |
| .mode-tab:disabled[data-icon]::before { |
| --icon: var(--i-spin); |
| animation: spin 0.8s linear infinite; |
| } |
| @keyframes spin { to { transform: rotate(360deg); } } |
| |
| |
| .topbar { cursor: default; } |
| .win-controls { |
| align-self: stretch; |
| display: flex; |
| margin-left: 6px; |
| } |
| .win-btn { |
| width: 46px; |
| border: 0; |
| background: transparent; |
| color: var(--muted); |
| cursor: default; |
| display: grid; |
| place-items: center; |
| transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); |
| } |
| .win-btn::before { |
| content: ""; |
| width: 10px; |
| height: 10px; |
| background: currentColor; |
| -webkit-mask: var(--wicon) center / contain no-repeat; |
| mask: var(--wicon) center / contain no-repeat; |
| } |
| .win-btn:hover { background-color: rgba(236, 233, 222, 0.07); color: var(--text); } |
| .win-btn:active { background-color: rgba(236, 233, 222, 0.04); transition-duration: var(--t-press); } |
| .win-btn.close:hover { background-color: #c42b1c; color: #fff; } |
| .win-btn.close:active { background-color: #a52719; } |
| .win-btn[data-wicon="min"] { --wicon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><rect y='4.5' width='10' height='1' fill='black'/></svg>"); } |
| .win-btn[data-wicon="max"] { --wicon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black'><rect x='0.5' y='0.5' width='9' height='9'/></svg>"); } |
| .win-btn[data-wicon="restore"] { --wicon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black'><rect x='0.5' y='2.5' width='7' height='7'/><path d='M2.5 2.5V0.5H9.5V7.5H7.5'/></svg>"); } |
| .win-btn[data-wicon="close"] { --wicon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke='black' stroke-width='1.1'><path d='M0.6 0.6l8.8 8.8M9.4 0.6L0.6 9.4'/></svg>"); } |
| |
| .rz { position: fixed; z-index: 20000; } |
| .rz[data-edge="n"] { top: 0; left: 8px; right: 8px; height: 5px; cursor: ns-resize; } |
| .rz[data-edge="s"] { bottom: 0; left: 8px; right: 8px; height: 5px; cursor: ns-resize; } |
| .rz[data-edge="e"] { right: 0; top: 8px; bottom: 8px; width: 5px; cursor: ew-resize; } |
| .rz[data-edge="w"] { left: 0; top: 8px; bottom: 8px; width: 5px; cursor: ew-resize; } |
| .rz[data-edge="ne"] { top: 0; right: 0; width: 10px; height: 10px; cursor: nesw-resize; } |
| .rz[data-edge="sw"] { bottom: 0; left: 0; width: 10px; height: 10px; cursor: nesw-resize; } |
| .rz[data-edge="nw"] { top: 0; left: 0; width: 10px; height: 10px; cursor: nwse-resize; } |
| .rz[data-edge="se"] { bottom: 0; right: 0; width: 10px; height: 10px; cursor: nwse-resize; } |
| body.maximized .rz { display: none; } |
| body.window-dragging, body.window-dragging * { user-select: none !important; } |
| |
| |
| .topbar { |
| height: 46px; |
| display: flex; |
| align-items: center; |
| gap: 10px; |
| padding-left: 14px; |
| background: var(--g-bar); |
| border-bottom: 1px solid var(--line); |
| box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); |
| flex-shrink: 0; |
| } |
| .brand { |
| display: flex; |
| align-items: center; |
| gap: 9px; |
| min-width: 0; |
| flex-shrink: 0; |
| } |
| .logo { width: 24px; height: 24px; display: block; flex-shrink: 0; } |
| .wordmark { |
| font-family: var(--display); |
| font-size: 19px; |
| line-height: 1; |
| color: var(--paper); |
| letter-spacing: 0.1px; |
| white-space: nowrap; |
| } |
| .wordmark b { font-weight: 700; } |
| .wordmark span { font-weight: 300; } |
| .ver { |
| font-family: var(--display); |
| font-size: 11px; |
| letter-spacing: 0.4px; |
| color: var(--dim); |
| padding: 1px 5px 0; |
| border: 1px solid var(--line-strong); |
| border-radius: 2px; |
| line-height: 15px; |
| } |
| .top-spacer { flex: 1; align-self: stretch; } |
| .top-right { display: flex; align-items: center; gap: 8px; min-width: 0; } |
| |
| .status-pill { |
| display: inline-flex; |
| align-items: center; |
| gap: 8px; |
| height: 28px; |
| padding: 0 11px 0 10px; |
| border: 1px solid var(--line-strong); |
| border-radius: var(--r-sm); |
| background: var(--g-surface); |
| font-family: var(--display); |
| font-size: 12px; |
| font-weight: 600; |
| letter-spacing: 0.6px; |
| text-transform: uppercase; |
| color: var(--muted); |
| white-space: nowrap; |
| min-width: 0; |
| max-width: 340px; |
| transition: color var(--t-panel) var(--ease-in-out), border-color var(--t-panel) var(--ease-in-out); |
| } |
| #overallText { overflow: hidden; text-overflow: ellipsis; } |
| .status-pill:has(.dot.ok) { color: var(--ok-text); border-color: var(--ok-line); background: linear-gradient(180deg, rgba(63, 185, 122, 0.17), rgba(63, 185, 122, 0.06)); } |
| .status-pill:has(.dot.bad) { color: var(--bad-text); border-color: var(--bad-line); background: linear-gradient(180deg, rgba(229, 83, 75, 0.2), rgba(229, 83, 75, 0.07)); } |
| .status-pill:has(.dot.warn) { color: var(--warn-text); border-color: var(--warn-line); background: linear-gradient(180deg, rgba(240, 125, 58, 0.18), rgba(240, 125, 58, 0.06)); } |
| .status-pill:has(.dot.spin) { color: var(--info-text); border-color: var(--info-line); background: linear-gradient(180deg, rgba(111, 168, 214, 0.18), rgba(111, 168, 214, 0.06)); } |
| |
| |
| .dot { |
| width: 8px; |
| height: 8px; |
| border-radius: 1px; |
| background: var(--dim); |
| flex-shrink: 0; |
| } |
| .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(63, 185, 122, 0.18); } |
| .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(240, 125, 58, 0.18); } |
| .dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(229, 83, 75, 0.2); animation: pulse 1.6s var(--ease-in-out) infinite; } |
| .dot.spin { background: var(--info); box-shadow: 0 0 0 3px rgba(111, 168, 214, 0.2); animation: pulse 1s var(--ease-in-out) infinite; } |
| .dot { transition: background-color var(--t-panel) var(--ease-in-out), box-shadow var(--t-panel) var(--ease-in-out); } |
| @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } } |
| |
| |
| .view-switch { |
| display: flex; |
| height: 28px; |
| padding: 2px; |
| gap: 2px; |
| background: var(--g-sunken); |
| border: 1px solid var(--line-strong); |
| border-radius: var(--r-sm); |
| flex-shrink: 0; |
| } |
| .view-switch button { |
| border: 0; |
| border-radius: 2px; |
| padding: 0 10px; |
| background: transparent; |
| color: var(--dim); |
| font-family: var(--display); |
| font-size: 12px; |
| font-weight: 600; |
| letter-spacing: 0.6px; |
| text-transform: uppercase; |
| cursor: pointer; |
| box-shadow: inset 0 0 0 var(--amber); |
| transition: background-color var(--t) var(--ease-out), color var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out); |
| } |
| .view-switch button:hover:not(.active) { color: var(--text); background-color: rgba(236, 233, 222, 0.04); } |
| .view-switch button.active { background-color: #33353b; color: var(--amber-text); box-shadow: inset 0 -2px 0 var(--amber), var(--sheen); } |
| |
| |
| .main { |
| flex: 1; |
| overflow-y: auto; |
| overflow-x: hidden; |
| padding: 18px 22px 22px; |
| } |
| .layout { |
| display: grid; |
| grid-template-columns: minmax(0, 1fr); |
| gap: 14px; |
| max-width: 1240px; |
| margin: 0 auto; |
| } |
| body[data-view="simple"] .layout { max-width: 1040px; } |
| |
| ::-webkit-scrollbar { width: 10px; height: 10px; } |
| ::-webkit-scrollbar-track { background: transparent; } |
| ::-webkit-scrollbar-thumb { background: rgba(236, 233, 222, 0.1); border: 3px solid transparent; background-clip: padding-box; border-radius: 2px; } |
| ::-webkit-scrollbar-thumb:hover { background-color: rgba(236, 233, 222, 0.18); } |
| |
| |
| .label { |
| display: flex; |
| align-items: center; |
| gap: 8px; |
| font-family: var(--display); |
| font-size: 12.5px; |
| font-weight: 600; |
| letter-spacing: 1.1px; |
| text-transform: uppercase; |
| color: var(--muted); |
| white-space: nowrap; |
| } |
| .label::before { |
| content: ""; |
| width: 6px; |
| height: 6px; |
| background: var(--amber); |
| flex-shrink: 0; |
| } |
| |
| .card { |
| background: var(--g-surface); |
| box-shadow: var(--sheen), 0 2px 8px rgba(0, 0, 0, 0.18); |
| border: 1px solid var(--line); |
| border-radius: var(--r); |
| padding: 14px 16px 16px; |
| min-width: 0; |
| } |
| .card-head { |
| display: flex; |
| align-items: center; |
| justify-content: space-between; |
| gap: 10px; |
| min-height: 28px; |
| margin-bottom: 10px; |
| } |
| .card-head .head-left { display: flex; align-items: center; gap: 10px; min-width: 0; } |
| |
| |
| .btn { |
| height: 34px; |
| border: 1px solid var(--line-strong); |
| background: var(--g-raised); |
| box-shadow: var(--sheen); |
| color: var(--text); |
| border-radius: var(--r-sm); |
| padding: 0 13px; |
| font-family: var(--sans); |
| font-size: 12.5px; |
| font-weight: 600; |
| cursor: pointer; |
| display: inline-flex; |
| align-items: center; |
| justify-content: center; |
| gap: 7px; |
| white-space: nowrap; |
| flex-shrink: 0; |
| transition: box-shadow var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), |
| color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out), |
| transform var(--t-press) var(--ease-out), opacity var(--t) var(--ease-out); |
| } |
| .btn:hover:not(:disabled) { border-color: var(--line-hard); box-shadow: var(--sheen), inset 0 0 0 99px rgba(255, 255, 255, 0.05); } |
| .btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 0 0 99px rgba(0, 0, 0, 0.14); transition-duration: var(--t-press); } |
| .btn:disabled { opacity: 0.65; cursor: progress; } |
| |
| |
| .btn-solid { |
| --c: 7px; |
| background: var(--g-amber); |
| box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); |
| border-color: transparent; |
| color: var(--ink); |
| clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); |
| } |
| .btn-solid:hover:not(:disabled) { border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 99px rgba(255, 255, 255, 0.14); } |
| .btn-solid:active:not(:disabled) { box-shadow: inset 0 0 0 99px rgba(0, 0, 0, 0.1); } |
| .btn-solid:disabled { opacity: 0.8; } |
| |
| |
| .btn-primary { background: linear-gradient(180deg, rgba(242, 179, 24, 0.17), rgba(242, 179, 24, 0.06)); border-color: var(--amber-line); color: var(--amber-text); } |
| .btn-primary:hover:not(:disabled) { border-color: var(--amber); box-shadow: inset 0 0 0 99px rgba(242, 179, 24, 0.08); } |
| |
| .btn-danger { color: var(--bad-text); border-color: var(--bad-line); background: linear-gradient(180deg, rgba(229, 83, 75, 0.1), rgba(229, 83, 75, 0.02)); } |
| .btn-danger:hover:not(:disabled) { border-color: var(--bad); box-shadow: inset 0 0 0 99px rgba(229, 83, 75, 0.1); } |
| .btn-danger.filled { background: linear-gradient(180deg, #ec6159, #d9473f); border-color: #d9473f; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); } |
| .btn-danger.filled:hover:not(:disabled) { border-color: #e5534b; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 99px rgba(255, 255, 255, 0.1); } |
| |
| .btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); } |
| .btn-ghost:hover:not(:disabled) { background-color: rgba(236, 233, 222, 0.06); border-color: var(--line); color: var(--text); box-shadow: none; } |
| |
| .btn-sm { height: 30px; padding: 0 11px; font-size: 12px; gap: 6px; } |
| .btn-sm[data-icon]::before { width: 14px; height: 14px; } |
| .btn-xs { height: 24px; padding: 0 8px; font-size: 11.5px; gap: 5px; } |
| .btn-xs[data-icon]::before { width: 12px; height: 12px; } |
| .btn-icon { width: 30px; padding: 0; } |
| |
| .link-btn { |
| border: 0; |
| background: none; |
| color: var(--amber-text); |
| font: inherit; |
| font-weight: 600; |
| cursor: pointer; |
| display: inline-flex; |
| align-items: center; |
| gap: 5px; |
| padding: 2px 0; |
| transition: color var(--t-fast) var(--ease-out); |
| } |
| .link-btn:hover { color: var(--amber-hi); text-decoration: underline; text-underline-offset: 3px; } |
| .link-btn[data-icon]::before { width: 13px; height: 13px; order: 2; } |
| |
| |
| .health { |
| --c: 16px; |
| --tone: var(--info); |
| --tone-soft: var(--info-soft); |
| position: relative; |
| display: flex; |
| transition: --tone var(--t-panel) var(--ease-in-out), --tone-soft var(--t-panel) var(--ease-in-out); |
| background: |
| linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 45%), |
| linear-gradient(100deg, var(--tone-soft), rgba(0, 0, 0, 0) 55%), |
| var(--g-surface); |
| clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); |
| } |
| .health.ok { --tone: var(--ok); --tone-soft: var(--ok-soft); } |
| .health.warn { --tone: var(--warn); --tone-soft: var(--warn-soft); } |
| .health.bad { --tone: var(--bad); --tone-soft: var(--bad-soft); } |
| .health.busy { --tone: var(--info); --tone-soft: var(--info-soft); } |
| |
| .health-band { width: 6px; flex-shrink: 0; background: var(--tone); } |
| .health.bad .health-band { |
| background: repeating-linear-gradient(-45deg, var(--bad) 0 7px, #3a1d1c 7px 14px); |
| } |
| .health.busy .health-band { |
| background: repeating-linear-gradient(-45deg, var(--info) 0 7px, #1f2c38 7px 14px); |
| background-size: 100% 19.8px; |
| animation: stripes 1.2s linear infinite; |
| } |
| @keyframes stripes { to { background-position: 0 19.8px; } } |
| |
| .health-main { flex: 1; min-width: 0; padding: 18px 22px 16px 18px; display: flex; flex-direction: column; gap: 14px; } |
| .health-head { display: flex; align-items: center; gap: 16px; } |
| .stamp { |
| --c: 9px; |
| width: 54px; |
| height: 54px; |
| flex-shrink: 0; |
| display: grid; |
| place-items: center; |
| background: |
| linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, 0.12)), |
| var(--tone); |
| color: var(--ink); |
| clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); |
| } |
| .stamp::before { |
| content: ""; |
| width: 28px; |
| height: 28px; |
| background: currentColor; |
| -webkit-mask: var(--hicon, var(--i-spin)) center / contain no-repeat; |
| mask: var(--hicon, var(--i-spin)) center / contain no-repeat; |
| } |
| .health.ok .stamp { --hicon: var(--i-check); } |
| .health.warn .stamp { --hicon: var(--i-alert); } |
| .health.bad .stamp { --hicon: var(--i-stop); } |
| .health.busy .stamp { --hicon: var(--i-spin); } |
| .health.busy .stamp::before { animation: spin 0.9s linear infinite; } |
| .health.changed .stamp { animation: stampIn var(--t-panel) var(--ease-out); } |
| .health.changed .health-text { animation: textIn var(--t-panel) var(--ease-out); } |
| @keyframes stampIn { from { transform: scale(0.82); opacity: 0.3; } to { transform: none; opacity: 1; } } |
| @keyframes textIn { from { opacity: 0.25; transform: translateX(-4px); } to { opacity: 1; transform: none; } } |
| |
| .health-text { flex: 1; min-width: 0; } |
| .health-kicker { |
| font-family: var(--display); |
| font-size: 11.5px; |
| font-weight: 600; |
| letter-spacing: 1.1px; |
| text-transform: uppercase; |
| color: var(--dim); |
| } |
| .health-title { |
| font-family: var(--display); |
| font-size: 26px; |
| font-weight: 600; |
| line-height: 1.12; |
| color: var(--paper); |
| margin-top: 2px; |
| } |
| .health-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; } |
| .health-head > .btn { align-self: center; } |
| .health-head > .btn-solid { height: 40px; padding: 0 18px; font-size: 13px; } |
| |
| .health-issues { display: flex; flex-direction: column; gap: 6px; } |
| .health-issues:empty { display: none; } |
| .issue { |
| display: flex; |
| align-items: center; |
| gap: 14px; |
| padding: 10px 10px 10px 12px; |
| background: linear-gradient(90deg, rgba(240, 125, 58, 0.07), rgba(0, 0, 0, 0.2) 38%); |
| border: 1px solid var(--line); |
| border-left: 3px solid var(--warn); |
| border-radius: var(--r-sm); |
| } |
| .health-issues .issue { animation: rowIn var(--t-panel) var(--ease-out) both; } |
| .health-issues .issue:nth-child(2) { animation-delay: 40ms; } |
| .health-issues .issue:nth-child(3) { animation-delay: 80ms; } |
| .health-issues .issue:nth-child(n+4) { animation-delay: 120ms; } |
| @keyframes rowIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } } |
| .issue.bad { border-left-color: var(--bad); background: linear-gradient(90deg, rgba(229, 83, 75, 0.09), rgba(0, 0, 0, 0.2) 38%); } |
| .sev { |
| font-family: var(--display); |
| font-size: 10.5px; |
| font-weight: 700; |
| letter-spacing: 1px; |
| text-transform: uppercase; |
| padding: 2px 6px 1px; |
| border-radius: 2px; |
| color: var(--ink); |
| background: var(--warn); |
| flex-shrink: 0; |
| width: 74px; |
| text-align: center; |
| } |
| .issue.bad .sev { background: var(--bad); color: #fff; } |
| .issue-text { flex: 1; min-width: 0; } |
| .issue-title { font-size: 13.5px; font-weight: 600; color: var(--paper); } |
| .issue-detail { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; } |
| .issue .btn { min-width: 96px; } |
| |
| .health-lasterr { |
| display: flex; |
| align-items: center; |
| gap: 8px; |
| font-size: 12.5px; |
| color: var(--muted); |
| min-width: 0; |
| } |
| .health-lasterr:empty { display: none; } |
| .health-lasterr .le-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } |
| .health-lasterr strong { color: var(--text); font-weight: 600; } |
| |
| .facts { |
| display: grid; |
| grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); |
| border-top: 1px solid var(--line); |
| padding-top: 12px; |
| gap: 10px 18px; |
| } |
| .fact { min-width: 0; } |
| .fact dt { |
| font-family: var(--display); |
| font-size: 11px; |
| font-weight: 600; |
| letter-spacing: 1px; |
| text-transform: uppercase; |
| color: var(--dim); |
| } |
| .fact dd { |
| margin-top: 3px; |
| font-family: var(--display); |
| font-size: 15px; |
| font-weight: 500; |
| color: var(--text); |
| white-space: nowrap; |
| overflow: hidden; |
| text-overflow: ellipsis; |
| font-variant-numeric: tabular-nums; |
| } |
| .fact dd.mono { font-family: var(--mono); font-size: 13px; font-weight: 400; padding-top: 2px; } |
| .fact dd .unit { color: var(--dim); font-weight: 400; font-size: 13px; } |
| |
| |
| .tk { |
| --c: 12px; |
| position: relative; |
| display: flex; |
| background: |
| linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 45%), |
| linear-gradient(100deg, rgba(242, 179, 24, 0.07), rgba(0, 0, 0, 0) 52%), |
| var(--g-surface); |
| clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); |
| } |
| .tk[hidden] { display: none; } |
| .tk-band { width: 6px; flex-shrink: 0; background: var(--amber); } |
| .tk-main { flex: 1; min-width: 0; padding: 12px 22px 12px 18px; display: flex; flex-direction: column; gap: 9px; } |
| .tk-head { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; min-width: 0; } |
| .tk-kicker { |
| font-family: var(--display); |
| font-size: 11.5px; |
| font-weight: 600; |
| letter-spacing: 1.1px; |
| text-transform: uppercase; |
| color: var(--dim); |
| flex-shrink: 0; |
| } |
| .tk-sub { font-size: 12.5px; color: var(--muted); min-width: 0; } |
| .tk-meta { |
| margin-left: auto; |
| display: flex; |
| gap: 14px; |
| font-size: 12px; |
| color: var(--muted); |
| white-space: nowrap; |
| font-variant-numeric: tabular-nums; |
| } |
| .tk-facts { |
| display: grid; |
| grid-template-columns: repeat(4, minmax(0, 1fr)); |
| border-top: 1px solid var(--line); |
| padding-top: 9px; |
| gap: 8px 18px; |
| } |
| .tk-fact { min-width: 0; } |
| .tk-fact dt { |
| font-family: var(--display); |
| font-size: 11px; |
| font-weight: 600; |
| letter-spacing: 1px; |
| text-transform: uppercase; |
| color: var(--dim); |
| white-space: nowrap; |
| overflow: hidden; |
| text-overflow: ellipsis; |
| } |
| .tk-fact dd { |
| margin-top: 2px; |
| font-family: var(--display); |
| font-size: 15px; |
| font-weight: 500; |
| color: var(--text); |
| white-space: nowrap; |
| overflow: hidden; |
| text-overflow: ellipsis; |
| font-variant-numeric: tabular-nums; |
| } |
| .tk-fact.total dd { font-size: 21px; font-weight: 600; color: var(--paper); line-height: 1.05; } |
| .tk-fact dd .sep { color: var(--dim); font-weight: 400; } |
| |
| |
| .actions { |
| display: grid; |
| grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); |
| gap: 10px; |
| } |
| .action { |
| position: relative; |
| min-height: 66px; |
| display: flex; |
| align-items: center; |
| gap: 14px; |
| padding: 12px 16px; |
| border: 1px solid var(--line-strong); |
| border-radius: var(--r); |
| background: var(--g-surface); |
| box-shadow: var(--sheen); |
| color: var(--text); |
| font-family: var(--sans); |
| text-align: left; |
| cursor: pointer; |
| transition: box-shadow var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), |
| transform var(--t-press) var(--ease-out), opacity var(--t) var(--ease-out); |
| min-width: 0; |
| } |
| .action[data-icon]::before { width: 22px; height: 22px; color: var(--amber); background: var(--amber); } |
| .action:hover:not(:disabled) { border-color: var(--line-hard); box-shadow: var(--sheen), inset 0 0 0 99px rgba(255, 255, 255, 0.04); } |
| .action:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 0 0 99px rgba(0, 0, 0, 0.14); transition-duration: var(--t-press); } |
| .action:disabled { cursor: progress; opacity: 0.8; } |
| .action-text { display: flex; flex-direction: column; min-width: 0; } |
| .action .lbl { |
| font-family: var(--display); |
| font-size: 16.5px; |
| font-weight: 600; |
| line-height: 1.2; |
| white-space: nowrap; |
| overflow: hidden; |
| text-overflow: ellipsis; |
| } |
| .action-sub { |
| font-size: 12px; |
| color: var(--muted); |
| margin-top: 3px; |
| white-space: nowrap; |
| overflow: hidden; |
| text-overflow: ellipsis; |
| } |
| .action.primary { |
| --c: 12px; |
| background: var(--g-amber); |
| box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); |
| border-color: transparent; |
| color: var(--ink); |
| clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); |
| } |
| .action.primary[data-icon]::before { background: var(--ink); } |
| .action.primary .action-sub { color: rgba(31, 33, 37, 0.72); } |
| .action.primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 99px rgba(255, 255, 255, 0.13); } |
| .action.primary:active:not(:disabled) { box-shadow: inset 0 0 0 99px rgba(0, 0, 0, 0.1); } |
| |
| |
| .duo { |
| display: grid; |
| grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); |
| gap: 14px; |
| align-items: stretch; |
| } |
| body[data-view="simple"] .duo { grid-template-columns: minmax(0, 1fr); } |
| |
| .ctrl-list { display: grid; grid-template-columns: minmax(0, 1fr); } |
| body[data-view="simple"] .ctrl-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; } |
| .ctrl-row { |
| display: flex; |
| align-items: center; |
| justify-content: space-between; |
| gap: 14px; |
| padding: 10px 0; |
| border-top: 1px solid var(--line); |
| min-width: 0; |
| } |
| .ctrl-list > .ctrl-row:first-child { border-top-color: transparent; padding-top: 2px; } |
| body[data-view="simple"] .ctrl-list > .ctrl-row { border-top-color: transparent; padding: 2px 0 0; } |
| .ctrl-info { min-width: 0; } |
| .ctrl-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--paper); } |
| .ctrl-desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; } |
| |
| |
| .switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; } |
| .switch input { position: absolute; opacity: 0; width: 0; height: 0; } |
| .slider { |
| position: absolute; |
| inset: 0; |
| cursor: pointer; |
| background: var(--g-sunken); |
| border: 1px solid var(--line-hard); |
| border-radius: 3px; |
| transition: border-color var(--t) var(--ease-out); |
| } |
| .slider::after { |
| content: ""; |
| position: absolute; |
| inset: -1px; |
| border-radius: 3px; |
| background: var(--g-green); |
| opacity: 0; |
| transition: opacity var(--t) var(--ease-out); |
| } |
| .slider::before { |
| content: ""; |
| position: absolute; |
| width: 16px; |
| height: 16px; |
| left: 3px; |
| top: 3px; |
| border-radius: 2px; |
| z-index: 1; |
| background-color: #8f8c84; |
| background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.08)); |
| transition: transform var(--t) var(--ease-out), background-color var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out); |
| } |
| .switch:hover .slider { border-color: rgba(236, 233, 222, 0.36); } |
| .switch input:checked + .slider { border-color: var(--ok); } |
| .switch input:checked + .slider::after { opacity: 1; } |
| .switch input:checked + .slider::before { transform: translateX(18px); background-color: #f4f2eb; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); } |
| .switch input:active + .slider::before { width: 19px; } |
| .switch input:checked:active + .slider::before { transform: translateX(15px); } |
| .switch input:focus-visible + .slider { outline: 2px solid var(--amber); outline-offset: 2px; } |
| .switch input:disabled + .slider { opacity: 0.55; cursor: progress; } |
| |
| |
| .tag { |
| display: inline-flex; |
| align-items: center; |
| gap: 5px; |
| font-family: var(--display); |
| font-size: 11px; |
| font-weight: 600; |
| letter-spacing: 0.6px; |
| text-transform: uppercase; |
| line-height: 16px; |
| padding: 1px 6px 0; |
| border-radius: 2px; |
| border: 1px solid var(--line-strong); |
| color: var(--muted); |
| white-space: nowrap; |
| flex-shrink: 0; |
| } |
| .tag.ok { color: var(--ok-text); border-color: var(--ok-line); background: var(--ok-soft); } |
| .tag.warn { color: var(--warn-text); border-color: var(--warn-line); background: var(--warn-soft); } |
| .tag.bad { color: var(--bad-text); border-color: var(--bad-line); background: var(--bad-soft); } |
| .tag.dim { color: var(--dim); } |
| |
| |
| .logs-card { display: flex; flex-direction: column; min-height: 320px; } |
| .tabs { |
| display: flex; |
| align-items: stretch; |
| gap: 2px; |
| min-width: 0; |
| overflow: hidden; |
| } |
| .tab { |
| position: relative; |
| height: 30px; |
| padding: 0 10px; |
| border: 0; |
| border-radius: 2px 2px 0 0; |
| background: transparent; |
| color: var(--dim); |
| font-family: var(--display); |
| font-size: 12.5px; |
| font-weight: 600; |
| letter-spacing: 0.7px; |
| text-transform: uppercase; |
| cursor: pointer; |
| display: inline-flex; |
| align-items: center; |
| gap: 6px; |
| white-space: nowrap; |
| box-shadow: inset 0 0 0 var(--amber); |
| transition: color var(--t) var(--ease-out), background-color var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out); |
| } |
| .tab:hover:not(.active) { color: var(--text); background-color: rgba(236, 233, 222, 0.03); } |
| .tab.active { color: var(--paper); background-color: #2b2a27; box-shadow: inset 0 -2px 0 var(--amber); } |
| .log-box.swap { animation: fadeIn var(--t) var(--ease-out); } |
| .count { |
| font-family: var(--display); |
| font-size: 10.5px; |
| min-width: 17px; |
| line-height: 15px; |
| padding: 1px 4px 0; |
| text-align: center; |
| border-radius: 2px; |
| background: var(--warn); |
| color: var(--ink); |
| letter-spacing: 0; |
| } |
| .count:empty { display: none; } |
| .logs-card .card-head { border-bottom: 1px solid var(--line); margin-bottom: 0; padding-bottom: 0; align-items: flex-end; } |
| .logs-card .card-head .btn-group { padding-bottom: 6px; } |
| .log-box { |
| flex: 1 1 0; |
| min-height: 220px; |
| overflow-y: auto; |
| margin: 0 -16px -16px; |
| padding: 12px 16px 14px; |
| background: var(--g-sunken); |
| border-radius: 0 0 var(--r) var(--r); |
| font-family: var(--mono); |
| font-size: 11.5px; |
| line-height: 1.7; |
| color: #c9c6bd; |
| user-select: text; |
| white-space: pre-wrap; |
| word-break: break-word; |
| } |
| .log-box .ts { color: var(--dim); } |
| .log-box .hl { color: var(--amber-text); } |
| .log-box .er { color: var(--bad-text); } |
| .log-note { font-family: var(--sans); font-size: 12px; color: var(--dim); white-space: normal; margin-bottom: 8px; } |
| |
| .empty { |
| display: flex; |
| align-items: center; |
| gap: 10px; |
| font-family: var(--sans); |
| font-size: 12.5px; |
| color: var(--muted); |
| white-space: normal; |
| padding: 6px 0; |
| } |
| .empty::before { |
| content: ""; |
| width: 18px; height: 18px; flex-shrink: 0; |
| background: var(--ok); |
| -webkit-mask: var(--i-check) center / contain no-repeat; mask: var(--i-check) center / contain no-repeat; |
| } |
| .empty.neutral::before { background: var(--dim); -webkit-mask-image: var(--i-info); mask-image: var(--i-info); } |
| |
| |
| .err-list { display: flex; flex-direction: column; gap: 8px; font-family: var(--sans); white-space: normal; } |
| .err-item { |
| padding: 10px 12px; |
| border-radius: var(--r-sm); |
| background: var(--g-surface); |
| border: 1px solid var(--line); |
| border-left: 3px solid var(--line-hard); |
| } |
| .err-item.current { border-left-color: var(--warn); background: linear-gradient(90deg, rgba(240, 125, 58, 0.09), rgba(240, 125, 58, 0) 45%), var(--g-surface); } |
| .err-top { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; } |
| .err-title { font-size: 13px; font-weight: 600; color: var(--paper); } |
| .err-meta { font-family: var(--display); font-size: 11.5px; letter-spacing: 0.3px; color: var(--dim); white-space: nowrap; } |
| .err-detail { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; } |
| .err-actions { margin-top: 8px; display: flex; gap: 8px; } |
| |
| |
| .conn .card-head { flex-wrap: wrap; } |
| .mode-desc { font-size: 12px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| .mode-tabs { |
| display: grid; |
| grid-template-columns: repeat(4, minmax(0, 1fr)); |
| gap: 2px; |
| padding: 2px; |
| background: var(--g-sunken); |
| border: 1px solid var(--line-strong); |
| border-radius: var(--r-sm); |
| } |
| .mode-tab { |
| height: 36px; |
| background: transparent; |
| border: 0; |
| border-radius: 2px; |
| color: var(--muted); |
| padding: 0 10px; |
| font-family: var(--sans); |
| font-size: 12.5px; |
| font-weight: 600; |
| cursor: pointer; |
| display: flex; |
| align-items: center; |
| justify-content: center; |
| gap: 7px; |
| white-space: nowrap; |
| min-width: 0; |
| overflow: hidden; |
| box-shadow: inset 0 0 0 var(--amber); |
| transition: background-color var(--t) var(--ease-out), color var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out); |
| } |
| .mode-tab[data-icon]::before { width: 15px; height: 15px; transition: background-color var(--t) var(--ease-out); } |
| .mode-tab:hover:not(.active) { color: var(--text); background-color: var(--surface-2); } |
| .mode-tab.active { background-color: #323238; color: var(--paper); box-shadow: inset 0 -2px 0 var(--amber), var(--sheen); } |
| .mode-tab.active::before { background-color: var(--amber); } |
| .mode-tab:disabled { cursor: progress; } |
| |
| .mode-subpanel { margin-top: 12px; animation: fadeIn var(--t) var(--ease-out); } |
| @keyframes fadeIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } } |
| .subpanel-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } |
| .subpanel-row.spread { justify-content: space-between; } |
| .subpanel-info { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); flex: 1; min-width: 200px; } |
| .scope-label { font-size: 12.5px; display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; } |
| .scope-label strong { font-weight: 600; color: var(--paper); flex-shrink: 0; } |
| .scope-hint { color: var(--muted); } |
| .seg { display: flex; gap: 6px; flex-wrap: wrap; } |
| .rec { font-family: var(--display); font-size: 10px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ok-text); border: 1px solid var(--ok-line); padding: 1px 4px 0; border-radius: 2px; line-height: 13px; } |
| |
| .subpanel-dot { width: 8px; height: 8px; border-radius: 1px; background: var(--dim); flex-shrink: 0; } |
| .subpanel-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(63, 185, 122, 0.18); } |
| .subpanel-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(229, 83, 75, 0.16); } |
| |
| .panel-note { margin-top: 8px; font-size: 12px; color: var(--dim); } |
| .panel-note.warn { color: var(--warn-text); display: flex; gap: 7px; align-items: flex-start; } |
| .panel-note:empty { display: none; } |
| |
| select.edge-select, .input-sm, .select-sm { |
| height: 30px; |
| background: var(--g-sunken); |
| color: var(--text); |
| border: 1px solid var(--line-strong); |
| border-radius: var(--r-sm); |
| padding: 0 9px; |
| font-family: var(--mono); |
| font-size: 12px; |
| outline: none; |
| min-width: 0; |
| transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out); |
| } |
| select.edge-select { width: 100%; height: 26px; font-size: 11.5px; padding: 0 6px; } |
| select.edge-select:hover, .input-sm:hover, .select-sm:hover { border-color: var(--line-hard); } |
| select.edge-select:focus, .input-sm:focus, .select-sm:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 179, 24, 0.14); } |
| .input-sm { user-select: text; } |
| .input-sm::placeholder { color: var(--dim); } |
| select option { background: var(--surface-2); color: var(--text); } |
| |
| .ping-result { |
| margin-top: 10px; |
| font-family: var(--mono); |
| font-size: 11.5px; |
| line-height: 1.6; |
| color: var(--text); |
| max-height: 130px; |
| overflow-y: auto; |
| background: var(--g-sunken); |
| padding: 8px 10px; |
| border-radius: var(--r-sm); |
| border: 1px solid var(--line); |
| user-select: text; |
| white-space: pre-wrap; |
| } |
| |
| |
| .stats { |
| display: grid; |
| grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); |
| gap: 1px; |
| margin-top: 14px; |
| background: var(--line); |
| border: 1px solid var(--line); |
| border-radius: var(--r-sm); |
| overflow: hidden; |
| } |
| .stat { background: linear-gradient(180deg, #25272c 0%, #1e2024 100%); padding: 11px 13px 12px; min-width: 0; } |
| .stat.clickable { cursor: copy; } |
| .stat.clickable { transition: box-shadow var(--t-fast) var(--ease-out); } |
| .stat.clickable:hover { box-shadow: inset 0 0 0 99px rgba(255, 255, 255, 0.035); } |
| .stat.clickable:active { box-shadow: inset 0 0 0 99px rgba(0, 0, 0, 0.12); transition-duration: var(--t-press); } |
| .stat-label { |
| display: flex; |
| align-items: center; |
| justify-content: space-between; |
| gap: 6px; |
| min-height: 22px; |
| font-family: var(--display); |
| font-size: 11px; |
| font-weight: 600; |
| letter-spacing: 1px; |
| text-transform: uppercase; |
| color: var(--dim); |
| } |
| .stat-label > span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } |
| .stat-value { |
| margin-top: 5px; |
| font-family: var(--mono); |
| font-size: 13.5px; |
| color: var(--paper); |
| white-space: nowrap; |
| overflow: hidden; |
| text-overflow: ellipsis; |
| } |
| .stat-value.num { font-family: var(--display); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; } |
| .stat-sub { |
| margin-top: 5px; |
| font-size: 11.5px; |
| color: var(--dim); |
| display: flex; |
| align-items: center; |
| justify-content: space-between; |
| gap: 8px; |
| min-width: 0; |
| } |
| .stat-sub > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } |
| |
| |
| .tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; padding: 0; } |
| .tool-group { padding: 14px 16px 16px; min-width: 0; } |
| .tool-group + .tool-group { border-left: 1px solid var(--line); } |
| .tool-group .label { margin-bottom: 12px; } |
| .btn-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } |
| .appset .ctrl-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; } |
| .appset .ctrl-list > .ctrl-row:nth-child(2) { border-top-color: transparent; padding-top: 2px; } |
| .tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; } |
| |
| .simple-hint { |
| display: flex; |
| align-items: center; |
| justify-content: center; |
| gap: 8px; |
| padding: 4px 0 0; |
| font-size: 12.5px; |
| color: var(--dim); |
| } |
| |
| |
| .inspector { |
| flex-shrink: 0; |
| height: 34px; |
| border-top: 1px solid var(--line); |
| background: var(--g-bar); |
| padding: 0 16px 0 14px; |
| display: flex; |
| align-items: center; |
| justify-content: space-between; |
| gap: 16px; |
| } |
| .insp-left { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; font-size: 12px; } |
| .insp-left::before { |
| content: ""; |
| width: 14px; height: 14px; flex-shrink: 0; |
| background: var(--dim); |
| -webkit-mask: var(--i-info) center / contain no-repeat; mask: var(--i-info) center / contain no-repeat; |
| } |
| .insp-title { font-weight: 600; color: var(--text); flex-shrink: 0; max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } |
| .insp-body { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } |
| .insp-credit { font-size: 11.5px; color: var(--dim); flex-shrink: 0; white-space: nowrap; } |
| .credit-link { color: var(--muted); font-weight: 600; text-decoration: none; cursor: pointer; transition: color var(--t-fast) var(--ease-out); } |
| .credit-link:hover { color: var(--amber-text); text-decoration: underline; text-underline-offset: 3px; } |
| |
| |
| |
| |
| .float-tip { |
| --ax: 50%; |
| position: fixed; |
| left: 0; |
| top: 0; |
| z-index: 9999; |
| width: max-content; |
| max-width: 300px; |
| padding: 10px 13px 11px; |
| border-radius: var(--r-sm); |
| background: linear-gradient(180deg, #313339 0%, #27292e 100%); |
| border: 1px solid var(--line-hard); |
| box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05); |
| pointer-events: none; |
| opacity: 0; |
| transform: translate(var(--tx, 0px), var(--ty, 0px)) translateY(var(--rise, 6px)) scale(0.96); |
| transform-origin: var(--ax) var(--oy, 0%); |
| transition: opacity 120ms var(--ease-in), transform 140ms var(--ease-in); |
| } |
| .float-tip.below { --rise: 6px; --oy: 0%; } |
| .float-tip.above { --rise: -6px; --oy: 100%; } |
| .float-tip.show { |
| opacity: 1; |
| transform: translate(var(--tx, 0px), var(--ty, 0px)); |
| transition: opacity 180ms var(--ease-out), transform 260ms cubic-bezier(0.25, 0.8, 0.3, 1); |
| } |
| |
| .float-tip.show.glide { transition: opacity 180ms var(--ease-out), transform 220ms cubic-bezier(0.25, 0.8, 0.3, 1); } |
| .float-tip-arrow { |
| position: absolute; |
| left: var(--ax); |
| width: 10px; |
| height: 10px; |
| margin-left: -5px; |
| background: #313339; |
| border: 1px solid var(--line-hard); |
| transform: rotate(45deg); |
| transition: left 220ms cubic-bezier(0.25, 0.8, 0.3, 1); |
| } |
| .float-tip.below .float-tip-arrow { top: -6px; border-right: 0; border-bottom: 0; } |
| .float-tip.above .float-tip-arrow { bottom: -6px; border-left: 0; border-top: 0; background: #27292e; } |
| .float-tip-title { |
| display: flex; |
| align-items: center; |
| gap: 7px; |
| font-family: var(--display); |
| font-size: 13px; |
| font-weight: 600; |
| letter-spacing: 0.2px; |
| color: var(--paper); |
| margin-bottom: 4px; |
| } |
| .float-tip-title::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; background: var(--amber); } |
| .float-tip-body { font-size: 12px; line-height: 1.5; color: var(--text); } |
| .float-tip-tech { |
| display: none; |
| margin-top: 8px; |
| padding-top: 7px; |
| border-top: 1px solid var(--line); |
| font-family: var(--mono, "Cascadia Mono", Consolas, monospace); |
| font-size: 11px; |
| line-height: 1.45; |
| color: var(--dim); |
| overflow-wrap: anywhere; |
| } |
| .float-tip.has-tech .float-tip-tech { display: block; } |
| .float-tip-under { |
| display: block; |
| margin-bottom: 2px; |
| font-family: var(--display); |
| font-size: 10px; |
| font-weight: 600; |
| letter-spacing: 0.8px; |
| text-transform: uppercase; |
| color: var(--amber-text); |
| opacity: 0.8; |
| } |
| |
| .insp-left.swap .insp-title, .insp-left.swap .insp-body { animation: inspIn 260ms cubic-bezier(0.25, 0.8, 0.3, 1); } |
| @keyframes inspIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } } |
| |
| |
| .toast { |
| position: fixed; |
| right: 20px; |
| bottom: 48px; |
| z-index: 9998; |
| max-width: 440px; |
| display: flex; |
| gap: 10px; |
| align-items: flex-start; |
| padding: 11px 14px 11px 12px; |
| border-radius: var(--r-sm); |
| background: linear-gradient(180deg, #303238 0%, #26282d 100%); |
| border: 1px solid var(--line-hard); |
| border-left: 4px solid var(--amber); |
| font-size: 12.5px; |
| line-height: 1.45; |
| color: var(--paper); |
| box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5); |
| opacity: 0; |
| transform: translateY(8px); |
| pointer-events: none; |
| transition: opacity var(--t) var(--ease-in), transform var(--t) var(--ease-in); |
| } |
| .toast::before { |
| content: ""; |
| width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; |
| background: var(--amber); |
| -webkit-mask: var(--ticon, var(--i-info)) center / contain no-repeat; mask: var(--ticon, var(--i-info)) center / contain no-repeat; |
| } |
| .toast.show { opacity: 1; transform: translateY(0); transition: opacity 220ms var(--ease-out), transform var(--t-panel) var(--ease-out); } |
| .toast.error { border-left-color: var(--bad); background: linear-gradient(180deg, #382423 0%, #2a1c1c 100%); --ticon: var(--i-stop); } |
| .toast.error::before { background: var(--bad); } |
| .toast.success { border-left-color: var(--ok); --ticon: var(--i-check); } |
| .toast.success::before { background: var(--ok); } |
| |
| |
| .modal-backdrop { |
| position: fixed; |
| inset: 0; |
| z-index: 10000; |
| background: rgba(8, 8, 10, 0.72); |
| display: none; |
| place-items: center; |
| } |
| .modal-backdrop.show { display: grid; animation: backdropIn 200ms var(--ease-out); } |
| .modal-backdrop.show .modal { animation: modalIn var(--t-panel) var(--ease-out); } |
| .modal-backdrop.closing { animation: backdropOut 140ms var(--ease-in) forwards; } |
| .modal-backdrop.closing .modal { animation: modalOut 140ms var(--ease-in) forwards; } |
| @keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } } |
| @keyframes backdropOut { from { opacity: 1; } to { opacity: 0; } } |
| @keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } } |
| @keyframes modalOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(4px) scale(0.99); } } |
| |
| .layout.view-change { animation: viewIn var(--t-panel) var(--ease-out); } |
| @keyframes viewIn { from { opacity: 0.35; transform: translateY(4px); } to { opacity: 1; transform: none; } } |
| .modal { |
| width: 460px; |
| max-width: 92vw; |
| background: linear-gradient(180deg, #2c2e33 0%, #222428 100%); |
| border: 1px solid var(--line-hard); |
| border-top: 3px solid var(--amber); |
| border-radius: var(--r); |
| padding: 20px 22px 18px; |
| box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); |
| } |
| .modal.danger { border-top-color: var(--bad); } |
| .modal h3 { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--paper); margin-bottom: 8px; } |
| .modal p { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 20px; user-select: text; } |
| .modal-actions { display: flex; justify-content: flex-end; gap: 8px; } |
| |
| |
| |
| |
| :root { |
| --ease-land: cubic-bezier(0.25, 0.8, 0.3, 1); |
| --ease-firm: cubic-bezier(0.34, 1.45, 0.64, 1); |
| --t-enter: 620ms; |
| --t-glide: 380ms; |
| } |
| |
| |
| body.intro .topbar { animation: barIn 520ms var(--ease-land) both; } |
| body.intro .brand .logo { animation: logoStamp 760ms var(--ease-firm) 140ms both; } |
| body.intro .layout > :not(.actions):not(.duo), |
| body.intro .actions > .action, |
| body.intro .duo > .card, |
| body.intro .inspector { |
| animation: riseIn var(--t-enter) var(--ease-land) both; |
| animation-delay: calc(var(--i, 0) * 70ms + 120ms); |
| } |
| @keyframes barIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } } |
| @keyframes logoStamp { |
| 0% { opacity: 0; transform: scale(0.35) rotate(-24deg); } |
| 60% { opacity: 1; transform: scale(1.12) rotate(4deg); } |
| 100% { opacity: 1; transform: none; } |
| } |
| @keyframes riseIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } } |
| |
| |
| .layout.view-change { animation: none; } |
| .layout.view-change > :not(.actions):not(.duo), |
| .layout.view-change .actions > .action, |
| .layout.view-change .duo > .card { |
| animation: riseInSm 480ms var(--ease-land) both; |
| animation-delay: calc(var(--i, 0) * 45ms); |
| } |
| @keyframes riseInSm { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } } |
| |
| |
| .health::after { |
| content: ""; |
| position: absolute; |
| inset: 0; |
| background: var(--tone); |
| opacity: 0; |
| pointer-events: none; |
| } |
| .health.changed::after { animation: healthFlash 900ms var(--ease-out); } |
| .health.changed .stamp { animation: stampSlam 620ms var(--ease-out) both; } |
| .health.changed .health-text { animation: textSlide 560ms var(--ease-land) 90ms both; } |
| .health.changed .health-band { animation: bandGrow 520ms var(--ease-land) both; transform-origin: top; } |
| @keyframes healthFlash { 0% { opacity: 0.2; } 100% { opacity: 0; } } |
| @keyframes stampSlam { |
| 0% { opacity: 0; transform: scale(1.9) rotate(-16deg); } |
| 45% { opacity: 1; transform: scale(0.9) rotate(3deg); } |
| 70% { transform: scale(1.05) rotate(-1deg); } |
| 100% { opacity: 1; transform: none; } |
| } |
| @keyframes textSlide { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } } |
| @keyframes bandGrow { from { transform: scaleY(0); } to { transform: none; } } |
| |
| |
| .health-issues .issue { animation: dealIn 520ms var(--ease-land) both; } |
| .health-issues .issue:nth-child(2) { animation-delay: 80ms; } |
| .health-issues .issue:nth-child(3) { animation-delay: 160ms; } |
| .health-issues .issue:nth-child(n+4) { animation-delay: 240ms; } |
| @keyframes dealIn { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } } |
| |
| |
| .action { transition: box-shadow 200ms var(--ease-out), border-color 200ms var(--ease-out), |
| transform 260ms var(--ease-land), opacity var(--t) var(--ease-out); } |
| .action:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--sheen), inset 0 0 0 99px rgba(255, 255, 255, 0.04), 0 10px 22px rgba(0, 0, 0, 0.38); } |
| .action:active:not(:disabled) { transform: translateY(1px) scale(0.98); box-shadow: inset 0 0 0 99px rgba(0, 0, 0, 0.16); transition-duration: 90ms; } |
| .action[data-icon]::before { transition: transform 360ms var(--ease-firm); } |
| .action:hover:not(:disabled)[data-icon]::before { transform: scale(1.18); } |
| .action[data-icon="hop"]:hover:not(:disabled)::before { transform: rotate(-35deg) scale(1.15); } |
| .btn:active:not(:disabled) { transform: scale(0.95); transition-duration: 90ms; } |
| |
| |
| .slider::after { opacity: 1; clip-path: inset(0 100% 0 0); transition: clip-path 300ms var(--ease-land); } |
| .switch input:checked + .slider::after { clip-path: inset(0 0 0 0); } |
| .slider::before { transition: transform 340ms var(--ease-firm), width 160ms var(--ease-out), |
| background-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out); } |
| .switch input:active + .slider::before { width: 22px; } |
| .switch input:checked:active + .slider::before { transform: translateX(12px); } |
| |
| |
| .has-glider { position: relative; isolation: isolate; } |
| .has-glider > :not(.glider) { position: relative; z-index: 1; } |
| .has-glider > .active { background-color: transparent !important; box-shadow: none !important; } |
| .glider { |
| position: absolute; |
| left: 0; |
| top: 0; |
| z-index: 0; |
| border-radius: 2px; |
| pointer-events: none; |
| background-color: #33353b; |
| box-shadow: inset 0 -2px 0 var(--amber), var(--sheen); |
| transition: transform var(--t-glide) var(--ease-land), width var(--t-glide) var(--ease-land), |
| height var(--t-glide) var(--ease-land), opacity 200ms var(--ease-out); |
| } |
| .glider.instant { transition: none; } |
| .tabs > .glider { background-color: #2b2a27; border-radius: 2px 2px 0 0; box-shadow: inset 0 -2px 0 var(--amber); } |
| .mode-tabs > .glider { background-color: #323238; } |
| |
| |
| .log-box.swap { animation: swapIn 360ms var(--ease-land); } |
| .mode-subpanel { animation: swapIn 380ms var(--ease-land); } |
| @keyframes swapIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } } |
| |
| |
| .toast { transform: translateX(36px); transition: opacity 180ms var(--ease-in), transform 220ms var(--ease-in); } |
| .toast.show { transform: none; transition: opacity 240ms var(--ease-out), transform 520ms var(--ease-land); } |
| .modal-backdrop.show { animation: backdropIn 260ms var(--ease-out); } |
| .modal-backdrop.show .modal { animation: modalRise 460ms var(--ease-land); } |
| .modal-backdrop.closing { animation: backdropOut 180ms var(--ease-in) forwards; } |
| .modal-backdrop.closing .modal { animation: modalDrop 180ms var(--ease-in) forwards; } |
| @keyframes modalRise { from { opacity: 0; transform: translateY(28px) scale(0.94); } to { opacity: 1; transform: none; } } |
| @keyframes modalDrop { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(12px) scale(0.97); } } |
| |
| @media (prefers-reduced-motion: reduce) { |
| .glider { transition: none; } |
| *, *::before, *::after { |
| animation-duration: 1ms !important; |
| animation-iteration-count: 1 !important; |
| animation-delay: 0ms !important; |
| transition-duration: 1ms !important; |
| } |
| } |
| |
| |
| @media (max-width: 1120px) { |
| .action .lbl { font-size: 15px; } |
| .action { gap: 12px; padding: 12px 14px; } |
| .ver { display: none; } |
| } |
| @media (max-width: 1060px) { |
| .tools { grid-template-columns: minmax(0, 1fr); } |
| .tool-group + .tool-group { border-left: 0; border-top: 1px solid var(--line); } |
| .appset .ctrl-list { grid-template-columns: minmax(0, 1fr); } |
| .appset .ctrl-list > .ctrl-row:nth-child(2) { border-top-color: var(--line); padding-top: 12px; } |
| .insp-body { display: none; } |
| .insp-title { max-width: none; } |
| } |
| |
| @media (min-width: 1480px) { |
| body[data-view="advanced"] .layout { |
| max-width: 1840px; |
| grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); |
| grid-template-areas: "health side" "tokens side" "actions side" "conn side" "tools side" "app side"; |
| grid-template-rows: auto auto auto auto auto 1fr; |
| } |
| body[data-view="advanced"] #healthPanel { grid-area: health; } |
| body[data-view="advanced"] #tokenPanel { grid-area: tokens; } |
| body[data-view="advanced"] .actions { grid-area: actions; } |
| body[data-view="advanced"] .duo { grid-area: side; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; } |
| body[data-view="advanced"] .conn { grid-area: conn; } |
| body[data-view="advanced"] .tools { grid-area: tools; align-self: start; } |
| body[data-view="advanced"] .appset { grid-area: app; align-self: start; } |
| body[data-view="simple"] .layout { max-width: 1120px; } |
| } |
| |
| .updbar { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px; margin-bottom: 12px; |
| background: var(--g-surface); border-left: 3px solid var(--amber); } |
| .updbar[hidden] { display: none; } |
| .updbar [hidden] { display: none; } |
| .updbar-text { flex: 1; min-width: 0; } |
| .updbar-title { font-weight: 600; } |
| .updbar-sub { color: var(--muted, #9a9ca3); font-size: 12.5px; margin-top: 2px; } |
| |
| @keyframes updFlash { |
| 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 179, 24, 0); } |
| 50% { box-shadow: 0 0 0 3px rgba(242, 179, 24, 0.85); } |
| } |
| .updbar.flash { animation: updFlash 0.7s ease-in-out 3; } |
| .updbar.flash #btnApplyUpdate { animation: updFlash 0.7s ease-in-out 3; outline: none; } |
| @media (prefers-reduced-motion: reduce) { |
| .updbar.flash, .updbar.flash #btnApplyUpdate { animation: none; box-shadow: 0 0 0 3px rgba(242, 179, 24, 0.85); } |
| } |
| |
| |
| [data-icon="flag"] { --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 22V4'/><path d='M4 4h13l-2.5 4.5L17 13H4'/></svg>"); } |
| .report-btn { height: 28px; } |
| @media (max-width: 960px) { .report-btn .lbl { display: none; } .report-btn { width: 30px; padding: 0; } } |
| .modal.report-modal { width: 600px; max-height: 90vh; display: flex; flex-direction: column; padding-bottom: 16px; } |
| .report-body { overflow-y: auto; min-height: 0; padding-right: 4px; margin-right: -4px; } |
| .modal .report-intro { margin-bottom: 14px; } |
| .report-label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin: 0 0 5px; } |
| .report-field { margin-bottom: 12px; } |
| .report-field .input-sm { width: 100%; box-sizing: border-box; } |
| textarea.report-text { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; font-family: var(--sans); line-height: 1.45; } |
| .report-files { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } |
| .report-hint { font-size: 11.5px; color: var(--dim); } |
| .report-file-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; } |
| .report-file-list:empty { display: none; } |
| .report-file-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); |
| background: var(--g-sunken); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px 4px 3px 9px; } |
| .report-file-list .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| .report-file-list .fsize { color: var(--dim); font-family: var(--mono); font-size: 11px; } |
| .report-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; } |
| .report-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; } |
| .report-preview { margin-top: 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--g-sunken); } |
| .report-preview > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; |
| padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text); user-select: none; } |
| .report-preview > summary::-webkit-details-marker { display: none; } |
| .report-preview > summary::before { content: ""; width: 0; height: 0; border-left: 5px solid var(--amber); |
| border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform var(--t-fast) var(--ease-out); } |
| .report-preview[open] > summary::before { transform: rotate(90deg); } |
| .report-size { margin-left: auto; font-weight: 400; color: var(--dim); font-family: var(--mono); font-size: 11px; } |
| .report-pre { margin: 0; max-height: 220px; overflow: auto; padding: 8px 10px; border-top: 1px solid var(--line); |
| font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--muted); white-space: pre-wrap; word-break: break-word; user-select: text; } |
| .report-msg { margin-top: 12px; font-size: 12.5px; line-height: 1.5; padding: 8px 10px; border-radius: var(--r-sm); |
| border: 1px solid var(--bad-line); border-left-width: 3px; background: var(--bad-soft); color: var(--bad-text); } |
| .report-done { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0 16px; } |
| .report-done-icon { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; background: var(--ok); |
| -webkit-mask: var(--i-check) center / contain no-repeat; mask: var(--i-check) center / contain no-repeat; } |
| .report-done-title { font-size: 14px; font-weight: 600; color: var(--paper); margin-bottom: 4px; } |
| .report-done-sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; } |
| .report-modal .modal-actions { margin-top: 14px; } |
| .report-modal [hidden] { display: none !important; } |
| </style> |
| </head> |
| <body data-view="simple"> |
| |
| |
| <header class="topbar"> |
| <div class="brand" data-tip="brand"> |
| <svg class="logo" viewBox="0 0 100 100" aria-label="openhop"> |
| <path d="M8 1 L92 1 L99 8 L99 92 L92 99 L8 99 L1 92 L1 8 Z" fill="#f2b318"/> |
| <rect x="22" y="17" width="15" height="66" fill="#1f2125"/> |
| <path d="M41 41.5 H51 Q68.5 41.5 68.5 59 V83" fill="none" stroke="#1f2125" stroke-width="15"/> |
| </svg> |
| <div class="wordmark"><span>open</span><b>hop</b></div> |
| <span id="appVersion" class="ver">v3.1.1</span> |
| </div> |
| <div class="top-spacer"></div> |
| <div class="top-right"> |
| <div id="overallPill" class="status-pill" data-tip="pill"> |
| <span id="overallDot" class="dot"></span> |
| <span id="overallText" data-i18n="pill.checking">Checking…</span> |
| </div> |
| <button id="btnReport" class="btn btn-sm btn-primary report-btn" data-icon="flag" data-tip="report"><span class="lbl" data-i18n="report.btn">Report a problem</span></button> |
| <div class="view-switch" role="group" data-tip="view"> |
| <button id="viewSimple" data-set-view="simple" data-i18n="view.simple">Simple</button> |
| <button id="viewAdvanced" data-set-view="advanced" data-i18n="view.advanced">Advanced</button> |
| </div> |
| <button id="btnRefresh" class="btn btn-sm btn-ghost btn-icon" data-icon="rotate" data-tip="refresh" data-i18n-title="refresh"></button> |
| </div> |
| <div class="win-controls"> |
| <button id="winMin" class="win-btn" data-wicon="min" data-i18n-title="win.min"></button> |
| <button id="winMax" class="win-btn" data-wicon="max" data-i18n-title="win.max"></button> |
| <button id="winClose" class="win-btn close" data-wicon="close" data-i18n-title="win.close"></button> |
| </div> |
| </header> |
| |
| |
| <div class="rz" data-edge="n"></div><div class="rz" data-edge="s"></div> |
| <div class="rz" data-edge="e"></div><div class="rz" data-edge="w"></div> |
| <div class="rz" data-edge="ne"></div><div class="rz" data-edge="nw"></div> |
| <div class="rz" data-edge="se"></div><div class="rz" data-edge="sw"></div> |
| |
| <main class="main"> |
| <div class="layout"> |
| |
| <div id="updateBar" class="updbar" hidden data-tip="updateBar"> |
| <div class="updbar-text"> |
| <div id="updTitle" class="updbar-title"></div> |
| <div id="updSub" class="updbar-sub" data-i18n="upd.sub">It updates itself and restarts. It takes a few seconds; protection keeps running.</div> |
| </div> |
| <button id="btnUpdateChecks" class="btn btn-sm" data-icon="rotate" data-i18n="upd.runChecks" hidden>Run checks again</button> |
| <button id="btnDismissUpdate" class="btn btn-sm btn-ghost" data-i18n="upd.hide" hidden>Hide</button> |
| <button id="btnApplyUpdate" class="btn btn-solid" data-icon="arrow" data-i18n="upd.now">Update now</button> |
| </div> |
| |
| |
| <section id="healthPanel" class="health busy" data-tip="health"> |
| <div class="health-band"></div> |
| <div class="health-main"> |
| <div class="health-head"> |
| <div class="stamp"></div> |
| <div class="health-text"> |
| <div class="health-kicker" data-i18n="health.kicker">OpenCode status</div> |
| <div id="healthTitle" class="health-title" data-i18n="health.checking">Checking your setup…</div> |
| <div id="healthSub" class="health-sub" data-i18n="health.checkingSub">This takes a second.</div> |
| </div> |
| <button id="btnFixAll" class="btn btn-solid" data-icon="wrench" data-tip="fixAll" style="display:none"></button> |
| </div> |
| <div id="healthIssues" class="health-issues"></div> |
| <div id="healthLastErr" class="health-lasterr"></div> |
| <dl class="facts"> |
| <div class="fact" data-tip="factConn"><dt data-i18n="fact.conn">Connection</dt><dd id="factConn">—</dd></div> |
| <div class="fact" data-tip="factIp"><dt data-i18n="fact.ip">Your IP</dt><dd id="factIp" class="mono">—</dd></div> |
| <div class="fact" data-tip="factHops"><dt data-i18n="fact.hops">New IPs so far</dt><dd id="factHops">—</dd></div> |
| <div class="fact" data-tip="factWork"><dt data-i18n="fact.work">Your work</dt><dd id="factWork">—</dd></div> |
| </dl> |
| </div> |
| </section> |
| |
| |
| <section id="tokenPanel" class="tk" data-tip="tokens" hidden> |
| <div class="tk-band"></div> |
| <div class="tk-main"> |
| <div class="tk-head"> |
| <div class="tk-kicker" data-i18n="tk.kicker">Token usage</div> |
| <div class="tk-sub" data-i18n="tk.sub">All OpenCode chats on this PC, including the helper chats it runs on its own.</div> |
| <div class="tk-meta"> |
| <span id="tkReasoning"></span> |
| <span id="tkCost"></span> |
| </div> |
| </div> |
| <dl class="tk-facts"> |
| <div class="tk-fact total"><dt data-i18n="tk.total">Total tokens</dt><dd id="tkTotal">—</dd></div> |
| <div class="tk-fact"><dt data-i18n="tk.inOut">Input / output</dt><dd id="tkInOut">—</dd></div> |
| <div class="tk-fact"><dt data-i18n="tk.cache">Cache read / write</dt><dd id="tkCache">—</dd></div> |
| <div class="tk-fact"><dt data-i18n="tk.work">Chats / projects</dt><dd id="tkWork">—</dd></div> |
| </dl> |
| </div> |
| </section> |
| |
| |
| <section class="actions"> |
| <button id="btnLaunchDesktop" class="action primary" data-icon="monitor" data-tip="launchDesktop"> |
| <span class="action-text"><span class="lbl" data-i18n="act.desktop">Launch OpenCode Desktop</span><span class="action-sub" data-i18n="act.desktopSub">Opens the app, already protected</span></span> |
| </button> |
| <button id="btnLaunchCli" class="action" data-icon="terminal" data-tip="launchCli"> |
| <span class="action-text"><span class="lbl" data-i18n="act.cli">Launch OpenCode CLI</span><span class="action-sub" data-i18n="act.cliSub">Opens a terminal window</span></span> |
| </button> |
| <button id="btnHop" class="action" data-icon="hop" data-tip="hop"> |
| <span class="action-text"><span class="lbl" data-i18n="act.hop">Get a new IP</span><span class="action-sub" data-i18n="act.hopSub">About 12 s · your chats are kept</span></span> |
| </button> |
| </section> |
| |
| |
| <div class="duo"> |
| <section class="card protect"> |
| <div class="card-head"> |
| <h2 class="label" data-i18n="sec.protection">Protection</h2> |
| <span id="adminBadge" class="tag" data-view="advanced" data-tip="admin">…</span> |
| </div> |
| <div class="ctrl-list"> |
| <div class="ctrl-row" data-tip="keeper"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="ctl.keeper">Background protection</span> <span id="keeperTag" class="tag">…</span></div> |
| <div class="ctrl-desc" data-i18n="ctl.keeperDesc">Keeps OpenCode connected, even with this window closed.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkKeeper" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-tip="guard"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="ctl.guard">Auto-rotate on limit</span> <span id="guardTag" class="tag">…</span></div> |
| <div class="ctrl-desc" data-i18n="ctl.guardDesc">Gets a new IP by itself when you hit the free limit.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkGuard" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-view="advanced" data-tip="autoResume"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="ctl.resume">Auto-continue</span> <span id="autoResumeTag" class="tag ok">…</span></div> |
| <div class="ctrl-desc" data-i18n="ctl.resumeDesc">After a new IP, types 'continue' in your chat so it keeps going.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkAutoResume" checked /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-view="advanced" data-tip="svc"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="ctl.svc">Protect the Desktop app</span> <span id="svcTag" class="tag">…</span></div> |
| <div class="ctrl-desc" data-i18n="ctl.svcDesc">Makes OpenCode Desktop use the protected connection.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkServiceProxy" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-view="advanced" data-tip="autostart"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="ctl.autostart">Protect from sign-in</span> <span id="autoTag" class="tag">…</span></div> |
| <div class="ctrl-desc" data-i18n="ctl.autostartDesc">Turns protection on by itself when you sign in.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkAutostart" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-view="advanced" data-tip="firewall"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="ctl.fw">Leak blocker</span> <span id="fwTag" class="tag">…</span></div> |
| <div class="ctrl-desc" data-i18n="ctl.fwDesc">Firewall rule so the CLI can't skip the protection. Asks for admin.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkFirewall" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-view="advanced" data-tip="strict"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="ctl.strict">Strict mode</span> <span id="strictTag" class="tag">…</span></div> |
| <div class="ctrl-desc" data-i18n="ctl.strictDesc">Never fall back to your normal internet. Safer, but more errors.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkStrict" /><span class="slider"></span></label> |
| </div> |
| </div> |
| </section> |
| |
| <section id="activityCard" class="card logs-card" data-view="advanced"> |
| <div class="card-head"> |
| <div class="tabs"> |
| <button class="tab" data-tab="opencode" data-tip="tabErrors"><span data-i18n="tab.errors">Errors</span><span id="errCount" class="count"></span></button> |
| <button class="tab" data-tab="guard" data-tip="tabGuard" data-i18n="tab.guard">Auto-rotate</button> |
| <button class="tab" data-tab="keeper" data-tip="tabKeeper" data-i18n="tab.keeper">Protection</button> |
| <button class="tab" data-tab="blacklist" data-tip="tabBlacklist" data-i18n="tab.blacklist">Used IPs</button> |
| </div> |
| <div class="btn-group"> |
| <button id="btnClearBlacklist" class="btn btn-xs btn-danger" data-icon="trash" style="display:none" data-tip="clearBlacklist" data-i18n="btn.clearList">Clear list</button> |
| <button id="btnCopyLog" class="btn btn-xs btn-ghost" data-icon="copy" data-tip="copyLog" data-i18n="btn.copy">Copy</button> |
| </div> |
| </div> |
| <div id="logBox" class="log-box" data-i18n="log.loading">Loading…</div> |
| </section> |
| </div> |
| |
| |
| <section class="card conn" data-view="advanced"> |
| <div class="card-head"> |
| <div class="head-left"> |
| <h2 class="label" data-i18n="sec.conn">Connection type</h2> |
| <span id="modeActiveBadge" class="tag ok">WARP</span> |
| </div> |
| <div class="mode-desc" id="modeDesc"></div> |
| </div> |
| <div class="mode-tabs"> |
| <button class="mode-tab active" id="tabModeWarp" data-mode="warp" data-icon="zap" data-tip="modeWarp" data-i18n="mode.warp">Cloudflare WARP</button> |
| <button class="mode-tab" id="tabModeTor" data-mode="tor" data-icon="layers" data-tip="modeTor" data-i18n="mode.tor">Tor</button> |
| <button class="mode-tab" id="tabModeCustom" data-mode="custom" data-icon="globe" data-tip="modeCustom" data-i18n="mode.custom">My own proxy</button> |
| <button class="mode-tab" id="tabModeClean" data-mode="clean" data-icon="shield" data-tip="modeClean" data-i18n="mode.clean">Unblock WARP</button> |
| </div> |
| |
| <div id="panelWarp" class="mode-subpanel" style="display:block;"> |
| <div class="subpanel-row spread"> |
| <div class="scope-label"> |
| <strong data-i18n="scope.label">Applies to</strong> |
| <span class="scope-hint" id="warpScopeHint"></span> |
| </div> |
| <div class="seg"> |
| <button id="btnScopeIsolated" class="btn btn-sm" data-icon="target" data-tip="scopeIso"><span class="lbl" data-i18n="scope.iso">Only OpenCode</span> <span class="rec" data-i18n="scope.rec">Recommended</span></button> |
| <button id="btnScopeTun" class="btn btn-sm" data-icon="monitor" data-tip="scopeTun" data-i18n="scope.tun">Whole PC</button> |
| </div> |
| </div> |
| <div id="scopeWarn" class="panel-note warn"></div> |
| </div> |
| |
| <div id="panelTor" class="mode-subpanel" style="display:none;"> |
| <div class="subpanel-row"> |
| <div class="subpanel-info"> |
| <span class="subpanel-dot" id="torStatusDot"></span> |
| <span id="torStatusText" data-i18n="tor.detecting">Looking for Tor…</span> |
| </div> |
| <div class="seg"> |
| <button id="btnTorRotate" class="btn btn-sm" data-icon="shuffle" data-tip="torRotate" data-i18n="tor.newIp">New Tor IP</button> |
| <button id="btnTorToggleService" class="btn btn-sm" data-icon="power" data-tip="torToggle" data-i18n="tor.start">Start Tor</button> |
| </div> |
| </div> |
| </div> |
| |
| <div id="panelCustom" class="mode-subpanel" style="display:none;"> |
| <div class="subpanel-row"> |
| <select id="selProxyType" class="select-sm" style="width:96px;" data-tip="proxyType"> |
| <option value="socks5">SOCKS5</option> |
| <option value="http">HTTP</option> |
| </select> |
| <input type="text" id="txtProxyAddr" class="input-sm" data-i18n-ph="custom.ph" style="flex:1;min-width:220px;" /> |
| <button id="btnSaveCustomProxy" class="btn btn-sm btn-primary" data-icon="check" data-tip="customSave" data-i18n="custom.save">Use this proxy</button> |
| <button id="btnRotateCustomProxy" class="btn btn-sm" data-icon="shuffle" data-tip="customNext" data-i18n="custom.next">Next proxy</button> |
| </div> |
| <div id="customPoolStatus" class="panel-note"></div> |
| </div> |
| |
| <div id="panelClean" class="mode-subpanel" style="display:none;"> |
| <div class="subpanel-row"> |
| <select id="selCleanEndpoint" class="select-sm" style="flex:1;min-width:170px;" data-tip="cleanSelect"> |
| <option value="" data-i18n="clean.loading">Loading…</option> |
| </select> |
| <button id="btnTestCleanPing" class="btn btn-sm" data-icon="activity" data-tip="cleanPing" data-i18n="clean.test">Test speed</button> |
| <button id="btnApplyCleanEndpoint" class="btn btn-sm btn-primary" data-icon="check" data-tip="cleanApply" data-i18n="clean.apply">Use selected</button> |
| <button id="btnAutoHealEndpoint" class="btn btn-sm" data-icon="sparkle" data-tip="cleanHeal" data-i18n="clean.heal">Pick fastest</button> |
| <button id="btnResetCleanEndpoint" class="btn btn-sm btn-ghost" data-icon="undo" data-tip="cleanReset" data-i18n="clean.reset">Back to default</button> |
| </div> |
| <div id="cleanPingResult" class="ping-result" style="display:none;"></div> |
| </div> |
| |
| <div class="stats"> |
| <div class="stat clickable" id="cardEgress" data-tip="cardEgress"> |
| <div class="stat-label"><span id="cardEgressLabel">…</span><span id="egressTag" class="tag">…</span></div> |
| <div id="egressPrefix" class="stat-value">…</div> |
| <div class="stat-sub"><span id="egressFull"></span></div> |
| </div> |
| <div class="stat clickable" id="cardAdapter" data-tip="cardAdapter"> |
| <div class="stat-label"><span id="cardAdapterLabel">…</span><span id="warpModeTag" class="tag">…</span></div> |
| <div id="adapterV6" class="stat-value">—</div> |
| <div class="stat-sub"><span id="adapterSub"></span></div> |
| </div> |
| <div class="stat" data-tip="cardEdge"> |
| <div class="stat-label"> |
| <span data-i18n="card.edge">OpenCode server</span> |
| <button id="btnRerollEdge" class="btn btn-xs" data-icon="dice" data-tip="reroll" data-i18n="btn.reroll">Re-roll</button> |
| </div> |
| <div id="pinnedEdge" class="stat-value">—</div> |
| <div class="stat-sub"> |
| <select id="edgeSelect" class="edge-select" data-tip="edgeSelect"><option value="auto" data-i18n="edge.auto">Automatic (random)</option></select> |
| </div> |
| </div> |
| <div class="stat" data-tip="cardStats"> |
| <div class="stat-label"><span data-i18n="card.stats">New IPs & saved work</span><span id="hopsTag" class="tag ok">0</span></div> |
| <div id="dbSummary" class="stat-value num">—</div> |
| <div class="stat-sub"><span id="blacklistSummary"></span><span id="lastHopText"></span></div> |
| </div> |
| </div> |
| </section> |
| |
| |
| <section class="card tools" data-view="advanced"> |
| <div class="tool-group"> |
| <h2 class="label" data-i18n="sec.troubleshoot">Troubleshoot</h2> |
| <div class="btn-group"> |
| <button id="btnWarpToggle" class="btn btn-sm" data-icon="power" data-tip="warpToggle" data-i18n="btn.warpConnect">Connect WARP</button> |
| <button id="btnRepairWarp" class="btn btn-sm" data-icon="wrench" data-tip="repairWarp" data-i18n="btn.repairWarp">Repair WARP</button> |
| <button id="btnFixService" class="btn btn-sm" data-icon="plug" data-tip="fixService" data-i18n="btn.fixPort">Fix port conflict</button> |
| <button id="btnDeepReset" class="btn btn-sm btn-danger" data-icon="zap" data-tip="deepReset" data-i18n="btn.deepReset">Deep reset</button> |
| </div> |
| </div> |
| <div class="tool-group"> |
| <h2 class="label" data-i18n="sec.setup">Setup</h2> |
| <div class="btn-group"> |
| <button id="btnInstallRepair" class="btn btn-sm btn-primary" data-icon="download" data-tip="install" data-i18n="btn.install">Install / Repair</button> |
| <button id="btnOpenFolder" class="btn btn-sm" data-icon="folder" data-tip="openFolder" data-i18n="btn.folder">Open data folder</button> |
| <button id="btnCopyDiag" class="btn btn-sm" data-icon="clipboard" data-tip="copyDiag" data-i18n="btn.diag">Copy diagnostics</button> |
| </div> |
| <div class="tool-foot"> |
| <span id="pathBadge" class="tag" data-tip="path">…</span> |
| <button id="btnUninstall" class="btn btn-xs btn-ghost" data-icon="trash" data-tip="uninstall" data-i18n="btn.uninstall">Uninstall</button> |
| </div> |
| </div> |
| </section> |
| |
| |
| <section class="card appset" data-view="advanced"> |
| <div class="card-head"> |
| <div class="head-left"> |
| <h2 class="label" data-i18n="sec.app">openhop app</h2> |
| <span id="trayTag" class="tag" data-tip="trayTag">…</span> |
| </div> |
| <div class="btn-group"> |
| <button id="btnCheckUpdate" class="btn btn-xs" data-icon="arrow" data-tip="checkUpdate" data-i18n="btn.checkUpdate">Check for updates</button> |
| <button id="btnTestNotify" class="btn btn-xs" data-icon="sparkle" data-tip="testNotify" data-i18n="btn.testNotify">Test notification</button> |
| <button id="btnQuitApp" class="btn btn-xs btn-ghost" data-icon="power" data-tip="quitApp" data-i18n="btn.quitApp">Quit openhop</button> |
| </div> |
| </div> |
| <div class="ctrl-list"> |
| <div class="ctrl-row" data-tip="appStartup"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="app.startup">Open with Windows</span></div> |
| <div class="ctrl-desc" data-i18n="app.startupDesc">Starts openhop quietly in the tray when you sign in.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkAppStartup" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-tip="closeToTray"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="app.closeTray">Close to the tray</span></div> |
| <div class="ctrl-desc" data-i18n="app.closeTrayDesc">The X button hides the window instead of quitting.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkCloseToTray" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-tip="notifyProblems"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="app.nProblems">Warn me about problems</span></div> |
| <div class="ctrl-desc" data-i18n="app.nProblemsDesc">A small popup when OpenCode stops working.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkNotifyProblems" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-tip="notifyHops"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="app.nHops">Tell me when the IP changes</span></div> |
| <div class="ctrl-desc" data-i18n="app.nHopsDesc">A popup each time you hit the limit and get a new IP.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkNotifyHops" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-tip="notifyUpdates"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="app.nUpdates">Tell me about updates</span></div> |
| <div class="ctrl-desc" data-i18n="app.nUpdatesDesc">A popup when a new version of openhop is out.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkNotifyUpdates" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-tip="desktopBrand"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="app.brand">Show openhop.cfd in OpenCode</span></div> |
| <div class="ctrl-desc" data-i18n="app.brandDesc">The big faint word on OpenCode Desktop's start screen says openhop.cfd.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkDesktopBrand" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-tip="hideBanner"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="app.banner">Keep the chat box when the limit hits</span></div> |
| <div class="ctrl-desc" data-i18n="app.bannerDesc">Hides OpenCode Desktop's "Free limit reached" card. openhop already got you a new IP.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkHideBanner" /><span class="slider"></span></label> |
| </div> |
| <div class="ctrl-row" data-tip="autoUpdate"> |
| <div class="ctrl-info"> |
| <div class="ctrl-title"><span data-i18n="app.autoUpdate">Update openhop automatically</span></div> |
| <div class="ctrl-desc" data-i18n="app.autoUpdateDesc">Downloads new versions from openhop.cfd and installs them when openhop restarts.</div> |
| </div> |
| <label class="switch"><input type="checkbox" id="chkAutoUpdate" /><span class="slider"></span></label> |
| </div> |
| </div> |
| </section> |
| |
| <div class="simple-hint" data-view="simple"> |
| <span data-i18n="simple.hint">These are the essentials.</span> |
| <button id="btnShowAdvanced" class="link-btn" data-icon="arrow" data-i18n="simple.more">Show connection type, logs and repair tools</button> |
| </div> |
| |
| </div> |
| </main> |
| |
| |
| <footer class="inspector"> |
| <div class="insp-left"> |
| <span id="inspTitle" class="insp-title" data-i18n="insp.title">Hover anything to see what it does</span> |
| <span id="inspBody" class="insp-body"></span> |
| </div> |
| <div class="insp-credit"><a href="#" class="credit-link" data-url="https://openhop.cfd" data-i18n-title="credit.byTitle">openhop.cfd</a> <span data-i18n="credit.based">· based on the original by</span> <a href="#" class="credit-link" data-url="https://github.com/ShadowySphinX/Opencode-Unlimited-Limit-Bypass-" data-i18n-title="credit.basedTitle">Avatar (ShadowySphinX)</a></div> |
| </footer> |
| |
| <div id="floatTip" class="float-tip" role="tooltip"> |
| <span class="float-tip-arrow"></span> |
| <div id="floatTipTitle" class="float-tip-title"></div> |
| <div id="floatTipBody" class="float-tip-body"></div> |
| <div id="floatTipTech" class="float-tip-tech"><span class="float-tip-under" data-i18n="tip.under">Under the hood</span><span id="floatTipTechText"></span></div> |
| </div> |
| |
| <div id="toast" class="toast"><span id="toastText"></span></div> |
| |
| <div id="modalBg" class="modal-backdrop"> |
| <div class="modal" id="modalBox" role="dialog" aria-modal="true"> |
| <h3 id="modalTitle"></h3> |
| <p id="modalBody"></p> |
| <div class="modal-actions"> |
| <button id="modalCancel" class="btn btn-sm btn-ghost" data-i18n="modal.cancel">Cancel</button> |
| <button id="modalConfirm" class="btn btn-sm btn-danger filled" data-i18n="modal.confirm">Confirm</button> |
| </div> |
| </div> |
| </div> |
| |
| |
| <div id="reportBg" class="modal-backdrop"> |
| <div class="modal report-modal" id="reportBox" role="dialog" aria-modal="true" aria-labelledby="reportTitle"> |
| <h3 id="reportTitle" data-i18n="report.title">Report a problem</h3> |
| <div class="report-body"> |
| <div id="reportForm"> |
| <p class="report-intro" data-i18n="report.intro"></p> |
| <div class="report-field"> |
| <label class="report-label" for="reportDesc" data-i18n="report.descLabel">What happened? (optional)</label> |
| <textarea id="reportDesc" class="input-sm report-text" rows="3" maxlength="2000" data-i18n-ph="report.descPh"></textarea> |
| </div> |
| <div class="report-field"> |
| <label class="report-label" for="reportContact" data-i18n="report.contactLabel">Contact (optional)</label> |
| <input id="reportContact" type="text" class="input-sm" maxlength="200" autocomplete="off" data-i18n-ph="report.contactPh" /> |
| </div> |
| <div class="report-files"> |
| <button id="reportAttach" class="btn btn-sm" data-icon="folder"><span class="lbl" data-i18n="report.attach">Attach screenshots or extra log files</span></button> |
| <span class="report-hint" data-i18n="report.attachHint"></span> |
| </div> |
| <ul id="reportFileList" class="report-file-list"></ul> |
| <div id="reportFileNote" class="report-note" hidden></div> |
| <div class="report-hp" aria-hidden="true"><label>Website <input id="reportWebsite" type="text" tabindex="-1" autocomplete="off" /></label></div> |
| <details id="reportPreview" class="report-preview"> |
| <summary><span data-i18n="report.previewToggle">See exactly what will be sent</span><span id="reportSize" class="report-size"></span></summary> |
| <pre id="reportPreviewText" class="report-pre"></pre> |
| </details> |
| <div id="reportError" class="report-msg" role="alert" hidden></div> |
| </div> |
| <div id="reportDone" class="report-done" hidden> |
| <div class="report-done-icon"></div> |
| <div> |
| <div class="report-done-title" data-i18n="report.sentTitle">Thanks — sent. We'll look at it.</div> |
| <div id="reportDoneSub" class="report-done-sub" data-i18n="report.sentSub"></div> |
| </div> |
| </div> |
| </div> |
| <div class="modal-actions"> |
| <button id="reportCancel" class="btn btn-sm btn-ghost" data-i18n="report.cancel">Cancel</button> |
| <button id="reportSend" class="btn btn-sm btn-solid" data-icon="arrow"><span class="lbl" data-i18n="report.send">Send report</span></button> |
| </div> |
| </div> |
| </div> |
| |
| <script> |
| |
| |
| |
| |
| const STRINGS = { |
| en: { |
| "app.version": "v3.1.1", |
| "view.simple": "Simple", |
| "view.advanced": "Advanced", |
| "refresh": "Refresh now", |
| "win.min": "Minimize", "win.max": "Maximize", "win.restore": "Restore", "win.close": "Close", |
| |
| "pill.checking": "Checking…", |
| "pill.rotating": "Getting a new IP…", |
| "pill.warp": "Protected · WARP", |
| "pill.warpIso": "Protected · WARP (OpenCode only)", |
| "pill.tor": "Protected · Tor", |
| "pill.custom": "Protected · Proxy ({type})", |
| "pill.verifying": "WARP on · checking IP", |
| "pill.offline": "Not connected", |
| "pill.action": "Needs attention", |
| |
| "health.kicker": "OpenCode status", |
| "health.checking": "Checking your setup…", |
| "health.checkingSub": "This takes a second.", |
| "health.ok": "Everything is working", |
| "health.warn": "Working, with warnings", |
| "health.bad": "OpenCode needs attention", |
| "health.busy": "Working…", |
| "sev.bad": "Problem", |
| "sev.warn": "Warning", |
| "fix.default": "Fix it", |
| "fix.busy": "Fixing…", |
| "fixAll": "Fix everything ({n})", |
| "fixAll.progress": "Fixing {i} of {n}…", |
| "fixAll.done": "Done: {ok} of {n} fixes worked.", |
| "lastErr.label": "Last OpenCode error:", |
| "lastErr.details": "See details", |
| |
| "tk.kicker": "Token usage", |
| "tk.sub": "All OpenCode chats on this PC, including the helper chats it runs on its own.", |
| "tk.total": "Total tokens", |
| "tk.inOut": "Input / output", |
| "tk.cache": "Cache read / write", |
| "tk.work": "Chats / projects", |
| "tk.reasoning": "Reasoning {n}", |
| "tk.cost": "Est. cost {n}", |
| |
| "fact.conn": "Connection", |
| "fact.ip": "Your IP", |
| "fact.hops": "New IPs so far", |
| "fact.work": "Your work", |
| "fact.last": "last {time}", |
| "fact.work.value": "{p} projects · {s} chats", |
| "fact.checking": "Checking…", |
| "fact.unknownIp": "Couldn't check", |
| "fact.offline": "Offline", |
| "fact.viaTor": "Through Tor", |
| "fact.viaProxy": "Through your proxy", |
| "conn.warp": "Cloudflare WARP", |
| "conn.warpTun": "WARP · whole PC", |
| "conn.warpIso": "WARP · OpenCode only", |
| "conn.tor": "Tor network", |
| "conn.custom": "Your proxy ({type})", |
| "conn.clean": "WARP · unblocked", |
| |
| "act.desktop": "Launch OpenCode Desktop", |
| "act.desktopSub": "Opens the app, already protected", |
| "act.desktopBusy": "Launching…", |
| "act.cli": "Launch OpenCode CLI", |
| "act.cliSub": "Opens a terminal window", |
| "act.cliBusy": "Opening…", |
| "act.hop": "Get a new IP", |
| "act.hopSub": "About 12 s · your chats are kept", |
| "act.hopBusy": "Getting a new IP…", |
| |
| "sec.protection": "Protection", |
| "sec.conn": "Connection type", |
| "sec.troubleshoot": "Troubleshoot", |
| "sec.setup": "Setup", |
| |
| "ctl.keeper": "Background protection", |
| "ctl.keeperDesc": "Keeps OpenCode connected, even with this window closed.", |
| "ctl.guard": "Auto-rotate on limit", |
| "ctl.guardDesc": "Gets a new IP by itself when you hit the free limit.", |
| "ctl.resume": "Auto-continue", |
| "ctl.resumeDesc": "After a new IP, types 'continue' in your chat so it keeps going.", |
| "ctl.svc": "Protect the Desktop app", |
| "ctl.svcDesc": "Makes OpenCode Desktop use the protected connection.", |
| "ctl.autostart": "Protect from sign-in", |
| "ctl.autostartDesc": "Turns protection on by itself when you sign in.", |
| |
| "sec.app": "openhop app", |
| "app.startup": "Open with Windows", |
| "app.startupDesc": "Starts openhop quietly in the tray when you sign in.", |
| "app.closeTray": "Close to the tray", |
| "app.closeTrayDesc": "The X button hides the window instead of quitting.", |
| "app.nProblems": "Warn me about problems", |
| "app.nProblemsDesc": "A small popup when OpenCode stops working.", |
| "app.nHops": "Tell me when the IP changes", |
| "app.nHopsDesc": "A popup each time you hit the limit and get a new IP.", |
| "app.nUpdates": "Tell me about updates", |
| "app.nUpdatesDesc": "A popup when a new version is out, and when openhop has just updated and checked itself.", |
| "app.brand": "Show openhop.cfd in OpenCode", |
| "app.brandDesc": "The big faint word on OpenCode Desktop's start screen says openhop.cfd.", |
| "app.trayOn": "In the tray", |
| "app.trayOff": "No tray icon", |
| "app.trayOffMsg": "The tray icon isn't running, so tray and popup settings can't be used right now.", |
| "btn.testNotify": "Test notification", |
| "btn.checkUpdate": "Check for updates", |
| "upd.title": "openhop {v} is ready", |
| "upd.sub": "It updates itself and restarts. It takes a few seconds; protection keeps running.", |
| "upd.now": "Update now", |
| "upd.restarting": "Updating. openhop will reopen by itself.", |
| "upd.toast": "openhop {v} is ready. Press Update now.", |
| "upd.done": "Updated to openhop {v}", |
| "upd.allOk": "All {n} checks passed. Everything is working.", |
| "upd.some": "{n} of {total} checks passed. The status panel shows what needs a look.", |
| "upd.runChecks": "Run checks again", |
| "upd.hide": "Hide", |
| "app.banner": "Keep the chat box when the limit hits", |
| "app.bannerDesc": "Hides OpenCode Desktop's \"Free limit reached\" card. openhop already got you a new IP.", |
| "app.autoUpdate": "Update openhop automatically", |
| "app.autoUpdateDesc": "Downloads new versions from openhop.cfd in the background and offers an Update now button. It also finishes them when openhop restarts.", |
| "btn.quitApp": "Quit openhop", |
| "confirm.quit.title": "Quit openhop?", |
| "confirm.quit.body": "The window and the tray icon close. Background protection keeps running, so OpenCode stays protected.", |
| "confirm.quit.ok": "Quit", |
| "ctl.fw": "Leak blocker", |
| "ctl.fwDesc": "Firewall rule so the CLI can't skip the protection. Asks for admin.", |
| "ctl.strict": "Strict mode", |
| "ctl.strictDesc": "Never fall back to your normal internet. Safer, but more errors.", |
| |
| "tag.running": "On", "tag.stopped": "Off", |
| "tag.enabled": "On", "tag.off": "Off", "tag.disabled": "Off", |
| "tag.wired": "Protected", "tag.proxyDown": "Proxy down", "tag.direct": "Not protected", |
| "tag.strict": "Strict", "tag.standard": "Standard", |
| "tag.admin": "Administrator", "tag.user": "Standard user", |
| "tag.pathOk": "'opencode' command: ready", "tag.pathNo": "'opencode' command: not first in PATH", |
| |
| "tab.errors": "Errors", |
| "tab.guard": "Auto-rotate", |
| "tab.keeper": "Protection", |
| "tab.blacklist": "Used IPs", |
| "btn.clearList": "Clear list", |
| "btn.copy": "Copy", |
| "log.loading": "Loading…", |
| "log.empty.guard": "Nothing logged yet. Entries appear here when auto-rotate starts or gets a new IP.", |
| "log.empty.keeper": "Nothing logged yet. Entries appear here when background protection starts.", |
| "log.noErrors": "No recent OpenCode errors. All quiet.", |
| "log.blacklistNote": "IPs (/64 blocks) that hit the free limit. They're skipped when getting a new IP.", |
| "log.blacklistEmpty": "No used IPs yet.", |
| "err.latest": "Latest", |
| "err.fix": "Fix", |
| |
| "mode.warp": "Cloudflare WARP", |
| "mode.tor": "Tor", |
| "mode.custom": "My own proxy", |
| "mode.clean": "Unblock WARP", |
| "mode.switching": "Switching…", |
| "badge.warp": "WARP", |
| "badge.tor": "Tor", |
| "badge.custom": "Custom proxy", |
| "badge.clean": "WARP · clean endpoint", |
| "desc.warp": "Free Cloudflare network. Gets a new IP automatically at the limit.", |
| "desc.torOn": "Going through Tor ({target}).", |
| "desc.torOff": "Tor is offline. Press Start Tor.", |
| "desc.custom": "Going through {type} → {addr}", |
| "desc.clean": "WARP with an unblocked entry point, for networks that block Cloudflare.", |
| "scope.label": "Applies to", |
| "scope.tun": "Whole PC", |
| "scope.iso": "Only OpenCode", |
| "scope.rec": "Recommended", |
| "scope.hintTun": "All apps on this PC go through WARP, not just OpenCode.", |
| "scope.hintIso": "Only OpenCode uses WARP. Games, Discord and browsers stay on your normal internet.", |
| "scope.reverted": "WARP isn't in 'Only OpenCode' mode right now (it switched back to whole-PC). Press Only OpenCode again, or use Repair WARP.", |
| "scope.busyIso": "Applying…", |
| "scope.busyTun": "Applying…", |
| "tor.detecting": "Looking for Tor…", |
| "tor.active": "Tor is running at {target}", |
| "tor.inactive": "Tor isn't running (ports 9050 / 9150 closed)", |
| "tor.newIp": "New Tor IP", |
| "tor.start": "Start Tor", |
| "tor.stop": "Stop Tor", |
| "tor.busyRotate": "Switching…", |
| "tor.busyStart": "Starting…", |
| "tor.busyStop": "Stopping…", |
| "custom.ph": "127.0.0.1:10808 (several: 1.1.1.1:1080, 2.2.2.2:1080)", |
| "custom.save": "Use this proxy", |
| "custom.next": "Next proxy", |
| "custom.busySave": "Saving…", |
| "custom.busyNext": "Switching…", |
| "custom.pool": "{n} proxies in the list · using {node}", |
| "custom.single": "One proxy. Paste several (comma-separated) to switch between them automatically.", |
| "clean.loading": "Loading…", |
| "clean.test": "Test speed", |
| "clean.apply": "Use selected", |
| "clean.heal": "Pick fastest", |
| "clean.reset": "Back to default", |
| "clean.testing": "Testing all entry points…", |
| "clean.timeout": "no answer / blocked", |
| "clean.done": "Test finished.", |
| "clean.busyApply": "Applying…", |
| "clean.busyHeal": "Testing…", |
| "clean.busyReset": "Resetting…", |
| |
| "card.ip": "Your public IP", |
| "card.ipTor": "Tor exit", |
| "card.ipCustom": "Proxy exit", |
| "card.adapter": "WARP adapter", |
| "card.adapterTor": "Tor service", |
| "card.adapterCustom": "Proxy list", |
| "card.edge": "OpenCode server", |
| "card.stats": "New IPs & saved work", |
| "edge.auto": "Automatic (random)", |
| "edge.autoNext": "Auto (next request)", |
| "btn.reroll": "Re-roll", |
| "eg.cf": "Cloudflare", |
| "eg.notCf": "Not WARP!", |
| "eg.checkingTag": "Checking", |
| "eg.pending": "Waiting", |
| "eg.closed": "Blocked", |
| "eg.proxyOn": "Active", |
| "eg.torOn": "Active", |
| "eg.checking": "Checking…", |
| "eg.checkingSub": "Asking Cloudflare which IP OpenCode uses…", |
| "eg.unknown": "Couldn't check", |
| "eg.unknownSub": "The IP check didn't answer. OpenCode can still work; it checks again in a moment.", |
| "eg.noV6": "No IPv6 answer yet", |
| "eg.offline": "Offline", |
| "eg.reprobe": "Press refresh to check again", |
| "eg.failClosed": "Blocked on purpose so your real IP doesn't leak", |
| "eg.exit": "Exit IP: {ip}", |
| "eg.poolRoute": "Through your proxy list", |
| "eg.torRoute": "Through a 3-hop Tor circuit", |
| "eg.clickCopy": "Click to copy", |
| "ad.proxyPort": "Proxy (port 40000)", |
| "ad.notActive": "Not active", |
| "ad.bound": "Traffic is pinned to this adapter", |
| "ad.iso": "OpenCode-only mode, no adapter needed", |
| "ad.waiting": "Waiting for the WARP adapter", |
| "ad.pool": "{n} proxies · switches automatically at the limit", |
| "ad.tor": "Control port 9051 · new IP at the limit", |
| "st.hops": "{n} new IPs", |
| "st.hop1": "1 new IP", |
| "st.db": "{p} projects · {s} chats", |
| "st.blacklist": "{n} used IPs", |
| "st.lastHop": "Last: {time}", |
| "never": "never", |
| |
| "btn.warpConnect": "Connect WARP", |
| "btn.warpDisconnect": "Disconnect WARP", |
| "btn.warpBusyOn": "Connecting…", |
| "btn.warpBusyOff": "Disconnecting…", |
| "btn.repairWarp": "Repair WARP", |
| "btn.repairBusy": "Repairing…", |
| "btn.fixPort": "Fix port conflict", |
| "btn.fixPortBusy": "Fixing…", |
| "btn.deepReset": "Deep reset", |
| "btn.deepBusy": "Resetting…", |
| "btn.install": "Install / Repair", |
| "btn.installBusy": "Repairing…", |
| "btn.folder": "Open data folder", |
| "btn.diag": "Copy diagnostics", |
| "btn.uninstall": "Uninstall", |
| "btn.uninstallBusy": "Removing…", |
| "diag.copied": "Copied the full diagnostic report.", |
| "refreshed": "Status refreshed.", |
| |
| "simple.hint": "These are the essentials.", |
| "simple.more": "Show connection type, logs and repair tools", |
| |
| "modal.cancel": "Cancel", |
| "modal.confirm": "Confirm", |
| "report.btn": "Report a problem", |
| "report.title": "Report a problem", |
| "report.intro": "This sends a diagnostic report to the openhop developer, so they can see why it isn't working for you. It has openhop's settings and recent logs, your Windows and WARP versions, and a quick check of which connection OpenCode really uses. Your user name, folders, passwords and full IP address are removed on this PC before anything is sent. What you wrote in your chats is not included.", |
| "report.descLabel": "What happened? (optional)", |
| "report.descPh": "For example: the chat keeps stopping with \"Free usage limit reached\", even after a new IP.", |
| "report.contactLabel": "Your Discord name or email, if you'd like an answer (optional)", |
| "report.contactPh": "Discord name or you@example.com", |
| "report.attach": "Attach screenshots or extra log files", |
| "report.attachHint": "Pictures or .log / .txt files · up to 5 files, 7 MB in total", |
| "report.imagesNote": "Pictures are sent exactly as they are, so check they don't show anything private. Log files get the same clean-up as the report.", |
| "report.remove": "Remove", |
| "report.skipped.count": "Only 5 files can be attached.", |
| "report.skipped.size": "Some files were left out: all files together can be 7 MB at most.", |
| "report.skipped.type": "Only pictures (PNG, JPG, GIF, WebP) and .log or .txt files can be attached.", |
| "report.previewToggle": "See exactly what will be sent", |
| "report.collecting": "Putting the report together… this takes a few seconds.", |
| "report.collectFail": "Couldn't put the report together for the preview. Sending will try again.", |
| "report.send": "Send report", |
| "report.sending": "Sending…", |
| "report.cancel": "Cancel", |
| "report.close": "Close", |
| "report.sentTitle": "Thanks — sent. We'll look at it.", |
| "report.sentSub": "If you left a contact, you may get an answer there. You can close this window.", |
| "report.sentDry": "Test mode: the server got it but didn't pass it on.", |
| "report.sentToast": "Your report was sent. Thanks!", |
| "report.err.offline": "Couldn't reach openhop.cfd. Check your internet connection and try again.", |
| "report.err.rate_limited": "Too many reports from here right now. Please try again in a little while.", |
| "report.err.too_large": "The report is too big. Remove an attachment or two and try again.", |
| "report.err.rejected": "The report server didn't accept the report. Please update openhop and try again.", |
| "report.err.server": "The report server had a problem. Please try again in a few minutes.", |
| "report.err.busy": "A report is already on its way. Wait a moment.", |
| "report.err.collect": "Couldn't put the report together. Please try again.", |
| "report.err.dialog": "Couldn't open the file picker. Please try again.", |
| "report.err.unknown": "Something went wrong while sending. Please try again later.", |
| "tip.report": ["Report a problem", "Sends a diagnostic report to the openhop developer. You can see what's in it before anything is sent.", "Redacted on this PC, then POST to openhop.cfd/api/report and forwarded privately."], |
| "confirm.deep.title": "Deep reset?", |
| "confirm.deep.body": "This gets a brand-new WARP identity: new keys, a new IP, and it clears the used-IP list and temporary files. Your OpenCode chats and projects are kept.", |
| "confirm.deep.ok": "Deep reset", |
| "confirm.uninstall.title": "Uninstall openhop?", |
| "confirm.uninstall.body": "This removes the background service, startup tasks, the Desktop app proxy setting, the 'opencode' command shim, PATH entry and openhop's data folder. Your OpenCode projects and chats, and the Cloudflare WARP app, stay untouched.", |
| "confirm.uninstall.ok": "Uninstall", |
| |
| "insp.title": "Hover anything to see what it does", |
| "credit.based": "· based on the original by", |
| "credit.byTitle": "openhop's website", |
| "credit.basedTitle": "Avatar's original project on GitHub", |
| |
| "err.generic": "Something went wrong. Press refresh and try again.", |
| "err.prefix": "Something went wrong: {msg}", |
| "ago.now": "just now", "ago.min": "{n} min ago", "ago.h": "{n} h ago", "ago.d": "{n} d ago", |
| |
| |
| "tip.under": "Under the hood", |
| "tip.brand": ["openhop", "Keeps OpenCode working on the free plan: when you hit the limit, it gets you a new IP and your chat carries on.", "Routes OpenCode through Cloudflare WARP, Tor or your own proxy. openhop.cfd · based on the original by Avatar (ShadowySphinX)."], |
| "tip.pill": ["Connection status", "Green means OpenCode is protected and working. Red means something needs fixing: the big panel below says what.", "Local proxy on 127.0.0.1:41987, over WARP, Tor or your own proxy."], |
| "tip.view": ["Simple / Advanced", "Simple shows only what you need day to day. Advanced adds connection type, logs, stats and repair tools. Your choice is remembered."], |
| "tip.refresh": ["Check again now", "Re-checks everything right away instead of waiting for the next automatic check.", "WARP status, public IPv6 via api64.ipify.org, the opencode.ai server list and the logs."], |
| "tip.health": ["Status at a glance", "Tells you in plain words whether OpenCode can work right now. If something is wrong, it says what and gives you a button to fix it."], |
| "tip.fixAll": ["Fix everything", "Runs every suggested fix, one after another, and tells you how it went."], |
| "tip.factConn": ["Connection type", "How OpenCode reaches the internet. You can change it in Advanced → Connection type."], |
| "tip.factIp": ["Your IP for OpenCode", "The address OpenCode sees you from. The free limit is counted per address, so a new one starts the count again.", "IPv6 /64 block."], |
| "tip.factHops": ["New IPs so far", "How many times openhop got you a new IP, automatically at the limit or with 'Get a new IP'."], |
| "tip.factWork": ["Your work is safe", "Projects and chats found in OpenCode. Getting a new IP never touches them.", "Read from opencode.db."], |
| "tip.tokens": ["Token usage", "Tokens are the small pieces of text a model reads and writes; every chat uses thousands of them. This is simply how much OpenCode has handled on this PC so far.", "Read from opencode.db (session_v2), read-only. Total = input + output + cache reads + cache writes, all sessions (helper sessions included)."], |
| "tip.launchDesktop": ["Launch OpenCode Desktop", "Opens the OpenCode app, already protected. Your projects and chats load as usual.", "OpenCode.exe wired to the local proxy 127.0.0.1:41987."], |
| "tip.launchCli": ["Launch OpenCode CLI", "Opens a new terminal window with OpenCode in it, already protected.", "Zen Lane: its own proxy per launch and a random Cloudflare edge."], |
| "tip.hop": ["Get a new IP", "Gives OpenCode a brand-new IP in about 12 seconds, so the free limit starts again. Your chats are kept.", "Zen Hop: pauses the keeper, deletes the WARP registration, registers a new device key and reconnects (new IPv6 /64 and Cloudflare edge)."], |
| "tip.admin": ["Windows permissions", "Some options, like the Leak blocker, need administrator approval. Windows asks you when you switch them."], |
| "tip.keeper": ["Background protection", "Keeps OpenCode connected all the time, even with this window closed, and repairs the connection if it drops.", "WARP Keeper: checks every few seconds, repairs dead tunnels and hosts the proxy on 127.0.0.1:41987."], |
| "tip.guard": ["Auto-rotate on limit", "Notices when you hit the free limit and gets you a new IP by itself, in about 12 seconds.", "Zen Guard: watches opencode.log, marks the current /64 as used and rotates."], |
| "tip.autoResume": ["Auto-continue", "After a new IP, types 'continue' in your OpenCode chat so the model keeps working while you're away.", "Sends 'continue' through the CLI and a keystroke."], |
| "tip.svc": ["Protect the Desktop app", "Makes the normal OpenCode Desktop app use the protected connection automatically.", "Sets HTTPS_PROXY=127.0.0.1:41987 in OpenCode's service.json."], |
| "tip.trayTag": ["Tray icon", "Whether openhop's icon is running next to the clock. The tray shows the popups and lets the window hide instead of closing."], |
| "tip.testNotify": ["Test notification", "Shows a sample popup in the bottom-right corner, so you can see what openhop's alerts look like."], |
| "tip.quitApp": ["Quit openhop", "Closes the window and the tray icon for real. Background protection keeps running, so OpenCode stays protected."], |
| "tip.appStartup": ["Open with Windows", "Starts openhop hidden in the tray every time you sign in, so the popups and the status dot are always there.", "HKCU Run entry with --tray."], |
| "tip.closeToTray": ["Close to the tray", "On: the X button only hides the window and openhop stays next to the clock. Off: the X button quits openhop."], |
| "tip.notifyProblems": ["Problem alerts", "A popup when OpenCode can't connect or protection stops. The same problem is shown at most once every 10 minutes."], |
| "tip.notifyHops": ["New IP alerts", "A popup each time openhop gets you a new IP after you hit the free limit."], |
| "tip.desktopBrand": ["openhop.cfd in OpenCode", "Swaps the big faint \"opencode\" above the chat box for \"openhop.cfd\". Only the look changes, and only while OpenCode is closed. Turn it off and OpenCode's own word comes back.", "Adds one style block to OpenCode Desktop's app.asar. A backup of the original is kept in %LOCALAPPDATA%\\openhop\\desktop_backup."], |
| "tip.notifyUpdates": ["Update alerts", "A popup when a new version of openhop has been downloaded and is ready to install, and when an update has just been installed and checked."], |
| "tip.autoUpdate": ["Automatic updates", "openhop checks openhop.cfd every few hours. A new version is downloaded in the background and checked, and you get an Update now button; it also installs itself the next time openhop starts. After updating it runs a few checks.", "Reads https://openhop.cfd/latest.json; the download must match its SHA-256. The old exe is kept as .old until the next start."], |
| "tip.hideBanner": ["Keep the chat box", "When the free limit hits, OpenCode Desktop swaps the chat box for a \"Free limit reached\" card for up to an hour. openhop has already moved you to a new IP by then, so this keeps the chat box instead. Only while OpenCode is closed; turn it off to get the card back.", "Changes one check in OpenCode Desktop's app.asar. A backup of the original is kept in %LOCALAPPDATA%\openhop\desktop_backup."], |
| "tip.checkUpdate": ["Check for updates", "Looks for a new openhop version on openhop.cfd right now and downloads it if there is one."], |
| "tip.updateBar": ["Update", "A new openhop version has been downloaded and checked. Press Update now and it swaps itself and reopens; your settings and protection stay as they are. After it updates, openhop runs a few checks and shows how they went."], |
| "tip.autostart": ["Protect from sign-in", "Turns protection on by itself every time you sign in to Windows, so you don't have to open openhop.", "Registers the Keeper and Guard tasks in Windows Task Scheduler (at logon)."], |
| "tip.firewall": ["Leak blocker", "Stops the OpenCode CLI from skipping the protection and using your real connection. Windows asks for admin approval.", "Windows Firewall rule OPENHOP_LEAKGUARD_CLI for opencode-cli.exe."], |
| "tip.strict": ["Strict mode", "On: if the protected connection drops, OpenCode stops instead of using your real IP. Off (recommended): OpenCode keeps working.", "Fail-closed proxy: answers 503 while WARP is down."], |
| "tip.tabErrors": ["Errors, explained", "Recent OpenCode errors in plain words: what happened and what to do.", "Read from opencode.log."], |
| "tip.tabGuard": ["Auto-rotate log", "Every time the limit was detected and a new IP was fetched.", "Zen Guard log: detections, rotations and skipped used IPs."], |
| "tip.tabKeeper": ["Protection log", "What the background protection has been doing: checks, start-ups and automatic repairs.", "WARP Keeper log: health checks, proxy port 41987, server choice."], |
| "tip.tabBlacklist": ["Used IPs", "IPs that already hit today's limit. openhop skips them when it gets you a new one.", "IPv6 /64 blacklist, up to 200 kept."], |
| "tip.clearBlacklist": ["Clear used-IP list", "Forgets the used IPs. Useful after the daily limit resets.", "The free limit resets at midnight UTC."], |
| "tip.copyLog": ["Copy", "Copies what this panel shows, so you can paste it somewhere."], |
| "tip.modeWarp": ["Cloudflare WARP (recommended)", "Free and fast. Gets you a new IP automatically when you hit the limit.", "Rotates IPv6 /64 blocks."], |
| "tip.modeTor": ["Tor network", "Slower, but works in places where WARP is blocked.", "SOCKS5 on port 9050 or 9150."], |
| "tip.modeCustom": ["My own proxy", "Use a proxy you already have.", "SOCKS5 or HTTP, e.g. Clash, V2Ray, Xray, sing-box or Shadowsocks on 127.0.0.1:10808, or a remote one."], |
| "tip.modeClean": ["Unblock WARP", "If your internet provider blocks WARP, this finds another way in that isn't blocked.", "Moves WARP's WireGuard endpoint away from the default 162.159.192.1."], |
| "tip.scopeTun": ["Whole PC", "Everything on your PC goes through WARP, like a VPN. Getting a new IP is slower and briefly cuts other apps.", "Full TUN mode: WARP virtual adapter over WireGuard."], |
| "tip.scopeIso": ["Only OpenCode (recommended)", "Only OpenCode uses WARP. Games, Discord and browsing stay on your normal internet and never drop when you get a new IP.", "WARP proxy mode: SOCKS5 on port 40000 over MASQUE."], |
| "tip.torRotate": ["New Tor IP", "Gives OpenCode a new Tor address right away.", "NEWNYM on Tor's control port."], |
| "tip.torToggle": ["Start / stop Tor", "Starts or stops the Tor service that runs in the background."], |
| "tip.proxyType": ["Proxy type", "SOCKS5 or HTTP: use whichever your proxy app offers."], |
| "tip.customSave": ["Use this proxy", "Saves the address(es) and sends OpenCode through them."], |
| "tip.customNext": ["Next proxy", "Switches to the next proxy in your list right away."], |
| "tip.cleanSelect": ["Entry point", "The address WARP connects through. Test them, then use the fastest.", "Known WARP WireGuard endpoints."], |
| "tip.cleanPing": ["Test speed", "Checks every entry point at once and shows how fast each one answers."], |
| "tip.cleanApply": ["Use selected", "Makes WARP connect through the entry point you picked.", "Sets WARP's WireGuard endpoint."], |
| "tip.cleanHeal": ["Pick the fastest", "Tests every entry point and switches to the fastest one that works."], |
| "tip.cleanReset": ["Back to default", "Removes your custom entry point so WARP uses its normal one."], |
| "tip.cardEgress": ["Your public IP", "The address opencode.ai sees you from. Click to copy it.", "IPv6 /64. Free limits are counted per /64 block and Cloudflare edge."], |
| "tip.cardAdapter": ["Connection adapter", "Where OpenCode's traffic is pinned, so it never goes out through your normal connection. Click to copy.", "WARP network adapter or proxy."], |
| "tip.cardEdge": ["OpenCode server", "opencode.ai has several servers. openhop picks one at random each time; you can switch, or pick one yourself.", "Pinned Cloudflare IPv6 edge (AAAA record)."], |
| "tip.reroll": ["Switch server", "Moves OpenCode to another random opencode.ai server right away, without restarting it.", "Re-rolls the IPv6 edge used by the proxy on 127.0.0.1:41987."], |
| "tip.edgeSelect": ["Server choice", "Automatic picks a random server each time. Or pin one from the list.", "Live AAAA list from DNS."], |
| "tip.cardStats": ["New IPs & saved work", "How many new IPs you got, how many are used up, and the projects and chats openhop found.", "Used /64 blocks are never reused (up to 200). Work read from opencode.db."], |
| "tip.warpToggle": ["Connect / disconnect WARP", "Turns WARP on or off. While it's off, OpenCode is blocked instead of using your real IP.", "Requests get a 503 while disconnected."], |
| "tip.repairWarp": ["Repair WARP", "Fixes most WARP connection problems by starting it fresh.", "Resets endpoint overrides and registration keys, then reconnects. Fixes CF_HAPPY_EYEBALLS_MITM_FAILURE and 'Unable to reach destination'."], |
| "tip.fixService": ["Fix port conflict", "Closes leftover OpenCode background processes that are stuck and blocking it.", "Ends stale opencode-cli processes holding dead ports (e.g. the 42914 IPC conflict)."], |
| "tip.deepReset": ["Deep reset", "Starts over with a fresh identity: new keys, a new IP and an empty used-IP list. Your chats are kept.", "Clears the temp cache, resets WARP keys, clears the /64 blacklist, then gets a new IP."], |
| "tip.install": ["Install / Repair", "Puts everything back in place: background protection, startup, the 'opencode' command and OpenCode Desktop's connection.", "Copies scripts and shims to %LOCALAPPDATA%\\openhop, updates PATH, registers the startup tasks and connects WARP."], |
| "tip.openFolder": ["Open data folder", "Opens the folder where openhop keeps its settings and logs.", "%LOCALAPPDATA%\\openhop"], |
| "tip.copyDiag": ["Copy diagnostics", "Copies a report you can send when you ask for help. It contains your IPs, so check it before posting it publicly.", "Full technical snapshot in JSON."], |
| "tip.path": ["'opencode' command", "Whether typing 'opencode' in a new terminal starts the protected version.", "%LOCALAPPDATA%\\openhop\\bin first in your user PATH."], |
| "tip.uninstall": ["Uninstall", "Removes openhop's background protection and settings and puts OpenCode back to normal. Your projects and chats are not touched.", "Stops the service, removes startup tasks and the firewall rule, restores OpenCode Desktop, cleans PATH, disconnects WARP and deletes %LOCALAPPDATA%\\openhop."] |
| } |
| }; |
| |
| let LANG = "en"; |
| |
| function blockLabel(p) { |
| p = String(p || ""); |
| if (!p.includes(":")) return p; |
| return (p.endsWith("::") ? p : p + "::") + "/64"; |
| } |
| |
| function t(key, vars) { |
| const table = STRINGS[LANG] || STRINGS.en; |
| let s = key in table ? table[key] : (key in STRINGS.en ? STRINGS.en[key] : key); |
| if (vars && typeof s === "string") s = s.replace(/\{(\w+)\}/g, (m, k) => (k in vars ? String(vars[k]) : m)); |
| return s; |
| } |
| |
| function applyStrings(root = document) { |
| root.querySelectorAll("[data-i18n]").forEach((el) => { el.textContent = t(el.dataset.i18n); }); |
| root.querySelectorAll("[data-i18n-ph]").forEach((el) => { el.placeholder = t(el.dataset.i18nPh); }); |
| root.querySelectorAll("[data-i18n-title]").forEach((el) => { |
| el.title = t(el.dataset.i18nTitle); |
| el.setAttribute("aria-label", el.title); |
| }); |
| root.querySelectorAll("[data-tip]").forEach((el) => { |
| const tip = t("tip." + el.dataset.tip); |
| if (Array.isArray(tip)) { |
| el.setAttribute("data-tip-title", tip[0]); |
| el.setAttribute("data-tip-body", tip[1]); |
| if (tip[2]) el.setAttribute("data-tip-tech", tip[2]); |
| else el.removeAttribute("data-tip-tech"); |
| } |
| }); |
| $("appVersion").textContent = t("app.version"); |
| } |
| |
| let state = null; |
| let activeTab = "opencode"; |
| let activeModeTab = null; |
| let busyIds = new Set(); |
| |
| const $ = (id) => document.getElementById(id); |
| const api = () => (window.pywebview && window.pywebview.api) || null; |
| |
| |
| const VIEW_KEY = "openhop.view"; |
| function setView(view, persist = true) { |
| const v = view === "advanced" ? "advanced" : "simple"; |
| const viewChanged = persist && document.body.dataset.view !== v; |
| document.body.dataset.view = v; |
| if (viewChanged) { |
| numberStagger(); |
| replay(document.querySelector(".layout"), "view-change", 1000); |
| } |
| $("viewSimple").classList.toggle("active", v === "simple"); |
| $("viewAdvanced").classList.toggle("active", v === "advanced"); |
| $("viewSimple").setAttribute("aria-pressed", String(v === "simple")); |
| $("viewAdvanced").setAttribute("aria-pressed", String(v === "advanced")); |
| if (persist) { |
| try { localStorage.setItem(VIEW_KEY, v); } catch (e) { } |
| } |
| } |
| function storedView() { |
| try { return localStorage.getItem(VIEW_KEY) || "simple"; } catch (e) { return "simple"; } |
| } |
| |
| |
| function showToast(msg, kind = "") { |
| const tEl = $("toast"); |
| $("toastText").textContent = msg; |
| tEl.className = "toast show" + (kind ? " " + kind : ""); |
| clearTimeout(showToast._timer); |
| showToast._timer = setTimeout(() => tEl.classList.remove("show"), kind === "error" ? 7000 : 3800); |
| } |
| |
| function friendlyError(err) { |
| const raw = String((err && err.message) || err || "").trim(); |
| if (!raw) return t("err.generic"); |
| const first = raw.split("\n")[0].replace(/^Error:\s*/i, ""); |
| return t("err.prefix", { msg: first.length > 160 ? first.slice(0, 160) + "…" : first }); |
| } |
| |
| function timeAgo(epoch) { |
| if (!epoch) return ""; |
| const s = Math.max(0, Math.round(Date.now() / 1000 - epoch)); |
| if (s < 60) return t("ago.now"); |
| if (s < 3600) return t("ago.min", { n: Math.round(s / 60) }); |
| if (s < 86400) return t("ago.h", { n: Math.round(s / 3600) }); |
| return t("ago.d", { n: Math.round(s / 86400) }); |
| } |
| |
| function formatTime(epoch) { |
| if (!epoch) return t("never"); |
| return new Date(epoch * 1000).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }); |
| } |
| |
| function setTag(el, text, cls) { |
| el.textContent = text; |
| el.className = "tag" + (cls ? " " + cls : ""); |
| } |
| |
| function el(tag, cls, text) { |
| const n = document.createElement(tag); |
| if (cls) n.className = cls; |
| if (text !== undefined && text !== null) n.textContent = text; |
| return n; |
| } |
| |
| |
| function fixableIssues() { |
| const issues = (state && state.health && state.health.issues) || []; |
| return issues.filter((i) => i.fix); |
| } |
| |
| |
| |
| |
| function numberStagger() { |
| const nodes = document.querySelectorAll( |
| ".layout > :not(.actions):not(.duo), .actions > .action, .duo > .card, .inspector"); |
| let i = 0; |
| const visible = [...nodes].filter((n) => n.offsetParent !== null || n.classList.contains("inspector")); |
| visible.sort((a, b) => a.getBoundingClientRect().top - b.getBoundingClientRect().top |
| || a.getBoundingClientRect().left - b.getBoundingClientRect().left); |
| visible.forEach((n) => n.style.setProperty("--i", String(i++))); |
| } |
| |
| |
| function initGliders() { |
| document.querySelectorAll(".view-switch, .mode-tabs, .tabs").forEach((box) => { |
| const g = document.createElement("span"); |
| g.className = "glider"; |
| box.prepend(g); |
| box.classList.add("has-glider"); |
| const place = (instant) => { |
| const a = box.querySelector(":scope > .active"); |
| if (!a || !a.offsetWidth) { g.style.opacity = "0"; return; } |
| const first = g.style.opacity !== "1"; |
| if (instant || first) g.classList.add("instant"); |
| g.style.opacity = "1"; |
| g.style.width = a.offsetWidth + "px"; |
| g.style.height = a.offsetHeight + "px"; |
| g.style.transform = `translate(${a.offsetLeft}px, ${a.offsetTop}px)`; |
| if (instant || first) { void g.offsetWidth; g.classList.remove("instant"); } |
| }; |
| new MutationObserver((list) => { |
| if (list.some((m) => m.target !== g)) place(false); |
| }).observe(box, { subtree: true, attributes: true, attributeFilter: ["class"] }); |
| if (window.ResizeObserver) new ResizeObserver(() => place(true)).observe(box); |
| place(true); |
| }); |
| } |
| |
| function replay(node, cls, ms) { |
| node.classList.remove(cls); |
| void node.offsetWidth; |
| node.classList.add(cls); |
| clearTimeout(node["_t_" + cls]); |
| node["_t_" + cls] = setTimeout(() => node.classList.remove(cls), ms); |
| } |
| |
| let lastHealthStatus = null; |
| function renderHealth(h) { |
| if (!h) return; |
| const status = h.status || "ok"; |
| const panel = $("healthPanel"); |
| const changed = lastHealthStatus !== status; |
| lastHealthStatus = status; |
| panel.classList.remove("ok", "warn", "bad", "busy"); |
| panel.classList.add(status); |
| if (changed) replay(panel, "changed", 1000); |
| $("healthTitle").textContent = h.title || t("health." + status); |
| $("healthSub").textContent = h.sub || ""; |
| |
| const fixable = fixableIssues(); |
| const fixAll = $("btnFixAll"); |
| if (!busyIds.has("btnFixAll")) { |
| fixAll.style.display = fixable.length >= 2 ? "" : "none"; |
| fixAll.textContent = t("fixAll", { n: fixable.length }); |
| } |
| |
| const list = $("healthIssues"); |
| const key = JSON.stringify(h.issues || []); |
| if (list.dataset.key !== key) { |
| list.dataset.key = key; |
| list.replaceChildren(); |
| (h.issues || []).forEach((it, idx) => { |
| const lvl = it.level === "bad" ? "bad" : "warn"; |
| const row = el("div", "issue " + lvl); |
| const text = el("div", "issue-text"); |
| text.append(el("div", "issue-title", it.title), el("div", "issue-detail", it.detail)); |
| row.append(el("span", "sev", t("sev." + lvl)), text); |
| if (it.fix) { |
| const btn = el("button", "btn btn-sm " + (lvl === "bad" ? "btn-solid" : "btn-primary"), it.fix_label || t("fix.default")); |
| btn.id = "btnFix_" + idx; |
| btn.setAttribute("data-icon", "wrench"); |
| btn.onclick = () => runAction(btn.id, () => api().fix_issue(it.fix), t("fix.busy")); |
| row.append(btn); |
| } |
| list.append(row); |
| }); |
| } |
| |
| |
| const le = $("healthLastErr"); |
| const last = (state.recent_errors || [])[0]; |
| const recent = last && last.ts && Date.now() / 1000 - last.ts < 3600; |
| const leKey = status !== "ok" && recent ? last.title + "|" + timeAgo(last.ts) : ""; |
| if (le.dataset.key !== leKey) { |
| le.dataset.key = leKey; |
| le.replaceChildren(); |
| if (leKey) { |
| const txt = el("span", "le-text"); |
| txt.append(t("lastErr.label") + " ", el("strong", "", last.title), " · " + timeAgo(last.ts)); |
| const link = el("button", "link-btn", t("lastErr.details")); |
| link.setAttribute("data-icon", "arrow"); |
| link.onclick = () => showErrors(); |
| le.append(txt, link); |
| } |
| } |
| } |
| |
| |
| |
| function fmtCount(n) { |
| const v = Math.max(0, Math.round(Number(n) || 0)); |
| if (v < 1000) return String(v); |
| for (const pair of [["B", 1e9], ["M", 1e6], ["k", 1e3]]) { |
| if (v >= pair[1]) return (v / pair[1]).toFixed(1).replace(/\.0$/, "") + pair[0]; |
| } |
| return String(v); |
| } |
| |
| function fmtPair(a, b) { |
| const frag = document.createDocumentFragment(); |
| frag.append(fmtCount(a), el("span", "sep", " / "), fmtCount(b)); |
| return frag; |
| } |
| |
| let tokenSeq = 0; |
| async function loadTokenStats() { |
| const a = api(); |
| if (!a || !a.get_token_stats) return; |
| const seq = ++tokenSeq; |
| let stats = null; |
| try { stats = await a.get_token_stats(); } catch (e) { stats = null; } |
| if (seq !== tokenSeq) return; |
| renderTokenStats(stats); |
| } |
| |
| function renderTokenStats(stats) { |
| const panel = $("tokenPanel"); |
| if (!panel) return; |
| const hasData = Boolean(stats && stats.ok && Number(stats.sessions) > 0); |
| panel.hidden = !hasData; |
| if (!hasData) return; |
| $("tkTotal").textContent = fmtCount(stats.total); |
| $("tkInOut").replaceChildren(fmtPair(stats.input, stats.output)); |
| $("tkCache").replaceChildren(fmtPair(stats.cache_read, stats.cache_write)); |
| $("tkWork").replaceChildren(fmtPair(stats.sessions, stats.projects)); |
| $("tkReasoning").textContent = t("tk.reasoning", { n: fmtCount(stats.reasoning) }); |
| $("tkCost").textContent = t("tk.cost", { n: "$" + Number(stats.cost || 0).toFixed(2) }); |
| } |
| |
| function showErrors() { |
| setView("advanced"); |
| selectTab("opencode"); |
| $("activityCard").scrollIntoView({ behavior: "smooth", block: "nearest" }); |
| } |
| |
| async function fixAll() { |
| const fixes = []; |
| fixableIssues().forEach((i) => { if (!fixes.includes(i.fix)) fixes.push(i.fix); }); |
| if (!fixes.length) return; |
| const btn = $("btnFixAll"); |
| busyIds.add("btnFixAll"); |
| btn.disabled = true; |
| let ok = 0; |
| let lastFail = ""; |
| try { |
| for (let i = 0; i < fixes.length; i++) { |
| btn.textContent = t("fixAll.progress", { i: i + 1, n: fixes.length }); |
| try { |
| const res = await api().fix_issue(fixes[i]); |
| if (res && res.ok === false) lastFail = res.message || ""; |
| else ok++; |
| } catch (err) { |
| lastFail = friendlyError(err); |
| } |
| } |
| const summary = t("fixAll.done", { ok, n: fixes.length }); |
| showToast(lastFail ? summary + " " + lastFail : summary, ok === fixes.length ? "success" : "error"); |
| } finally { |
| busyIds.delete("btnFixAll"); |
| btn.disabled = false; |
| await refresh(false); |
| } |
| } |
| |
| |
| function renderErrors(box) { |
| const errs = (state && state.recent_errors) || []; |
| const healthy = state && state.health && state.health.status === "ok"; |
| box.replaceChildren(); |
| if (!errs.length) { |
| box.append(el("div", "empty", t("log.noErrors"))); |
| return; |
| } |
| const list = el("div", "err-list"); |
| errs.forEach((e, i) => { |
| const current = !healthy && i === 0; |
| const item = el("div", "err-item" + (current ? " current" : "")); |
| const top = el("div", "err-top"); |
| const meta = [current ? t("err.latest") : "", timeAgo(e.ts), e.count > 1 ? "×" + e.count : "", e.where].filter(Boolean).join(" · "); |
| top.append(el("span", "err-title", e.title), el("span", "err-meta", meta)); |
| item.append(top, el("div", "err-detail", e.detail)); |
| if (current && e.fix) { |
| const acts = el("div", "err-actions"); |
| const btn = el("button", "btn btn-xs btn-primary", t("err.fix")); |
| btn.id = "btnErrFix"; |
| btn.setAttribute("data-icon", "wrench"); |
| btn.onclick = () => runAction(btn.id, () => api().fix_issue(e.fix), t("fix.busy")); |
| acts.append(btn); |
| item.append(acts); |
| } |
| list.append(item); |
| }); |
| box.append(list); |
| } |
| |
| const TS_RE = /^(\d\d-\d\d \d\d:\d\d:\d\d|\d{4}-\d\d-\d\d[ T]\d\d:\d\d:\d\d(?:[.,]\d+)?)\s?/; |
| function renderLogLines(box, lines) { |
| const frag = document.createDocumentFragment(); |
| lines.forEach((line) => { |
| const m = TS_RE.exec(line); |
| const rest = m ? line.slice(m[0].length) : line; |
| if (m) frag.append(el("span", "ts", m[0])); |
| const low = rest.toLowerCase(); |
| const cls = /error|fail|traceback|refused|dead/.test(low) ? "er" : /rotat|hop:|new ip|wall detected|continue/.test(low) ? "hl" : ""; |
| frag.append(cls ? el("span", cls, rest) : document.createTextNode(rest)); |
| frag.append(document.createTextNode("\n")); |
| }); |
| box.replaceChildren(frag); |
| } |
| |
| function selectTab(name) { |
| if (activeTab !== name && state) replay($("logBox"), "swap", 260); |
| activeTab = name; |
| document.querySelectorAll(".tab").forEach((tb) => tb.classList.toggle("active", tb.getAttribute("data-tab") === name)); |
| renderLogs(); |
| } |
| |
| function renderLogs() { |
| if (!state) return; |
| const box = $("logBox"); |
| $("btnClearBlacklist").style.display = activeTab === "blacklist" ? "inline-flex" : "none"; |
| const errs = state.recent_errors || []; |
| $("errCount").textContent = errs.length ? String(errs.length) : ""; |
| |
| if (activeTab === "blacklist") { |
| const bl = state.stats.blacklist || []; |
| const key = "bl|" + bl.join(","); |
| if (box.dataset.key === key) return; |
| box.dataset.key = key; |
| box.replaceChildren(); |
| if (!bl.length) { box.append(el("div", "empty neutral", t("log.blacklistEmpty"))); return; } |
| box.append(el("div", "log-note", t("log.blacklistNote"))); |
| box.append(document.createTextNode(bl.map((b, i) => `${String(i + 1).padStart(2, "0")} ${blockLabel(b)}`).join("\n"))); |
| return; |
| } |
| if (activeTab === "opencode") { |
| const key = "err|" + JSON.stringify(errs) + "|" + (state.health && state.health.status); |
| if (box.dataset.key === key && !busyIds.has("btnErrFix")) return; |
| box.dataset.key = key; |
| renderErrors(box); |
| return; |
| } |
| const lines = (state.logs && state.logs[activeTab]) || []; |
| const key = activeTab + "|" + lines.length + "|" + (lines[lines.length - 1] || ""); |
| if (box.dataset.key === key) return; |
| box.dataset.key = key; |
| const atBottom = box.scrollHeight - box.scrollTop - box.clientHeight < 35; |
| if (lines.length) renderLogLines(box, lines); |
| else box.replaceChildren(el("div", "empty neutral", t("log.empty." + activeTab))); |
| if (atBottom) box.scrollTop = box.scrollHeight; |
| } |
| |
| |
| function renderState(s) { |
| state = s; |
| const w = s.warp || {}; |
| const sv = s.services || {}; |
| const ln = s.lane || {}; |
| const st = s.stats || { db: {} }; |
| const eg = s.egress || { mode: "warp" }; |
| const egressMode = eg.mode || "warp"; |
| const wmode = String(w.mode || ""); |
| const warpScope = eg.warp_scope || "isolated"; |
| const isProxyMode = wmode.toLowerCase().includes("proxy") || warpScope === "isolated"; |
| |
| if (s.version) STRINGS.en["app.version"] = "v" + String(s.version).replace(/^v/, ""); |
| $("appVersion").textContent = t("app.version"); |
| |
| |
| const pillDot = $("overallDot"); |
| const pillTxt = $("overallText"); |
| let dot = "", pill = ""; |
| if (w.rotating) { dot = "spin"; pill = t("pill.rotating"); } |
| else if (egressMode === "custom") { dot = "ok"; pill = t("pill.custom", { type: (eg.custom_type || "socks5").toUpperCase() }); } |
| else if (egressMode === "tor") { dot = "ok"; pill = t("pill.tor"); } |
| else if (w.connected && (w.is_cf || (w.adapter_v6 && !w.egress_v6))) { dot = "ok"; pill = isProxyMode ? t("pill.warpIso") : t("pill.warp"); } |
| else if (w.connected && w.egress_failed) { dot = "warn"; pill = isProxyMode ? t("pill.warpIso") : t("pill.warp"); } |
| else if (w.connected) { dot = "warn"; pill = t("pill.verifying"); } |
| else { dot = "bad"; pill = t("pill.offline"); } |
| if (s.health && s.health.status === "bad" && !w.rotating) { dot = "bad"; pill = t("pill.action"); } |
| pillDot.className = "dot " + dot; |
| pillTxt.textContent = pill; |
| |
| renderHealth(s.health); |
| |
| |
| const connName = egressMode === "tor" ? t("conn.tor") |
| : egressMode === "custom" ? t("conn.custom", { type: (eg.custom_type || "socks5").toUpperCase() }) |
| : egressMode === "clean" ? t("conn.clean") |
| : (warpScope === "isolated" ? t("conn.warpIso") : t("conn.warpTun")); |
| $("factConn").textContent = connName; |
| let ipText; |
| if (egressMode === "tor") ipText = w.egress_v6 || t("fact.viaTor"); |
| else if (egressMode === "custom") ipText = w.egress_v6 || t("fact.viaProxy"); |
| else if (w.egress_v6) ipText = (w.egress_prefix ? blockLabel(w.egress_prefix) : w.egress_v6); |
| else if (w.checking_egress) ipText = t("fact.checking"); |
| else if (w.egress_failed && w.connected) ipText = t("fact.unknownIp"); |
| else ipText = w.connected ? t("fact.checking") : t("fact.offline"); |
| $("factIp").textContent = ipText; |
| $("factIp").title = w.egress_v6 || ""; |
| const hopsEl = $("factHops"); |
| hopsEl.replaceChildren(String(st.hops || 0)); |
| if (st.last_hop) hopsEl.append(el("span", "unit", " · " + t("fact.last", { time: formatTime(st.last_hop) }))); |
| const db = st.db || {}; |
| $("factWork").textContent = t("fact.work.value", { p: db.projects || 0, s: db.sessions || 0 }); |
| |
| |
| if (!busyIds.has("btnWarpToggle")) $("btnWarpToggle").textContent = w.connected ? t("btn.warpDisconnect") : t("btn.warpConnect"); |
| |
| |
| const card1Label = $("cardEgressLabel"); |
| if (egressMode === "custom") { |
| card1Label.textContent = t("card.ipCustom"); |
| $("egressPrefix").textContent = eg.custom_current_node || eg.custom_proxy || "127.0.0.1:10808"; |
| $("egressFull").textContent = w.egress_v6 ? t("eg.exit", { ip: w.egress_v6 }) : t("eg.poolRoute"); |
| setTag($("egressTag"), t("eg.proxyOn"), "ok"); |
| } else if (egressMode === "tor") { |
| card1Label.textContent = t("card.ipTor"); |
| $("egressPrefix").textContent = eg.tor_target || "127.0.0.1:9050"; |
| $("egressFull").textContent = w.egress_v6 ? t("eg.exit", { ip: w.egress_v6 }) : t("eg.torRoute"); |
| setTag($("egressTag"), t("eg.torOn"), "ok"); |
| } else if (w.egress_v6) { |
| card1Label.textContent = t("card.ip"); |
| $("egressPrefix").textContent = w.egress_prefix ? blockLabel(w.egress_prefix) : w.egress_v6; |
| $("egressFull").textContent = w.egress_v6; |
| setTag($("egressTag"), w.is_cf ? t("eg.cf") : t("eg.notCf"), w.is_cf ? "ok" : "bad"); |
| } else if (w.egress_failed && w.connected) { |
| card1Label.textContent = t("card.ip"); |
| $("egressPrefix").textContent = t("eg.unknown"); |
| $("egressFull").textContent = t("eg.unknownSub"); |
| setTag($("egressTag"), t("eg.pending"), "warn"); |
| } else if (w.checking_egress) { |
| card1Label.textContent = t("card.ip"); |
| $("egressPrefix").textContent = t("eg.checking"); |
| $("egressFull").textContent = t("eg.checkingSub"); |
| setTag($("egressTag"), t("eg.checkingTag"), "warn"); |
| } else { |
| card1Label.textContent = t("card.ip"); |
| $("egressPrefix").textContent = w.connected ? t("eg.noV6") : t("eg.offline"); |
| $("egressFull").textContent = w.connected ? t("eg.reprobe") : t("eg.failClosed"); |
| setTag($("egressTag"), w.connected ? t("eg.pending") : t("eg.closed"), w.connected ? "warn" : "bad"); |
| } |
| |
| |
| const card2Label = $("cardAdapterLabel"); |
| if (egressMode === "custom") { |
| card2Label.textContent = t("card.adapterCustom"); |
| $("adapterV6").textContent = eg.custom_proxy || "127.0.0.1:10808"; |
| setTag($("warpModeTag"), (eg.custom_type || "SOCKS5").toUpperCase(), "ok"); |
| $("adapterSub").textContent = t("ad.pool", { n: eg.custom_pool_count || 1 }); |
| } else if (egressMode === "tor") { |
| card2Label.textContent = t("card.adapterTor"); |
| $("adapterV6").textContent = eg.tor_target || "127.0.0.1:9050"; |
| setTag($("warpModeTag"), "SOCKS5", "ok"); |
| $("adapterSub").textContent = t("ad.tor"); |
| } else { |
| card2Label.textContent = t("card.adapter"); |
| $("adapterV6").textContent = w.adapter_v6 || (isProxyMode ? t("ad.proxyPort") : t("ad.notActive")); |
| setTag($("warpModeTag"), wmode || "?", wmode.toLowerCase().includes("warp") ? "ok" : "warn"); |
| $("adapterSub").textContent = w.adapter_v6 ? t("ad.bound") : (isProxyMode ? t("ad.iso") : t("ad.waiting")); |
| } |
| |
| |
| $("pinnedEdge").textContent = ln.pinned_edge || (ln.edge_override && ln.edge_override !== "auto" ? ln.edge_override : t("edge.autoNext")); |
| const sel = $("edgeSelect"); |
| const pool = ln.edge_pool || []; |
| const desired = ["auto", ...pool]; |
| if (JSON.stringify(Array.from(sel.options).map((o) => o.value)) !== JSON.stringify(desired)) { |
| sel.replaceChildren(); |
| const autoOpt = el("option", "", t("edge.auto")); |
| autoOpt.value = "auto"; |
| sel.append(autoOpt); |
| pool.forEach((ip) => { const o = el("option", "", ip); o.value = ip; sel.append(o); }); |
| } |
| if (!busyIds.has("edgeSelect")) sel.value = desired.includes(ln.edge_override) ? ln.edge_override : "auto"; |
| |
| |
| setTag($("hopsTag"), st.hops === 1 ? t("st.hop1") : t("st.hops", { n: st.hops || 0 }), "ok"); |
| $("dbSummary").textContent = t("st.db", { p: db.projects || 0, s: db.sessions || 0 }); |
| $("blacklistSummary").textContent = t("st.blacklist", { n: st.blacklist_count || 0 }); |
| $("lastHopText").textContent = t("st.lastHop", { time: formatTime(st.last_hop) }); |
| |
| |
| setTag($("adminBadge"), sv.is_admin ? t("tag.admin") : t("tag.user"), sv.is_admin ? "ok" : ""); |
| setTag($("keeperTag"), sv.keeper_running ? t("tag.running") : t("tag.stopped"), sv.keeper_running ? "ok" : "bad"); |
| setTag($("guardTag"), sv.guard_running ? t("tag.running") : t("tag.stopped"), sv.guard_running ? "ok" : "warn"); |
| setTag($("svcTag"), |
| ln.desktop_service_wired && sv.proxy_listening ? t("tag.wired") : ln.desktop_service_wired ? t("tag.proxyDown") : t("tag.direct"), |
| ln.desktop_service_wired && sv.proxy_listening ? "ok" : ln.desktop_service_wired ? "bad" : "warn"); |
| setTag($("fwTag"), sv.firewall_installed ? t("tag.enabled") : t("tag.off"), sv.firewall_installed ? "ok" : "dim"); |
| setTag($("strictTag"), ln.strict_mode ? t("tag.strict") : t("tag.standard"), ln.strict_mode ? "ok" : "dim"); |
| const autoResume = sv.auto_resume !== undefined ? sv.auto_resume : true; |
| setTag($("autoResumeTag"), autoResume ? t("tag.enabled") : t("tag.disabled"), autoResume ? "ok" : "dim"); |
| const autoOn = sv.keeper_task && sv.guard_task; |
| setTag($("autoTag"), autoOn ? t("tag.enabled") : t("tag.off"), autoOn ? "ok" : "warn"); |
| |
| if (!busyIds.has("chkKeeper")) $("chkKeeper").checked = !!sv.keeper_running; |
| if (!busyIds.has("chkGuard")) $("chkGuard").checked = !!sv.guard_running; |
| if (!busyIds.has("chkServiceProxy")) $("chkServiceProxy").checked = !!ln.desktop_service_wired; |
| if (!busyIds.has("chkFirewall")) $("chkFirewall").checked = !!sv.firewall_installed; |
| if (!busyIds.has("chkStrict")) $("chkStrict").checked = !!ln.strict_mode; |
| if (!busyIds.has("chkAutoResume")) $("chkAutoResume").checked = !!autoResume; |
| if (!busyIds.has("chkAutostart")) $("chkAutostart").checked = !!autoOn; |
| |
| setTag($("pathBadge"), ln.path_wired ? t("tag.pathOk") : t("tag.pathNo"), ln.path_wired ? "ok" : "warn"); |
| |
| |
| if (!activeModeTab) activeModeTab = egressMode; |
| ["warp", "tor", "custom", "clean"].forEach((m) => { |
| const tab = $("tabMode" + m.charAt(0).toUpperCase() + m.slice(1)); |
| if (tab) tab.classList.toggle("active", m === activeModeTab); |
| }); |
| const badge = $("modeActiveBadge"); |
| const desc = $("modeDesc"); |
| if (egressMode === "tor") { |
| setTag(badge, t("badge.tor"), eg.tor_active ? "ok" : "warn"); |
| desc.textContent = eg.tor_active ? t("desc.torOn", { target: eg.tor_target }) : t("desc.torOff"); |
| } else if (egressMode === "custom") { |
| setTag(badge, t("badge.custom"), "ok"); |
| desc.textContent = t("desc.custom", { type: (eg.custom_type || "socks5").toUpperCase(), addr: eg.custom_proxy || "127.0.0.1:10808" }); |
| } else if (egressMode === "clean") { |
| setTag(badge, t("badge.clean"), "ok"); |
| desc.textContent = t("desc.clean"); |
| } else { |
| setTag(badge, t("badge.warp"), "ok"); |
| desc.textContent = t("desc.warp"); |
| } |
| showModePanel(activeModeTab); |
| |
| |
| const isIso = warpScope === "isolated"; |
| $("btnScopeIsolated").classList.toggle("btn-primary", isIso); |
| $("btnScopeTun").classList.toggle("btn-primary", !isIso); |
| $("warpScopeHint").textContent = isIso ? t("scope.hintIso") : t("scope.hintTun"); |
| const reverted = isIso && w.connected && wmode && !wmode.toLowerCase().includes("proxy"); |
| $("scopeWarn").textContent = reverted ? t("scope.reverted") : ""; |
| |
| |
| $("torStatusDot").className = "subpanel-dot " + (eg.tor_active ? "ok" : "bad"); |
| $("torStatusText").textContent = eg.tor_active ? t("tor.active", { target: eg.tor_target }) : t("tor.inactive"); |
| if (!busyIds.has("btnTorToggleService")) $("btnTorToggleService").textContent = eg.tor_running ? t("tor.stop") : t("tor.start"); |
| |
| |
| if (!$("txtProxyAddr").dataset.userEdited && eg.custom_proxy) { |
| $("txtProxyAddr").value = eg.custom_proxy; |
| $("selProxyType").value = eg.custom_type || "socks5"; |
| } |
| $("customPoolStatus").textContent = eg.custom_pool_count > 1 |
| ? t("custom.pool", { n: eg.custom_pool_count, node: eg.custom_current_node }) |
| : t("custom.single"); |
| |
| |
| if (eg.clean_endpoints && eg.clean_endpoints.length > 0) { |
| const cleanSel = $("selCleanEndpoint"); |
| if (cleanSel.dataset.loaded !== "true") { |
| cleanSel.dataset.loaded = "true"; |
| cleanSel.replaceChildren(); |
| eg.clean_endpoints.forEach((ep) => { const o = el("option", "", ep); o.value = ep; cleanSel.append(o); }); |
| } |
| } |
| |
| renderLogs(); |
| } |
| |
| function showModePanel(mode) { |
| $("panelWarp").style.display = mode === "warp" ? "block" : "none"; |
| $("panelTor").style.display = mode === "tor" ? "block" : "none"; |
| $("panelCustom").style.display = mode === "custom" ? "block" : "none"; |
| $("panelClean").style.display = mode === "clean" ? "block" : "none"; |
| } |
| |
| async function refresh(forceEgress = false) { |
| if (!api()) return; |
| try { |
| const s = await api().get_state(forceEgress); |
| renderState(s); |
| } catch (e) { |
| console.error(e); |
| } |
| } |
| |
| |
| async function runAction(btnOrInputId, fn, labelWhenBusy = null) { |
| const node = btnOrInputId ? $(btnOrInputId) : null; |
| const labelEl = node && node.tagName === "BUTTON" ? (node.querySelector(".lbl") || node) : null; |
| const origText = labelEl ? labelEl.textContent : null; |
| if (node) { |
| busyIds.add(btnOrInputId); |
| node.disabled = true; |
| if (labelWhenBusy && labelEl) labelEl.textContent = labelWhenBusy; |
| } |
| try { |
| const res = await fn(); |
| if (res && res.message) showToast(res.message, res.ok === false ? "error" : "success"); |
| await refresh(false); |
| return res; |
| } catch (err) { |
| showToast(friendlyError(err), "error"); |
| } finally { |
| if (node) { |
| busyIds.delete(btnOrInputId); |
| node.disabled = false; |
| if (origText !== null && labelEl) labelEl.textContent = origText; |
| } |
| } |
| } |
| |
| function confirmDialog(title, body, onConfirm, confirmLabel = null) { |
| $("modalTitle").textContent = title; |
| $("modalBody").textContent = body; |
| $("modalConfirm").textContent = confirmLabel || t("modal.confirm"); |
| $("modalBox").classList.add("danger"); |
| clearTimeout(closeModal._t); |
| $("modalBg").classList.remove("closing"); |
| $("modalBg").classList.add("show"); |
| $("modalConfirm").onclick = async () => { closeModal(); await onConfirm(); }; |
| $("modalCancel").onclick = closeModal; |
| $("modalBg").onclick = (e) => { if (e.target === $("modalBg")) closeModal(); }; |
| setTimeout(() => $("modalCancel").focus(), 0); |
| } |
| function closeModal() { |
| const bg = $("modalBg"); |
| if (!bg.classList.contains("show") || bg.classList.contains("closing")) return; |
| bg.classList.add("closing"); |
| closeModal._t = setTimeout(() => bg.classList.remove("show", "closing"), 140); |
| } |
| document.addEventListener("keydown", (e) => { |
| if (e.key === "Escape" && $("modalBg").classList.contains("show")) closeModal(); |
| }); |
| |
| |
| const tipEl = $("floatTip"); |
| let tipTimer = null; |
| |
| function findTipNode(target) { |
| return target && target.closest ? target.closest("[data-tip-title]") : null; |
| } |
| |
| const TIP_DELAY = 450; |
| const TIP_WARM = 600; |
| let tipNode = null; |
| let tipWarmUntil = 0; |
| let hideTimer = null; |
| |
| |
| function placeTip(node) { |
| const pad = 10, gap = 10; |
| const r = node.getBoundingClientRect(); |
| const w = tipEl.offsetWidth, h = tipEl.offsetHeight; |
| const below = r.bottom + gap + h + pad <= window.innerHeight - 34 || r.top - gap - h < pad; |
| const cx = r.left + r.width / 2; |
| const left = Math.min(Math.max(pad, cx - w / 2), window.innerWidth - w - pad); |
| const top = below ? r.bottom + gap : r.top - gap - h; |
| tipEl.classList.toggle("below", below); |
| tipEl.classList.toggle("above", !below); |
| tipEl.style.setProperty("--tx", Math.round(left) + "px"); |
| tipEl.style.setProperty("--ty", Math.round(top) + "px"); |
| tipEl.style.setProperty("--ax", Math.round(Math.min(Math.max(14, cx - left), w - 14)) + "px"); |
| } |
| |
| function fillTip(node) { |
| const tech = node.getAttribute("data-tip-tech") || ""; |
| $("floatTipTitle").textContent = node.getAttribute("data-tip-title"); |
| $("floatTipBody").textContent = node.getAttribute("data-tip-body"); |
| $("floatTipTechText").textContent = tech; |
| tipEl.classList.toggle("has-tech", !!tech); |
| } |
| |
| function setGuide(node) { |
| const title = node ? node.getAttribute("data-tip-title") : t("insp.title"); |
| if ($("inspTitle").textContent === title) return; |
| $("inspTitle").textContent = title; |
| $("inspBody").textContent = node ? node.getAttribute("data-tip-body") : ""; |
| replay($("inspTitle").parentElement, "swap", 300); |
| } |
| |
| function showTip(node, instant) { |
| clearTimeout(hideTimer); |
| if (tipNode === node) return; |
| clearTimeout(tipTimer); |
| tipNode = node; |
| const open = () => { |
| const glide = tipEl.classList.contains("show"); |
| tipEl.classList.toggle("glide", glide); |
| fillTip(node); |
| if (glide) { |
| placeTip(node); |
| } else { |
| |
| tipEl.style.transition = "none"; |
| placeTip(node); |
| void tipEl.offsetWidth; |
| tipEl.style.transition = ""; |
| } |
| tipEl.classList.add("show"); |
| }; |
| if (instant || Date.now() < tipWarmUntil || tipEl.classList.contains("show")) open(); |
| else tipTimer = setTimeout(open, TIP_DELAY); |
| } |
| |
| function hideTip(soon) { |
| clearTimeout(tipTimer); |
| if (!tipEl.classList.contains("show")) tipNode = null; |
| const go = () => { |
| if (tipEl.classList.contains("show")) tipWarmUntil = Date.now() + TIP_WARM; |
| tipEl.classList.remove("show", "glide"); |
| tipNode = null; |
| }; |
| clearTimeout(hideTimer); |
| if (soon) hideTimer = setTimeout(go, 80); |
| else go(); |
| } |
| |
| document.addEventListener("mouseover", (e) => { |
| const node = findTipNode(e.target); |
| if (node) { |
| setGuide(node); |
| showTip(node, false); |
| } else { |
| hideTip(true); |
| } |
| }); |
| document.addEventListener("mouseleave", () => { hideTip(false); setGuide(null); }); |
| |
| document.addEventListener("mousedown", () => { hideTip(false); tipWarmUntil = 0; }, true); |
| document.addEventListener("scroll", () => hideTip(false), true); |
| window.addEventListener("blur", () => hideTip(false)); |
| window.addEventListener("resize", () => hideTip(false)); |
| |
| document.addEventListener("focusin", (e) => { |
| const node = findTipNode(e.target); |
| if (node && e.target.matches(":focus-visible")) { setGuide(node); showTip(node, true); } |
| }); |
| document.addEventListener("focusout", () => hideTip(true)); |
| document.addEventListener("keydown", (e) => { if (e.key === "Escape") hideTip(false); }); |
| |
| |
| applyStrings(); |
| setView(storedView(), false); |
| selectTab(activeTab); |
| |
| document.querySelectorAll("[data-set-view]").forEach((b) => { b.onclick = () => setView(b.dataset.setView); }); |
| $("btnShowAdvanced").onclick = () => setView("advanced"); |
| document.querySelectorAll("[data-url]").forEach((a) => { |
| a.addEventListener("click", (e) => { |
| e.preventDefault(); |
| if (api()) api().open_external_url(a.dataset.url); |
| }); |
| }); |
| |
| $("btnRefresh").onclick = () => runAction("btnRefresh", () => refresh(true).then(() => ({ message: t("refreshed") }))); |
| $("btnFixAll").onclick = () => fixAll(); |
| |
| function pickMode(mode) { |
| activeModeTab = mode; |
| showModePanel(mode); |
| document.querySelectorAll(".mode-tab").forEach((tb) => tb.classList.toggle("active", tb.dataset.mode === mode)); |
| } |
| $("tabModeWarp").onclick = () => { |
| pickMode("warp"); |
| runAction("tabModeWarp", () => api().set_egress_mode("warp"), t("mode.switching")); |
| }; |
| $("tabModeTor").onclick = () => { |
| pickMode("tor"); |
| runAction("tabModeTor", () => api().set_egress_mode("tor"), t("mode.switching")); |
| }; |
| $("tabModeCustom").onclick = () => { |
| pickMode("custom"); |
| const addr = $("txtProxyAddr").value.trim() || "127.0.0.1:10808"; |
| const ptype = $("selProxyType").value; |
| runAction("tabModeCustom", () => api().set_egress_mode("custom", addr, ptype), t("mode.switching")); |
| }; |
| $("tabModeClean").onclick = () => pickMode("clean"); |
| |
| $("btnScopeIsolated").onclick = () => runAction("btnScopeIsolated", () => api().set_warp_scope("isolated"), t("scope.busyIso")); |
| $("btnScopeTun").onclick = () => runAction("btnScopeTun", () => api().set_warp_scope("tun"), t("scope.busyTun")); |
| |
| $("btnTorRotate").onclick = () => runAction("btnTorRotate", () => api().rotate_tor_circuit(), t("tor.busyRotate")); |
| $("btnTorToggleService").onclick = () => { |
| const isRunning = state && state.egress && state.egress.tor_running; |
| runAction("btnTorToggleService", () => api().toggle_tor_service(!isRunning), isRunning ? t("tor.busyStop") : t("tor.busyStart")); |
| }; |
| |
| $("txtProxyAddr").oninput = () => { $("txtProxyAddr").dataset.userEdited = "true"; }; |
| $("btnSaveCustomProxy").onclick = () => { |
| const addr = $("txtProxyAddr").value.trim() || "127.0.0.1:10808"; |
| const ptype = $("selProxyType").value; |
| runAction("btnSaveCustomProxy", () => api().set_egress_mode("custom", addr, ptype), t("custom.busySave")); |
| }; |
| $("btnRotateCustomProxy").onclick = () => runAction("btnRotateCustomProxy", () => api().rotate_custom_proxy(), t("custom.busyNext")); |
| |
| $("btnApplyCleanEndpoint").onclick = () => { |
| const ep = $("selCleanEndpoint").value; |
| if (!ep) return; |
| runAction("btnApplyCleanEndpoint", () => api().set_clean_endpoint(ep), t("clean.busyApply")); |
| }; |
| $("btnAutoHealEndpoint").onclick = () => runAction("btnAutoHealEndpoint", () => api().auto_heal_endpoint(), t("clean.busyHeal")); |
| $("btnResetCleanEndpoint").onclick = () => runAction("btnResetCleanEndpoint", () => api().reset_clean_endpoint(), t("clean.busyReset")); |
| $("btnTestCleanPing").onclick = () => { |
| const out = $("cleanPingResult"); |
| out.style.display = "block"; |
| out.textContent = t("clean.testing"); |
| runAction("btnTestCleanPing", () => api().test_clean_endpoints().then((res) => { |
| if (res && res.endpoints) { |
| out.textContent = res.endpoints.map((r) => `${r.endpoint} → ${r.latency ? r.latency + " ms" : t("clean.timeout")}`).join("\n"); |
| } else { |
| out.textContent = (res && res.message) || t("clean.done"); |
| } |
| return null; |
| })); |
| }; |
| |
| $("btnLaunchDesktop").onclick = () => runAction("btnLaunchDesktop", () => api().launch_desktop(), t("act.desktopBusy")); |
| $("btnLaunchCli").onclick = () => runAction("btnLaunchCli", () => api().launch_cli(), t("act.cliBusy")); |
| $("btnHop").onclick = () => runAction("btnHop", () => api().hop_now(), t("act.hopBusy")); |
| $("btnWarpToggle").onclick = () => { |
| const conn = state && state.warp && state.warp.connected; |
| runAction("btnWarpToggle", () => (conn ? api().warp_disconnect() : api().warp_connect()), conn ? t("btn.warpBusyOff") : t("btn.warpBusyOn")); |
| }; |
| $("btnDeepReset").onclick = () => { |
| confirmDialog(t("confirm.deep.title"), t("confirm.deep.body"), |
| () => runAction("btnDeepReset", () => api().deep_reset_identity(), t("btn.deepBusy")), t("confirm.deep.ok")); |
| }; |
| $("btnRepairWarp").onclick = () => runAction("btnRepairWarp", () => api().repair_warp_connection(), t("btn.repairBusy")); |
| $("btnFixService").onclick = () => runAction("btnFixService", () => api().fix_opencode_service(), t("btn.fixPortBusy")); |
| $("btnRerollEdge").onclick = () => runAction("btnRerollEdge", () => api().reroll_edge()); |
| $("edgeSelect").onchange = (e) => runAction("edgeSelect", () => api().set_edge_override(e.target.value)); |
| |
| $("chkKeeper").onchange = (e) => runAction("chkKeeper", () => api().toggle_worker("keeper", e.target.checked)); |
| $("chkGuard").onchange = (e) => runAction("chkGuard", () => api().toggle_worker("guard", e.target.checked)); |
| $("chkServiceProxy").onchange = (e) => runAction("chkServiceProxy", () => api().toggle_desktop_service_proxy(e.target.checked)); |
| $("chkFirewall").onchange = (e) => runAction("chkFirewall", () => api().toggle_firewall(e.target.checked)); |
| $("chkStrict").onchange = (e) => runAction("chkStrict", () => api().toggle_strict_mode(e.target.checked)); |
| $("chkAutoResume").onchange = (e) => runAction("chkAutoResume", () => api().toggle_auto_resume(e.target.checked)); |
| $("chkAutostart").onchange = (e) => runAction("chkAutostart", () => api().toggle_autostart(e.target.checked)); |
| |
| |
| const APP_SWITCHES = { |
| chkAppStartup: "start_with_windows", |
| chkCloseToTray: "close_to_tray", |
| chkNotifyProblems: "notify_problems", |
| chkNotifyHops: "notify_hops", |
| chkNotifyUpdates: "notify_updates", |
| chkDesktopBrand: "desktop_brand", |
| chkHideBanner: "hide_limit_banner", |
| chkAutoUpdate: "auto_update", |
| }; |
| async function loadAppSettings() { |
| if (!api() || !api().get_app_settings) return; |
| try { |
| const s = await api().get_app_settings(); |
| for (const [id, key] of Object.entries(APP_SWITCHES)) { |
| if (!busyIds.has(id)) $(id).checked = !!s[key]; |
| } |
| const tray = !!s.tray_available; |
| setTag($("trayTag"), tray ? t("app.trayOn") : t("app.trayOff"), tray ? "ok" : "warn"); |
| $("trayTag").setAttribute("data-tip-body", tray ? t("tip.trayTag")[1] : t("app.trayOffMsg")); |
| } catch (e) { |
| console.error(e); |
| } |
| } |
| for (const [id, key] of Object.entries(APP_SWITCHES)) { |
| $(id).onchange = (e) => |
| runAction(id, () => api().set_app_setting(key, e.target.checked)).then(loadAppSettings); |
| } |
| const NOTIFY_SAMPLES = ["info", "problem", "hop"]; |
| let notifySample = 0; |
| |
| let toldAboutUpdate = ""; |
| let lastPostKey = ""; |
| async function loadUpdateState() { |
| if (!api() || !api().get_update_state) return; |
| try { |
| const u = await api().get_update_state(); |
| const pending = !!(u && u.ready && u.can_install); |
| const post = u && u.post && typeof u.post === "object" && u.post.total ? u.post : null; |
| const recent = !!post && post.to === u.current && Date.now() / 1000 - Number(post.at || 0) < 86400; |
| lastPostKey = recent ? `openhop.update.${post.to}.${post.at}` : ""; |
| let showPost = false; |
| if (recent) { |
| try { showPost = localStorage.getItem(lastPostKey) !== "1"; } catch (e) { showPost = true; } |
| } |
| $("updateBar").hidden = !(pending || showPost); |
| $("btnApplyUpdate").hidden = !pending; |
| $("btnUpdateChecks").hidden = !showPost; |
| $("btnDismissUpdate").hidden = !showPost; |
| if (pending) { |
| $("updTitle").textContent = t("upd.title").replace("{v}", u.latest || ""); |
| $("updSub").textContent = t("upd.sub"); |
| if (toldAboutUpdate !== String(u.latest || "")) { |
| toldAboutUpdate = String(u.latest || ""); |
| showToast(t("upd.toast").replace("{v}", u.latest || ""), "success"); |
| } |
| } else if (showPost) { |
| $("updTitle").textContent = t("upd.done").replace("{v}", post.to || u.current); |
| $("updSub").textContent = post.ok |
| ? t("upd.allOk").replace("{n}", String(post.total || 0)) |
| : t("upd.some").replace("{n}", String(post.passed || 0)).replace("{total}", String(post.total || 0)); |
| } |
| } catch (e) { |
| console.error(e); |
| } |
| } |
| |
| window.focusUpdate = async (scroll = true) => { |
| await loadUpdateState(); |
| const bar = $("updateBar"); |
| if (bar.hidden) return; |
| if (scroll) { |
| const main = document.querySelector(".main"); |
| if (main) main.scrollTo({ top: 0, behavior: "smooth" }); |
| bar.scrollIntoView({ block: "nearest", behavior: "smooth" }); |
| } |
| bar.classList.remove("flash"); |
| void bar.offsetWidth; |
| bar.classList.add("flash"); |
| setTimeout(() => bar.classList.remove("flash"), 2600); |
| const btn = $("btnApplyUpdate"); |
| if (scroll && !btn.hidden) { |
| try { btn.focus({ preventScroll: true }); } catch (e) { } |
| } |
| }; |
| $("btnCheckUpdate").onclick = () => runAction("btnCheckUpdate", () => api().check_update()).then(loadUpdateState); |
| $("btnApplyUpdate").onclick = () => runAction("btnApplyUpdate", () => api().apply_update(), t("upd.restarting")); |
| $("btnUpdateChecks").onclick = () => runAction("btnUpdateChecks", () => api().run_update_checks()).then(loadUpdateState); |
| $("btnDismissUpdate").onclick = () => { |
| if (lastPostKey) { |
| try { localStorage.setItem(lastPostKey, "1"); } catch (e) { } |
| } |
| $("updateBar").hidden = true; |
| }; |
| |
| $("btnTestNotify").onclick = () => { |
| const kind = NOTIFY_SAMPLES[notifySample++ % NOTIFY_SAMPLES.length]; |
| runAction("btnTestNotify", () => api().test_notification(kind)); |
| }; |
| $("btnQuitApp").onclick = () => |
| confirmDialog(t("confirm.quit.title"), t("confirm.quit.body"), () => api().quit_app(), t("confirm.quit.ok")); |
| |
| $("cardEgress").onclick = () => state && state.warp.egress_v6 && api().copy_text(state.warp.egress_v6).then((r) => showToast(r.message)); |
| $("cardAdapter").onclick = () => state && state.warp.adapter_v6 && api().copy_text(state.warp.adapter_v6).then((r) => showToast(r.message)); |
| |
| document.querySelectorAll(".tab").forEach((tab) => { |
| tab.onclick = () => selectTab(tab.getAttribute("data-tab")); |
| }); |
| |
| $("btnClearBlacklist").onclick = () => runAction("btnClearBlacklist", () => api().clear_blacklist()); |
| $("btnCopyLog").onclick = () => api().copy_text($("logBox").innerText).then((r) => showToast(r.message)); |
| $("btnOpenFolder").onclick = () => api().open_logs_folder(); |
| $("btnCopyDiag").onclick = () => state && api().copy_text(JSON.stringify(state, null, 2)).then(() => showToast(t("diag.copied"), "success")); |
| $("btnInstallRepair").onclick = () => runAction("btnInstallRepair", () => api().install_or_repair(), t("btn.installBusy")); |
| $("btnUninstall").onclick = () => { |
| confirmDialog(t("confirm.uninstall.title"), t("confirm.uninstall.body"), |
| () => runAction("btnUninstall", () => api().uninstall_all(), t("btn.uninstallBusy")), t("confirm.uninstall.ok")); |
| }; |
| |
| |
| (function initWindowFrame() { |
| const api = () => (window.pywebview && window.pywebview.api) || null; |
| let dragging = false, inFlight = false, again = false; |
| |
| function syncMax(res) { |
| const maxed = !!(res && res.maximized); |
| document.body.classList.toggle("maximized", maxed); |
| const b = $("winMax"); |
| b.setAttribute("data-wicon", maxed ? "restore" : "max"); |
| b.title = maxed ? t("win.restore") : t("win.max"); |
| } |
| |
| function pump() { |
| if (!dragging || !api()) return; |
| if (inFlight) { again = true; return; } |
| inFlight = true; |
| Promise.resolve(api().win_step()).catch(() => {}).finally(() => { |
| inFlight = false; |
| if (again && dragging) { again = false; pump(); } |
| }); |
| } |
| |
| function startDrag(kind, e) { |
| if (e.button !== 0 || !api()) return; |
| e.preventDefault(); |
| dragging = true; |
| document.body.classList.add("window-dragging"); |
| api().win_begin(kind).then(syncMax).catch(() => {}); |
| const onMove = () => requestAnimationFrame(pump); |
| const onUp = () => { |
| dragging = false; |
| document.body.classList.remove("window-dragging"); |
| window.removeEventListener("mousemove", onMove); |
| window.removeEventListener("mouseup", onUp); |
| api().win_end().then(syncMax).catch(() => {}); |
| }; |
| window.addEventListener("mousemove", onMove); |
| window.addEventListener("mouseup", onUp); |
| } |
| |
| const bar = document.querySelector(".topbar"); |
| const interactive = (el) => el.closest("button, a, input, select, .win-controls, .no-drag"); |
| bar.addEventListener("mousedown", (e) => { if (!interactive(e.target)) startDrag("move", e); }); |
| bar.addEventListener("dblclick", (e) => { |
| if (!interactive(e.target) && api()) api().win_toggle_maximize().then(syncMax); |
| }); |
| document.querySelectorAll(".rz").forEach((el) => |
| el.addEventListener("mousedown", (e) => startDrag(el.getAttribute("data-edge"), e))); |
| |
| $("winMin").onclick = () => api() && api().win_minimize(); |
| $("winMax").onclick = () => api() && api().win_toggle_maximize().then(syncMax); |
| $("winClose").onclick = () => api() && api().win_close(); |
| })(); |
| |
| |
| (function initReport() { |
| const bg = $("reportBg"); |
| let previewSeq = 0; |
| let sending = false; |
| |
| function fmtBytes(n) { |
| n = Number(n) || 0; |
| if (n < 1024) return n + " B"; |
| if (n < 1024 * 1024) return Math.round(n / 1024) + " KB"; |
| return (n / 1048576).toFixed(1) + " MB"; |
| } |
| function setError(msg) { |
| const box = $("reportError"); |
| box.textContent = msg || ""; |
| box.hidden = !msg; |
| } |
| function errorText(res) { |
| const code = (res && res.code) || "unknown"; |
| if ((code === "rate_limited" || code === "too_large" || code === "rejected") && res.message) return res.message; |
| const key = "report.err." + code; |
| const msg = t(key); |
| return msg === key ? t("report.err.unknown") : msg; |
| } |
| function renderFiles(res) { |
| const list = $("reportFileList"); |
| list.textContent = ""; |
| const files = (res && res.files) || []; |
| files.forEach((f, i) => { |
| const li = el("li"); |
| li.appendChild(el("span", "fname", f.name)); |
| li.appendChild(el("span", "fsize", fmtBytes(f.size))); |
| const rm = el("button", "btn btn-xs btn-ghost", t("report.remove")); |
| rm.onclick = async () => { if (api()) renderFiles(await api().report_remove_file(i)); }; |
| li.appendChild(rm); |
| list.appendChild(li); |
| }); |
| const note = $("reportFileNote"); |
| const skipped = res && res.skipped ? t("report.skipped." + res.skipped) + " " : ""; |
| note.textContent = files.length || skipped ? skipped + (files.length ? t("report.imagesNote") : "") : ""; |
| note.hidden = !note.textContent; |
| } |
| async function loadPreview(refresh) { |
| const seq = ++previewSeq; |
| $("reportPreviewText").textContent = t("report.collecting"); |
| $("reportSize").textContent = ""; |
| if (!api()) return; |
| try { |
| const res = await api().report_preview(!!refresh); |
| if (seq !== previewSeq) return; |
| if (res && res.ok) { |
| $("reportPreviewText").textContent = res.text; |
| $("reportSize").textContent = fmtBytes(res.size); |
| } else { |
| $("reportPreviewText").textContent = t("report.collectFail"); |
| } |
| } catch (e) { |
| if (seq === previewSeq) $("reportPreviewText").textContent = t("report.collectFail"); |
| } |
| } |
| function showForm(done) { |
| $("reportForm").hidden = !!done; |
| $("reportDone").hidden = !done; |
| $("reportSend").hidden = !!done; |
| $("reportCancel").textContent = done ? t("report.close") : t("report.cancel"); |
| } |
| function openReport() { |
| if (sending) { clearTimeout(closeReport._t); bg.classList.remove("closing"); bg.classList.add("show"); return; } |
| showForm(false); |
| setError(""); |
| $("reportPreview").open = false; |
| clearTimeout(closeReport._t); |
| bg.classList.remove("closing"); |
| bg.classList.add("show"); |
| if (api() && api().report_clear_files) api().report_clear_files().then(renderFiles).catch(() => {}); |
| else renderFiles(null); |
| loadPreview(true); |
| setTimeout(() => $("reportDesc").focus(), 0); |
| } |
| function closeReport() { |
| if (!bg.classList.contains("show") || bg.classList.contains("closing")) return; |
| bg.classList.add("closing"); |
| closeReport._t = setTimeout(() => bg.classList.remove("show", "closing"), 180); |
| } |
| async function sendReport() { |
| if (sending || !api()) return; |
| sending = true; |
| setError(""); |
| const btn = $("reportSend"); |
| const lbl = btn.querySelector(".lbl"); |
| btn.disabled = true; |
| $("reportAttach").disabled = true; |
| lbl.textContent = t("report.sending"); |
| let res = null; |
| try { |
| res = await api().send_report($("reportDesc").value, $("reportContact").value, $("reportWebsite").value); |
| } catch (e) { |
| res = { ok: false, code: "unknown" }; |
| } finally { |
| sending = false; |
| btn.disabled = false; |
| $("reportAttach").disabled = false; |
| lbl.textContent = t("report.send"); |
| } |
| const visible = bg.classList.contains("show") && !bg.classList.contains("closing"); |
| if (res && res.ok) { |
| $("reportDesc").value = ""; |
| $("reportContact").value = ""; |
| $("reportDoneSub").textContent = t("report.sentSub") + (res.dry_run ? " " + t("report.sentDry") : ""); |
| if (visible) showForm(true); else showToast(t("report.sentToast"), "success"); |
| } else if (visible) { |
| setError(errorText(res)); |
| } else { |
| showToast(errorText(res), "error"); |
| } |
| } |
| |
| $("btnReport").onclick = openReport; |
| $("reportCancel").onclick = closeReport; |
| $("reportSend").onclick = sendReport; |
| $("reportAttach").onclick = async () => { |
| if (!api()) return; |
| setError(""); |
| try { |
| const res = await api().report_pick_files(); |
| renderFiles(res); |
| if (res && res.ok === false && res.code) setError(errorText(res)); |
| } catch (e) { |
| setError(t("report.err.dialog")); |
| } |
| }; |
| bg.addEventListener("mousedown", (e) => { if (e.target === bg) closeReport(); }); |
| document.addEventListener("keydown", (e) => { |
| if (e.key === "Escape" && bg.classList.contains("show")) closeReport(); |
| }); |
| window.__openReport = openReport; |
| })(); |
| |
| |
| initGliders(); |
| numberStagger(); |
| document.body.classList.add("intro"); |
| setTimeout(() => document.body.classList.remove("intro"), 1800); |
| |
| let isPollerStarted = false; |
| function startLifecycle() { |
| if (isPollerStarted) return; |
| isPollerStarted = true; |
| refresh(true); |
| loadTokenStats(); |
| loadAppSettings(); |
| loadUpdateState(); |
| setInterval(loadAppSettings, 30000); |
| setInterval(loadUpdateState, 60000); |
| setInterval(loadTokenStats, 45000); |
| setInterval(() => refresh(false), 3000); |
| } |
| |
| |
| if (window.pywebview && window.pywebview.api) { |
| startLifecycle(); |
| } else { |
| window.addEventListener("pywebviewready", startLifecycle); |
| let attempts = 0; |
| const pollTimer = setInterval(() => { |
| attempts++; |
| if (window.pywebview && window.pywebview.api) { |
| clearInterval(pollTimer); |
| startLifecycle(); |
| } else if (attempts >= 15) { |
| clearInterval(pollTimer); |
| } |
| }, 200); |
| } |
| </script> |
| </body> |
| </html> |