]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
use GaugeWidget from widget toolkit
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 11 Dec 2017 13:57:13 +0000 (14:57 +0100)
committerDominik Csapak <d.csapak@proxmox.com>
Thu, 25 Jan 2018 12:36:38 +0000 (13:36 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Makefile
www/manager6/ceph/Status.js
www/manager6/dc/Summary.js
www/manager6/panel/GaugeWidget.js [deleted file]

index 39ccc346a624d14a7e0781a4721aa51de4b3354e..88501b782a8f5e5ed4a97fecf95f7192802cbe34 100644 (file)
@@ -68,7 +68,6 @@ JSSRC=                                                        \
        panel/InfoWidget.js                             \
        panel/TemplateStatusView.js                     \
        panel/InputPanel.js                             \
-       panel/GaugeWidget.js                            \
        panel/HealthWidget.js                           \
        window/LoginWindow.js                           \
        window/Wizard.js                                \
index 02abb81f73037e9eb8fc71f7f7291ba216b87592..96f49066c2a4fa6a66ee4ed99e2dde387db41d84 100644 (file)
@@ -121,7 +121,7 @@ Ext.define('PVE.node.CephStatus', {
            items: [
                {
                    flex: 1,
-                   xtype: 'pveGauge',
+                   xtype: 'proxmoxGauge',
                    itemId: 'space',
                    title: gettext('Usage')
                },
index 88c66b2900b5c67e9be87ca7c577341a01b70852..f984f58f1df026b4c76cd6062c3b7795c6007564 100644 (file)
@@ -29,7 +29,7 @@ Ext.define('PVE.dc.Summary', {
            bodyPadding: '0 0 10 0',
            layout: 'hbox',
            defaults: {
-               xtype: 'pveGauge',
+               xtype: 'proxmoxGauge',
                flex: 1
            },
            items:[
diff --git a/www/manager6/panel/GaugeWidget.js b/www/manager6/panel/GaugeWidget.js
deleted file mode 100644 (file)
index 0d80972..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-Ext.define('PVE.panel.GaugeWidget', {
-    extend: 'Ext.panel.Panel',
-    alias: 'widget.pveGauge',
-
-    defaults: {
-       style: {
-           'text-align':'center'
-       }
-    },
-    items: [
-       {
-           xtype: 'box',
-           itemId: 'title',
-           data: {
-               title: ''
-           },
-           tpl: '<h3>{title}</h3>'
-       },
-       {
-           xtype: 'polar',
-           height: 120,
-           border: false,
-           itemId: 'chart',
-           series: [{
-               type: 'gauge',
-               value: 0,
-               colors: ['#f5f5f5'],
-               sectors: [0],
-               donut: 90,
-               needleLength: 100,
-               totalAngle: Math.PI
-           }],
-           sprites: [{
-               id: 'valueSprite',
-               type: 'text',
-               text: '',
-               textAlign: 'center',
-               textBaseline: 'bottom',
-               x: 125,
-               y: 110,
-               fontSize: 30
-           }]
-       },
-       {
-           xtype: 'box',
-           itemId: 'text'
-       }
-    ],
-
-    header: false,
-    border: false,
-
-    warningThreshold: 0.6,
-    criticalThreshold: 0.9,
-    warningColor: '#fc0',
-    criticalColor: '#FF6C59',
-    defaultColor: '#c2ddf2',
-    backgroundColor: '#f5f5f5',
-
-    initialValue: 0,
-
-
-    updateValue: function(value, text) {
-       var me = this;
-       var color = me.defaultColor;
-
-       if (value >= me.criticalThreshold) {
-           color = me.criticalColor;
-       } else if (value >= me.warningThreshold) {
-           color = me.warningColor;
-       }
-
-       me.chart.series[0].setColors([color, me.backgroundColor]);
-       me.chart.series[0].setValue(value*100);
-
-       me.valueSprite.setText(' '+(value*100).toFixed(0) + '%');
-       me.valueSprite.setAttributes({x: me.chart.getWidth()/2, y:me.chart.getHeight()-20}, true);
-
-       if (text !== undefined) {
-           me.text.setHtml(text);
-       }
-    },
-
-    initComponent: function() {
-       var me = this;
-
-       me.callParent();
-
-       if (me.title) {
-           me.getComponent('title').update({title: me.title});
-       }
-       me.text = me.getComponent('text');
-       me.chart = me.getComponent('chart');
-       me.valueSprite = me.chart.getSurface('chart').get('valueSprite');
-    }
-});