[pve-devel] [PATCH manager v2 7/7] delete old lxc/qemu statusview classes

Dominik Csapak d.csapak at proxmox.com
Fri Aug 19 10:47:53 CEST 2016


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/Makefile           |   2 -
 www/manager6/lxc/StatusView.js  | 105 ----------------------------------------
 www/manager6/qemu/StatusView.js |  75 ----------------------------
 3 files changed, 182 deletions(-)
 delete mode 100644 www/manager6/lxc/StatusView.js
 delete mode 100644 www/manager6/qemu/StatusView.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 8b6d272..7f6c60d 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -121,7 +121,6 @@ JSSRC= 				                 	\
 	node/Subscription.js				\
 	node/APT.js					\
 	node/Config.js					\
-	qemu/StatusView.js				\
 	window/Migrate.js				\
 	window/MigrateAll.js				\
 	qemu/Monitor.js					\
@@ -151,7 +150,6 @@ JSSRC= 				                 	\
 	qemu/SnapshotTree.js				\
 	qemu/Config.js					\
 	qemu/CreateWizard.js				\
-	lxc/StatusView.js				\
 	lxc/Summary.js					\
 	lxc/Network.js					\
 	lxc/Resources.js				\
diff --git a/www/manager6/lxc/StatusView.js b/www/manager6/lxc/StatusView.js
deleted file mode 100644
index 11145b3..0000000
--- a/www/manager6/lxc/StatusView.js
+++ /dev/null
@@ -1,105 +0,0 @@
-Ext.define('PVE.lxc.StatusView', {
-    extend: 'PVE.grid.ObjectGrid',
-    disabled: true,
-
-    initComponent : function() {
-	var me = this;
-
-	var nodename = me.pveSelNode.data.node;
-	if (!nodename) {
-	    throw "no node name specified";
-	}
-
-	var vmid = me.pveSelNode.data.vmid;
-	if (!vmid) {
-	    throw "no VM ID specified";
-	}
-
-	var template = !!me.pveSelNode.data.template;
-
-	var render_cpu = function(value, metaData, record, rowIndex, colIndex, store) {
-	    if (!me.getObjectValue('uptime')) {
-		return '-';
-	    }
-
-	    var maxcpu = me.getObjectValue('cpus', 1);
-
-	    if (!(Ext.isNumeric(value) && Ext.isNumeric(maxcpu) && (maxcpu >= 1))) {
-		return '-';
-	    }
-
-	    var cpu = value * 100;
-	    return cpu.toFixed(1) + '% of ' + maxcpu.toString() + (maxcpu > 1 ? 'CPUs' : 'CPU');
-
-	};
-
-	var render_mem = function(value, metaData, record, rowIndex, colIndex, store) {
-	    var maxmem = me.getObjectValue('maxmem', 0);
-	    var per = (value / maxmem)*100;
-	    var text = "<div>" + PVE.Utils.totalText + ": " + PVE.Utils.format_size(maxmem) + "</div>" + 
-		"<div>" + PVE.Utils.usedText + ": " + PVE.Utils.format_size(value) + "</div>";
-	    return text;
-	};
-
-	var render_swap = function(value, metaData, record, rowIndex, colIndex, store) {
-	    var maxswap = me.getObjectValue('maxswap', 0);
-	    var per = (value / maxswap)*100;
-	    var text = "<div>" + PVE.Utils.totalText + ": " + PVE.Utils.format_size(maxswap) + "</div>" + 
-		"<div>" + PVE.Utils.usedText + ": " + PVE.Utils.format_size(value) + "</div>";
-	    return text;
-	};
-
-	var render_status = function(value, metaData, record, rowIndex, colIndex, store) {
-	    var failcnt = me.getObjectValue('failcnt', 0);
-	    if (failcnt > 0) {
-		return value + " (failure count " + failcnt.toString() + ")";
-	    }
-	    return value;
-	};
-
-	var render_bootdisk = function(value, metaData, record, rowIndex, colIndex, store) {
-	    if (!Ext.isNumeric(value)) {
-		return '';
-	    }
-	    var disk = me.getObjectValue('disk', 0);
-	    var text = "<div>" + PVE.Utils.totalText + ": " + PVE.Utils.format_size(value) + "</div>";
-	    if (Ext.isNumeric(disk) && disk > 0) {
-		text += "<div>" + PVE.Utils.usedText + ": " + PVE.Utils.format_size(disk) + "</div>";
-	    }
-	    return text;
-	};
-
-	var rows = {};
-
-	if (template) {
-	    rows = {
-		name: { header: gettext('Name'), defaultValue: 'no name specified' },
-		cpus: { header: gettext('CPU limit'), required: true},
-		maxmem: { header: gettext('Memory'), required: true,  renderer: PVE.Utils.render_size },
-		maxswap: { header: gettext('VSwap'), required: true,  renderer: PVE.Utils.render_size },
-		maxdisk: { header: gettext('Bootdisk size'), renderer: PVE.Utils.render_size, required: true}
-	    };
-	} else {
-	    rows = {
-		name: { header: gettext('Name'), defaultValue: 'no name specified' },
-		status: { header: gettext('Status'), defaultValue: 'unknown', renderer: render_status },
-		failcnt: { visible: false },
-		cpu: { header: gettext('CPU usage'), required: true,  renderer: render_cpu },
-		cpus: { visible: false },
-		mem: { header: gettext('Memory usage'), required: true,  renderer: render_mem },
-		maxmem: { visible: false },
-		swap: { header: gettext('VSwap usage'), required: true,  renderer: render_swap },
-		maxswap: { visible: false },
-		maxdisk: { header: gettext('Bootdisk size'), renderer: render_bootdisk, required: true},
-		uptime: { header: gettext('Uptime'), required: true, renderer: PVE.Utils.render_uptime },
-		ha: { header: gettext('Managed by HA'), required: true, renderer: PVE.Utils.format_ha }
-	    };
-	}
-	Ext.applyIf(me, {
-	    cwidth1: 150,
-	    rows: rows
-	});
-
-	me.callParent();
-    }
-});
diff --git a/www/manager6/qemu/StatusView.js b/www/manager6/qemu/StatusView.js
deleted file mode 100644
index 67e54d4..0000000
--- a/www/manager6/qemu/StatusView.js
+++ /dev/null
@@ -1,75 +0,0 @@
-Ext.define('PVE.qemu.StatusView', {
-    extend: 'PVE.grid.ObjectGrid',
-    alias: ['widget.pveQemuStatusView'],
-    disabled: true,
-
-    initComponent : function() {
-	var me = this;
-
-	var nodename = me.pveSelNode.data.node;
-	if (!nodename) {
-	    throw "no node name specified";
-	}
-
-	var vmid = me.pveSelNode.data.vmid;
-	if (!vmid) {
-	    throw "no VM ID specified";
-	}
-
-	var template = !!me.pveSelNode.data.template;
-
-	var render_cpu = function(value, metaData, record, rowIndex, colIndex, store) {
-	    if (!me.getObjectValue('uptime')) {
-		return '-';
-	    }
-
-	    var maxcpu = me.getObjectValue('cpus', 1);
-
-	    if (!(Ext.isNumeric(value) && Ext.isNumeric(maxcpu) && (maxcpu >= 1))) {
-		return '-';
-	    }
-
-	    var per = (value * 100);
-
-	    return per.toFixed(1) + '% of ' + maxcpu.toString() + (maxcpu > 1 ? 'CPUs' : 'CPU');
-	};
-
-	var render_mem = function(value, metaData, record, rowIndex, colIndex, store) {
-	    var maxmem = me.getObjectValue('maxmem', 0);
-	    var per = (value / maxmem)*100;
-	    var text = "<div>" + PVE.Utils.totalText + ": " + PVE.Utils.format_size(maxmem) + "</div>" + 
-		"<div>" + PVE.Utils.usedText + ": " + PVE.Utils.format_size(value) + "</div>";
-	    return text;
-	};
-
-	var rows = {};
-
-	if (template) {
-	    rows = {
-		name: { header: gettext('Name'), defaultValue: 'no name specified' },
-		cpus: { header: gettext('Processors'), required: true},
-		maxmem: { header: gettext('Memory'), renderer: PVE.Utils.render_size, required: true},
-		maxdisk: { header: gettext('Bootdisk size'), renderer: PVE.Utils.render_size, required: true}
-	    };
-	} else {
-	    rows = {
-		name: { header: gettext('Name'), defaultValue: 'no name specified' },
-		qmpstatus: { header: gettext('Status'), defaultValue: 'unknown' },
-		cpu: { iconCls: 'fa fa-up', header: gettext('CPU usage'), required: true,  renderer: render_cpu },
-		cpus: { visible: false },
-		mem: { header: gettext('Memory usage'), required: true,  renderer: render_mem },
-		maxmem: { visible: false },
-		maxdisk: { header: gettext('Bootdisk size'), renderer: PVE.Utils.render_size, required: true},
-		uptime: { header: gettext('Uptime'), required: true, renderer: PVE.Utils.render_uptime },
-		ha: { header: gettext('Managed by HA'), required: true, renderer: PVE.Utils.format_ha }
-	    };
-	}
-
-	Ext.applyIf(me, {
-	    cwidth1: 150,
-	    rows: rows
-	});
-
-	me.callParent();
-    }
-});
-- 
2.1.4





More information about the pve-devel mailing list