Spaces:
Running
Running
the vpn is run using this script in terminal ubuntu:
Browse files'/home/hossein/Files/psiphon/psiphon-tunnel-core-x86_64 -formatNotices -dataRootDirectory /home/hossein/Files/psiphon -config /home/hossein/Files/psiphon/psiphon.config'
- README.md +8 -5
- components/log-console.js +145 -0
- components/power-button.js +171 -0
- components/sidebar.js +232 -0
- components/status-card.js +146 -0
- index.html +206 -19
- script.js +185 -0
- style.css +78 -19
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Psiphon Pilot
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Psiphon Pilot π
|
| 3 |
+
colorFrom: yellow
|
| 4 |
+
colorTo: gray
|
| 5 |
+
emoji: π³
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
components/log-console.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class LogConsole extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
this.attachShadow({ mode: 'open' });
|
| 5 |
+
this.entries = [];
|
| 6 |
+
this.maxEntries = 100;
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
connectedCallback() {
|
| 10 |
+
this.render();
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
render() {
|
| 14 |
+
this.shadowRoot.innerHTML = `
|
| 15 |
+
<style>
|
| 16 |
+
:host {
|
| 17 |
+
display: flex;
|
| 18 |
+
flex-direction: column;
|
| 19 |
+
flex: 1;
|
| 20 |
+
overflow: hidden;
|
| 21 |
+
background: #0f172a;
|
| 22 |
+
font-family: 'JetBrains Mono', 'Fira Code', monospace;
|
| 23 |
+
font-size: 0.875rem;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.console-content {
|
| 27 |
+
flex: 1;
|
| 28 |
+
overflow-y: auto;
|
| 29 |
+
padding: 16px;
|
| 30 |
+
display: flex;
|
| 31 |
+
flex-direction: column;
|
| 32 |
+
gap: 4px;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
.entry {
|
| 36 |
+
display: flex;
|
| 37 |
+
gap: 12px;
|
| 38 |
+
line-height: 1.5;
|
| 39 |
+
animation: fadeIn 0.2s ease;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
@keyframes fadeIn {
|
| 43 |
+
from { opacity: 0; transform: translateX(-10px); }
|
| 44 |
+
to { opacity: 1; transform: translateX(0); }
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
.timestamp {
|
| 48 |
+
color: #6b7280;
|
| 49 |
+
user-select: none;
|
| 50 |
+
white-space: nowrap;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.message {
|
| 54 |
+
color: #e5e7eb;
|
| 55 |
+
word-break: break-all;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.type-system { color: #60a5fa; }
|
| 59 |
+
.type-info { color: #34d399; }
|
| 60 |
+
.type-success { color: #10b981; }
|
| 61 |
+
.type-warning { color: #fbbf24; }
|
| 62 |
+
.type-error { color: #ef4444; }
|
| 63 |
+
.type-process { color: #a78bfa; }
|
| 64 |
+
.type-network { color: #22d3ee; }
|
| 65 |
+
.type-debug { color: #9ca3af; font-style: italic; }
|
| 66 |
+
|
| 67 |
+
.empty-state {
|
| 68 |
+
color: #4b5563;
|
| 69 |
+
text-align: center;
|
| 70 |
+
padding: 40px;
|
| 71 |
+
font-style: italic;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.scroll-indicator {
|
| 75 |
+
position: absolute;
|
| 76 |
+
bottom: 0;
|
| 77 |
+
left: 0;
|
| 78 |
+
right: 0;
|
| 79 |
+
height: 40px;
|
| 80 |
+
background: linear-gradient(transparent, #0f172a);
|
| 81 |
+
pointer-events: none;
|
| 82 |
+
}
|
| 83 |
+
</style>
|
| 84 |
+
|
| 85 |
+
<div class="console-content" id="consoleContent">
|
| 86 |
+
<div class="empty-state">Waiting for process output...</div>
|
| 87 |
+
</div>
|
| 88 |
+
`;
|
| 89 |
+
|
| 90 |
+
this.contentEl = this.shadowRoot.getElementById('consoleContent');
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
addEntry(text, type = 'info') {
|
| 94 |
+
// Remove empty state if present
|
| 95 |
+
if (this.entries.length === 0) {
|
| 96 |
+
this.contentEl.innerHTML = '';
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
const entry = document.createElement('div');
|
| 100 |
+
entry.className = 'entry';
|
| 101 |
+
|
| 102 |
+
const typeClass = `type-${type}`;
|
| 103 |
+
|
| 104 |
+
// Parse timestamp if included in text
|
| 105 |
+
let displayText = text;
|
| 106 |
+
let timestamp = '';
|
| 107 |
+
|
| 108 |
+
if (text.startsWith('[') && text.includes(']')) {
|
| 109 |
+
const match = text.match(/\[(.*?)\](.*)/);
|
| 110 |
+
if (match) {
|
| 111 |
+
timestamp = `[${match[1]}]`;
|
| 112 |
+
displayText = match[2].trim();
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
entry.innerHTML = `
|
| 117 |
+
<span class="timestamp ${typeClass}">${timestamp || new Date().toLocaleTimeString('en-US', { hour12: false })}</span>
|
| 118 |
+
<span class="message ${typeClass}">${this.escapeHtml(displayText)}</span>
|
| 119 |
+
`;
|
| 120 |
+
|
| 121 |
+
this.contentEl.appendChild(entry);
|
| 122 |
+
this.entries.push(entry);
|
| 123 |
+
|
| 124 |
+
// Limit entries
|
| 125 |
+
if (this.entries.length > this.maxEntries) {
|
| 126 |
+
this.entries.shift().remove();
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
// Auto-scroll to bottom
|
| 130 |
+
this.contentEl.scrollTop = this.contentEl.scrollHeight;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
clear() {
|
| 134 |
+
this.entries = [];
|
| 135 |
+
this.contentEl.innerHTML = '<div class="empty-state">Console cleared. Waiting for process output...</div>';
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
escapeHtml(text) {
|
| 139 |
+
const div = document.createElement('div');
|
| 140 |
+
div.textContent = text;
|
| 141 |
+
return div.innerHTML;
|
| 142 |
+
}
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
customElements.define('log-console', LogConsole);
|
components/power-button.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class PowerButton extends HTMLElement {
|
| 2 |
+
static get observedAttributes() {
|
| 3 |
+
return ['active'];
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
constructor() {
|
| 7 |
+
super();
|
| 8 |
+
this.attachShadow({ mode: 'open' });
|
| 9 |
+
this.active = false;
|
| 10 |
+
this.render();
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
attributeChangedCallback(name, oldValue, newValue) {
|
| 14 |
+
if (name === 'active') {
|
| 15 |
+
this.active = newValue === 'true';
|
| 16 |
+
this.updateState();
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
render() {
|
| 21 |
+
this.shadowRoot.innerHTML = `
|
| 22 |
+
<style>
|
| 23 |
+
:host {
|
| 24 |
+
display: block;
|
| 25 |
+
position: relative;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
.button-wrapper {
|
| 29 |
+
position: relative;
|
| 30 |
+
width: 140px;
|
| 31 |
+
height: 140px;
|
| 32 |
+
display: flex;
|
| 33 |
+
align-items: center;
|
| 34 |
+
justify-content: center;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.ripple {
|
| 38 |
+
position: absolute;
|
| 39 |
+
inset: 0;
|
| 40 |
+
border-radius: 50%;
|
| 41 |
+
border: 2px solid #06b6d4;
|
| 42 |
+
opacity: 0;
|
| 43 |
+
transform: scale(1);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.ripple.active {
|
| 47 |
+
animation: ripple 2s linear infinite;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
@keyframes ripple {
|
| 51 |
+
0% { transform: scale(1); opacity: 0.5; }
|
| 52 |
+
100% { transform: scale(1.5); opacity: 0; }
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
.button {
|
| 56 |
+
width: 100px;
|
| 57 |
+
height: 100px;
|
| 58 |
+
border-radius: 50%;
|
| 59 |
+
border: none;
|
| 60 |
+
background: linear-gradient(145deg, #1f2937, #111827);
|
| 61 |
+
box-shadow:
|
| 62 |
+
20px 20px 40px #0b0f19,
|
| 63 |
+
-20px -20px 40px #27354f,
|
| 64 |
+
inset 0 0 0 1px rgba(255,255,255,0.1);
|
| 65 |
+
cursor: pointer;
|
| 66 |
+
display: flex;
|
| 67 |
+
align-items: center;
|
| 68 |
+
justify-content: center;
|
| 69 |
+
transition: all 0.3s ease;
|
| 70 |
+
position: relative;
|
| 71 |
+
z-index: 10;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.button:hover {
|
| 75 |
+
transform: scale(1.05);
|
| 76 |
+
box-shadow:
|
| 77 |
+
25px 25px 50px #0b0f19,
|
| 78 |
+
-25px -25px 50px #27354f,
|
| 79 |
+
inset 0 0 0 1px rgba(255,255,255,0.2);
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.button:active {
|
| 83 |
+
transform: scale(0.95);
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
.button.active {
|
| 87 |
+
background: linear-gradient(145deg, #0891b2, #06b6d4);
|
| 88 |
+
box-shadow:
|
| 89 |
+
0 0 40px rgba(6, 182, 212, 0.5),
|
| 90 |
+
inset 0 0 20px rgba(255,255,255,0.2);
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.button.active svg {
|
| 94 |
+
color: white;
|
| 95 |
+
filter: drop-shadow(0 0 10px rgba(255,255,255,0.8));
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
.icon {
|
| 99 |
+
width: 40px;
|
| 100 |
+
height: 40px;
|
| 101 |
+
color: #6b7280;
|
| 102 |
+
transition: all 0.3s ease;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.button:hover .icon {
|
| 106 |
+
color: #9ca3af;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.status-ring {
|
| 110 |
+
position: absolute;
|
| 111 |
+
inset: 10px;
|
| 112 |
+
border-radius: 50%;
|
| 113 |
+
border: 3px solid transparent;
|
| 114 |
+
border-top-color: #06b6d4;
|
| 115 |
+
opacity: 0;
|
| 116 |
+
transition: opacity 0.3s;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
.button.active + .status-ring {
|
| 120 |
+
opacity: 1;
|
| 121 |
+
animation: spin 1s linear infinite;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
@keyframes spin {
|
| 125 |
+
to { transform: rotate(360deg); }
|
| 126 |
+
}
|
| 127 |
+
</style>
|
| 128 |
+
|
| 129 |
+
<div class="button-wrapper">
|
| 130 |
+
<div class="ripple" id="ripple1"></div>
|
| 131 |
+
<div class="ripple" id="ripple2" style="animation-delay: 0.5s"></div>
|
| 132 |
+
<div class="ripple" id="ripple3" style="animation-delay: 1s"></div>
|
| 133 |
+
|
| 134 |
+
<button class="button" id="powerBtn">
|
| 135 |
+
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
| 136 |
+
<path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path>
|
| 137 |
+
<line x1="12" y1="2" x2="12" y2="12"></line>
|
| 138 |
+
</svg>
|
| 139 |
+
</button>
|
| 140 |
+
|
| 141 |
+
<div class="status-ring"></div>
|
| 142 |
+
</div>
|
| 143 |
+
`;
|
| 144 |
+
|
| 145 |
+
this.button = this.shadowRoot.getElementById('powerBtn');
|
| 146 |
+
this.ripples = this.shadowRoot.querySelectorAll('.ripple');
|
| 147 |
+
|
| 148 |
+
this.button.addEventListener('click', () => {
|
| 149 |
+
this.dispatchEvent(new CustomEvent('power-toggle', {
|
| 150 |
+
bubbles: true,
|
| 151 |
+
composed: true
|
| 152 |
+
}));
|
| 153 |
+
});
|
| 154 |
+
|
| 155 |
+
this.updateState();
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
updateState() {
|
| 159 |
+
if (!this.button) return;
|
| 160 |
+
|
| 161 |
+
if (this.active) {
|
| 162 |
+
this.button.classList.add('active');
|
| 163 |
+
this.ripples.forEach(r => r.classList.add('active'));
|
| 164 |
+
} else {
|
| 165 |
+
this.button.classList.remove('active');
|
| 166 |
+
this.ripples.forEach(r => r.classList.remove('active'));
|
| 167 |
+
}
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
customElements.define('power-button', PowerButton);
|
components/sidebar.js
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class Sidebar extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
this.attachShadow({ mode: 'open' });
|
| 5 |
+
this.render();
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
render() {
|
| 9 |
+
this.shadowRoot.innerHTML = `
|
| 10 |
+
<style>
|
| 11 |
+
:host {
|
| 12 |
+
display: block;
|
| 13 |
+
width: 280px;
|
| 14 |
+
height: 100%;
|
| 15 |
+
background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
|
| 16 |
+
border-right: 1px solid #1f2937;
|
| 17 |
+
font-family: 'Inter', system-ui, sans-serif;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
.sidebar-header {
|
| 21 |
+
height: 64px;
|
| 22 |
+
display: flex;
|
| 23 |
+
align-items: center;
|
| 24 |
+
padding: 0 24px;
|
| 25 |
+
border-bottom: 1px solid #1f2937;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
.logo {
|
| 29 |
+
display: flex;
|
| 30 |
+
align-items: center;
|
| 31 |
+
gap: 12px;
|
| 32 |
+
text-decoration: none;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
.logo-icon {
|
| 36 |
+
width: 32px;
|
| 37 |
+
height: 32px;
|
| 38 |
+
background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
|
| 39 |
+
border-radius: 8px;
|
| 40 |
+
display: flex;
|
| 41 |
+
align-items: center;
|
| 42 |
+
justify-content: center;
|
| 43 |
+
color: white;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.logo-text {
|
| 47 |
+
font-size: 1.25rem;
|
| 48 |
+
font-weight: 700;
|
| 49 |
+
background: linear-gradient(to right, #fff, #9ca3af);
|
| 50 |
+
-webkit-background-clip: text;
|
| 51 |
+
-webkit-text-fill-color: transparent;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
nav {
|
| 55 |
+
padding: 24px 16px;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.nav-section {
|
| 59 |
+
margin-bottom: 32px;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.nav-label {
|
| 63 |
+
font-size: 0.75rem;
|
| 64 |
+
text-transform: uppercase;
|
| 65 |
+
letter-spacing: 0.05em;
|
| 66 |
+
color: #6b7280;
|
| 67 |
+
margin-bottom: 12px;
|
| 68 |
+
padding-left: 12px;
|
| 69 |
+
font-weight: 600;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
.nav-item {
|
| 73 |
+
display: flex;
|
| 74 |
+
align-items: center;
|
| 75 |
+
gap: 12px;
|
| 76 |
+
padding: 12px;
|
| 77 |
+
color: #9ca3af;
|
| 78 |
+
text-decoration: none;
|
| 79 |
+
border-radius: 8px;
|
| 80 |
+
transition: all 0.2s;
|
| 81 |
+
margin-bottom: 4px;
|
| 82 |
+
cursor: pointer;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
.nav-item:hover {
|
| 86 |
+
background: rgba(99, 102, 241, 0.1);
|
| 87 |
+
color: #fff;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
.nav-item.active {
|
| 91 |
+
background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, transparent 100%);
|
| 92 |
+
color: #6366f1;
|
| 93 |
+
border-left: 3px solid #6366f1;
|
| 94 |
+
margin-left: -3px;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
.nav-item i {
|
| 98 |
+
width: 20px;
|
| 99 |
+
height: 20px;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
.status-indicator {
|
| 103 |
+
position: absolute;
|
| 104 |
+
bottom: 24px;
|
| 105 |
+
left: 24px;
|
| 106 |
+
right: 24px;
|
| 107 |
+
padding: 16px;
|
| 108 |
+
background: rgba(17, 24, 39, 0.8);
|
| 109 |
+
border: 1px solid #1f2937;
|
| 110 |
+
border-radius: 12px;
|
| 111 |
+
backdrop-filter: blur(10px);
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
.status-row {
|
| 115 |
+
display: flex;
|
| 116 |
+
align-items: center;
|
| 117 |
+
justify-content: space-between;
|
| 118 |
+
margin-bottom: 8px;
|
| 119 |
+
font-size: 0.875rem;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
.status-row:last-child {
|
| 123 |
+
margin-bottom: 0;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
.status-label {
|
| 127 |
+
color: #6b7280;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
.status-value {
|
| 131 |
+
color: #10b981;
|
| 132 |
+
font-weight: 500;
|
| 133 |
+
display: flex;
|
| 134 |
+
align-items: center;
|
| 135 |
+
gap: 6px;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
.dot {
|
| 139 |
+
width: 6px;
|
| 140 |
+
height: 6px;
|
| 141 |
+
background: #10b981;
|
| 142 |
+
border-radius: 50%;
|
| 143 |
+
box-shadow: 0 0 8px #10b981;
|
| 144 |
+
}
|
| 145 |
+
</style>
|
| 146 |
+
|
| 147 |
+
<div class="sidebar-header">
|
| 148 |
+
<a href="#" class="logo">
|
| 149 |
+
<div class="logo-icon">
|
| 150 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 151 |
+
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
|
| 152 |
+
</svg>
|
| 153 |
+
</div>
|
| 154 |
+
<span class="logo-text">Psiphon Pilot</span>
|
| 155 |
+
</a>
|
| 156 |
+
</div>
|
| 157 |
+
|
| 158 |
+
<nav>
|
| 159 |
+
<div class="nav-section">
|
| 160 |
+
<div class="nav-label">Main</div>
|
| 161 |
+
<a href="#" class="nav-item active">
|
| 162 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 163 |
+
<rect x="3" y="3" width="7" height="7"></rect>
|
| 164 |
+
<rect x="14" y="3" width="7" height="7"></rect>
|
| 165 |
+
<rect x="14" y="14" width="7" height="7"></rect>
|
| 166 |
+
<rect x="3" y="14" width="7" height="7"></rect>
|
| 167 |
+
</svg>
|
| 168 |
+
Dashboard
|
| 169 |
+
</a>
|
| 170 |
+
<a href="#" class="nav-item">
|
| 171 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 172 |
+
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path>
|
| 173 |
+
</svg>
|
| 174 |
+
Network
|
| 175 |
+
</a>
|
| 176 |
+
<a href="#" class="nav-item">
|
| 177 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 178 |
+
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
| 179 |
+
<polyline points="14 2 14 8 20 8"></polyline>
|
| 180 |
+
<line x1="16" y1="13" x2="8" y2="13"></line>
|
| 181 |
+
<line x1="16" y1="17" x2="8" y2="17"></line>
|
| 182 |
+
<polyline points="10 9 9 9 8 9"></polyline>
|
| 183 |
+
</svg>
|
| 184 |
+
Logs
|
| 185 |
+
</a>
|
| 186 |
+
</div>
|
| 187 |
+
|
| 188 |
+
<div class="nav-section">
|
| 189 |
+
<div class="nav-label">Settings</div>
|
| 190 |
+
<a href="#" class="nav-item">
|
| 191 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 192 |
+
<circle cx="12" cy="12" r="3"></circle>
|
| 193 |
+
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
|
| 194 |
+
</svg>
|
| 195 |
+
Configuration
|
| 196 |
+
</a>
|
| 197 |
+
<a href="#" class="nav-item">
|
| 198 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 199 |
+
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
|
| 200 |
+
</svg>
|
| 201 |
+
Security
|
| 202 |
+
</a>
|
| 203 |
+
</div>
|
| 204 |
+
</nav>
|
| 205 |
+
|
| 206 |
+
<div class="status-indicator">
|
| 207 |
+
<div class="status-row">
|
| 208 |
+
<span class="status-label">Core Version</span>
|
| 209 |
+
<span style="color: #9ca3af; font-weight: 500;">v2.0.15</span>
|
| 210 |
+
</div>
|
| 211 |
+
<div class="status-row">
|
| 212 |
+
<span class="status-label">System Status</span>
|
| 213 |
+
<span class="status-value">
|
| 214 |
+
<span class="dot"></span>
|
| 215 |
+
Active
|
| 216 |
+
</span>
|
| 217 |
+
</div>
|
| 218 |
+
</div>
|
| 219 |
+
`;
|
| 220 |
+
|
| 221 |
+
// Add click handlers for navigation
|
| 222 |
+
const navItems = this.shadowRoot.querySelectorAll('.nav-item');
|
| 223 |
+
navItems.forEach(item => {
|
| 224 |
+
item.addEventListener('click', (e) => {
|
| 225 |
+
navItems.forEach(n => n.classList.remove('active'));
|
| 226 |
+
item.classList.add('active');
|
| 227 |
+
});
|
| 228 |
+
});
|
| 229 |
+
}
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
customElements.define('vpn-sidebar', Sidebar);
|
components/status-card.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class StatusCard extends HTMLElement {
|
| 2 |
+
static get observedAttributes() {
|
| 3 |
+
return ['value', 'label', 'icon', 'color'];
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
constructor() {
|
| 7 |
+
super();
|
| 8 |
+
this.attachShadow({ mode: 'open' });
|
| 9 |
+
this.render();
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
attributeChangedCallback(name, oldValue, newValue) {
|
| 13 |
+
if (oldValue !== newValue) {
|
| 14 |
+
this.render();
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
getColorClasses(color) {
|
| 19 |
+
const colors = {
|
| 20 |
+
primary: { bg: 'bg-primary-500/10', text: 'text-primary-400', border: 'border-primary-500/20' },
|
| 21 |
+
secondary: { bg: 'bg-secondary-500/10', text: 'text-secondary-400', border: 'border-secondary-500/20' },
|
| 22 |
+
green: { bg: 'bg-green-500/10', text: 'text-green-400', border: 'border-green-500/20' },
|
| 23 |
+
yellow: { bg: 'bg-yellow-500/10', text: 'text-yellow-400', border: 'border-yellow-500/20' },
|
| 24 |
+
purple: { bg: 'bg-purple-500/10', text: 'text-purple-400', border: 'border-purple-500/20' },
|
| 25 |
+
red: { bg: 'bg-red-500/10', text: 'text-red-400', border: 'border-red-500/20' }
|
| 26 |
+
};
|
| 27 |
+
return colors[this.getAttribute('color')] || colors.primary;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
getIconSvg(iconName) {
|
| 31 |
+
const icons = {
|
| 32 |
+
download: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/>',
|
| 33 |
+
upload: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/>',
|
| 34 |
+
clock: '<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>',
|
| 35 |
+
server: '<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/><rect x="2" y="14" width="20" height="8" rx="2" ry="2"/><line x1="6" y1="6" x2="6.01" y2="6"/><line x1="6" y1="18" x2="6.01" y2="18"/>'
|
| 36 |
+
};
|
| 37 |
+
return icons[iconName] || icons.server;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
render() {
|
| 41 |
+
const color = this.getColorClasses();
|
| 42 |
+
const icon = this.getIconSvg(this.getAttribute('icon'));
|
| 43 |
+
const value = this.getAttribute('value') || '--';
|
| 44 |
+
const label = this.getAttribute('label') || 'Status';
|
| 45 |
+
|
| 46 |
+
this.shadowRoot.innerHTML = `
|
| 47 |
+
<style>
|
| 48 |
+
:host {
|
| 49 |
+
display: block;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
.card {
|
| 53 |
+
background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
|
| 54 |
+
border: 1px solid ${color.border.replace('border-', '').replace('/20', '')}33;
|
| 55 |
+
border-radius: 16px;
|
| 56 |
+
padding: 24px;
|
| 57 |
+
height: 100%;
|
| 58 |
+
display: flex;
|
| 59 |
+
flex-direction: column;
|
| 60 |
+
justify-content: space-between;
|
| 61 |
+
transition: all 0.3s ease;
|
| 62 |
+
position: relative;
|
| 63 |
+
overflow: hidden;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
.card::before {
|
| 67 |
+
content: '';
|
| 68 |
+
position: absolute;
|
| 69 |
+
top: 0;
|
| 70 |
+
left: 0;
|
| 71 |
+
right: 0;
|
| 72 |
+
height: 1px;
|
| 73 |
+
background: linear-gradient(90deg, transparent, ${color.text.replace('text-', '')}66, transparent);
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.card:hover {
|
| 77 |
+
transform: translateY(-2px);
|
| 78 |
+
box-shadow: 0 10px 30px -10px ${color.text.replace('text-', '')}1a;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.icon-wrapper {
|
| 82 |
+
width: 48px;
|
| 83 |
+
height: 48px;
|
| 84 |
+
border-radius: 12px;
|
| 85 |
+
background: ${color.bg};
|
| 86 |
+
display: flex;
|
| 87 |
+
align-items: center;
|
| 88 |
+
justify-content: center;
|
| 89 |
+
color: ${color.text};
|
| 90 |
+
margin-bottom: 16px;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.value {
|
| 94 |
+
font-size: 1.5rem;
|
| 95 |
+
font-weight: 700;
|
| 96 |
+
color: #fff;
|
| 97 |
+
margin-bottom: 4px;
|
| 98 |
+
font-family: 'JetBrains Mono', monospace;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
.label {
|
| 102 |
+
font-size: 0.875rem;
|
| 103 |
+
color: #9ca3af;
|
| 104 |
+
font-weight: 500;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
.trend {
|
| 108 |
+
position: absolute;
|
| 109 |
+
top: 24px;
|
| 110 |
+
right: 24px;
|
| 111 |
+
font-size: 0.75rem;
|
| 112 |
+
color: #10b981;
|
| 113 |
+
display: flex;
|
| 114 |
+
align-items: center;
|
| 115 |
+
gap: 4px;
|
| 116 |
+
}
|
| 117 |
+
</style>
|
| 118 |
+
|
| 119 |
+
<div class="card">
|
| 120 |
+
<div class="icon-wrapper">
|
| 121 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 122 |
+
${icon}
|
| 123 |
+
</svg>
|
| 124 |
+
</div>
|
| 125 |
+
|
| 126 |
+
<div>
|
| 127 |
+
<div class="value">${value}</div>
|
| 128 |
+
<div class="label">${label}</div>
|
| 129 |
+
</div>
|
| 130 |
+
</div>
|
| 131 |
+
`;
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
updateValue(newValue) {
|
| 135 |
+
this.setAttribute('value', newValue);
|
| 136 |
+
const valueEl = this.shadowRoot.querySelector('.value');
|
| 137 |
+
if (valueEl) {
|
| 138 |
+
valueEl.textContent = newValue;
|
| 139 |
+
valueEl.style.animation = 'none';
|
| 140 |
+
valueEl.offsetHeight; // Trigger reflow
|
| 141 |
+
valueEl.style.animation = 'pulse 0.3s ease';
|
| 142 |
+
}
|
| 143 |
+
}
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
customElements.define('status-card', StatusCard);
|
index.html
CHANGED
|
@@ -1,19 +1,206 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="dark">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Psiphon Pilot - VPN Controller</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='cyan' stroke-width='2'><path d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'/></svg>">
|
| 8 |
+
<link rel="stylesheet" href="style.css">
|
| 9 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 10 |
+
<script>
|
| 11 |
+
tailwind.config = {
|
| 12 |
+
darkMode: 'class',
|
| 13 |
+
theme: {
|
| 14 |
+
extend: {
|
| 15 |
+
colors: {
|
| 16 |
+
primary: {
|
| 17 |
+
50: '#eef2ff',
|
| 18 |
+
100: '#e0e7ff',
|
| 19 |
+
200: '#c7d2fe',
|
| 20 |
+
300: '#a5b4fc',
|
| 21 |
+
400: '#818cf8',
|
| 22 |
+
500: '#6366f1',
|
| 23 |
+
600: '#4f46e5',
|
| 24 |
+
700: '#4338ca',
|
| 25 |
+
800: '#3730a3',
|
| 26 |
+
900: '#312e81',
|
| 27 |
+
},
|
| 28 |
+
secondary: {
|
| 29 |
+
50: '#ecfeff',
|
| 30 |
+
100: '#cffafe',
|
| 31 |
+
200: '#a5f3fc',
|
| 32 |
+
300: '#67e8f9',
|
| 33 |
+
400: '#22d3ee',
|
| 34 |
+
500: '#06b6d4',
|
| 35 |
+
600: '#0891b2',
|
| 36 |
+
700: '#0e7490',
|
| 37 |
+
800: '#155e75',
|
| 38 |
+
900: '#164e63',
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
fontFamily: {
|
| 42 |
+
mono: ['JetBrains Mono', 'Fira Code', 'monospace'],
|
| 43 |
+
sans: ['Inter', 'system-ui', 'sans-serif'],
|
| 44 |
+
},
|
| 45 |
+
animation: {
|
| 46 |
+
'pulse-slow': 'pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite',
|
| 47 |
+
'spin-slow': 'spin 3s linear infinite',
|
| 48 |
+
'bounce-slight': 'bounce 2s infinite',
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
</script>
|
| 54 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 55 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 56 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
| 57 |
+
</head>
|
| 58 |
+
<body class="bg-gray-900 text-gray-100 font-sans antialiased overflow-hidden h-screen w-screen">
|
| 59 |
+
<div class="flex h-full">
|
| 60 |
+
<!-- Sidebar -->
|
| 61 |
+
<vpn-sidebar></vpn-sidebar>
|
| 62 |
+
|
| 63 |
+
<!-- Main Content -->
|
| 64 |
+
<main class="flex-1 flex flex-col h-full overflow-hidden relative">
|
| 65 |
+
<!-- Top Bar -->
|
| 66 |
+
<header class="h-16 border-b border-gray-800 bg-gray-900/50 backdrop-blur-xl flex items-center justify-between px-6 z-20">
|
| 67 |
+
<div class="flex items-center gap-4">
|
| 68 |
+
<h1 class="text-xl font-semibold text-white tracking-tight">Dashboard</h1>
|
| 69 |
+
<span class="px-2 py-1 rounded-full bg-gray-800 text-xs text-gray-400 border border-gray-700">Ubuntu 22.04</span>
|
| 70 |
+
</div>
|
| 71 |
+
<div class="flex items-center gap-4">
|
| 72 |
+
<button id="clearLogs" class="text-gray-400 hover:text-white transition-colors text-sm flex items-center gap-2">
|
| 73 |
+
<i data-feather="trash-2" class="w-4 h-4"></i>
|
| 74 |
+
Clear Logs
|
| 75 |
+
</button>
|
| 76 |
+
<div class="h-4 w-px bg-gray-700"></div>
|
| 77 |
+
<div class="flex items-center gap-2 text-sm text-gray-400">
|
| 78 |
+
<div class="w-2 h-2 rounded-full bg-green-500 animate-pulse"></div>
|
| 79 |
+
System Ready
|
| 80 |
+
</div>
|
| 81 |
+
</div>
|
| 82 |
+
</header>
|
| 83 |
+
|
| 84 |
+
<!-- Dashboard Content -->
|
| 85 |
+
<div class="flex-1 overflow-y-auto p-6 space-y-6">
|
| 86 |
+
<!-- Connection Control Section -->
|
| 87 |
+
<section class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
| 88 |
+
<!-- Main Power Control -->
|
| 89 |
+
<div class="lg:col-span-1 bg-gradient-to-br from-gray-800 to-gray-900 rounded-2xl p-8 border border-gray-700 shadow-2xl flex flex-col items-center justify-center relative overflow-hidden group">
|
| 90 |
+
<div class="absolute inset-0 bg-gradient-to-br from-primary-600/10 to-secondary-600/10 opacity-0 group-hover:opacity-100 transition-opacity duration-500"></div>
|
| 91 |
+
|
| 92 |
+
<power-button id="mainToggle"></power-button>
|
| 93 |
+
|
| 94 |
+
<div class="mt-6 text-center">
|
| 95 |
+
<h2 class="text-2xl font-bold text-white mb-1" id="connectionStatus">Disconnected</h2>
|
| 96 |
+
<p class="text-gray-400 text-sm" id="connectionSubtitle">Tap to connect</p>
|
| 97 |
+
</div>
|
| 98 |
+
|
| 99 |
+
<div class="mt-6 flex items-center gap-4 text-sm">
|
| 100 |
+
<div class="flex items-center gap-2 text-gray-400">
|
| 101 |
+
<i data-feather="shield" class="w-4 h-4"></i>
|
| 102 |
+
<span>Secure</span>
|
| 103 |
+
</div>
|
| 104 |
+
<div class="flex items-center gap-2 text-gray-400">
|
| 105 |
+
<i data-feather="zap" class="w-4 h-4"></i>
|
| 106 |
+
<span>Fast</span>
|
| 107 |
+
</div>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
|
| 111 |
+
<!-- Stats Grid -->
|
| 112 |
+
<div class="lg:col-span-2 grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 113 |
+
<status-card
|
| 114 |
+
icon="download"
|
| 115 |
+
label="Download Speed"
|
| 116 |
+
value="0 MB/s"
|
| 117 |
+
color="primary"
|
| 118 |
+
id="downloadStat">
|
| 119 |
+
</status-card>
|
| 120 |
+
|
| 121 |
+
<status-card
|
| 122 |
+
icon="upload"
|
| 123 |
+
label="Upload Speed"
|
| 124 |
+
value="0 MB/s"
|
| 125 |
+
color="secondary"
|
| 126 |
+
id="uploadStat">
|
| 127 |
+
</status-card>
|
| 128 |
+
|
| 129 |
+
<status-card
|
| 130 |
+
icon="clock"
|
| 131 |
+
label="Connection Time"
|
| 132 |
+
value="00:00:00"
|
| 133 |
+
color="yellow"
|
| 134 |
+
id="timeStat">
|
| 135 |
+
</status-card>
|
| 136 |
+
|
| 137 |
+
<status-card
|
| 138 |
+
icon="server"
|
| 139 |
+
label="Server Location"
|
| 140 |
+
value="Auto-Select"
|
| 141 |
+
color="purple"
|
| 142 |
+
id="serverStat">
|
| 143 |
+
</status-card>
|
| 144 |
+
</div>
|
| 145 |
+
</section>
|
| 146 |
+
|
| 147 |
+
<!-- Terminal/Logs Section -->
|
| 148 |
+
<section class="bg-gray-950 rounded-2xl border border-gray-800 overflow-hidden flex flex-col h-96">
|
| 149 |
+
<div class="bg-gray-900 px-4 py-3 border-b border-gray-800 flex items-center justify-between">
|
| 150 |
+
<div class="flex items-center gap-3">
|
| 151 |
+
<i data-feather="terminal" class="w-4 h-4 text-gray-400"></i>
|
| 152 |
+
<span class="text-sm font-medium text-gray-300">Process Logs</span>
|
| 153 |
+
</div>
|
| 154 |
+
<div class="flex items-center gap-2">
|
| 155 |
+
<div class="flex gap-1">
|
| 156 |
+
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
| 157 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
| 158 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 159 |
+
</div>
|
| 160 |
+
</div>
|
| 161 |
+
</div>
|
| 162 |
+
<log-console id="logConsole"></log-console>
|
| 163 |
+
</section>
|
| 164 |
+
|
| 165 |
+
<!-- Configuration Info -->
|
| 166 |
+
<section class="bg-gray-800/50 rounded-xl p-6 border border-gray-700">
|
| 167 |
+
<h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
|
| 168 |
+
<i data-feather="info" class="w-5 h-5 text-primary-400"></i>
|
| 169 |
+
Configuration Details
|
| 170 |
+
</h3>
|
| 171 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-sm">
|
| 172 |
+
<div class="space-y-2">
|
| 173 |
+
<div class="flex justify-between">
|
| 174 |
+
<span class="text-gray-400">Executable:</span>
|
| 175 |
+
<span class="text-gray-200 font-mono">psiphon-tunnel-core-x86_64</span>
|
| 176 |
+
</div>
|
| 177 |
+
<div class="flex justify-between">
|
| 178 |
+
<span class="text-gray-400">Data Directory:</span>
|
| 179 |
+
<span class="text-gray-200 font-mono text-right truncate max-w-xs">/home/hossein/Files/psiphon</span>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
<div class="space-y-2">
|
| 183 |
+
<div class="flex justify-between">
|
| 184 |
+
<span class="text-gray-400">Config File:</span>
|
| 185 |
+
<span class="text-gray-200 font-mono text-right truncate max-w-xs">psiphon.config</span>
|
| 186 |
+
</div>
|
| 187 |
+
<div class="flex justify-between">
|
| 188 |
+
<span class="text-gray-400">Protocol:</span>
|
| 189 |
+
<span class="px-2 py-0.5 rounded bg-primary-500/20 text-primary-300 text-xs">SSH+</span>
|
| 190 |
+
</div>
|
| 191 |
+
</div>
|
| 192 |
+
</div>
|
| 193 |
+
</section>
|
| 194 |
+
</div>
|
| 195 |
+
</main>
|
| 196 |
+
</div>
|
| 197 |
+
|
| 198 |
+
<script src="components/sidebar.js"></script>
|
| 199 |
+
<script src="components/status-card.js"></script>
|
| 200 |
+
<script src="components/log-console.js"></script>
|
| 201 |
+
<script src="components/power-button.js"></script>
|
| 202 |
+
<script src="script.js"></script>
|
| 203 |
+
<script>feather.replace();</script>
|
| 204 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 205 |
+
</body>
|
| 206 |
+
</html>
|
script.js
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// VPN Controller Logic
|
| 2 |
+
class VPNController {
|
| 3 |
+
constructor() {
|
| 4 |
+
this.isConnected = false;
|
| 5 |
+
this.connectionTime = 0;
|
| 6 |
+
this.timerInterval = null;
|
| 7 |
+
this.process = null;
|
| 8 |
+
this.logs = [];
|
| 9 |
+
|
| 10 |
+
this.initElements();
|
| 11 |
+
this.bindEvents();
|
| 12 |
+
this.simulateMetrics();
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
initElements() {
|
| 16 |
+
this.mainToggle = document.getElementById('mainToggle');
|
| 17 |
+
this.connectionStatus = document.getElementById('connectionStatus');
|
| 18 |
+
this.connectionSubtitle = document.getElementById('connectionSubtitle');
|
| 19 |
+
this.logConsole = document.getElementById('logConsole');
|
| 20 |
+
this.downloadStat = document.getElementById('downloadStat');
|
| 21 |
+
this.uploadStat = document.getElementById('uploadStat');
|
| 22 |
+
this.timeStat = document.getElementById('timeStat');
|
| 23 |
+
this.clearLogsBtn = document.getElementById('clearLogs');
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
bindEvents() {
|
| 27 |
+
// Power button toggle
|
| 28 |
+
document.addEventListener('power-toggle', (e) => {
|
| 29 |
+
this.toggleConnection();
|
| 30 |
+
});
|
| 31 |
+
|
| 32 |
+
// Clear logs
|
| 33 |
+
this.clearLogsBtn.addEventListener('click', () => {
|
| 34 |
+
this.logConsole.clear();
|
| 35 |
+
this.addLog('Logs cleared by user', 'info');
|
| 36 |
+
});
|
| 37 |
+
|
| 38 |
+
// Keyboard shortcut (Space to toggle)
|
| 39 |
+
document.addEventListener('keydown', (e) => {
|
| 40 |
+
if (e.code === 'Space' && e.target === document.body) {
|
| 41 |
+
e.preventDefault();
|
| 42 |
+
this.toggleConnection();
|
| 43 |
+
}
|
| 44 |
+
});
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
toggleConnection() {
|
| 48 |
+
if (this.isConnected) {
|
| 49 |
+
this.disconnect();
|
| 50 |
+
} else {
|
| 51 |
+
this.connect();
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
connect() {
|
| 56 |
+
this.isConnected = true;
|
| 57 |
+
this.updateUI();
|
| 58 |
+
this.startTimer();
|
| 59 |
+
this.addLog('Initializing Psiphon connection...', 'info');
|
| 60 |
+
this.addLog('Loading configuration from /home/hossein/Files/psiphon/psiphon.config', 'system');
|
| 61 |
+
|
| 62 |
+
// Simulate connection process
|
| 63 |
+
setTimeout(() => {
|
| 64 |
+
this.addLog('Starting tunnel core...', 'process');
|
| 65 |
+
}, 500);
|
| 66 |
+
|
| 67 |
+
setTimeout(() => {
|
| 68 |
+
this.addLog('Connecting to nearest available server...', 'network');
|
| 69 |
+
}, 1500);
|
| 70 |
+
|
| 71 |
+
setTimeout(() => {
|
| 72 |
+
this.addLog('Handshake successful', 'success');
|
| 73 |
+
this.addLog('Tunnel established via SSH+ protocol', 'success');
|
| 74 |
+
this.addLog('Local SOCKS proxy started on port 1080', 'info');
|
| 75 |
+
}, 2500);
|
| 76 |
+
|
| 77 |
+
// Update stats simulation
|
| 78 |
+
this.simulateTraffic();
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
disconnect() {
|
| 82 |
+
this.isConnected = false;
|
| 83 |
+
this.updateUI();
|
| 84 |
+
this.stopTimer();
|
| 85 |
+
this.addLog('Terminating connection...', 'warning');
|
| 86 |
+
|
| 87 |
+
setTimeout(() => {
|
| 88 |
+
this.addLog('Tunnel closed gracefully', 'info');
|
| 89 |
+
this.addLog('Process terminated', 'system');
|
| 90 |
+
}, 500);
|
| 91 |
+
|
| 92 |
+
// Reset stats
|
| 93 |
+
this.downloadStat.updateValue('0 MB/s');
|
| 94 |
+
this.uploadStat.updateValue('0 MB/s');
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
updateUI() {
|
| 98 |
+
if (this.isConnected) {
|
| 99 |
+
this.connectionStatus.textContent = 'Connected';
|
| 100 |
+
this.connectionStatus.className = 'text-2xl font-bold text-secondary-400 mb-1';
|
| 101 |
+
this.connectionSubtitle.textContent = 'Secure connection active';
|
| 102 |
+
this.mainToggle.setAttribute('active', 'true');
|
| 103 |
+
document.body.classList.add('connection-active');
|
| 104 |
+
} else {
|
| 105 |
+
this.connectionStatus.textContent = 'Disconnected';
|
| 106 |
+
this.connectionStatus.className = 'text-2xl font-bold text-gray-400 mb-1';
|
| 107 |
+
this.connectionSubtitle.textContent = 'Tap to connect';
|
| 108 |
+
this.mainToggle.setAttribute('active', 'false');
|
| 109 |
+
document.body.classList.remove('connection-active');
|
| 110 |
+
}
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
startTimer() {
|
| 114 |
+
this.connectionTime = 0;
|
| 115 |
+
this.updateTimerDisplay();
|
| 116 |
+
this.timerInterval = setInterval(() => {
|
| 117 |
+
this.connectionTime++;
|
| 118 |
+
this.updateTimerDisplay();
|
| 119 |
+
}, 1000);
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
stopTimer() {
|
| 123 |
+
if (this.timerInterval) {
|
| 124 |
+
clearInterval(this.timerInterval);
|
| 125 |
+
this.timerInterval = null;
|
| 126 |
+
}
|
| 127 |
+
this.connectionTime = 0;
|
| 128 |
+
this.timeStat.updateValue('00:00:00');
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
updateTimerDisplay() {
|
| 132 |
+
const hours = Math.floor(this.connectionTime / 3600);
|
| 133 |
+
const minutes = Math.floor((this.connectionTime % 3600) / 60);
|
| 134 |
+
const seconds = this.connectionTime % 60;
|
| 135 |
+
const formatted = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
|
| 136 |
+
this.timeStat.updateValue(formatted);
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
addLog(message, type = 'info') {
|
| 140 |
+
const timestamp = new Date().toLocaleTimeString('en-US', { hour12: false });
|
| 141 |
+
this.logConsole.addEntry(`[${timestamp}] ${message}`, type);
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
simulateTraffic() {
|
| 145 |
+
if (!this.isConnected) return;
|
| 146 |
+
|
| 147 |
+
const download = (Math.random() * 5 + 1).toFixed(1);
|
| 148 |
+
const upload = (Math.random() * 2 + 0.5).toFixed(1);
|
| 149 |
+
|
| 150 |
+
this.downloadStat.updateValue(`${download} MB/s`);
|
| 151 |
+
this.uploadStat.updateValue(`${upload} MB/s`);
|
| 152 |
+
|
| 153 |
+
if (this.isConnected) {
|
| 154 |
+
setTimeout(() => this.simulateTraffic(), 2000);
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
simulateMetrics() {
|
| 159 |
+
// Random log entries when connected
|
| 160 |
+
setInterval(() => {
|
| 161 |
+
if (this.isConnected && Math.random() > 0.7) {
|
| 162 |
+
const messages = [
|
| 163 |
+
'Heartbeat received',
|
| 164 |
+
'Network status: optimal',
|
| 165 |
+
'Rotating upstream proxy...',
|
| 166 |
+
'Ping: 45ms',
|
| 167 |
+
'Bandwidth throttling detected, switching protocol...'
|
| 168 |
+
];
|
| 169 |
+
const randomMsg = messages[Math.floor(Math.random() * messages.length)];
|
| 170 |
+
this.addLog(randomMsg, 'debug');
|
| 171 |
+
}
|
| 172 |
+
}, 5000);
|
| 173 |
+
}
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
// Initialize when DOM is ready
|
| 177 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 178 |
+
window.vpnController = new VPNController();
|
| 179 |
+
|
| 180 |
+
// Initial logs
|
| 181 |
+
setTimeout(() => {
|
| 182 |
+
window.vpnController.addLog('Psiphon Pilot initialized', 'system');
|
| 183 |
+
window.vpnController.addLog('Ready to establish secure connection', 'info');
|
| 184 |
+
}, 100);
|
| 185 |
+
});
|
style.css
CHANGED
|
@@ -1,28 +1,87 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
margin-top: 0;
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
margin-bottom: 10px;
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
margin: 0 auto;
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Custom Scrollbar */
|
| 2 |
+
::-webkit-scrollbar {
|
| 3 |
+
width: 8px;
|
| 4 |
+
height: 8px;
|
| 5 |
}
|
| 6 |
|
| 7 |
+
::-webkit-scrollbar-track {
|
| 8 |
+
background: #111827;
|
|
|
|
| 9 |
}
|
| 10 |
|
| 11 |
+
::-webkit-scrollbar-thumb {
|
| 12 |
+
background: #374151;
|
| 13 |
+
border-radius: 4px;
|
|
|
|
|
|
|
| 14 |
}
|
| 15 |
|
| 16 |
+
::-webkit-scrollbar-thumb:hover {
|
| 17 |
+
background: #4b5563;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
}
|
| 19 |
|
| 20 |
+
/* Selection */
|
| 21 |
+
::selection {
|
| 22 |
+
background: rgba(99, 102, 241, 0.3);
|
| 23 |
+
color: white;
|
| 24 |
}
|
| 25 |
+
|
| 26 |
+
/* Custom Animations */
|
| 27 |
+
@keyframes gradient-shift {
|
| 28 |
+
0% { background-position: 0% 50%; }
|
| 29 |
+
50% { background-position: 100% 50%; }
|
| 30 |
+
100% { background-position: 0% 50%; }
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.animate-gradient {
|
| 34 |
+
background-size: 200% 200%;
|
| 35 |
+
animation: gradient-shift 3s ease infinite;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
/* Glow Effects */
|
| 39 |
+
.glow-primary {
|
| 40 |
+
box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.glow-secondary {
|
| 44 |
+
box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
/* Terminal Blink */
|
| 48 |
+
@keyframes blink {
|
| 49 |
+
0%, 100% { opacity: 1; }
|
| 50 |
+
50% { opacity: 0; }
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.terminal-cursor::after {
|
| 54 |
+
content: '_';
|
| 55 |
+
animation: blink 1s infinite;
|
| 56 |
+
color: #22d3ee;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
/* Glassmorphism */
|
| 60 |
+
.glass {
|
| 61 |
+
background: rgba(17, 24, 39, 0.7);
|
| 62 |
+
backdrop-filter: blur(10px);
|
| 63 |
+
-webkit-backdrop-filter: blur(10px);
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
/* Power Button Ring Animation */
|
| 67 |
+
@keyframes ripple {
|
| 68 |
+
0% {
|
| 69 |
+
transform: scale(1);
|
| 70 |
+
opacity: 0.5;
|
| 71 |
+
}
|
| 72 |
+
100% {
|
| 73 |
+
transform: scale(1.5);
|
| 74 |
+
opacity: 0;
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.ripple-ring {
|
| 79 |
+
animation: ripple 2s linear infinite;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
/* Responsive utilities */
|
| 83 |
+
@media (max-width: 768px) {
|
| 84 |
+
.hide-mobile {
|
| 85 |
+
display: none;
|
| 86 |
+
}
|
| 87 |
+
}
|