Gestionnaire de fichiers - Editer - /home/kridsana/webapp.cm.in.th/663012801/u66301280015/เฉลยสอบ Setup Server/Setup.html
Arrière
<!DOCTYPE html> <html lang="th"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Debian 12 Setup</title> <link href="https://fonts.googleapis.com/css2?family=K2D:wght@400;500;600&display=swap" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github-dark.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/9.1.6/marked.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/php.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/shell.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/dos.min.js"></script> <style> body { font-family: 'K2D', sans-serif; line-height: 1.6; max-width: 800px; margin: 0 auto; padding: 20px; color: #e0e0e0; background-color: #1a1a1a; } .container { background-color: #2d2d2d; padding: 30px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } h1 { color: #fff; border-bottom: 2px solid #444; padding-bottom: 10px; } pre { padding: 15px; border-radius: 4px; overflow-x: auto; margin: 1em 0; background-color: #333; color: #fff; } .code-block { position: relative; transition: all 0.3s; } .code-block.copied { border-left: 4px solid #4CAF50; padding-left: 6px; } .code-block.copied::after { content: "✓ คัดลอกแล้ว"; position: absolute; bottom: 5px; right: 5px; font-size: 12px; color: #4CAF50; background: rgba(45, 45, 45, 0.7); padding: 3px 6px; border-radius: 3px; } .copy-button { position: absolute; top: 5px; right: 5px; padding: 5px 10px; background: #4CAF50; color: white; border: none; border-radius: 4px; cursor: pointer; opacity: 0.9; font-family: 'K2D', sans-serif; transition: all 0.2s; } .copy-button:hover { opacity: 1; transform: scale(1.05); } .copy-button.copied { background: #2E7D32; } .theme-toggle { position: fixed; top: 20px; right: 20px; padding: 10px; background: #444; color: white; border: none; border-radius: 4px; cursor: pointer; font-family: 'K2D', sans-serif; } .light-theme { background-color: white; color: #333; } .light-theme .container { background-color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } .light-theme h1 { color: #2c3e50; border-bottom-color: #eee; } .light-theme pre { background-color: #f4f4f4; color: #333; } .light-theme .code-block.copied { border-left: 4px solid #4CAF50; } .light-theme .code-block.copied::after { background: rgba(240, 240, 240, 0.7); color: #2E7D32; } /* เพิ่มสไตล์เพื่อแสดงระยะเวลาที่คัดลอก */ .copy-time { position: absolute; bottom: 5px; left: 5px; font-size: 11px; color: #888; background: rgba(45, 45, 45, 0.7); padding: 2px 4px; border-radius: 2px; } .light-theme .copy-time { background: rgba(240, 240, 240, 0.7); color: #666; } </style> </head> <body class="dark-theme"> <button class="theme-toggle" onclick="toggleTheme()">🌓 เปลี่ยนธีม</button> <div class="container"> <div id="content"></div> </div> <script> // เก็บข้อมูลโค้ดที่คัดลอกไปแล้วในตัวแปรในหน่วยความจำ (ไม่ใช้ LocalStorage) const copiedCodes = {}; function toggleTheme() { document.body.classList.toggle('dark-theme'); document.body.classList.toggle('light-theme'); } function formatTimestamp(timestamp) { // แปลงจาก timestamp เป็นข้อความแสดงเวลา const now = new Date(); const copyDate = new Date(timestamp); // ถ้าเป็นวันนี้ if (now.toDateString() === copyDate.toDateString()) { return `วันนี้ ${copyDate.getHours().toString().padStart(2, '0')}:${copyDate.getMinutes().toString().padStart(2, '0')}`; } // ถ้าเป็นเมื่อวาน const yesterday = new Date(now); yesterday.setDate(now.getDate() - 1); if (yesterday.toDateString() === copyDate.toDateString()) { return `เมื่อวาน ${copyDate.getHours().toString().padStart(2, '0')}:${copyDate.getMinutes().toString().padStart(2, '0')}`; } // กรณีอื่นๆ แสดงวันที่เต็ม return `${copyDate.getDate()}/${copyDate.getMonth()+1}/${copyDate.getFullYear()} ${copyDate.getHours().toString().padStart(2, '0')}:${copyDate.getMinutes().toString().padStart(2, '0')}`; } const renderer = new marked.Renderer(); renderer.code = function(code, language) { const validLang = hljs.getLanguage(language) ? language : 'plaintext'; const highlightedCode = hljs.highlight(code, { language: validLang }).value; const uniqueId = 'code-' + Math.random().toString(36).substr(2, 9); // แปลงอักขระพิเศษเป็น HTML entities เพื่อป้องกันการแสดงผลที่ผิดพลาด const escapedCode = code .replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/"/g, '"') .replace(/'/g, '''); // ตรวจสอบว่าโค้ดนี้เคยคัดลอกหรือไม่ (ในเซสชันนี้เท่านั้น) const isCopied = copiedCodes[escapedCode]; const copiedClass = isCopied ? 'copied' : ''; const buttonText = isCopied ? '✓ คัดลอกแล้ว' : 'คัดลอกโค้ด'; // สร้าง HTML สำหรับแสดงเวลาที่คัดลอก (ถ้ามี) let timeDisplay = ''; if (isCopied) { timeDisplay = `<div class="copy-time">คัดลอกเมื่อ: ${formatTimestamp(isCopied)}</div>`; } return ` <div class="code-block ${copiedClass}" style="position: relative;" id="block-${uniqueId}"> <pre><code class="hljs ${validLang}">${highlightedCode}</code></pre> <button class="copy-button ${copiedClass}" data-code-id="${uniqueId}" onclick="copyCode('${uniqueId}')"> ${buttonText} </button> ${timeDisplay} <div style="display:none;" id="${uniqueId}">${escapedCode}</div> </div> `; }; marked.setOptions({ renderer }); fetch('Readme.md') .then(response => response.text()) .then(text => { document.getElementById('content').innerHTML = marked.parse(text); document.querySelectorAll('pre code').forEach(block => { hljs.highlightElement(block); }); }) .catch(err => { document.getElementById('content').innerHTML = '<h1>ไม่พบไฟล์ README.md</h1><p>กรุณาตรวจสอบไฟล์</p>'; }); function copyCode(id) { const codeElement = document.getElementById(id); const code = codeElement.textContent; const button = document.querySelector(`[data-code-id="${id}"]`); const codeBlock = document.getElementById(`block-${id}`); navigator.clipboard.writeText(code).then(() => { // เปลี่ยนสถานะปุ่ม button.textContent = '✓ คัดลอกแล้ว'; button.classList.add('copied'); // เปลี่ยนสถานะบล็อกโค้ด codeBlock.classList.add('copied'); // เก็บข้อมูลไว้ในตัวแปรในหน่วยความจำเท่านั้น const now = new Date().getTime(); copiedCodes[code] = now; // เพิ่มข้อความแสดงเวลาที่คัดลอก let timeElement = codeBlock.querySelector('.copy-time'); if (!timeElement) { timeElement = document.createElement('div'); timeElement.className = 'copy-time'; codeBlock.appendChild(timeElement); } timeElement.textContent = `คัดลอกเมื่อ: ${formatTimestamp(now)}`; }).catch(err => { button.textContent = 'ผิดพลาด!'; setTimeout(() => { button.textContent = 'คัดลอกโค้ด'; }, 2000); }); } </script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Génération de la page: 0.54 |
proxy
|
phpinfo
|
Réglages