This commit is contained in:
Degradin 2025-01-22 00:09:53 +03:00
parent d78a11bce2
commit 0b94436005
4 changed files with 252 additions and 221 deletions

5
bot.js
View File

@ -989,6 +989,11 @@ bot.command('ent_rename', async (ctx) => {
if (!enterprise) { if (!enterprise) {
return await ctx.reply(`Предприятие с ID ${enterpriseId} не найдено.`) return await ctx.reply(`Предприятие с ID ${enterpriseId} не найдено.`)
} }
const user = await UserModel.findByPk(ctx.from.id);
if (enterprise.playerId !== user.telegram_id) {
return await ctx.reply('Это не ваше предприятие.');
}
// Переименовываем предприятие // Переименовываем предприятие
await enterprise.update({ name: newName }) await enterprise.update({ name: newName })

View File

@ -4,228 +4,256 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Меню игрока</title> <title>Меню игрока</title>
<link href="https://fonts.googleapis.com/css2?family=Tektur:wght@400..900&display=swap" rel="stylesheet">
<style> <style>
/* Общие стили */ /* Общие стили */
body { body {
font-family: 'Arial', sans-serif; font-family: 'Tektur', sans-serif;
padding: 0; background-color: #121212;
background-color: #f4f7fc; color: #e0e0e0;
color: #333; margin: 0;
display: flex; padding: 0;
justify-content: center; display: flex;
align-items: center; justify-content: center;
max-width: 500px; align-items: center;
} min-height: 100vh;
}
/* Контейнер для контента */ .container {
.container { width: 90%;
max-width: 500px; max-width: 800px;
width: 100%; padding: 20px;
background: white; background: rgba(0, 0, 0, 0.8);
padding: 20px; border-radius: 15px;
border-radius: 15px; box-shadow: 0 0 20px rgba(226, 111, 34, 0.3);
font-size: 16px; text-align: center;
} }
/* Заголовки */ .title {
.title { font-size: 32px;
font-size: 28px; font-weight: bold;
font-weight: bold; color: #e26f22;
text-align: center; text-shadow: 0 0 10px rgba(226, 111, 34, 0.8), 0 0 20px rgba(226, 111, 34, 0.5);
margin-bottom: 20px; margin-bottom: 20px;
color: #e26f22; }
}
.section { /* Секции */
margin-bottom: 20px; .section {
} margin-top: 20px;
padding: 10px;
border: 2px solid #e26f22;
border-radius: 10px;
background: rgba(255, 255, 255, 0.05);
}
.section h2 { .section h2 {
font-size: 20px; font-size: 22px;
margin-bottom: 10px; color: #e26f22;
color: #e26f22; margin-bottom: 10px;
} }
.section p {
font-size: 16px;
margin: 5px 0;
}
.section span { /* Прогресс-бары */
font-weight: bold; .progress-bar {
} position: relative;
height: 20px;
width: 100%;
background: rgba(255, 255, 255, 0.1);
border-radius: 10px;
overflow: hidden;
margin: 10px 0;
transition: width 0.5s ease;
}
/* Кнопка */ .progress-hp, .progress-stamina {
.button { height: 100%;
display: block; border-radius: 10px;
background-color: #e26f22; transition: width 0.5s ease;
color: white; }
padding: 10px 20px;
text-decoration: none;
border-radius: 5px;
font-size: 16px;
margin-top: 20px;
text-align: center;
width: 350px;
}
/* Профиль */ .progress-hp {
.profile-section { background: linear-gradient(90deg, red, darkred);
display: flex; }
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.profile-img { .progress-stamina {
width: 100px; background: linear-gradient(90deg, green, darkgreen);
height: 100px; }
border-radius: 50%;
background-size: cover;
background-position: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.progress-circle { /* FIRE характеристики */
display: flex; .fire-stats {
flex-direction: column; display: grid;
align-items: center; grid-template-columns: repeat(2, 1fr);
} gap: 10px;
}
.circle-container { .stat {
position: relative; padding: 10px;
width: 100px; border: 2px solid #e26f22;
height: 100px; border-radius: 10px;
margin-bottom: 10px; background: rgba(255, 255, 255, 0.05);
} text-align: center;
}
.circle { .stat span {
stroke-width: 10; font-size: 20px;
fill: transparent; color: #e26f22;
transform-origin: center; font-weight: bold;
transform: rotate(-90deg); }
}
.background-ring { /* Круги прогресса */
stroke: #ddd; .progress-circle {
} display: inline-block;
text-align: center;
margin: 10px;
}
.progress-ring { .circle-container {
stroke: #e26f22; position: relative;
stroke-dasharray: 251; width: 100px;
stroke-dashoffset: 251; height: 100px;
transition: stroke-dashoffset 1s; }
}
.circle-text { .circle {
position: absolute; transform: rotate(-90deg);
top: 50%; }
left: 50%;
transform: translate(-50%, -50%);
font-size: 18px;
font-weight: bold;
}
/* Прогресс-бары */ .background-ring {
.progress-bar { fill: none;
background-color: #ddd; stroke: rgba(255, 255, 255, 0.1);
border-radius: 10px; stroke-width: 8;
height: 15px; }
width: 100%;
margin-bottom: 10px;
overflow: hidden;
}
.progress-hp, .progress-stamina { .progress-ring {
height: 100%; fill: none;
border-radius: 10px; stroke: #e26f22;
transition: width 0.5s ease; stroke-width: 8;
display: flex; stroke-dasharray: 251;
justify-content: center; stroke-dashoffset: 251;
align-items: center; transition: stroke-dashoffset 0.5s ease;
font-weight: bold; }
font-size: 14px;
color: white;
}
/* Статистика игрока */ .circle-text {
.fire-stats { position: absolute;
display: grid; top: 50%;
grid-template-columns: repeat(2, 1fr); left: 50%;
gap: 10px; transform: translate(-50%, -50%);
background-color: #f9f9f9; font-size: 18px;
padding: 10px; font-weight: bold;
margin-top: 15px; color: #e26f22;
border-radius: 8px; text-shadow: 0 0 10px rgba(226, 111, 34, 0.8);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); }
}
.fire-stats .stat { /* Кнопка */
text-align: center; .button {
} display: block;
margin: 20px auto 0;
padding: 10px 20px;
font-size: 18px;
font-weight: bold;
text-transform: uppercase;
color: #FFFFFF;
background: linear-gradient(90deg, #e26f22, #0099CC);
text-decoration: none;
border-radius: 10px;
box-shadow: 0 0 15px rgba(226, 111, 34, 0.6);
transition: all 0.3s ease;
}
.fire-stats .stat span { .button:hover {
font-weight: bold; transform: scale(1.05);
} box-shadow: 0 0 25px rgba(226, 111, 34, 0.8);
}
/* Предприятия */ /* Картинка профиля */
.enterprise { .profile-img {
padding: 15px; width: 100px;
background-color: #f9f9f9; height: 100px;
border-radius: 10px; border-radius: 50%;
margin-top: 10px; margin: 10px auto;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); background-size: cover;
} background-position: center;
border: 2px solid #e26f22;
box-shadow: 0 0 10px rgba(226, 111, 34, 0.6), 0 0 20px rgba(226, 111, 34, 0.4), 0 0 30px rgba(226, 111, 34, 0.3); /* Тени для неонового эффекта */
transition: all 0.3s ease; /* Плавные переходы */
}
.enterprise strong { .profile-img:hover {
display: block; transform: scale(1.05); /* Легкое увеличение при наведении */
margin-bottom: 5px; box-shadow: 0 0 15px rgba(226, 111, 34, 1), 0 0 25px rgba(226, 111, 34, 0.8), 0 0 35px rgba(226, 111, 34, 0.6); /* Увеличение свечения при наведении */
} }
.progress-bar-inner { .company {
background-color: #e26f22; font-family: 'Tektur', sans-serif; /* Футуристический шрифт */
height: 10px; font-size: 16px; /* Размер текста */
border-radius: 5px; font-weight: bold; /* Жирное начертание */
transition: width 0.5s ease; color: #e26f22; /* Холодный цвет для футуристичного эффекта */
} text-transform: uppercase; /* Заглавные буквы */
letter-spacing: 2px; /* Расстояние между буквами для четкости */
background: linear-gradient(90deg, #e26f22, #e28f22, #e29c22); /* Градиент */
-webkit-background-clip: text; /* Применение градиента к тексту */
color: transparent; /* Прозрачный цвет для текста */
text-shadow: 0 0 10px rgba(226, 111, 34, 0.6), 0 0 20px rgba(226, 111, 34, 0.4), 0 0 30px rgba(226, 111, 34, 0.3); /* Тени для неонового эффекта */
transition: all 0.3s ease; /* Плавные переходы */
}
/* Анимация */ .company:hover {
@keyframes fadeIn { transform: scale(1.05); /* Легкое увеличение при наведении */
from { text-shadow: 0 0 15px rgba(226, 111, 34, 1), 0 0 25px rgba(226, 111, 34, 0.8), 0 0 35px rgba(226, 111, 34, 0.6); /* Увеличение свечения при наведении */
opacity: 0; }
}
to {
opacity: 1;
}
}
@keyframes progress { .money {
from { font-family: 'Tektur', sans-serif; /* Используем тот же футуристический шрифт */
width: 0; font-size: 12px;
} font-weight: bold;
} color: #00ff99; /* Цвет текста — светлый неоново-зеленый */
text-shadow: 0 0 5px rgba(0, 255, 153, 0.8), 0 0 10px rgba(0, 255, 153, 0.7), 0 0 15px rgba(0, 255, 153, 0.6); /* Электронный блеск */
letter-spacing: 2px; /* Немного увеличиваем расстояние между символами для эффектности */
text-transform: uppercase; /* Верхний регистр для четкости */
background: linear-gradient(90deg, #00ff99, #33ccff, #ff33cc); /* Градиент для фона текста */
background-clip: text; /* Применяем фон к тексту */
color: transparent; /* Делаем текст прозрачным, чтобы фон был виден */
animation: glow-electronic 3s infinite alternate; /* Анимация мерцающего эффекта */
}
/* Анимация для всех элементов */ @keyframes glow-electronic {
* { 0% {
animation: fadeIn 1s; text-shadow: 0 0 5px rgba(0, 255, 153, 0.8), 0 0 10px rgba(0, 255, 153, 0.7), 0 0 15px rgba(0, 255, 153, 0.6);
} }
50% {
text-shadow: 0 0 10px rgba(0, 255, 153, 1), 0 0 20px rgba(0, 255, 153, 0.9), 0 0 30px rgba(0, 255, 153, 0.8);
}
100% {
text-shadow: 0 0 5px rgba(0, 255, 153, 0.8), 0 0 10px rgba(0, 255, 153, 0.7), 0 0 15px rgba(0, 255, 153, 0.6);
}
}
/* Анимация для прогресс-баров */ .nickname {
.progress-bar-inner { font-family: 'Tektur', sans-serif; /* Шрифт с футуристическим стилем */
animation: progress 1s; font-size: 13px;
} font-weight: bold;
background: linear-gradient(90deg, #00ff99, #00ccff, #ff33cc); /* Градиент для текста */
background-clip: text; /* Применяет фон к тексту */
color: transparent; /* Делаем текст прозрачным, чтобы фон был виден */
text-shadow: 0 0 10px rgba(0, 255, 153, 0.7), 0 0 20px rgba(0, 204, 255, 0.7), 0 0 30px rgba(255, 51, 204, 0.7); /* Неоновые тени */
letter-spacing: 1px; /* Расстояние между буквами для футуристичного эффекта */
text-transform: uppercase; /* Преобразуем в верхний регистр для более стильного вида */
transition: all 0.3s ease; /* Плавные переходы */
}
/* Анимация .progress-hp */ .nickname:hover {
.progress-hp { transform: scale(1.05); /* Легкое увеличение при наведении */
animation: progress 3s; text-shadow: 0 0 15px rgba(0, 255, 153, 1), 0 0 40px rgba(0, 204, 255, 1), 0 0 60px rgba(255, 51, 204, 1);
} }
/* Анимация .progress-stamina */
.progress-stamina {
animation: progress 3s;
}
</style> </style>
<script src="https://telegram.org/js/telegram-web-app.js"></script> <script src="https://telegram.org/js/telegram-web-app.js"></script>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<div class="title">📜 Меню игрока</div> <div class="company">📜 Меню игрока</div>
<div class="profile-section"> <div class="profile-section">
<div id="profile-img" class="profile-img"></div> <div id="profile-img" class="profile-img"></div>
@ -252,11 +280,11 @@ body {
</div> </div>
<div class="progress-bar"> <div class="progress-bar">
<div class="progress-hp" id="hp-bar"></div> <div class="progress-hp" id="hp-bar" style="width: 0%;"></div>
</div> </div>
<div class="progress-bar"> <div class="progress-bar">
<div class="progress-stamina" id="stamina-bar"></div> <div class="progress-stamina" id="stamina-bar" style="width: 0%;"></div>
</div> </div>
<div class="fire-stats"> <div class="fire-stats">
@ -279,33 +307,33 @@ body {
</div> </div>
<div class="section"> <div class="section">
<h2>👤 Личные данные</h2> <h2 class="company">👤 Личные данные</h2>
<p>Имя: <span id="name"></span></p> <p>Имя: <span class="nickname" id="name"></span></p>
<p>Telegram ID: <span id="telegramID"></span></p> <p>Telegram ID: <span id="telegramID"></span></p>
</div> </div>
<div class="section"> <div class="section">
<h2>👤 Профиль</h2> <h2 class="company">👤 Профиль</h2>
<p>Деньги: <span id="money"></span></p> <p>Деньги: <span class="money" id="money"></span></p>
<p>Грязные деньги: <span id="dirtymoney"></span></p> <p>Грязные деньги: <span class="money" id="dirtymoney"></span></p>
</div> </div>
<div class="section"> <div class="section">
<h2>🏢 Организация</h2> <h2 class="company">🏢 Организация</h2>
<p>Название: <span id="business-name"></span></p> <p>Название: <span class="company" id="business-name"></span></p>
<p>Баланс: <span id="business-balance"></span></p> <p>Баланс: <span class="money" id="business-balance"></span></p>
<p>Материалы: <span id="business-materials"></span></p> <p>Материалы: <span id="business-materials"></span></p>
</div> </div>
<div class="section"> <div class="section">
<h2>🏭 Предприятия</h2> <h2 class="company">🏭 Предприятия</h2>
<div id="enterprises"> <div id="enterprises">
<p>Нет активных предприятий.</p> <p>Нет активных предприятий.</p>
</div> </div>
</div> </div>
<div class="section"> <div class="section">
<h2>🗄️ Склад</h2> <h2 class="company">🗄️ Склад</h2>
<div id="warehouse"> <div id="warehouse">
<p>Нет доступного склада.</p> <p>Нет доступного склада.</p>
</div> </div>
@ -328,8 +356,8 @@ body {
document.getElementById("telegramID").textContent = user.telegramID; document.getElementById("telegramID").textContent = user.telegramID;
// Профиль // Профиль
document.getElementById("money").textContent = user.money; document.getElementById("money").textContent = "₽" + user.money;
document.getElementById("dirtymoney").textContent = user.dirtymoney; document.getElementById("dirtymoney").textContent = "Ð" + user.dirtymoney;
// Устанавливаем картинку профиля // Устанавливаем картинку профиля
const profileImg = document.getElementById("profile-img"); const profileImg = document.getElementById("profile-img");
@ -358,7 +386,6 @@ body {
document.getElementById("hp-bar").style.width = `${hpProgress}%`; document.getElementById("hp-bar").style.width = `${hpProgress}%`;
document.getElementById("hp-bar").style.backgroundColor = `red`;
document.getElementById("hp-bar").textContent = `❤`; document.getElementById("hp-bar").textContent = `❤`;
document.getElementById("stamina-bar").style.width = `${staminaProgress}%`; document.getElementById("stamina-bar").style.width = `${staminaProgress}%`;
document.getElementById("stamina-bar").style.backgroundColor = `green`; document.getElementById("stamina-bar").style.backgroundColor = `green`;
@ -373,7 +400,7 @@ body {
// Организация // Организация
document.getElementById("business-name").textContent = business.name; document.getElementById("business-name").textContent = business.name;
document.getElementById("business-balance").textContent = business.balance; document.getElementById("business-balance").textContent = "₽" + business.balance;
document.getElementById("business-materials").textContent = business.materials; document.getElementById("business-materials").textContent = business.materials;
// Предприятия // Предприятия
@ -382,18 +409,18 @@ body {
enterprisesDiv.innerHTML = ""; enterprisesDiv.innerHTML = "";
enterprises.forEach(ent => { enterprises.forEach(ent => {
const div = document.createElement("div"); const div = document.createElement("div");
div.classList.add("enterprise"); div.classList.add("section");
div.innerHTML = ` div.innerHTML = `
<strong>${ent.name}</strong><br> <strong>${ent.name}</strong><br>
Тип ресурса: ${getResourceIcon(ent.resourceType)} ${getResourceName(ent.resourceType)}<br> Тип ресурса: ${getResourceIcon(ent.resourceType)} ${getResourceName(ent.resourceType)}<br>
Уровень: ${ent.level}<br> Уровень: ${ent.level}<br>
Эффективность: ${ent.efficiency}/час<br> Эффективность: ${ent.efficiency}/час<br>
Заполненность склада: ${ent.currentResources}/${ent.warehouseCapacity} Заполненность склада: ${ent.currentResources}/${ent.warehouseCapacity}<br><br>
`; `;
// Добавляем прогрессбар заполненности склада // Добавляем прогрессбар заполненности склада
const progress = (ent.currentResources / ent.warehouseCapacity) * 100; const progress = (ent.currentResources / ent.warehouseCapacity) * 100;
const progressBar = document.createElement("div"); const progressBar = document.createElement("div");
progressBar.innerHTML = `<div class="progress-bar-inner" style="width: ${progress}%"></div>`; progressBar.innerHTML = `<div class="progress-bar" style="width: ${progress}%"></div>`;
div.appendChild(progressBar); div.appendChild(progressBar);
enterprisesDiv.appendChild(div); enterprisesDiv.appendChild(div);
}); });
@ -412,8 +439,7 @@ body {
const warehouseCapacity = warehouse.wood + warehouse.coal + warehouse.oil + warehouse.metall + warehouse.gold + warehouse.diamond; const warehouseCapacity = warehouse.wood + warehouse.coal + warehouse.oil + warehouse.metall + warehouse.gold + warehouse.diamond;
const progress = (warehouseCapacity / warehouse.capacity) * 100; const progress = (warehouseCapacity / warehouse.capacity) * 100;
const progressBar = document.createElement("div"); const progressBar = document.createElement("div");
progressBar.classList.add("progress-bar"); progressBar.innerHTML = `<div class="progress-bar" style="width: ${progress}%"></div>`;
progressBar.innerHTML = `<div class="progress-bar-inner" style="width: ${progress}%"></div>`;
warehouseDiv.appendChild(progressBar); warehouseDiv.appendChild(progressBar);
}) })
.catch(err => { .catch(err => {

View File

@ -5,12 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Таблица лидеров</title> <title>Таблица лидеров</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEJgP4v8Jf+K6cM7V3zv7+uCGo5F5O+Xq6bM+bB5HXitBzvvhQ2V5+fu+n9U7" crossorigin="anonymous"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEJgP4v8Jf+K6cM7V3zv7+uCGo5F5O+Xq6bM+bB5HXitBzvvhQ2V5+fu+n9U7" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Tektur:wght@400..900&display=swap" rel="stylesheet">
<style> <style>
body { body {
background-color: #121212; background-color: #121212;
color: #e0e0e0; color: #e0e0e0;
font-family: 'Roboto', sans-serif; font-family: 'Tektur', sans-serif;
margin: 0; margin: 0;
padding: 0; padding: 0;
display: flex; display: flex;
@ -111,7 +111,7 @@
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-family: 'Orbitron', sans-serif; /* Используем футуристический шрифт */ font-family: 'Tektur', sans-serif; /* Используем футуристический шрифт */
font-size: 11px; /* Размер текста внутри круга */ font-size: 11px; /* Размер текста внутри круга */
color: white; /* Цвет текста */ color: white; /* Цвет текста */
background: radial-gradient(circle, rgba(255, 165, 0, 1) 10%, rgba(255, 69, 0, 1) 60%, rgba(255, 0, 0, 1) 100%); /* Огненный градиент */ background: radial-gradient(circle, rgba(255, 165, 0, 1) 10%, rgba(255, 69, 0, 1) 60%, rgba(255, 0, 0, 1) 100%); /* Огненный градиент */
@ -134,7 +134,7 @@
.money { .money {
font-family: 'Orbitron', sans-serif; /* Используем тот же футуристический шрифт */ font-family: 'Tektur', sans-serif; /* Используем тот же футуристический шрифт */
font-size: 12px; font-size: 12px;
font-weight: bold; font-weight: bold;
color: #00ff99; /* Цвет текста — светлый неоново-зеленый */ color: #00ff99; /* Цвет текста — светлый неоново-зеленый */
@ -161,7 +161,7 @@
.nickname { .nickname {
font-family: 'Orbitron', sans-serif; /* Шрифт с футуристическим стилем */ font-family: 'Tektur', sans-serif; /* Шрифт с футуристическим стилем */
font-size: 13px; font-size: 13px;
font-weight: bold; font-weight: bold;
background: linear-gradient(90deg, #00ff99, #00ccff, #ff33cc); /* Градиент для текста */ background: linear-gradient(90deg, #00ff99, #00ccff, #ff33cc); /* Градиент для текста */
@ -179,7 +179,7 @@
} }
.company { .company {
font-family: 'Orbitron', sans-serif; /* Футуристический шрифт */ font-family: 'Tektur', sans-serif; /* Футуристический шрифт */
font-size: 16px; /* Размер текста */ font-size: 16px; /* Размер текста */
font-weight: bold; /* Жирное начертание */ font-weight: bold; /* Жирное начертание */
color: #00FFFF; /* Холодный цвет для футуристичного эффекта */ color: #00FFFF; /* Холодный цвет для футуристичного эффекта */
@ -244,7 +244,7 @@
<span class="nickname">${player.username} ${player.status === 'bronze' ? '[🔺]' : player.status === 'silver' ? '[🔹]' : player.status === 'gold' ? '[🔸]' : player.status === 'admin' ? '[🛡️]' : ''} <span class="nickname">${player.username} ${player.status === 'bronze' ? '[🔺]' : player.status === 'silver' ? '[🔹]' : player.status === 'gold' ? '[🔸]' : player.status === 'admin' ? '[🛡️]' : ''}
</div> </div>
<div class="card-body"> <div class="card-body">
<p>Баланс: <span class="money">${player.money}</span></p> <p>Баланс: <span class="money">${player.money}</span></p>
<p>Уровень: <span class="circle">${player.level}</span></p> <p>Уровень: <span class="circle">${player.level}</span></p>
</div> </div>
</div> </div>
@ -257,7 +257,7 @@
<span class="nickname">${character.username} <span class="nickname">${character.username}
</div> </div>
<div class="card-body"> <div class="card-body">
<p>Баланс: <span class="money">${character.dirtymoney} Ð</span></p> <p>Баланс: <span class="money">Ð${character.dirtymoney}</span></p>
<p>Уровень: <span class="circle">${character.level}</span></p> <p>Уровень: <span class="circle">${character.level}</span></p>
<p>Врагов ликвидировано: ${character.enemiesKilled}</p> <p>Врагов ликвидировано: ${character.enemiesKilled}</p>
<div class="fire-stats"> <div class="fire-stats">
@ -286,10 +286,10 @@
topContent.innerHTML = data.map(enterprise => ` topContent.innerHTML = data.map(enterprise => `
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<span class="company">${enterprise.name} <span class="icon">${enterprise.icon}</span> <span class="company">${enterprise.name}</span>
</div> </div>
<div class="card-body"> <div class="card-body">
<p>Тип ресурса: ${enterprise.resourceType}</p> <p>Тип ресурса: <span class="icon">${enterprise.icon}</p>
<p>Уровень: <span class="circle">${enterprise.level}</span></p> <p>Уровень: <span class="circle">${enterprise.level}</span></p>
<p>Производительность: ${enterprise.efficiency} ед./час</p> <p>Производительность: ${enterprise.efficiency} ед./час</p>
<p>Емкость склада: ${enterprise.warehouseCapacity} ед.</p> <p>Емкость склада: ${enterprise.warehouseCapacity} ед.</p>
@ -307,7 +307,7 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<p>Владелец: <span class="nickname">${business.owner}</span></p> <p>Владелец: <span class="nickname">${business.owner}</span></p>
<p>Баланс: <span class="money">${business.balance}</span></p> <p>Баланс: <span class="money">${business.balance}</span></p>
<p>Сотрудники: ${business.usersCount}</p> <p>Сотрудники: ${business.usersCount}</p>
</div> </div>
</div> </div>

View File

@ -138,7 +138,7 @@ app.get('/enterprises', async (req, res) => {
const enterprisesData = await Promise.all(enterprises.map(async enterprise => { const enterprisesData = await Promise.all(enterprises.map(async enterprise => {
const player = await UserModel.findOne({ const player = await UserModel.findOne({
attributes: ['name'], attributes: ['username'],
where: { telegram_id: enterprise.playerId } where: { telegram_id: enterprise.playerId }
}); });
@ -149,7 +149,7 @@ app.get('/enterprises', async (req, res) => {
efficiency: enterprise.efficiency, efficiency: enterprise.efficiency,
warehouseCapacity: enterprise.warehouseCapacity, warehouseCapacity: enterprise.warehouseCapacity,
currentResources: enterprise.currentResources, currentResources: enterprise.currentResources,
owner: player ? player.name : 'Unknown', owner: player ? player.username : 'Unknown',
icon: resourceIcons[enterprise.resourceType] || '❓' icon: resourceIcons[enterprise.resourceType] || '❓'
}; };
})); }));