public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Dominic Jäger" <d.jaeger@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 4/5] ui: panel/RunningChart: eslint fixes
Date: Wed, 19 May 2021 12:56:21 +0200	[thread overview]
Message-ID: <20210519105622.6514-4-d.jaeger@proxmox.com> (raw)
In-Reply-To: <20210519105622.6514-1-d.jaeger@proxmox.com>

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
 www/manager6/panel/RunningChart.js | 43 +++++++++++++++---------------
 1 file changed, 21 insertions(+), 22 deletions(-)

diff --git a/www/manager6/panel/RunningChart.js b/www/manager6/panel/RunningChart.js
index ab4c9039..19db8b50 100644
--- a/www/manager6/panel/RunningChart.js
+++ b/www/manager6/panel/RunningChart.js
@@ -63,14 +63,13 @@ Ext.define('PVE.widget.RunningChart', {
 		tooltip: {
 		    trackMouse: true,
 		    renderer: function(tooltip, record, ctx) {
-			let me = this.getChart();
 			if (!record || !record.data) return;
-			let date = new Date(record.data.time);
-			let value = me.up().renderer(record.data.val);
-			tooltip.setHtml(
-			    me.up().title + ': ' + value + '<br />' +
-			    Ext.Date.format(date, 'H:i:s'),
-			);
+			const view = this.getChart();
+			const date = new Date(record.data.time);
+			const value = view.up().renderer(record.data.val);
+			const line1 = `${view.up().title}: ${value}`;
+			const line2 = Ext.Date.format(date, 'H:i:s');
+			tooltip.setHtml(`${line1}<br />${line2}`);
 		    },
 		},
 		style: {
@@ -100,12 +99,12 @@ Ext.define('PVE.widget.RunningChart', {
     timeFrame: 5*60,
 
     addDataPoint: function(value, time) {
-	let me = this.chart;
-	let panel = me.up();
+	let view = this.chart;
+	let panel = view.up();
 	let now = new Date().getTime();
 	let begin = new Date(now - 1000 * panel.timeFrame).getTime();
 
-	me.store.add({
+	view.store.add({
 	    time: time || now,
 	    val: value || 0,
 	});
@@ -117,28 +116,28 @@ Ext.define('PVE.widget.RunningChart', {
 	// records in the store do not take much space, but like this,
 	// we prevent a memory leak when someone has the site open for a long time
 	// with minimal graphical glitches
-	if (me.store.count() > panel.timeFrame * 20) {
-	    var oldData = me.store.getData().createFiltered(function(item) {
+	if (view.store.count() > panel.timeFrame * 20) {
+	    var oldData = view.store.getData().createFiltered(function(item) {
 		return item.data.time < begin;
 	    });
 
-	    me.store.remove(oldData.getRange());
+	    view.store.remove(oldData.getRange());
 	}
 
-	me.timeaxis.setMinimum(begin);
-	me.timeaxis.setMaximum(now);
-	me.valuesprite.setText(panel.renderer(value || 0).toString());
-	me.valuesprite.setAttributes({
-	    x: me.getWidth() - 15,
-	    y: me.getHeight()/2,
+	view.timeaxis.setMinimum(begin);
+	view.timeaxis.setMaximum(now);
+	view.valuesprite.setText(panel.renderer(value || 0).toString());
+	view.valuesprite.setAttributes({
+	    x: view.getWidth() - 15,
+	    y: view.getHeight()/2,
 	}, true);
-	me.redraw();
+	view.redraw();
     },
 
     setTitle: function(title) {
 	this.title = title;
-	var me = this.getComponent('title');
-	me.update({ title: title });
+	let titlebox = this.getComponent('title');
+	titlebox.update({ title: title });
     },
 
     initComponent: function() {
-- 
2.20.1





  parent reply	other threads:[~2021-05-19 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 10:56 [pve-devel] [PATCH manager 1/5] ui: panel/ConfigPanel: " Dominic Jäger
2021-05-19 10:56 ` [pve-devel] [PATCH manager 2/5] ui: panel/IPSet: " Dominic Jäger
2021-05-19 10:56 ` [pve-devel] [PATCH manager 3/5] ui: panel/NotesView: " Dominic Jäger
2021-05-19 10:56 ` Dominic Jäger [this message]
2021-05-19 10:56 ` [pve-devel] [PATCH manager 5/5] ui: panel/StatusPanel: " Dominic Jäger
2021-05-19 12:10 ` [pve-devel] applied-series: [PATCH manager 1/5] ui: panel/ConfigPanel: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210519105622.6514-4-d.jaeger@proxmox.com \
    --to=d.jaeger@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal