MINI
C:
/
siak
/
app
/
Upload File:
files >> C:/siak/app/DukcapilController.html
<!DOCTYPE html> <html lang="id"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Dukcapil Remote Controller</title> <style> *{box-sizing:border-box} body{margin:0;min-height:100vh;font-family:Arial,sans-serif;background:#f2f4f7;display:flex;justify-content:center;align-items:center;padding:20px} .card{width:100%;max-width:430px;background:#fff;border-radius:18px;padding:24px;box-shadow:0 8px 30px rgba(0,0,0,.12)} h1{margin:0 0 6px;font-size:24px;text-align:center} .server{text-align:center;color:#666;font-size:14px;margin-bottom:22px} .status{border-radius:14px;padding:18px;text-align:center;background:#f5f5f5;margin-bottom:18px} .dot{display:inline-block;width:13px;height:13px;border-radius:50%;background:#999;margin-right:7px} .online{background:#22a447}.offline{background:#d93025} .status-text{font-size:22px;font-weight:bold} .info{margin-top:10px;font-size:14px;color:#555;line-height:1.7} button{width:100%;border:0;border-radius:12px;padding:15px;margin-top:10px;font-size:17px;font-weight:bold;cursor:pointer} button:active{transform:scale(.98)} button:disabled{opacity:.6;cursor:not-allowed} .btn-status{background:#e8eaed}.btn-start{background:#22a447;color:white}.btn-stop{background:#d93025;color:white}.btn-restart{background:#f29900;color:white} .result{margin-top:18px;background:#111827;color:#d1fae5;border-radius:10px;padding:12px;min-height:45px;font-family:monospace;font-size:12px;white-space:pre-wrap;word-break:break-word} </style> </head> <body> <div class="card"> <h1>DUKCAPIL CONTROLLER</h1> <div class="server">Server: 192.168.25.15:38080</div> <div class="status"> <span id="dot" class="dot"></span> <span id="statusText" class="status-text">CHECKING...</span> <div class="info"> PID: <b id="pid">-</b><br> Proxy: <b>192.168.25.15:3030</b> </div> </div> <button class="btn-status" onclick="callApi('status')">STATUS</button> <button class="btn-start" onclick="callApi('start')">▶ START</button> <button class="btn-stop" onclick="callApi('stop')">■ STOP</button> <button class="btn-restart" onclick="callApi('restart')">↻ RESTART</button> <div id="result" class="result">Menghubungkan ke controller...</div> </div> <script> const SERVER = "http://192.168.25.15:38080"; const TOKEN = "DUKCAPIL-2026"; const dot = document.getElementById("dot"); const statusText = document.getElementById("statusText"); const pid = document.getElementById("pid"); const result = document.getElementById("result"); const buttons = document.querySelectorAll("button"); function setOnline(data){ dot.className="dot online"; statusText.textContent="ONLINE"; pid.textContent=data.pid || "-"; } function setOffline(){ dot.className="dot offline"; statusText.textContent="OFFLINE"; pid.textContent="0"; } async function callApi(action){ result.textContent="Mengirim: /"+action+"..."; buttons.forEach(b=>b.disabled=true); try{ const response=await fetch(SERVER+"/"+action,{ method:"GET", headers:{ "X-Dukcapil-Token":TOKEN }, cache:"no-store" }); const text=await response.text(); let data; try{ data=JSON.parse(text); }catch(e){ throw new Error("Response bukan JSON: "+text); } result.textContent=JSON.stringify(data,null,2); if(response.status===401 || data.status==="UNAUTHORIZED"){ dot.className="dot offline"; statusText.textContent="UNAUTHORIZED"; pid.textContent="-"; return; } if(data.status==="ONLINE") setOnline(data); else if(data.status==="OFFLINE") setOffline(); else if(data.status==="ERROR"){ dot.className="dot offline"; statusText.textContent="ERROR"; } }catch(error){ setOffline(); result.textContent="ERROR: "+error.message+ "\n\nPastikan perangkat dapat mengakses:\n"+ SERVER; }finally{ buttons.forEach(b=>b.disabled=false); } } callApi("status"); setInterval(()=>callApi("status"),10000); </script> </body> </html>
Copyright ©2021 || Defacer Indonesia