Spaces:
Paused
Paused
Upload 5 files
Browse filesFiles changed (3)
- public/client.js+7-15
- public/index.html+1
- server.js+12-13
53 unmodified lines5455565758596061626364656667686970717273747576777879148 unmodified lines22822923023123223323453 unmodified linesconst HARDCODED_SERVERS = [{uid: 'hardcoded-1', name: 'Terminal-v1', url: 'https://server-terminal-vip1.onrender.com',description: 'Server-Terminal 🚀', deployHookUrl: 'https://api.render.com/deploy/srv-d6a8pgur433s738i4e60?key=8HSmJvG6OSA',isHardcoded: true},{uid: 'hardcoded-2', name: 'Terminal-v2', url: 'https://server-terminal-vip2.onrender.com',description: 'Server-Terminal 🚀', deployHookUrl: 'https://api.render.com/deploy/srv-d6a8qg2li9vc73ak0j30?key=Z1lRDU0oWRs',isHardcoded: true},{uid: 'hardcoded-3', name: 'Terminal-v3', url: 'https://server-terminal-vip3.onrender.com',description: 'Server-Terminal 🚀', deployHookUrl: 'https://api.render.com/deploy/srv-d6a8sfkr85hc738f55gg?key=kkBnCudwIWA',isHardcoded: true},{uid: 'hardcoded-4', name: 'Terminal-v4', url: 'https://server-terminal-vip4.onrender.com',description: 'Server-Terminal 🚀', deployHookUrl: 'https://api.render.com/deploy/srv-d6a8tep5pdvs738gvdbg?key=0SECzlgpNso',isHardcoded: true}];148 unmodified linesconst service = allServices.find(s => s.uid === activeServerUid);if (service && !service.isLocal && service.url) {window.open(`${service.url}/p/${port}/`, '_blank');} else {alert('Vui lòng chọn một Server Terminal để mở cổng.');}53 unmodified lines545556575859606162636465666768697071148 unmodified lines22022122222322422522653 unmodified linesconst HARDCODED_SERVERS = [{uid: 'hardcoded-1', name: 'Terminal-v1', url: 'https://av4x03-server-terminal-v1.hf.space',description: 'Server-Terminal 🚀',isHardcoded: true},{uid: 'hardcoded-2', name: 'Terminal-v2', url: 'https://av4x04-server-terminal-v2.hf.space',description: 'Server-Terminal 🚀',isHardcoded: true},{uid: 'hardcoded-3', name: 'Terminal-v3', url: 'https://av4x04-server-terminal-v3.hf.space',description: 'Server-Terminal 🚀',isHardcoded: true}];148 unmodified linesconst service = allServices.find(s => s.uid === activeServerUid);if (service && !service.isLocal && service.url) {window.open(`${service.url.replace(/\/+$/, '')}/p/${port}/`, '_blank');} else {alert('Vui lòng chọn một Server Terminal để mở cổng.');}
48 unmodified lines49505152535448 unmodified lines-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;overflow: hidden;}/* Pulsing logo */48 unmodified lines4950515253545548 unmodified lines-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;overflow: hidden;zoom: 0.8;}/* Pulsing logo */
17 unmodified lines181920212223246 unmodified lines3132333435363738394023 unmodified lines64656667686970717273747536 unmodified lines11211311411511611711829 unmodified lines14814915015115217 unmodified lines// Fallback for SPAapp.get('*', (req, res) => {res.sendFile(path.join(__dirname, 'public', 'index.html'));});// --- SYSTEM STATUS LOGIC ---6 unmodified linesconst currentTimes = cpu.times;const idle = currentTimes.idle - lastTimes.idle;const total = (currentTimes.user - lastTimes.user) +(currentTimes.nice - lastTimes.nice) +(currentTimes.sys - lastTimes.sys) +(currentTimes.irq - lastTimes.irq) +idle;return total === 0 ? 0 : 100 * (1 - idle / total);});lastCpuTimes = currentCpuTimes.map(cpu => ({ ...cpu.times }));23 unmodified lines// --- UPTIME MONITOR LOGIC ---const HARDCODED_UPTIME_SITES = [{ uid: 'hc_site_1', name: 'Server Admin', url: 'https://server-admin-v1-fp0s.onrender.com', isHardcoded: true },{ uid: 'hc_site_2', name: 'Server admin', url: 'https://terminal-admin.netlify.app', isHardcoded: true },{ uid: 'hc_site_3', name: 'Server Terminal v1', url: 'https://server-terminal-vip1.onrender.com', isHardcoded: true },{ uid: 'hc_site_4', name: 'Server Terminal v2', url: 'https://server-terminal-vip2.onrender.com', isHardcoded: true },{ uid: 'hc_site_5', name: 'Server Terminal v3', url: 'https://server-terminal-vip3.onrender.com', isHardcoded: true },{ uid: 'hc_site_6', name: 'Server Terminal v4', url: 'https://server-terminal-vip4.onrender.com', isHardcoded: true },];let sites = [...HARDCODED_UPTIME_SITES];36 unmodified linesio.on('connection', (socket) => {// console.log('Admin Client Connected');socket.on('system:subscribe', () => {const cpus = getCpuUsage();const totalMem = os.totalmem();29 unmodified lines});server.listen(PORT, () => {console.log(`Admin Server listening on http://localhost:${PORT}`);});17 unmodified lines181920212223246 unmodified lines3132333435363738394023 unmodified lines646566676869707172737436 unmodified lines11111211311411511611729 unmodified lines14714814915015117 unmodified lines// Fallback for SPAapp.get('*', (req, res) => {res.sendFile(path.join(__dirname, 'public', 'index.html'));});// --- SYSTEM STATUS LOGIC ---6 unmodified linesconst currentTimes = cpu.times;const idle = currentTimes.idle - lastTimes.idle;const total = (currentTimes.user - lastTimes.user) +(currentTimes.nice - lastTimes.nice) +(currentTimes.sys - lastTimes.sys) +(currentTimes.irq - lastTimes.irq) +idle;return total === 0 ? 0 : 100 * (1 - idle / total);});lastCpuTimes = currentCpuTimes.map(cpu => ({ ...cpu.times }));23 unmodified lines// --- UPTIME MONITOR LOGIC ---const HARDCODED_UPTIME_SITES = [{ uid: 'hc_site_1', name: 'Server Admin (Vercel)', url: 'https://server-admin-vip.vercel.app/', isHardcoded: true },{ uid: 'hc_site_2', name: 'Server Admin (HF)', url: 'https://av4x03-server-admin.hf.space/', isHardcoded: true },{ uid: 'hc_site_3', name: 'Server Terminal v1', url: 'https://av4x03-server-terminal-v1.hf.space/', isHardcoded: true },{ uid: 'hc_site_4', name: 'Server Terminal v2', url: 'https://av4x04-server-terminal-v2.hf.space/', isHardcoded: true },{ uid: 'hc_site_5', name: 'Server Terminal v3', url: 'https://av4x04-server-terminal-v3.hf.space/', isHardcoded: true },];let sites = [...HARDCODED_UPTIME_SITES];36 unmodified linesio.on('connection', (socket) => {// console.log('Admin Client Connected');socket.on('system:subscribe', () => {const cpus = getCpuUsage();const totalMem = os.totalmem();29 unmodified lines});server.listen(PORT, () => {console.log(`Admin Server listening on http://localhost:${PORT}`);});
public/client.js+7-15
public/index.html+1
server.js+12-13