ui: archive upload mode + lint stub, fix stress warmup output, add descriptions

This commit is contained in:
“Naeel”
2026-05-03 17:14:25 +04:00
parent 2af39ff3e2
commit e9853a4bc0
6 changed files with 436 additions and 17 deletions
+28
View File
@@ -1,5 +1,33 @@
/* functions.js — CRUD операции с функциями */
// setCodeMode переключает режим формы между вводом кода и загрузкой архива.
// prefix: 'c' (create) или 'e' (edit)
// mode: 'code' | 'archive'
function setCodeMode(prefix, mode) {
var codeArea = document.getElementById(prefix + '-code-area');
var archiveArea = document.getElementById(prefix + '-archive-area');
var btnCode = document.getElementById(prefix + '-mode-code');
var btnArchive = document.getElementById(prefix + '-mode-archive');
if (!codeArea || !archiveArea) return;
var isCode = mode === 'code';
codeArea.style.display = isCode ? '' : 'none';
archiveArea.style.display = isCode ? 'none' : '';
if (btnCode) btnCode.style.opacity = isCode ? '1' : '0.5';
if (btnArchive) btnArchive.style.opacity = isCode ? '0.5' : '1';
}
// lintArchiveFile — заглушка линтера для архивов.
// Реализация (распаковка + пофайловая проверка) добавляется позже.
function lintArchiveFile(prefix) {
var input = document.getElementById(prefix + '-archive-file');
if (!input || !input.files || !input.files[0]) {
showStatus('Выберите .zip файл', 'err');
return;
}
showStatus('Линтинг архива — пока не реализован (скоро)', 'info');
}
function parseMethods(v) {
const items = String(v || '').split(',').map(s => s.trim().toUpperCase()).filter(Boolean);
return items.length ? Array.from(new Set(items)) : ['GET'];