public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager 1/5] ui: panel/ConfigPanel: eslint fixes
@ 2021-05-19 10:56 Dominic Jäger
  2021-05-19 10:56 ` [pve-devel] [PATCH manager 2/5] ui: panel/IPSet: " Dominic Jäger
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Dominic Jäger @ 2021-05-19 10:56 UTC (permalink / raw)
  To: pve-devel

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

diff --git a/www/manager6/panel/ConfigPanel.js b/www/manager6/panel/ConfigPanel.js
index 23a6ee58..788615aa 100644
--- a/www/manager6/panel/ConfigPanel.js
+++ b/www/manager6/panel/ConfigPanel.js
@@ -68,11 +68,11 @@ Ext.define('PVE.panel.Config', {
 	    singleExpand: false,
 	    listeners: {
 		selectionchange: function(treeList, selection) {
-		    var me = this.up('panel');
-		    me.suspendLayout = true;
-		    me.activateCard(selection.data.id);
-		    me.suspendLayout = false;
-		    me.updateLayout();
+		    let view = this.up('panel');
+		    view.suspendLayout = true;
+		    view.activateCard(selection.data.id);
+		    view.suspendLayout = false;
+		    view.updateLayout();
 		},
 		itemclick: function(treelist, info) {
 		    var olditem = treelist.getSelection();
@@ -123,6 +123,7 @@ Ext.define('PVE.panel.Config', {
 	    menu.setSelection(selection);
 	    return cardid;
 	}
+	return '';
     },
 
     activateCard: function(cardid) {
@@ -160,7 +161,7 @@ Ext.define('PVE.panel.Config', {
 	var activeTab; // leaving this undefined means items[0] will be the default tab
 
 	if (stateid) {
-	    var state = me.sp.get(stateid);
+	    let state = me.sp.get(stateid);
 	    if (state && state.value) {
 		// if this tab does not exist, it chooses the first
 		activeTab = state.value;
@@ -259,7 +260,7 @@ Ext.define('PVE.panel.Config', {
 		var acard = me.getLayout().getActiveItem().itemId;
 		// get the itemid of the new value
 		var ncard = state.value || me.firstItem;
-		if (ncard && acard != ncard) {
+		if (ncard && acard !== ncard) {
 		    // select the chosen item
 		    menu.setSelection(root.findChild('id', ncard, true) || root.firstChild);
 		}
-- 
2.20.1





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH manager 2/5] ui: panel/IPSet: eslint fixes
  2021-05-19 10:56 [pve-devel] [PATCH manager 1/5] ui: panel/ConfigPanel: eslint fixes Dominic Jäger
@ 2021-05-19 10:56 ` Dominic Jäger
  2021-05-19 10:56 ` [pve-devel] [PATCH manager 3/5] ui: panel/NotesView: " Dominic Jäger
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Dominic Jäger @ 2021-05-19 10:56 UTC (permalink / raw)
  To: pve-devel

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

diff --git a/www/manager6/panel/IPSet.js b/www/manager6/panel/IPSet.js
index 303e518a..94117789 100644
--- a/www/manager6/panel/IPSet.js
+++ b/www/manager6/panel/IPSet.js
@@ -22,11 +22,11 @@ Ext.define('PVE.IPSetList', {
     initComponent: function() {
         var me = this;
 
-	if (me.ipset_panel == undefined) {
+	if (typeof me.ipset_panel === 'undefined') {
 	    throw "no rule panel specified";
 	}
 
-	if (me.base_url == undefined) {
+	if (typeof me.ipset_panel === 'undefined') {
 	    throw "no base_url specified";
 	}
 
@@ -143,7 +143,7 @@ Ext.define('PVE.IPSetList', {
 	    ],
 	    listeners: {
 		itemdblclick: run_editor,
-		select: function(sm, rec) {
+		select: function(_, rec) {
 		    var url = me.base_url + '/' + rec.data.name;
 		    me.ipset_panel.setBaseUrl(url);
 		},
@@ -346,7 +346,7 @@ Ext.define('PVE.IPSetGrid', {
 		    metaData.tdCls = 'proxmox-invalid-row';
 		    var html = '<p>' + Ext.htmlEncode(msg) + '</p>';
 		    metaData.tdAttr = 'data-qwidth=600 data-qtitle="ERROR" data-qtip="' +
-			html.replace(/\"/g, '&quot;') + '"';
+			html.replace(/"/g, '&quot;') + '"';
 		}
 	    }
 	    return value;
-- 
2.20.1





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH manager 3/5] ui: panel/NotesView: eslint fixes
  2021-05-19 10:56 [pve-devel] [PATCH manager 1/5] ui: panel/ConfigPanel: eslint fixes 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 ` Dominic Jäger
  2021-05-19 10:56 ` [pve-devel] [PATCH manager 4/5] ui: panel/RunningChart: " Dominic Jäger
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Dominic Jäger @ 2021-05-19 10:56 UTC (permalink / raw)
  To: pve-devel

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

diff --git a/www/manager6/panel/NotesView.js b/www/manager6/panel/NotesView.js
index 18dd8876..a40cb7d5 100644
--- a/www/manager6/panel/NotesView.js
+++ b/www/manager6/panel/NotesView.js
@@ -15,8 +15,8 @@ Ext.define('PVE.panel.NotesView', {
 	    {
 		text: gettext('Edit'),
 		handler: function() {
-		    var me = this.up('panel');
-		    me.run_editor();
+		    let view = this.up('panel');
+		    view.run_editor();
 		},
 	    },
 	],
@@ -70,8 +70,8 @@ Ext.define('PVE.panel.NotesView', {
     tools: [{
 	type: 'gear',
 	handler: function() {
-	    var me = this.up('panel');
-	    me.run_editor();
+	    let view = this.up('panel');
+	    view.run_editor();
 	},
     }],
 
-- 
2.20.1





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH manager 4/5] ui: panel/RunningChart: eslint fixes
  2021-05-19 10:56 [pve-devel] [PATCH manager 1/5] ui: panel/ConfigPanel: eslint fixes 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
  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
  4 siblings, 0 replies; 6+ messages in thread
From: Dominic Jäger @ 2021-05-19 10:56 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH manager 5/5] ui: panel/StatusPanel: eslint fixes
  2021-05-19 10:56 [pve-devel] [PATCH manager 1/5] ui: panel/ConfigPanel: eslint fixes Dominic Jäger
                   ` (2 preceding siblings ...)
  2021-05-19 10:56 ` [pve-devel] [PATCH manager 4/5] ui: panel/RunningChart: " Dominic Jäger
@ 2021-05-19 10:56 ` Dominic Jäger
  2021-05-19 12:10 ` [pve-devel] applied-series: [PATCH manager 1/5] ui: panel/ConfigPanel: " Thomas Lamprecht
  4 siblings, 0 replies; 6+ messages in thread
From: Dominic Jäger @ 2021-05-19 10:56 UTC (permalink / raw)
  To: pve-devel

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

diff --git a/www/manager6/panel/StatusPanel.js b/www/manager6/panel/StatusPanel.js
index f7bb4a91..f9e3537b 100644
--- a/www/manager6/panel/StatusPanel.js
+++ b/www/manager6/panel/StatusPanel.js
@@ -24,8 +24,8 @@ Ext.define('PVE.panel.StatusPanel', {
 	    listeners: {
 		tabchange: function() {
 		    var atab = me.getActiveTab().itemId;
-		    var state = { value: atab };
-		    sp.set(stateid, state);
+		    let tabstate = { value: atab };
+		    sp.set(stateid, tabstate);
 		},
 	    },
 	    items: [
@@ -46,11 +46,11 @@ Ext.define('PVE.panel.StatusPanel', {
 
 	me.items.get(0).fireEvent('show', me.items.get(0));
 
-	var statechange = function(sp, key, state) {
+	var statechange = function(_, key, newstate) {
 	    if (key === stateid) {
 		var atab = me.getActiveTab().itemId;
-		var ntab = state.value;
-		if (state && ntab && atab != ntab) {
+		let ntab = newstate.value;
+		if (newstate && ntab && atab !== ntab) {
 		    me.setActiveTab(ntab);
 		}
 	    }
-- 
2.20.1





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] applied-series: [PATCH manager 1/5] ui: panel/ConfigPanel: eslint fixes
  2021-05-19 10:56 [pve-devel] [PATCH manager 1/5] ui: panel/ConfigPanel: eslint fixes Dominic Jäger
                   ` (3 preceding siblings ...)
  2021-05-19 10:56 ` [pve-devel] [PATCH manager 5/5] ui: panel/StatusPanel: " Dominic Jäger
@ 2021-05-19 12:10 ` Thomas Lamprecht
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2021-05-19 12:10 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominic Jäger

On 19.05.21 12:56, Dominic Jäger wrote:
> Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
> ---
>  www/manager6/panel/ConfigPanel.js | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
>

applied all 5 patches, much thanks!




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-19 12:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 10:56 [pve-devel] [PATCH manager 1/5] ui: panel/ConfigPanel: eslint fixes 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 ` [pve-devel] [PATCH manager 4/5] ui: panel/RunningChart: " Dominic Jäger
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

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