mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 09:22:03 +00:00
ui: use pmxInfoWidget instead of pveInfoWidget
to prevent that they further diverge than they alread have (pmxInfoWidget got an additional function that is compatible) Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
1490b5eb6d
commit
c95917c263
@ -77,7 +77,6 @@ JSSRC= \
|
|||||||
panel/ConfigPanel.js \
|
panel/ConfigPanel.js \
|
||||||
panel/HealthWidget.js \
|
panel/HealthWidget.js \
|
||||||
panel/IPSet.js \
|
panel/IPSet.js \
|
||||||
panel/InfoWidget.js \
|
|
||||||
panel/NotesView.js \
|
panel/NotesView.js \
|
||||||
panel/RunningChart.js \
|
panel/RunningChart.js \
|
||||||
panel/StatusPanel.js \
|
panel/StatusPanel.js \
|
||||||
|
@ -16,7 +16,7 @@ Ext.define('PVE.node.StatusView', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
xtype: 'pveInfoWidget',
|
xtype: 'pmxInfoWidget',
|
||||||
padding: '0 15 5 15',
|
padding: '0 15 5 15',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ Ext.define('PVE.panel.GuestStatusView', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
xtype: 'pveInfoWidget',
|
xtype: 'pmxInfoWidget',
|
||||||
padding: '2 25',
|
padding: '2 25',
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
@ -52,7 +52,6 @@ Ext.define('PVE.panel.GuestStatusView', {
|
|||||||
renderer: PVE.Utils.format_ha,
|
renderer: PVE.Utils.format_ha,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'pveInfoWidget',
|
|
||||||
itemId: 'node',
|
itemId: 'node',
|
||||||
iconCls: 'fa fa-building fa-fw',
|
iconCls: 'fa fa-building fa-fw',
|
||||||
title: gettext('Node'),
|
title: gettext('Node'),
|
||||||
@ -85,7 +84,6 @@ Ext.define('PVE.panel.GuestStatusView', {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
itemId: 'swap',
|
itemId: 'swap',
|
||||||
xtype: 'pveInfoWidget',
|
|
||||||
iconCls: 'fa fa-refresh fa-fw',
|
iconCls: 'fa fa-refresh fa-fw',
|
||||||
title: gettext('SWAP usage'),
|
title: gettext('SWAP usage'),
|
||||||
valueField: 'swap',
|
valueField: 'swap',
|
||||||
|
@ -1,96 +0,0 @@
|
|||||||
Ext.define('PVE.widget.Info', {
|
|
||||||
extend: 'Ext.container.Container',
|
|
||||||
alias: 'widget.pveInfoWidget',
|
|
||||||
|
|
||||||
layout: {
|
|
||||||
type: 'vbox',
|
|
||||||
align: 'stretch',
|
|
||||||
},
|
|
||||||
|
|
||||||
value: 0,
|
|
||||||
maximum: 1,
|
|
||||||
printBar: true,
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
xtype: 'component',
|
|
||||||
itemId: 'label',
|
|
||||||
data: {
|
|
||||||
title: '',
|
|
||||||
usage: '',
|
|
||||||
iconCls: undefined,
|
|
||||||
},
|
|
||||||
tpl: [
|
|
||||||
'<div class="left-aligned">',
|
|
||||||
'<tpl if="iconCls">',
|
|
||||||
'<i class="{iconCls}"></i> ',
|
|
||||||
'</tpl>',
|
|
||||||
'{title}</div> <div class="right-aligned">{usage}</div>',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
height: 2,
|
|
||||||
border: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
xtype: 'progressbar',
|
|
||||||
itemId: 'progress',
|
|
||||||
height: 5,
|
|
||||||
value: 0,
|
|
||||||
animate: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
warningThreshold: 0.6,
|
|
||||||
criticalThreshold: 0.9,
|
|
||||||
|
|
||||||
setPrintBar: function(enable) {
|
|
||||||
var me = this;
|
|
||||||
me.printBar = enable;
|
|
||||||
me.getComponent('progress').setVisible(enable);
|
|
||||||
},
|
|
||||||
|
|
||||||
setIconCls: function(iconCls) {
|
|
||||||
var me = this;
|
|
||||||
me.getComponent('label').data.iconCls = iconCls;
|
|
||||||
},
|
|
||||||
|
|
||||||
updateValue: function(text, usage) {
|
|
||||||
var me = this;
|
|
||||||
var label = me.getComponent('label');
|
|
||||||
label.update(Ext.apply(label.data, { title: me.title, usage: text }));
|
|
||||||
|
|
||||||
if (usage !== undefined &&
|
|
||||||
me.printBar &&
|
|
||||||
Ext.isNumeric(usage) &&
|
|
||||||
usage >= 0) {
|
|
||||||
var progressBar = me.getComponent('progress');
|
|
||||||
progressBar.updateProgress(usage, '');
|
|
||||||
if (usage > me.criticalThreshold) {
|
|
||||||
progressBar.removeCls('warning');
|
|
||||||
progressBar.addCls('critical');
|
|
||||||
} else if (usage > me.warningThreshold) {
|
|
||||||
progressBar.removeCls('critical');
|
|
||||||
progressBar.addCls('warning');
|
|
||||||
} else {
|
|
||||||
progressBar.removeCls('warning');
|
|
||||||
progressBar.removeCls('critical');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
initComponent: function() {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
if (!me.title) {
|
|
||||||
throw "no title defined";
|
|
||||||
}
|
|
||||||
|
|
||||||
me.callParent();
|
|
||||||
|
|
||||||
me.getComponent('progress').setVisible(me.printBar);
|
|
||||||
|
|
||||||
me.updateValue(me.text, me.value);
|
|
||||||
me.setIconCls(me.iconCls);
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
@ -8,7 +8,7 @@ Ext.define('PVE.panel.TemplateStatusView', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
xtype: 'pveInfoWidget',
|
xtype: 'pmxInfoWidget',
|
||||||
printBar: false,
|
printBar: false,
|
||||||
padding: '2 25',
|
padding: '2 25',
|
||||||
},
|
},
|
||||||
|
@ -11,7 +11,7 @@ Ext.define('PVE.storage.StatusView', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
xtype: 'pveInfoWidget',
|
xtype: 'pmxInfoWidget',
|
||||||
padding: '0 30 5 30',
|
padding: '0 30 5 30',
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
|
Loading…
Reference in New Issue
Block a user