65 lines
3.2 KiB
HTML
65 lines
3.2 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="ru">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<title>AstroMayak Admin</title>
|
||
<script type="module" crossorigin src="/assets/index-DzvFzRSs.js"></script>
|
||
<link rel="stylesheet" crossorigin href="/assets/index-CMrKVZZb.css">
|
||
</head>
|
||
<body>
|
||
<div id="app"></div>
|
||
|
||
<script>
|
||
/* Навигация с дашборда: карточки метрик ведут в соответствующий раздел */
|
||
(function () {
|
||
var MAP = [
|
||
['Всего клиентов', '/users'],
|
||
['Активных подписок', '/subscriptions'],
|
||
['Доход', '/payments'],
|
||
['Платежей успешно', '/payments'],
|
||
['Запросов за 30д', '/users'],
|
||
['Токенов за 30д', '/users'],
|
||
['Стоимость $ за 30д', '/users']
|
||
];
|
||
function decorate() {
|
||
var cards = document.querySelectorAll('div[class*="bg-white"]');
|
||
for (var i = 0; i < cards.length; i++) {
|
||
(function (card) {
|
||
if (card.getAttribute('data-nav')) return;
|
||
var ps = card.querySelectorAll('p');
|
||
if (ps.length < 2) return;
|
||
var label = (ps[0].textContent || '').trim();
|
||
for (var j = 0; j < MAP.length; j++) {
|
||
if (label.indexOf(MAP[j][0]) === 0) {
|
||
card.setAttribute('data-nav', MAP[j][1]);
|
||
card.style.cursor = 'pointer';
|
||
card.style.transition = 'box-shadow .15s, transform .15s';
|
||
card.title = 'Открыть раздел';
|
||
card.addEventListener('mouseenter', function () {
|
||
card.style.boxShadow = '0 6px 18px rgba(0,0,0,.12)';
|
||
card.style.transform = 'translateY(-1px)';
|
||
});
|
||
card.addEventListener('mouseleave', function () {
|
||
card.style.boxShadow = '';
|
||
card.style.transform = '';
|
||
});
|
||
card.addEventListener('click', function () {
|
||
location.href = card.getAttribute('data-nav');
|
||
});
|
||
var hint = document.createElement('div');
|
||
hint.textContent = 'перейти →';
|
||
hint.style.cssText = 'font-size:11px;color:#6366f1;margin-top:2px';
|
||
card.appendChild(hint);
|
||
break;
|
||
}
|
||
}
|
||
})(cards[i]);
|
||
}
|
||
}
|
||
new MutationObserver(decorate).observe(document.body, {childList: true, subtree: true});
|
||
setInterval(decorate, 1000);
|
||
})();
|
||
</script>
|
||
<script>(function(){function add(){var nav=document.querySelector('nav')||document.querySelector('aside');if(!nav||document.getElementById('nav-llm'))return;var a=document.createElement('a');a.id='nav-llm';a.href='/llm.html';a.innerHTML='\u{1F916} LLM';a.style.cssText='display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:8px;color:inherit;text-decoration:none';nav.appendChild(a);}new MutationObserver(add).observe(document.body,{childList:true,subtree:true});setInterval(add,1000);})();</script></body>
|
||
</html> |