Регулярное выражение

This commit is contained in:
2026-03-07 13:05:26 +05:00
parent 37b03dc1b5
commit 3ef77e35ff
3 changed files with 26 additions and 5 deletions

View File

@@ -51,9 +51,9 @@
</button>
</form>
<div class="test-users">
<h3><i class="fas fa-users"></i> Управление задачами 0.9</h3>
<h3><i class="fas fa-users"></i> Управление задачами {{APP_VERSION}}</h3>
<ul>
<li><strong><i class="fas fa-school"></i> @2025</strong> МАОУ - СОШ № 25</li>
<li><strong><i class="fas fa-school"></i> @2025</strong> {{SCHOOL_NAME}}</li>
</ul>
</div>
</div>
@@ -64,7 +64,7 @@
<div class="header-top">
<div style="display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 20px;">
<img src="login2.png" alt="School CRM Logo" style="max-width: 200px; max-height: 110px; flex-shrink: 0;">
<h1 style="margin: 0;"> School CRM - Управление задачами</h1>
<h1 style="margin: 0;"> {{SCHOOL_NAME}} - Управление задачами</h1>
<img src="login2.png" alt="School CRM Logo" style="max-width: 200px; max-height: 110px; flex-shrink: 0;">
</div>

View File

@@ -34,9 +34,9 @@ function startAutoUpdate() {
// Запускаем новый интервал (каждые 15 секунд)
updateInterval = setInterval(() => {
autoUpdateTasks();
}, 15000); // 15000 мс = 15 секунд
}, 120000); // 120000 мс = 2 минуты
console.log('🔄 Автообновление задач запущено (каждые 15 сек)');
console.log('🔄 Автообновление задач запущено (каждые 2 минуты)');
}
// Остановка автоматического обновления

View File

@@ -37,6 +37,27 @@ let serverReady = false;
let adminRouter = null;
let upload = null;
let cachedHtml = null;
app.get('/', (req, res) => {
if (cachedHtml) {
// Заменяем плейсхолдеры в закешированном HTML (на случай, если переменные окружения изменились но обычно они не меняются во время работы)
let modifiedHtml = cachedHtml
.replace(/{{APP_NAME}}/g, process.env.APP_NAME)
.replace(/{{APP_VERSION}}/g, process.env.APP_VERSION)
.replace(/{{SCHOOL_NAME}}/g, process.env.SCHOOL_NAME);
return res.send(modifiedHtml);
}
const filePath = path.join(__dirname, 'public', 'index.html');
fs.readFile(filePath, 'utf8', (err, html) => {
if (err) {
return res.status(500).send('Ошибка');
}
cachedHtml = html;
// ... отправка
});
});
// Инициализируем multer сразу с настройками по умолчанию
const uploadsDir = path.join(__dirname, 'data', 'uploads');
const createDirIfNotExists = (dirPath) => {