<html lang=en><meta charset=UTF-8><meta content="width=device-width,initial-scale=1"name=viewport><title>Coders Hosting Panel</title><script src=https://cdn.tailwindcss.com></script><link href=https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css rel=stylesheet><link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap"rel=stylesheet><style>body{font-family:Roboto,sans-serif}.status{transition:all .3s ease-in-out}.status.active{color:#34d399}.status.inactive{color:#f87171}.logs ul{list-style-type:none;padding:0;max-height:300px;overflow-y:auto}.logs ul li{margin-bottom:.5rem}.logs ul li::before{content:"";margin-right:.5rem}.status-animation{display:inline-block;width:1rem;height:1rem;border-radius:50%;margin-left:.5rem;animation:pulse 1.5s infinite}.status-animation.active{background-color:#34d399}.status-animation.inactive{background-color:#f87171}@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.5)}}.alert{display:none;position:fixed;top:20px;right:20px;padding:20px;background-color:#34d399;color:#fff;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,.1);animation:slideIn .5s forwards}.alert.show{display:block}.alert.error{background-color:#f87171}@keyframes slideIn{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}</style><body class="text-gray-200 bg-gray-900 font-sans h-screen overflow-hidden"><div class="rounded-lg bg-gray-800 container max-w-md mt-20 mx-auto p-12 shadow-2xl"id=loginPanel><h1 class="font-bold text-white mb-8 text-4xl text-center">Login</h1><form class=space-y-6 id=loginForm><div><label class="text-gray-400 block font-medium mb-2"for=email>Email:</label> <input class="p-4 bg-gray-700 w-full border border-gray-600 rounded-lg text-white"id=email name=email required type=email></div><div><label class="text-gray-400 block font-medium mb-2"for=password>Password:</label> <input class="p-4 bg-gray-700 w-full border border-gray-600 rounded-lg text-white"id=password name=password required type=password></div><button class="rounded-lg text-white w-full bg-blue-600 duration-300 font-bold hover:bg-blue-700 py-4 transition"type=submit>Login</button></form></div><div class="flex flex-col h-screen hidden"id=mainPanel><div class="p-4 flex bg-gray-900 items-center justify-between"><div class="flex items-center space-x-2"><i class="fas fa-bars text-gray-400"></i> <span class="font-semibold text-lg">Coders Hosting Temp</span></div></div><div class="p-4 flex flex-1 overflow-hidden space-x-4"><div class="p-4 bg-gray-700 w-full md:w-1/4"><div class=mb-4><h2 class="font-semibold text-lg">Coders Hosting</h2><p class="text-sm text-yellow-400"id=serverStatus>STARTING</div><div class=mb-4><p class=text-sm><i class="fas fa-memory"></i> <span id=memoryUsage>0 MB / ∞ MB</span><p class=text-sm><i class="fas fa-microchip"></i> <span id=cpuUsage>0% CPU</span></div><div class="flex space-x-2"><button class="text-gray-200 px-4 py-2 rounded bg-green-600"id=startButton>START</button> <button class="text-gray-200 px-4 py-2 rounded bg-red-600"id=stopButton>STOP</button></div></div><div class="p-4 bg-gray-700 flex-1 overflow-hidden"><div class="text-sm bg-gray-800 font-mono h-full overflow-y-auto p-2"id=consoleOutput><p>Console output will be displayed here...</div></div></div></div><div class=alert id=alert><i class="fas fa-check-circle"></i> Action completed successfully!</div><script>document.addEventListener('DOMContentLoaded', function() {
            const users = [
                { email: "townzone@host.panel.com", password: "tzopea35a", id: `townzone` },
            ];

            let currentUserId = null;

            document.getElementById('loginForm').addEventListener('submit', function(event) {
                event.preventDefault();
                const email = document.getElementById('email').value;
                const password = document.getElementById('password').value;

                const user = users.find(user => user.email === email && user.password === password);

                if (user) {
                    currentUserId = user.id;
                    document.getElementById('loginPanel').classList.add('hidden');
                    document.getElementById('mainPanel').classList.remove('hidden');
                    checkStatus();
                    fetchLogs();
                    setInterval(fetchLogs, 1000);
                } else {
                    showAlert('Invalid email or password', true);
                }
            });

            function showAlert(message, isError = false) {
                const alert = document.getElementById('alert');
                if (alert) {
                    alert.innerHTML = isError ? `<i class="fas fa-times-circle"></i> ${message}` : `<i class="fas fa-check-circle"></i> ${message}`;
                    alert.className = isError ? 'alert show error' : 'alert show';
                    setTimeout(() => {
                        alert.classList.remove('show');
                    }, 3000);
                }
            }

            function updateStatus(action, data) {
                const statusElement = document.getElementById('serverStatus');
                if (statusElement) {
                    statusElement.innerText = action === 'start' ? 'ONLINE' : 'OFFLINE';
                    statusElement.className = action === 'start' ? 'text-green-400' : 'text-red-400';
                }
            }

            function checkStatus() {
                const action = 'status';
                const url = `https://catch-bracelet-sys-slide.trycloudflare.com/${action}/${currentUserId}`;

                fetch(url, {
                    method: 'GET',
                    headers: {
                        'Content-Type': 'application/json'
                    }
                })
                .then(response => {
                    if (!response.ok) {
                        throw new Error('Network response was not ok');
                    }
                    return response.json();
                })
                .then(data => {
                    const status = data.status === 'online' ? 'start' : 'stop';
                    const message = data.logs && data.logs.length > 0 ? data.logs[0] : 'No additional information';
                    
                    updateStatus(status, message, {
                        cpu: data.cpu || 0,
                        memory: data.memory || 0
                    });
                    updateResourceUsage(data.memory, data.cpu);
                })
                .catch(error => {
                    console.error('There was a problem with the fetch operation:', error);
                    showAlert('Error: ' + error.message, true);
                    updateStatus('stop', 'Connection error', { cpu: 0, memory: 0 });
                });
            }

            function fetchLogs() {
                const url = `https://catch-bracelet-sys-slide.trycloudflare.com/logs/${currentUserId}`;

                fetch(url, {
                    method: 'GET',
                    headers: {
                        'Content-Type': 'application/json'
                    }
                })
                .then(response => {
                    if (!response.ok) {
                        throw new Error('Network response was not ok');
                    }
                    return response.json();
                })
                .then(data => {
                    updateConsoleOutput(data.logs);
                })
                .catch(error => {
                    console.error('There was a problem with the fetch operation:', error);
                    showAlert('Error: ' + error.message, true);
                });
            }

            function updateConsoleOutput(logs) {
                const consoleOutput = document.getElementById('consoleOutput');
                if (consoleOutput) {
                    consoleOutput.innerHTML = '';
                    logs.forEach(log => {
                        const logItem = document.createElement('p');
                        logItem.innerText = log;
                        consoleOutput.appendChild(logItem);
                    });
                }
            }

            document.getElementById('startButton').addEventListener('click', function() {
                const action = 'start';
                const url = `https://catch-bracelet-sys-slide.trycloudflare.com/${action}/${currentUserId}`;

                fetch(url, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    }
                })
                .then(response => {
                    if (!response.ok) {
                        throw new Error('Network response was not ok');
                    }
                    return response.text();
                })
                .then(data => {
                    updateStatus(action, data);
                    fetchLogs();
                })
                .catch(error => {
                    console.error('There was a problem with the fetch operation:', error);
                    showAlert('Error: ' + error.message, true);
                });
            });

            document.getElementById('stopButton').addEventListener('click', function() {
                const action = 'stop';
                const url = `https://catch-bracelet-sys-slide.trycloudflare.com/${action}/${currentUserId}`;

                fetch(url, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    }
                })
                .then(response => {
                    if (!response.ok) {
                        throw new Error('Network response was not ok');
                    }
                    return response.text();
                })
                .then(data => {
                    updateStatus(action, data);
                    fetchLogs();

                    return fetch('https://catch-bracelet-sys-slide.trycloudflare.com/clear_files', {
                        method: 'POST',
                        headers: {
                            'Content-Type': 'application/json'
                        }
                    });
                })
                .then(response => {
                    if (!response.ok) {
                        throw new Error('Failed to clear files');
                    }
                    return response.json();
                })
                .then(clearData => {
                    console.log('Files cleared:', clearData);
                })
                .catch(error => {
                    console.error('There was a problem with the fetch operation:', error);
                    showAlert('Error: ' + error.message, true);
                });
            });

            function updateResourceUsage(memory, cpu) {
                const memoryUsageElement = document.getElementById('memoryUsage');
                const cpuUsageElement = document.getElementById('cpuUsage');
                if (memoryUsageElement && cpuUsageElement) {
                    memoryUsageElement.innerText = `${memory} MB / ∞ MB`;
                    cpuUsageElement.innerText = `${cpu}% CPU`;
                }
            }

            setInterval(() => {
                checkStatus();
            }, 1000);
        });</script>