2020-04-30 04:50:45 +00:00
|
|
|
Ext.define('pbs-datastore-list', {
|
|
|
|
extend: 'Ext.data.Model',
|
|
|
|
fields: [ 'name', 'comment' ],
|
|
|
|
proxy: {
|
|
|
|
type: 'proxmox',
|
|
|
|
url: "/api2/json/admin/datastore"
|
|
|
|
},
|
|
|
|
idProperty: 'store'
|
|
|
|
});
|
|
|
|
|
2020-05-23 09:52:26 +00:00
|
|
|
Ext.define('pve-rrd-node', {
|
|
|
|
extend: 'Ext.data.Model',
|
|
|
|
fields: [
|
|
|
|
{
|
2020-05-23 12:03:44 +00:00
|
|
|
name: 'cpu',
|
2020-05-23 09:52:26 +00:00
|
|
|
// percentage
|
|
|
|
convert: function(value) {
|
|
|
|
return value*100;
|
|
|
|
}
|
|
|
|
},
|
2020-05-23 12:03:44 +00:00
|
|
|
{
|
|
|
|
name: 'iowait',
|
|
|
|
// percentage
|
|
|
|
convert: function(value) {
|
|
|
|
return value*100;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"memtotal",
|
|
|
|
"memused",
|
2020-05-23 09:52:26 +00:00
|
|
|
{ type: 'date', dateFormat: 'timestamp', name: 'time' }
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2020-05-23 12:03:44 +00:00
|
|
|
|
2020-04-29 09:22:05 +00:00
|
|
|
Ext.define('PBS.DataStoreStatus', {
|
|
|
|
extend: 'Ext.panel.Panel',
|
|
|
|
alias: 'widget.pbsDataStoreStatus',
|
|
|
|
|
|
|
|
title: gettext('Data Store Status'),
|
2020-05-23 09:52:26 +00:00
|
|
|
tbar: ['->', { xtype: 'proxmoxRRDTypeSelector' } ],
|
|
|
|
|
|
|
|
initComponent: function() {
|
|
|
|
var me = this;
|
|
|
|
|
|
|
|
// this is just a test for the RRD api
|
|
|
|
|
|
|
|
var rrdstore = Ext.create('Proxmox.data.RRDStore', {
|
|
|
|
rrdurl: "/api2/json/nodes/localhost/rrd",
|
|
|
|
model: 'pve-rrd-node'
|
|
|
|
});
|
|
|
|
|
|
|
|
me.items = {
|
|
|
|
xtype: 'container',
|
|
|
|
itemId: 'itemcontainer',
|
|
|
|
layout: 'column',
|
|
|
|
minWidth: 700,
|
|
|
|
defaults: {
|
|
|
|
minHeight: 320,
|
|
|
|
padding: 5,
|
|
|
|
columnWidth: 1
|
|
|
|
},
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxRRDChart',
|
|
|
|
title: gettext('CPU usage'),
|
2020-05-23 12:03:44 +00:00
|
|
|
fields: ['cpu','iowait'],
|
|
|
|
fieldTitles: [gettext('CPU usage'), gettext('IO delay')],
|
|
|
|
store: rrdstore
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxRRDChart',
|
|
|
|
title: gettext('Memory usage'),
|
|
|
|
fields: ['memtotal','memused'],
|
|
|
|
fieldTitles: [gettext('Total'), gettext('RAM usage')],
|
2020-05-23 09:52:26 +00:00
|
|
|
store: rrdstore
|
2020-05-23 12:03:44 +00:00
|
|
|
},
|
2020-05-23 09:52:26 +00:00
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
me.listeners = {
|
|
|
|
activate: function() {
|
|
|
|
rrdstore.startUpdate();
|
|
|
|
},
|
|
|
|
destroy: function() {
|
|
|
|
rrdstore.stopUpdate();
|
|
|
|
},
|
|
|
|
};
|
2020-04-29 09:22:05 +00:00
|
|
|
|
2020-05-23 09:52:26 +00:00
|
|
|
me.callParent();
|
|
|
|
}
|
2020-04-29 09:22:05 +00:00
|
|
|
});
|