From 77a159a1a88ccda605683ffec177581cc9c77e91 Mon Sep 17 00:00:00 2001 From: Vladislav Ostapov Date: Wed, 29 Jan 2025 16:32:31 +0300 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B0=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D1=81=D0=BC=D0=BE=D1=82?= =?UTF-8?q?=D1=80=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/dev.html | 32 ++++++++++++++++++++++++++++---- static/fields.css | 11 +++++------ 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/static/dev.html b/static/dev.html index 145da64..729dbc4 100644 --- a/static/dev.html +++ b/static/dev.html @@ -28,6 +28,7 @@ .l3-proto-label input[type=checkbox] { width: auto; } + . @@ -87,13 +88,24 @@ - +

Просмотр логов

Скачать -
{{ logfileContent }}
+
+ + + + + + + + + +
{{ h }}
{{ value }}
+
@@ -120,7 +132,10 @@ maxAgeMs: 0 } }, - logfileContent: "", + logsTable: { + headers: [], + rows: [] + }, settingFetchComplete: false } @@ -173,7 +188,16 @@ this.submitStatus.logView = true fetch(`/dev/logs.csv`, {method: 'GET', credentials: 'same-origin' }) - .then(async (resp) => { this.logfileContent = await resp.text() }) + .then(async (resp) => { + let logfileContent = await resp.text() + const lines = logfileContent.split(/\r\n|\n/) + + // Первая строка содержит заголовки + this.logsTable.headers = lines.shift().split('\t') + + // Остальные строки содержат данные + this.logsTable.rows = lines.map(line => line.split('\t')) + }) .catch((reason) => { alert(`Ошибка при чтении логов: ${reason}`) }) .finally(() => { this.submitStatus.logView = false }) }, diff --git a/static/fields.css b/static/fields.css index e9cb9d5..c2beaf8 100644 --- a/static/fields.css +++ b/static/fields.css @@ -84,15 +84,14 @@ padding: 1em; } -.settings-set-container th { +.statistics-container th { text-align: left; font-weight: normal; - padding: 0.2em 1em 0.2em 0.2em; -} -.settings-set-container td { - min-width: 10em; - padding: 0.2em; } +th { padding: 0.2em 1em 0.2em 0.2em; } +.statistics-container td { min-width: 10em; } +td { padding: 0.2em; } + .tabs-item-flex-container h2 { margin-top: 0; }