Compare commits

..

No commits in common. "ecaad92ef0b85f1ab1688e5047647dc8b8c5643a" and "74012d2fbc13d579514772bf422de759a7799957" have entirely different histories.

4 changed files with 221 additions and 252 deletions

5
bot.js
View File

@ -990,11 +990,6 @@ bot.command('ent_rename', async (ctx) => {
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,256 +4,228 @@
<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: 'Tektur', sans-serif; font-family: 'Arial', sans-serif;
background-color: #121212; padding: 0;
color: #e0e0e0; background-color: #f4f7fc;
margin: 0; color: #333;
padding: 0; display: flex;
display: flex; justify-content: center;
justify-content: center; align-items: center;
align-items: center; max-width: 500px;
min-height: 100vh; }
}
.container { /* Контейнер для контента */
width: 90%; .container {
max-width: 800px; max-width: 500px;
padding: 20px; width: 100%;
background: rgba(0, 0, 0, 0.8); background: white;
border-radius: 15px; padding: 20px;
box-shadow: 0 0 20px rgba(226, 111, 34, 0.3); border-radius: 15px;
text-align: center; font-size: 16px;
} }
.title { /* Заголовки */
font-size: 32px; .title {
font-weight: bold; font-size: 28px;
color: #e26f22; font-weight: bold;
text-shadow: 0 0 10px rgba(226, 111, 34, 0.8), 0 0 20px rgba(226, 111, 34, 0.5); text-align: center;
margin-bottom: 20px; margin-bottom: 20px;
} color: #e26f22;
}
/* Секции */ .section {
.section { margin-bottom: 20px;
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: 22px; font-size: 20px;
color: #e26f22; margin-bottom: 10px;
margin-bottom: 10px; color: #e26f22;
} }
.section p {
font-size: 16px;
margin: 5px 0;
}
/* Прогресс-бары */ .section span {
.progress-bar { font-weight: bold;
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 { /* Кнопка */
height: 100%; .button {
border-radius: 10px; display: block;
transition: width 0.5s ease; background-color: #e26f22;
} color: white;
padding: 10px 20px;
text-decoration: none;
border-radius: 5px;
font-size: 16px;
margin-top: 20px;
text-align: center;
width: 350px;
}
.progress-hp { /* Профиль */
background: linear-gradient(90deg, red, darkred); .profile-section {
} display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.progress-stamina { .profile-img {
background: linear-gradient(90deg, green, darkgreen); width: 100px;
} height: 100px;
border-radius: 50%;
background-size: cover;
background-position: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
/* FIRE характеристики */ .progress-circle {
.fire-stats { display: flex;
display: grid; flex-direction: column;
grid-template-columns: repeat(2, 1fr); align-items: center;
gap: 10px; }
}
.stat { .circle-container {
padding: 10px; position: relative;
border: 2px solid #e26f22; width: 100px;
border-radius: 10px; height: 100px;
background: rgba(255, 255, 255, 0.05); margin-bottom: 10px;
text-align: center; }
}
.stat span { .circle {
font-size: 20px; stroke-width: 10;
color: #e26f22; fill: transparent;
font-weight: bold; transform-origin: center;
} transform: rotate(-90deg);
}
/* Круги прогресса */ .background-ring {
.progress-circle { stroke: #ddd;
display: inline-block; }
text-align: center;
margin: 10px;
}
.circle-container { .progress-ring {
position: relative; stroke: #e26f22;
width: 100px; stroke-dasharray: 251;
height: 100px; stroke-dashoffset: 251;
} transition: stroke-dashoffset 1s;
}
.circle { .circle-text {
transform: rotate(-90deg); position: absolute;
} top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 18px;
font-weight: bold;
}
.background-ring { /* Прогресс-бары */
fill: none; .progress-bar {
stroke: rgba(255, 255, 255, 0.1); background-color: #ddd;
stroke-width: 8; border-radius: 10px;
} height: 15px;
width: 100%;
margin-bottom: 10px;
overflow: hidden;
}
.progress-ring { .progress-hp, .progress-stamina {
fill: none; height: 100%;
stroke: #e26f22; border-radius: 10px;
stroke-width: 8; transition: width 0.5s ease;
stroke-dasharray: 251; display: flex;
stroke-dashoffset: 251; justify-content: center;
transition: stroke-dashoffset 0.5s ease; align-items: center;
} font-weight: bold;
font-size: 14px;
color: white;
}
.circle-text { /* Статистика игрока */
position: absolute; .fire-stats {
top: 50%; display: grid;
left: 50%; grid-template-columns: repeat(2, 1fr);
transform: translate(-50%, -50%); gap: 10px;
font-size: 18px; background-color: #f9f9f9;
font-weight: bold; padding: 10px;
color: #e26f22; margin-top: 15px;
text-shadow: 0 0 10px rgba(226, 111, 34, 0.8); border-radius: 8px;
} box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
/* Кнопка */ .fire-stats .stat {
.button { text-align: center;
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;
}
.button:hover { .fire-stats .stat span {
transform: scale(1.05); font-weight: bold;
box-shadow: 0 0 25px rgba(226, 111, 34, 0.8); }
}
/* Картинка профиля */ /* Предприятия */
.profile-img { .enterprise {
width: 100px; padding: 15px;
height: 100px; background-color: #f9f9f9;
border-radius: 50%; border-radius: 10px;
margin: 10px auto; margin-top: 10px;
background-size: cover; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
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; /* Плавные переходы */
}
.profile-img:hover { .enterprise strong {
transform: scale(1.05); /* Легкое увеличение при наведении */ display: block;
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); /* Увеличение свечения при наведении */ margin-bottom: 5px;
} }
.company { .progress-bar-inner {
font-family: 'Tektur', sans-serif; /* Футуристический шрифт */ background-color: #e26f22;
font-size: 16px; /* Размер текста */ height: 10px;
font-weight: bold; /* Жирное начертание */ border-radius: 5px;
color: #e26f22; /* Холодный цвет для футуристичного эффекта */ transition: width 0.5s ease;
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 { /* Анимация */
transform: scale(1.05); /* Легкое увеличение при наведении */ @keyframes fadeIn {
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); /* Увеличение свечения при наведении */ from {
} opacity: 0;
}
to {
opacity: 1;
}
}
.money { @keyframes progress {
font-family: 'Tektur', sans-serif; /* Используем тот же футуристический шрифт */ from {
font-size: 12px; width: 0;
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% { * {
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); animation: fadeIn 1s;
} }
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 { /* Анимация для прогресс-баров */
font-family: 'Tektur', sans-serif; /* Шрифт с футуристическим стилем */ .progress-bar-inner {
font-size: 13px; animation: progress 1s;
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; /* Плавные переходы */
}
.nickname:hover { /* Анимация .progress-hp */
transform: scale(1.05); /* Легкое увеличение при наведении */ .progress-hp {
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); animation: progress 3s;
} }
/* Анимация .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="company">📜 Меню игрока</div> <div class="title">📜 Меню игрока</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>
@ -280,11 +252,11 @@
</div> </div>
<div class="progress-bar"> <div class="progress-bar">
<div class="progress-hp" id="hp-bar" style="width: 0%;"></div> <div class="progress-hp" id="hp-bar"></div>
</div> </div>
<div class="progress-bar"> <div class="progress-bar">
<div class="progress-stamina" id="stamina-bar" style="width: 0%;"></div> <div class="progress-stamina" id="stamina-bar"></div>
</div> </div>
<div class="fire-stats"> <div class="fire-stats">
@ -307,33 +279,33 @@
</div> </div>
<div class="section"> <div class="section">
<h2 class="company">👤 Личные данные</h2> <h2>👤 Личные данные</h2>
<p>Имя: <span class="nickname" id="name"></span></p> <p>Имя: <span 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 class="company">👤 Профиль</h2> <h2>👤 Профиль</h2>
<p>Деньги: <span class="money" id="money"></span></p> <p>Деньги: <span id="money"></span></p>
<p>Грязные деньги: <span class="money" id="dirtymoney"></span></p> <p>Грязные деньги: <span id="dirtymoney"></span></p>
</div> </div>
<div class="section"> <div class="section">
<h2 class="company">🏢 Организация</h2> <h2>🏢 Организация</h2>
<p>Название: <span class="company" id="business-name"></span></p> <p>Название: <span id="business-name"></span></p>
<p>Баланс: <span class="money" id="business-balance"></span></p> <p>Баланс: <span 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 class="company">🏭 Предприятия</h2> <h2>🏭 Предприятия</h2>
<div id="enterprises"> <div id="enterprises">
<p>Нет активных предприятий.</p> <p>Нет активных предприятий.</p>
</div> </div>
</div> </div>
<div class="section"> <div class="section">
<h2 class="company">🗄️ Склад</h2> <h2>🗄️ Склад</h2>
<div id="warehouse"> <div id="warehouse">
<p>Нет доступного склада.</p> <p>Нет доступного склада.</p>
</div> </div>
@ -356,8 +328,8 @@
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");
@ -386,6 +358,7 @@
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`;
@ -400,7 +373,7 @@
// Организация // Организация
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;
// Предприятия // Предприятия
@ -409,18 +382,18 @@
enterprisesDiv.innerHTML = ""; enterprisesDiv.innerHTML = "";
enterprises.forEach(ent => { enterprises.forEach(ent => {
const div = document.createElement("div"); const div = document.createElement("div");
div.classList.add("section"); div.classList.add("enterprise");
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}<br><br> Заполненность склада: ${ent.currentResources}/${ent.warehouseCapacity}
`; `;
// Добавляем прогрессбар заполненности склада // Добавляем прогрессбар заполненности склада
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" style="width: ${progress}%"></div>`; progressBar.innerHTML = `<div class="progress-bar-inner" style="width: ${progress}%"></div>`;
div.appendChild(progressBar); div.appendChild(progressBar);
enterprisesDiv.appendChild(div); enterprisesDiv.appendChild(div);
}); });
@ -439,7 +412,8 @@
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.innerHTML = `<div class="progress-bar" style="width: ${progress}%"></div>`; progressBar.classList.add("progress-bar");
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=Tektur:wght@400..900&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500&display=swap" rel="stylesheet">
<style> <style>
body { body {
background-color: #121212; background-color: #121212;
color: #e0e0e0; color: #e0e0e0;
font-family: 'Tektur', sans-serif; font-family: 'Roboto', 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: 'Tektur', sans-serif; /* Используем футуристический шрифт */ font-family: 'Orbitron', 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: 'Tektur', sans-serif; /* Используем тот же футуристический шрифт */ font-family: 'Orbitron', 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: 'Tektur', sans-serif; /* Шрифт с футуристическим стилем */ font-family: 'Orbitron', 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: 'Tektur', sans-serif; /* Футуристический шрифт */ font-family: 'Orbitron', 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> <span class="company">${enterprise.name} <span class="icon">${enterprise.icon}</span>
</div> </div>
<div class="card-body"> <div class="card-body">
<p>Тип ресурса: <span class="icon">${enterprise.icon}</p> <p>Тип ресурса: ${enterprise.resourceType}</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: ['username'], attributes: ['name'],
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.username : 'Unknown', owner: player ? player.name : 'Unknown',
icon: resourceIcons[enterprise.resourceType] || '❓' icon: resourceIcons[enterprise.resourceType] || '❓'
}; };
})); }));