fix: история — столбцы шире, дата в 1 строку, text-overflow (v1.2.44)

Время: 130->145px, Операция: 90->115px
Все ячейки: white-space:nowrap
Инстанс/Операция: overflow:hidden + text-overflow:ellipsis
This commit is contained in:
“Naeel”
2026-08-04 13:28:48 +04:00
parent 1218a84bc7
commit 2f07ba507d
2 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ from routes.api_scenario_defs import bp_defs as api_scenario_defs_bp
# Версия — показывается в топбаре UI. Меняется при КАЖДОМ изменении кода.
# Нужна для фильтрации истории (пользователь видит только записи своей версии).
VERSION = "1.2.43"
VERSION = "1.2.44"
# Flask-приложение с Jinja2-шаблонами из папки templates/
app = Flask(__name__, template_folder="templates", static_folder="static")
+6 -8
View File
@@ -40,21 +40,19 @@ async function loadHistory(){
// Таблица с фиксированной шириной колонок
let html='<table style="width:100%;font-size:11px;table-layout:fixed;">';
html+='<tr><th style="padding:2px 6px;width:130px;">Время</th><th style="padding:2px 6px;width:90px;">Операция</th><th style="padding:2px 6px;">Инстанс</th><th style="padding:2px 6px;width:50px;">Статус</th><th style="padding:2px 6px;width:55px;">Длит.</th></tr>';
html+='<tr><th style="padding:2px 6px;width:145px;">Время</th><th style="padding:2px 6px;width:115px;">Операция</th><th style="padding:2px 6px;">Инстанс</th><th style="padding:2px 6px;width:55px;">Статус</th><th style="padding:2px 6px;width:50px;">Длит.</th></tr>';
rows.forEach((r, i)=>{
const time=r.created_at?r.created_at.replace('T',' ').substring(0,19):'?';
const cls=r.status==='OK'?'badge-success':r.status==='FAIL'?'badge':'';
// Цвет фона строки: RUNNING → жёлтый, FAIL → красный
const stCls=r.status==='RUNNING'?'background:#fef3c7;':r.status==='FAIL'?'background:#fef2f2;':'';
// Строка таблицы — кликабельна (раскрывает этапы)
html+=`<tr style="cursor:pointer;${stCls}" onclick="toggleHistoryRow(${i})">
<td style="padding:2px 6px;">${time}</td>
<td style="padding:2px 6px;">${_esc(r.op_name||'?')}</td>
<td style="padding:2px 6px;">${_esc(r.display_name||r.instance_uid||'?')}</td>
<td style="padding:2px 6px;"><span class="badge ${cls}" style="font-size:9px;">${_esc(r.status||'?')}</span></td>
<td style="padding:2px 6px;">${r.duration_sec!=null?r.duration_sec.toFixed(1)+'s':'-'}</td>
<td style="padding:2px 6px;white-space:nowrap;">${time}</td>
<td style="padding:2px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">${_esc(r.op_name||'?')}</td>
<td style="padding:2px 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${_esc(r.display_name||r.instance_uid||'?')}</td>
<td style="padding:2px 6px;white-space:nowrap;"><span class="badge ${cls}" style="font-size:9px;">${_esc(r.status||'?')}</span></td>
<td style="padding:2px 6px;white-space:nowrap;">${r.duration_sec!=null?r.duration_sec.toFixed(1)+'s':'-'}</td>
</tr>`;
// Скрытая строка с этапами (раскрывается по клику)