Spaces:
Running
Running
Update index.html
Browse files- index.html +92 -357
index.html
CHANGED
@@ -324,11 +324,11 @@
|
|
324 |
</div>
|
325 |
<div class="row">
|
326 |
<span class="label">์ถ์ ์๋ฒ:</span>
|
327 |
-
<span class="value">seawolf2357-
|
328 |
</div>
|
329 |
<div class="row">
|
330 |
<span class="label">์ฌ์ดํธ ID:</span>
|
331 |
-
<span class="value">
|
332 |
</div>
|
333 |
<div class="row">
|
334 |
<span class="label">์ถ์ ์์:</span>
|
@@ -354,8 +354,7 @@
|
|
354 |
<div class="debug-log" id="debugLog"></div>
|
355 |
<div class="buttons" style="margin-top: 10px;">
|
356 |
<button onclick="clearDebugLog()" class="secondary">๋ก๊ทธ ์ง์ฐ๊ธฐ</button>
|
357 |
-
<button onclick="
|
358 |
-
<button onclick="window._tracker.debug.testAllMethods()" class="secondary">๋ชจ๋ ๋ฐฉ๋ฒ ํ
์คํธ</button>
|
359 |
</div>
|
360 |
</div>
|
361 |
|
@@ -388,92 +387,27 @@
|
|
388 |
|
389 |
<footer class="footer">
|
390 |
<p>© 2025 EV Cook. ๋ชจ๋ ๊ถ๋ฆฌ ๋ณด์ .</p>
|
391 |
-
<p>์ถ์ ์๋ฒ: <a href="https://seawolf2357-
|
392 |
</footer>
|
393 |
|
394 |
-
<!--
|
395 |
<script>
|
396 |
(function() {
|
397 |
-
// ์ถ์ ์๋ฒ
|
398 |
-
const TRACKING_SERVER = 'https://seawolf2357-
|
399 |
-
const SITE_ID = '
|
400 |
-
const PROCESS_TRACKING_FN_INDEX = 10; // ์๋ฒ ๋ถ์ ๊ฒฐ๊ณผ process_tracking์ fn_index
|
401 |
-
|
402 |
-
// ๋๋ฒ๊ทธ ๋ก๊น
|
403 |
-
const debugLog = [];
|
404 |
-
function addDebugLog(type, message) {
|
405 |
-
const timestamp = new Date().toLocaleTimeString();
|
406 |
-
const logEntry = { type, message, timestamp };
|
407 |
-
debugLog.push(logEntry);
|
408 |
-
|
409 |
-
// ์ฝ์์๋ ์ถ๋ ฅ
|
410 |
-
const consoleMethod = type === 'error' ? 'error' : type === 'success' ? 'log' : 'info';
|
411 |
-
console[consoleMethod](`[Tracker ${timestamp}] ${message}`);
|
412 |
-
|
413 |
-
// UI ์
๋ฐ์ดํธ
|
414 |
-
updateDebugPanel();
|
415 |
-
}
|
416 |
-
|
417 |
-
function updateDebugPanel() {
|
418 |
-
const debugLogEl = document.getElementById('debugLog');
|
419 |
-
if (debugLogEl) {
|
420 |
-
debugLogEl.innerHTML = debugLog.slice(-50).reverse().map(entry =>
|
421 |
-
`<div class="log-entry ${entry.type}">[${entry.timestamp}] ${entry.message}</div>`
|
422 |
-
).join('');
|
423 |
-
}
|
424 |
-
}
|
425 |
|
426 |
// ๋๋ฐ์ด์ค ID ์์ฑ/์กฐํ
|
427 |
function getDeviceId() {
|
428 |
let deviceId = localStorage.getItem('_tracker_device_id');
|
429 |
if (!deviceId) {
|
430 |
-
|
431 |
-
const components = [
|
432 |
-
screen.width + 'x' + screen.height,
|
433 |
-
navigator.hardwareConcurrency || 0,
|
434 |
-
navigator.deviceMemory || 0,
|
435 |
-
navigator.platform,
|
436 |
-
navigator.language,
|
437 |
-
new Date().getTimezoneOffset(),
|
438 |
-
navigator.vendor,
|
439 |
-
screen.colorDepth,
|
440 |
-
window.devicePixelRatio || 1
|
441 |
-
];
|
442 |
-
|
443 |
-
// ๋ ๊ฐ๋ ฅํ ํด์ ํจ์
|
444 |
-
let hash = 0;
|
445 |
-
const str = components.join('|');
|
446 |
-
for (let i = 0; i < str.length; i++) {
|
447 |
-
const char = str.charCodeAt(i);
|
448 |
-
hash = ((hash << 5) - hash) + char;
|
449 |
-
hash = hash & hash;
|
450 |
-
}
|
451 |
-
|
452 |
-
deviceId = 'DEV_' + Math.abs(hash).toString(36).toUpperCase();
|
453 |
localStorage.setItem('_tracker_device_id', deviceId);
|
454 |
-
addDebugLog('info', `์ Device ID ์์ฑ: ${deviceId}`);
|
455 |
}
|
456 |
return deviceId;
|
457 |
}
|
458 |
|
459 |
-
//
|
460 |
-
function getWebGLInfo() {
|
461 |
-
try {
|
462 |
-
const canvas = document.createElement('canvas');
|
463 |
-
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
464 |
-
if (!gl) return 'Not supported';
|
465 |
-
|
466 |
-
const debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
|
467 |
-
if (debugInfo) {
|
468 |
-
return gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
|
469 |
-
}
|
470 |
-
return 'Unknown';
|
471 |
-
} catch(e) {
|
472 |
-
return 'Error: ' + e.message;
|
473 |
-
}
|
474 |
-
}
|
475 |
-
|
476 |
-
// ์ถ์ ๋ฐ์ดํฐ ์ ์ก (๋ชจ๋ ๋ฐฉ๋ฒ ์๋)
|
477 |
async function collectAndSend(eventType = 'pageview', eventData = {}) {
|
478 |
const data = {
|
479 |
siteId: SITE_ID,
|
@@ -487,292 +421,84 @@
|
|
487 |
screenResolution: screen.width + 'x' + screen.height,
|
488 |
platform: navigator.platform,
|
489 |
language: navigator.language,
|
490 |
-
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
491 |
-
cpuCores: navigator.hardwareConcurrency || 0,
|
492 |
-
deviceMemory: navigator.deviceMemory || 0,
|
493 |
-
gpuInfo: getWebGLInfo(),
|
494 |
timestamp: new Date().toISOString()
|
495 |
};
|
496 |
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
},
|
511 |
-
body: JSON.stringify({
|
512 |
-
data: [JSON.stringify(data)]
|
513 |
-
})
|
514 |
-
});
|
515 |
-
|
516 |
-
if (response.ok) {
|
517 |
-
const result = await response.json();
|
518 |
-
|
519 |
-
// event_id๋ฅผ ์ฌ์ฉํด์ ๊ฒฐ๊ณผ ๊ฐ์ ธ์ค๊ธฐ
|
520 |
-
if (result.event_id) {
|
521 |
-
const resultResponse = await fetch(TRACKING_SERVER + '/call/process_tracking/' + result.event_id);
|
522 |
-
if (resultResponse.ok) {
|
523 |
-
addDebugLog('success', 'โ
๋ฐฉ๋ฒ 1 ์ฑ๊ณต: Gradio Client API');
|
524 |
-
success = true;
|
525 |
-
updateTrackingStatus('์ ์ก ์๋ฃ (Client API)');
|
526 |
-
}
|
527 |
-
}
|
528 |
-
}
|
529 |
-
} catch (e) {
|
530 |
-
addDebugLog('error', `๋ฐฉ๋ฒ 1 ์คํจ: ${e.message}`);
|
531 |
-
}
|
532 |
-
}
|
533 |
-
|
534 |
-
// ๋ฐฉ๋ฒ 2: Direct API with fn_index=10
|
535 |
-
if (!success) {
|
536 |
-
try {
|
537 |
-
addDebugLog('info', `๋ฐฉ๋ฒ 2: Direct API (fn_index=${PROCESS_TRACKING_FN_INDEX}) ์๋`);
|
538 |
-
const response = await fetch(TRACKING_SERVER + '/api/predict', {
|
539 |
-
method: 'POST',
|
540 |
-
headers: {
|
541 |
-
'Content-Type': 'application/json',
|
542 |
-
},
|
543 |
-
body: JSON.stringify({
|
544 |
-
data: [JSON.stringify(data)],
|
545 |
-
fn_index: PROCESS_TRACKING_FN_INDEX
|
546 |
-
})
|
547 |
-
});
|
548 |
-
|
549 |
-
if (response.ok) {
|
550 |
-
const result = await response.json();
|
551 |
-
addDebugLog('success', 'โ
๋ฐฉ๋ฒ 2 ์ฑ๊ณต: Direct API');
|
552 |
-
success = true;
|
553 |
-
updateTrackingStatus('์ ์ก ์๋ฃ (Direct API)');
|
554 |
-
} else {
|
555 |
-
addDebugLog('error', `๋ฐฉ๋ฒ 2 ์คํจ: HTTP ${response.status}`);
|
556 |
-
}
|
557 |
-
} catch (e) {
|
558 |
-
addDebugLog('error', `๋ฐฉ๋ฒ 2 ์คํจ: ${e.message}`);
|
559 |
-
}
|
560 |
-
}
|
561 |
-
|
562 |
-
// ๋ฐฉ๋ฒ 3: Queue API
|
563 |
-
if (!success) {
|
564 |
-
try {
|
565 |
-
addDebugLog('info', '๋ฐฉ๋ฒ 3: Queue API ์๋');
|
566 |
-
const session_hash = Math.random().toString(36).substring(2, 15);
|
567 |
-
|
568 |
-
const joinResponse = await fetch(TRACKING_SERVER + '/queue/join', {
|
569 |
-
method: 'POST',
|
570 |
-
headers: {
|
571 |
-
'Content-Type': 'application/json',
|
572 |
-
},
|
573 |
-
body: JSON.stringify({
|
574 |
-
data: [JSON.stringify(data)],
|
575 |
-
fn_index: PROCESS_TRACKING_FN_INDEX,
|
576 |
-
session_hash: session_hash
|
577 |
-
})
|
578 |
-
});
|
579 |
-
|
580 |
-
if (joinResponse.ok) {
|
581 |
-
// SSE๋ก ๊ฒฐ๊ณผ ๋ฐ๊ธฐ
|
582 |
-
const reader = joinResponse.body.getReader();
|
583 |
-
const decoder = new TextDecoder();
|
584 |
-
|
585 |
-
while (true) {
|
586 |
-
const { done, value } = await reader.read();
|
587 |
-
if (done) break;
|
588 |
-
|
589 |
-
const text = decoder.decode(value);
|
590 |
-
if (text.includes('process_completed')) {
|
591 |
-
addDebugLog('success', 'โ
๋ฐฉ๋ฒ 3 ์ฑ๊ณต: Queue API');
|
592 |
-
success = true;
|
593 |
-
updateTrackingStatus('์ ์ก ์๋ฃ (Queue API)');
|
594 |
-
break;
|
595 |
-
}
|
596 |
-
}
|
597 |
-
}
|
598 |
-
} catch (e) {
|
599 |
-
addDebugLog('error', `๋ฐฉ๋ฒ 3 ์คํจ: ${e.message}`);
|
600 |
-
}
|
601 |
-
}
|
602 |
-
|
603 |
-
// ๋ฐฉ๋ฒ 4: Run endpoint
|
604 |
-
if (!success) {
|
605 |
-
try {
|
606 |
-
addDebugLog('info', '๋ฐฉ๋ฒ 4: Run endpoint ์๋');
|
607 |
-
const response = await fetch(TRACKING_SERVER + '/run/process_tracking', {
|
608 |
-
method: 'POST',
|
609 |
-
headers: {
|
610 |
-
'Content-Type': 'application/json',
|
611 |
-
},
|
612 |
-
body: JSON.stringify({
|
613 |
-
data: [JSON.stringify(data)]
|
614 |
-
})
|
615 |
-
});
|
616 |
-
|
617 |
-
if (response.ok) {
|
618 |
-
addDebugLog('success', 'โ
๋ฐฉ๋ฒ 4 ์ฑ๊ณต: Run endpoint');
|
619 |
-
success = true;
|
620 |
-
updateTrackingStatus('์ ์ก ์๋ฃ (Run API)');
|
621 |
}
|
622 |
-
}
|
623 |
-
|
|
|
|
|
624 |
}
|
625 |
-
}
|
626 |
-
|
627 |
-
|
628 |
-
addDebugLog('error',
|
629 |
-
updateTrackingStatus('์ ์ก ์คํจ');
|
630 |
-
}
|
631 |
-
|
632 |
-
return success;
|
633 |
-
}
|
634 |
-
|
635 |
-
// ์ถ์ ์ํ ์
๋ฐ์ดํธ
|
636 |
-
function updateTrackingStatus(status) {
|
637 |
-
const statusEl = document.getElementById('trackingStatus');
|
638 |
-
if (statusEl) {
|
639 |
-
statusEl.textContent = status;
|
640 |
}
|
641 |
}
|
642 |
|
643 |
-
// ์ ์ญ ์ถ์
|
644 |
window._tracker = {
|
645 |
trackEvent: function(eventName, eventData) {
|
646 |
-
|
647 |
-
},
|
648 |
-
|
649 |
-
// ๋๋ฒ๊น
๋๊ตฌ
|
650 |
-
debug: {
|
651 |
-
getDeviceId: getDeviceId,
|
652 |
-
getWebGLInfo: getWebGLInfo,
|
653 |
-
|
654 |
-
// ์๋ฒ ๊ตฌ์กฐ ํ์ธ
|
655 |
-
checkConfig: async function() {
|
656 |
-
addDebugLog('info', '์๋ฒ ๊ตฌ์กฐ ํ์ธ ์ค...');
|
657 |
-
try {
|
658 |
-
const response = await fetch(TRACKING_SERVER + '/config');
|
659 |
-
const config = await response.json();
|
660 |
-
|
661 |
-
addDebugLog('info', `Gradio ๋ฒ์ : ${config.version}`);
|
662 |
-
|
663 |
-
if (config.dependencies) {
|
664 |
-
addDebugLog('info', `API ํจ์ ๊ฐ์: ${config.dependencies.length}`);
|
665 |
-
config.dependencies.forEach((dep, i) => {
|
666 |
-
if (dep.api_name) {
|
667 |
-
addDebugLog('info', `[${i}] ${dep.api_name}`);
|
668 |
-
}
|
669 |
-
});
|
670 |
-
}
|
671 |
-
} catch (e) {
|
672 |
-
addDebugLog('error', `์๏ฟฝ๏ฟฝ๏ฟฝ ๊ตฌ์กฐ ํ์ธ ์คํจ: ${e.message}`);
|
673 |
-
}
|
674 |
-
},
|
675 |
-
|
676 |
-
// ๋ชจ๋ ๋ฐฉ๋ฒ ํ
์คํธ
|
677 |
-
testAllMethods: async function() {
|
678 |
-
addDebugLog('info', '=== ๋ชจ๋ ์ ์ก ๋ฐฉ๋ฒ ํ
์คํธ ์์ ===');
|
679 |
-
const testData = {
|
680 |
-
test: true,
|
681 |
-
method: 'all',
|
682 |
-
timestamp: new Date().toISOString()
|
683 |
-
};
|
684 |
-
await collectAndSend('test_all_methods', testData);
|
685 |
-
},
|
686 |
-
|
687 |
-
// ๊ฐ๋จํ ํ
์คํธ
|
688 |
-
test: function() {
|
689 |
-
return collectAndSend('debug_test', {
|
690 |
-
test: true,
|
691 |
-
timestamp: new Date().toISOString(),
|
692 |
-
random: Math.random()
|
693 |
-
});
|
694 |
-
},
|
695 |
-
|
696 |
-
// ๋ก๊ทธ ํ์ธ
|
697 |
-
getLogs: function() {
|
698 |
-
return debugLog;
|
699 |
-
}
|
700 |
}
|
701 |
};
|
702 |
|
703 |
// ํ์ด์ง ๋ก๋์ ์ถ์
|
704 |
if (document.readyState === 'loading') {
|
705 |
-
document.addEventListener('DOMContentLoaded', () =>
|
706 |
-
addDebugLog('info', 'DOM ๋ก๋ ์๋ฃ, pageview ์ ์ก');
|
707 |
-
collectAndSend();
|
708 |
-
});
|
709 |
} else {
|
710 |
-
addDebugLog('info', 'ํ์ด์ง ์ด๋ฏธ ๋ก๋๋จ, pageview ์ ์ก');
|
711 |
collectAndSend();
|
712 |
}
|
713 |
|
714 |
-
//
|
715 |
-
|
716 |
-
|
717 |
-
const
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
if (!scrollTracked && window.scrollY > 100) {
|
729 |
-
scrollTracked = true;
|
730 |
-
addDebugLog('info', `์คํฌ๋กค ์ด๋ฒคํธ: ${window.scrollY}px`);
|
731 |
-
window._tracker.trackEvent('scroll', { depth: window.scrollY });
|
732 |
}
|
733 |
-
}
|
734 |
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
const trackData = {
|
740 |
-
element: target.tagName,
|
741 |
-
text: target.textContent.substring(0, 50),
|
742 |
-
href: target.href || '',
|
743 |
-
id: target.id || '',
|
744 |
-
class: target.className || ''
|
745 |
-
};
|
746 |
-
window._tracker.trackEvent('click', trackData);
|
747 |
}
|
748 |
-
}
|
749 |
|
750 |
-
//
|
751 |
-
window.
|
752 |
-
|
753 |
-
|
754 |
-
timeOnPage: timeOnPage,
|
755 |
-
scrollDepth: window.scrollY
|
756 |
-
});
|
757 |
-
});
|
758 |
|
759 |
-
//
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
console.log('
|
764 |
-
|
765 |
-
console.log('%c์ฌ์ดํธ ID: ' + SITE_ID, 'color: #2196F3');
|
766 |
-
console.log('%cDevice ID: ' + getDeviceId(), 'color: #2196F3');
|
767 |
-
console.log('%cprocess_tracking fn_index: ' + PROCESS_TRACKING_FN_INDEX, 'color: #2196F3');
|
768 |
-
console.log('\n%c๐ ์ฌ์ฉ ๊ฐ๋ฅํ ๋ช
๋ น์ด:', 'font-weight: bold');
|
769 |
-
console.log('โข window._tracker.trackEvent(name, data) - ์ปค์คํ
์ด๋ฒคํธ ์ ์ก');
|
770 |
-
console.log('โข window._tracker.debug.checkConfig() - ์๋ฒ ๊ตฌ์กฐ ํ์ธ');
|
771 |
-
console.log('โข window._tracker.debug.test() - ํ
์คํธ ์ด๋ฒคํธ ์ ์ก');
|
772 |
-
console.log('โข window._tracker.debug.testAllMethods() - ๋ชจ๋ ๋ฐฉ๋ฒ ํ
์คํธ');
|
773 |
-
console.log('โข window._tracker.debug.getLogs() - ๋๋ฒ๊ทธ ๋ก๊ทธ ํ์ธ');
|
774 |
-
|
775 |
-
addDebugLog('success', 'EV Cook Tracker ์ด๊ธฐํ ์๋ฃ');
|
776 |
})();
|
777 |
</script>
|
778 |
<!-- End Visitor Tracking Script -->
|
@@ -799,13 +525,8 @@
|
|
799 |
timestamp: Date.now(),
|
800 |
location: 'hero_section',
|
801 |
userAction: true
|
802 |
-
}).then(success => {
|
803 |
-
if (success) {
|
804 |
-
alert('โ
์ถ์ ์ด๋ฒคํธ๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์ ์ก๋์์ต๋๋ค!\n\n๋๋ฒ๊ทธ ํจ๋์์ ์์ธ ์ ๋ณด๋ฅผ ํ์ธํ์ธ์.');
|
805 |
-
} else {
|
806 |
-
alert('โ ์ถ์ ์ด๋ฒคํธ ์ ์ก์ ์คํจํ์ต๋๋ค.\n\n๋๋ฒ๊ทธ ํจ๋์์ ์ค๋ฅ๋ฅผ ํ์ธํ์ธ์.');
|
807 |
-
}
|
808 |
});
|
|
|
809 |
} else {
|
810 |
alert('โ ์ถ์ ์คํฌ๋ฆฝํธ๊ฐ ๋ก๋๋์ง ์์์ต๋๋ค.');
|
811 |
}
|
@@ -843,9 +564,9 @@
|
|
843 |
const details = {
|
844 |
tracking: {
|
845 |
deviceId: localStorage.getItem('_tracker_device_id'),
|
846 |
-
siteId: '
|
847 |
-
serverUrl: 'https://seawolf2357-
|
848 |
-
startTime:
|
849 |
},
|
850 |
browser: {
|
851 |
userAgent: navigator.userAgent,
|
@@ -874,8 +595,7 @@
|
|
874 |
hardware: {
|
875 |
cpuCores: navigator.hardwareConcurrency || 'Unknown',
|
876 |
deviceMemory: navigator.deviceMemory ? navigator.deviceMemory + 'GB' : 'Unknown',
|
877 |
-
maxTouchPoints: navigator.maxTouchPoints || 0
|
878 |
-
webGL: window._tracker.debug.getWebGLInfo()
|
879 |
},
|
880 |
location: {
|
881 |
href: window.location.href,
|
@@ -888,8 +608,7 @@
|
|
888 |
time: {
|
889 |
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
890 |
offset: new Date().getTimezoneOffset(),
|
891 |
-
locale: new Date().toLocaleString()
|
892 |
-
timeOnPage: window._trackerStartTime ? Math.floor((Date.now() - window._trackerStartTime) / 1000) + '์ด' : 'Unknown'
|
893 |
},
|
894 |
storage: {
|
895 |
localStorage: typeof(Storage) !== "undefined",
|
@@ -922,17 +641,33 @@
|
|
922 |
|
923 |
// ๋๋ฒ๊ทธ ๋ก๊ทธ ์ง์ฐ๊ธฐ
|
924 |
function clearDebugLog() {
|
925 |
-
window._tracker.
|
926 |
-
|
927 |
-
|
928 |
-
debugLogEl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
929 |
}
|
930 |
}
|
931 |
|
932 |
// ์ฝ์์ ์ถ์ ์ ๋ณด ์ถ๋ ฅ
|
933 |
console.log('%c๐ EV Cook ์ถ์ ์์คํ
ํ์ฑํ๋จ', 'color: #4CAF50; font-size: 16px; font-weight: bold;');
|
934 |
-
console.log('%c์ถ์ ์๋ฒ:', 'font-weight: bold;', 'https://seawolf2357-
|
935 |
-
console.log('%c์ฌ์ดํธ ID:', 'font-weight: bold;', '
|
936 |
console.log('%cDevice ID:', 'font-weight: bold;', localStorage.getItem('_tracker_device_id') || '์์ฑ ์ค...');
|
937 |
console.log('\n%c๐ก Tip: ๋๋ฒ๊ทธ ํจ๋ ๋ฒํผ์ ํด๋ฆญํ์ฌ ์ค์๊ฐ ์ถ์ ๋ก๊ทธ๋ฅผ ํ์ธํ์ธ์!', 'color: #666;');
|
938 |
</script>
|
|
|
324 |
</div>
|
325 |
<div class="row">
|
326 |
<span class="label">์ถ์ ์๋ฒ:</span>
|
327 |
+
<span class="value">seawolf2357-ev-cook-siteurl.static.hf.space</span>
|
328 |
</div>
|
329 |
<div class="row">
|
330 |
<span class="label">์ฌ์ดํธ ID:</span>
|
331 |
+
<span class="value">c4562ca1</span>
|
332 |
</div>
|
333 |
<div class="row">
|
334 |
<span class="label">์ถ์ ์์:</span>
|
|
|
354 |
<div class="debug-log" id="debugLog"></div>
|
355 |
<div class="buttons" style="margin-top: 10px;">
|
356 |
<button onclick="clearDebugLog()" class="secondary">๋ก๊ทธ ์ง์ฐ๊ธฐ</button>
|
357 |
+
<button onclick="checkServerStatus()" class="secondary">์๋ฒ ์ํ ํ์ธ</button>
|
|
|
358 |
</div>
|
359 |
</div>
|
360 |
|
|
|
387 |
|
388 |
<footer class="footer">
|
389 |
<p>© 2025 EV Cook. ๋ชจ๋ ๊ถ๋ฆฌ ๋ณด์ .</p>
|
390 |
+
<p>์ถ์ ์๋ฒ: <a href="https://seawolf2357-ev-cook-siteurl.static.hf.space" target="_blank" style="color: white;">seawolf2357-ev-cook-siteurl.static.hf.space</a></p>
|
391 |
</footer>
|
392 |
|
393 |
+
<!-- Visitor Tracking Script -->
|
394 |
<script>
|
395 |
(function() {
|
396 |
+
// ์ถ์ ์๋ฒ URL
|
397 |
+
const TRACKING_SERVER = 'https://seawolf2357-ev-cook-siteurl.static.hf.space/';
|
398 |
+
const SITE_ID = 'c4562ca1';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
|
400 |
// ๋๋ฐ์ด์ค ID ์์ฑ/์กฐํ
|
401 |
function getDeviceId() {
|
402 |
let deviceId = localStorage.getItem('_tracker_device_id');
|
403 |
if (!deviceId) {
|
404 |
+
deviceId = 'DEV_' + Date.now() + '_' + Math.random().toString(36).substring(2, 9);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
localStorage.setItem('_tracker_device_id', deviceId);
|
|
|
406 |
}
|
407 |
return deviceId;
|
408 |
}
|
409 |
|
410 |
+
// ์ถ์ ๋ฐ์ดํฐ ์ ์ก
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
async function collectAndSend(eventType = 'pageview', eventData = {}) {
|
412 |
const data = {
|
413 |
siteId: SITE_ID,
|
|
|
421 |
screenResolution: screen.width + 'x' + screen.height,
|
422 |
platform: navigator.platform,
|
423 |
language: navigator.language,
|
|
|
|
|
|
|
|
|
424 |
timestamp: new Date().toISOString()
|
425 |
};
|
426 |
|
427 |
+
try {
|
428 |
+
const response = await fetch(TRACKING_SERVER + '/call/process_tracking', {
|
429 |
+
method: 'POST',
|
430 |
+
headers: { 'Content-Type': 'application/json' },
|
431 |
+
body: JSON.stringify({ data: [JSON.stringify(data)] })
|
432 |
+
});
|
433 |
+
|
434 |
+
if (response.ok) {
|
435 |
+
const result = await response.json();
|
436 |
+
if (result.event_id) {
|
437 |
+
console.log('[Tracker] โ
Event tracked');
|
438 |
+
updateTrackingStatus('์ ์ก ์๋ฃ');
|
439 |
+
addDebugLog('success', `์ด๋ฒคํธ ์ ์ก ์ฑ๊ณต: ${eventType}`);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
}
|
441 |
+
} else {
|
442 |
+
console.error('[Tracker] Server error:', response.status);
|
443 |
+
updateTrackingStatus('์ ์ก ์คํจ');
|
444 |
+
addDebugLog('error', `์๋ฒ ์ค๋ฅ: ${response.status}`);
|
445 |
}
|
446 |
+
} catch(e) {
|
447 |
+
console.error('[Tracker] Error:', e);
|
448 |
+
updateTrackingStatus('๋คํธ์ํฌ ์ค๋ฅ');
|
449 |
+
addDebugLog('error', `๋คํธ์ํฌ ์ค๋ฅ: ${e.message}`);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
}
|
451 |
}
|
452 |
|
453 |
+
// ์ ์ญ ์ถ์ ํจ์
|
454 |
window._tracker = {
|
455 |
trackEvent: function(eventName, eventData) {
|
456 |
+
collectAndSend('custom', { name: eventName, data: eventData });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
}
|
458 |
};
|
459 |
|
460 |
// ํ์ด์ง ๋ก๋์ ์ถ์
|
461 |
if (document.readyState === 'loading') {
|
462 |
+
document.addEventListener('DOMContentLoaded', () => collectAndSend());
|
|
|
|
|
|
|
463 |
} else {
|
|
|
464 |
collectAndSend();
|
465 |
}
|
466 |
|
467 |
+
// ๋๋ฒ๊ทธ ๋ก๊ทธ (UI ์ฐ๋์ฉ)
|
468 |
+
const debugLog = [];
|
469 |
+
function addDebugLog(type, message) {
|
470 |
+
const timestamp = new Date().toLocaleTimeString();
|
471 |
+
debugLog.push({ type, message, timestamp });
|
472 |
+
updateDebugPanel();
|
473 |
+
}
|
474 |
+
|
475 |
+
function updateDebugPanel() {
|
476 |
+
const debugLogEl = document.getElementById('debugLog');
|
477 |
+
if (debugLogEl) {
|
478 |
+
debugLogEl.innerHTML = debugLog.slice(-50).reverse().map(entry =>
|
479 |
+
`<div class="log-entry ${entry.type}">[${entry.timestamp}] ${entry.message}</div>`
|
480 |
+
).join('');
|
|
|
|
|
|
|
|
|
481 |
}
|
482 |
+
}
|
483 |
|
484 |
+
function updateTrackingStatus(status) {
|
485 |
+
const statusEl = document.getElementById('trackingStatus');
|
486 |
+
if (statusEl) {
|
487 |
+
statusEl.textContent = status;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
488 |
}
|
489 |
+
}
|
490 |
|
491 |
+
// ์ ์ญ ํจ์ ํ์ฅ
|
492 |
+
window._tracker.getDebugLog = function() {
|
493 |
+
return debugLog;
|
494 |
+
};
|
|
|
|
|
|
|
|
|
495 |
|
496 |
+
// ์ด๊ธฐํ ๋ก๊ทธ
|
497 |
+
console.log('๐ EV Cook Tracker ์ด๊ธฐํ๋จ');
|
498 |
+
console.log('์๋ฒ:', TRACKING_SERVER);
|
499 |
+
console.log('์ฌ์ดํธ ID:', SITE_ID);
|
500 |
+
console.log('๋๋ฐ์ด์ค ID:', getDeviceId());
|
501 |
+
addDebugLog('info', 'EV Cook Tracker ์ด๊ธฐํ ์๋ฃ');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
502 |
})();
|
503 |
</script>
|
504 |
<!-- End Visitor Tracking Script -->
|
|
|
525 |
timestamp: Date.now(),
|
526 |
location: 'hero_section',
|
527 |
userAction: true
|
|
|
|
|
|
|
|
|
|
|
|
|
528 |
});
|
529 |
+
alert('โ
์ถ์ ์ด๋ฒคํธ๊ฐ ์ ์ก๋์์ต๋๋ค!\n\n์ฝ์๊ณผ ๋๋ฒ๊ทธ ํจ๋์์ ํ์ธํ์ธ์.');
|
530 |
} else {
|
531 |
alert('โ ์ถ์ ์คํฌ๋ฆฝํธ๊ฐ ๋ก๋๋์ง ์์์ต๋๋ค.');
|
532 |
}
|
|
|
564 |
const details = {
|
565 |
tracking: {
|
566 |
deviceId: localStorage.getItem('_tracker_device_id'),
|
567 |
+
siteId: 'c4562ca1',
|
568 |
+
serverUrl: 'https://seawolf2357-ev-cook-siteurl.static.hf.space',
|
569 |
+
startTime: new Date().toLocaleString()
|
570 |
},
|
571 |
browser: {
|
572 |
userAgent: navigator.userAgent,
|
|
|
595 |
hardware: {
|
596 |
cpuCores: navigator.hardwareConcurrency || 'Unknown',
|
597 |
deviceMemory: navigator.deviceMemory ? navigator.deviceMemory + 'GB' : 'Unknown',
|
598 |
+
maxTouchPoints: navigator.maxTouchPoints || 0
|
|
|
599 |
},
|
600 |
location: {
|
601 |
href: window.location.href,
|
|
|
608 |
time: {
|
609 |
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
610 |
offset: new Date().getTimezoneOffset(),
|
611 |
+
locale: new Date().toLocaleString()
|
|
|
612 |
},
|
613 |
storage: {
|
614 |
localStorage: typeof(Storage) !== "undefined",
|
|
|
641 |
|
642 |
// ๋๋ฒ๊ทธ ๋ก๊ทธ ์ง์ฐ๊ธฐ
|
643 |
function clearDebugLog() {
|
644 |
+
if (window._tracker && window._tracker.getDebugLog) {
|
645 |
+
window._tracker.getDebugLog().length = 0;
|
646 |
+
const debugLogEl = document.getElementById('debugLog');
|
647 |
+
if (debugLogEl) {
|
648 |
+
debugLogEl.innerHTML = '<div class="log-entry info">๋ก๊ทธ๊ฐ ์ง์์ก์ต๋๋ค.</div>';
|
649 |
+
}
|
650 |
+
}
|
651 |
+
}
|
652 |
+
|
653 |
+
// ์๋ฒ ์ํ ํ์ธ
|
654 |
+
async function checkServerStatus() {
|
655 |
+
try {
|
656 |
+
const response = await fetch('https://seawolf2357-ev-cook-siteurl.static.hf.space/');
|
657 |
+
if (response.ok) {
|
658 |
+
alert('โ
์๋ฒ๊ฐ ์ ์์ ์ผ๋ก ์๋ ์ค์
๋๋ค.');
|
659 |
+
} else {
|
660 |
+
alert('โ ๏ธ ์๋ฒ ์๋ต ์ํ: ' + response.status);
|
661 |
+
}
|
662 |
+
} catch (e) {
|
663 |
+
alert('โ ์๋ฒ์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค: ' + e.message);
|
664 |
}
|
665 |
}
|
666 |
|
667 |
// ์ฝ์์ ์ถ์ ์ ๋ณด ์ถ๋ ฅ
|
668 |
console.log('%c๐ EV Cook ์ถ์ ์์คํ
ํ์ฑํ๋จ', 'color: #4CAF50; font-size: 16px; font-weight: bold;');
|
669 |
+
console.log('%c์ถ์ ์๋ฒ:', 'font-weight: bold;', 'https://seawolf2357-ev-cook-siteurl.static.hf.space');
|
670 |
+
console.log('%c์ฌ์ดํธ ID:', 'font-weight: bold;', 'c4562ca1');
|
671 |
console.log('%cDevice ID:', 'font-weight: bold;', localStorage.getItem('_tracker_device_id') || '์์ฑ ์ค...');
|
672 |
console.log('\n%c๐ก Tip: ๋๋ฒ๊ทธ ํจ๋ ๋ฒํผ์ ํด๋ฆญํ์ฌ ์ค์๊ฐ ์ถ์ ๋ก๊ทธ๋ฅผ ํ์ธํ์ธ์!', 'color: #666;');
|
673 |
</script>
|