From 2cc42daaa7145e52051d6020d1936923222b01df Mon Sep 17 00:00:00 2001 From: Ludovic <54670129+lbr38@users.noreply.github.com> Date: Tue, 14 Jul 2026 15:31:57 +0200 Subject: [PATCH] 6.11.2 --- www/public/resources/js/classes/ConfirmBox.js | 4 +- www/public/resources/js/classes/EChart.js | 29 ++-- www/public/resources/js/classes/Layout.js | 5 + www/public/resources/js/classes/Modal.js | 25 ++-- www/public/resources/styles/common.css | 136 +++++++++++++++--- .../resources/styles/components/button.css | 100 +++++++++---- .../styles/components/confirmbox.css | 38 +++-- .../resources/styles/components/input.css | 16 ++- .../resources/styles/components/label.css | 45 +++--- .../resources/styles/components/layout.css | 2 +- 10 files changed, 302 insertions(+), 98 deletions(-) diff --git a/www/public/resources/js/classes/ConfirmBox.js b/www/public/resources/js/classes/ConfirmBox.js index e7c33e78..158d4d98 100644 --- a/www/public/resources/js/classes/ConfirmBox.js +++ b/www/public/resources/js/classes/ConfirmBox.js @@ -17,7 +17,7 @@ class ConfirmBox // If there is a title if (data.title != "") { - innerHtml += '
'; + innerHtml += '
'; innerHtml += '
' + data.title.toUpperCase() + '
'; innerHtml += ''; innerHtml += '
'; @@ -38,7 +38,7 @@ class ConfirmBox if (!empty(data.buttons)) { var id = 0; for (const [key, value] of Object.entries(data.buttons)) { - innerHtml += '
' + value.text + '
'; + innerHtml += '
' + value.text + '
'; id++; } } diff --git a/www/public/resources/js/classes/EChart.js b/www/public/resources/js/classes/EChart.js index 9f7ec30c..02a0d27c 100644 --- a/www/public/resources/js/classes/EChart.js +++ b/www/public/resources/js/classes/EChart.js @@ -11,7 +11,6 @@ class EChart // Static registry to store all chart instances for external access static instances = {}; - // If on mobile, default to 1 day range, otherwise 3 days constructor(type, id, autoUpdate = true, autoUpdateInterval = 15000, days = 1, wasInNaturalState = true, periodChanged = false, preservedCurrentType = null) { this.id = id; @@ -25,8 +24,8 @@ class EChart this._periodChanged = periodChanged; this.datasets = []; this.labels = []; - this.chartOptions = []; - this.animate = ''; + this.chartOptions = {}; + this._resizeHandler = null; // Default options (will be cloned before use) this.baseOptions = { @@ -537,7 +536,7 @@ class EChart type: 'pie', roseType: 'radius', radius: [innerRadius, outerRadius], // Configurable radius values - center: ['50%', '50%'], + center: this.chartOptions?.title?.text ? ['50%', '57%'] : ['50%', '50%'], itemStyle: { borderRadius: 2 }, @@ -556,7 +555,7 @@ class EChart }); } - if (this.type === 'doughnut') { + if (this.currentType === 'doughnut') { return this.datasets.map(dataset => { const data = dataset.data.map((v, i) => { const item = { @@ -968,6 +967,12 @@ class EChart options.xAxis.axisLabel.textStyle = { color: '#8A99AA' }; + + // Show all bars by default (override the 80-100% default zoom) + options.dataZoom[0].start = 0; + options.dataZoom[0].end = 100; + options.dataZoom[1].start = 0; + options.dataZoom[1].end = 100; } // For horizontal bar charts, just swap the axes (same as vertical but inverted) @@ -999,6 +1004,9 @@ class EChart if (this.chartOptions.title?.text) { options.title.text = this.chartOptions.title.text; options.title.left = this.chartOptions.title.align || 'left'; + if (this.chartOptions.title.fontSize !== undefined) { + options.title.textStyle.fontSize = this.chartOptions.title.fontSize; + } } // Y-axis features @@ -1235,9 +1243,8 @@ class EChart } // Handle window resize - window.addEventListener('resize', () => { - chart.resize(); - }); + this._resizeHandler = () => { chart.resize(); }; + window.addEventListener('resize', this._resizeHandler); } // helper local formatter (use user's locale and local timezone) @@ -1360,6 +1367,12 @@ EChart.destroyInstance = function(chartId) { if (instance) { instance.stopAutoUpdate(); + // Remove resize listener + if (instance._resizeHandler) { + window.removeEventListener('resize', instance._resizeHandler); + instance._resizeHandler = null; + } + // Clean up DOM element reference const chartElement = document.querySelector("#" + chartId); if (chartElement && chartElement._chartInstance) { diff --git a/www/public/resources/js/classes/Layout.js b/www/public/resources/js/classes/Layout.js index 558f523e..a98d72a7 100644 --- a/www/public/resources/js/classes/Layout.js +++ b/www/public/resources/js/classes/Layout.js @@ -56,6 +56,11 @@ class Layout { $('body').append('
'); } + toggleElementById(id) + { + $('#' + id).toggle(); + } + /** * Reload opened or closed elements that where opened/closed before reloading */ diff --git a/www/public/resources/js/classes/Modal.js b/www/public/resources/js/classes/Modal.js index 8cf4d875..fea9edc6 100644 --- a/www/public/resources/js/classes/Modal.js +++ b/www/public/resources/js/classes/Modal.js @@ -38,18 +38,6 @@ class Modal // Remove existing modal loading window if any $('.modal-window-container.modal-loading').remove(); - // Parse content and if a line contains [ERR] or [WRN], color it accordingly - content = content.split('\n').map(function(line) { - if (line.includes('[ERR]')) { - return '' + line + ''; - } - if (line.includes('[WRN]')) { - return '' + line + ''; - } - - return line; - }).join('\n'); - // Generate content var html = '