그리고 offline 했다가 online 하니 Media Error Count가 0으로 리셋되던데 원래 의도된 작동인 듯
Device ID Device ID of a physical drive Connector*2 Group of physical ports to which a physical drive is connected Slot Number Slot number on which a physical drive is mounted *2: This item is not displayed for LSI Software RAID.
$ cat lotto.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Lotto from QR</title> </head> <body> <span id="result1">decode</span><br /> <span id="result2">set</span><br /> <span id="result3">random</span><br /> <input type="button" onclick="rand();" value="추첨"/><br /> <input type="file" onchange="previewFile();" /><br /> <img id="lotto" src="" alt="이미지 미리보기..." /> </body> <script src="./lib/index.min.js"></script> <script> function rand() { e = new Set() var val = 0; for(i = 0; i < 6; i++) { do { val = parseInt(Math.random() * 45 + 1) } while(d.has(val) || e.has(val)) e.add(val) }
var result3 = document.querySelector("#result3"); result3.innerHTML = Array.from(e).sort((a, b) => a - b) }
async function qr_decode() { var qr = new QrcodeDecoder(); var img1 = document.querySelector("#lotto"); const code = await qr.decodeFromImage(img1); console.log(code);
var result = document.querySelector("#result1"); result.innerHTML = code.data;
a = code.data.split('v=') b = a[1].split('q') c = b[1]+b[2]+b[3]+b[4] +b[5].slice(0,12) d = new Set() for(i = 0; i < c.length ; i+=2) d.add(parseInt(c.slice(i, i+2)))
var result2 = document.querySelector("#result2"); result2.innerHTML = Array.from(d).sort((a, b) => a - b)
rand(); }
function previewFile() { var file = document.querySelector("input[type=file]").files[0]; var reader = new FileReader(); reader.onload = function () { var preview = document.querySelector("#lotto"); preview.src = reader.result; preview.onload = function () { qr_decode(); } }
if (file) { reader.readAsDataURL(file); } } </script>