add panel for pools

This commit is contained in:
Dietmar Maurer 2012-01-30 08:09:12 +01:00
parent 524710d6f1
commit 0004edad8d
7 changed files with 108 additions and 3 deletions

View File

@ -103,9 +103,12 @@ JSSRC= \
openvz/Options.js \
openvz/Network.js \
openvz/DNS.js \
openvz/BeanCounterGrid.js \
openvz/BeanCounterGrid.js \
openvz/Config.js \
openvz/CreateWizard.js \
pool/StatusView.js \
pool/Summary.js \
pool/Config.js \
storage/ContentView.js \
storage/StatusView.js \
storage/Summary.js \

View File

@ -40,6 +40,7 @@ Ext.define('PVE.StateProvider', {
['ltab', 'tasks'],
['nodetab', ''],
['storagetab', ''],
['pooltab', ''],
['kvmtab', ''],
['ovztab', ''],
['dctab', '']
@ -48,6 +49,7 @@ Ext.define('PVE.StateProvider', {
hprefix: 'v1',
compDict: {
pool: 26,
syslog: 25,
ubc: 24,
initlog: 23,

View File

@ -245,7 +245,8 @@ Ext.define('PVE.StdWorkspace', {
node: 'PVE.node.Config',
qemu: 'PVE.qemu.Config',
openvz: 'PVE.openvz.Config',
storage: 'PVE.storage.Browser'
storage: 'PVE.storage.Browser',
pool: 'pvePoolConfig'
};
if (selected.length > 0) {

View File

@ -92,7 +92,6 @@ Ext.define('PVE.panel.Config', {
var statechange = function(sp, key, state) {
if (stateid && key === stateid) {
console.log("scanhge");
var atab = tab.getActiveTab().itemId;
var ntab = state.value || items[0].itemId;
if (state && ntab && (atab != ntab)) {

View File

@ -0,0 +1,33 @@
Ext.define('PVE.pool.Config', {
extend: 'PVE.panel.Config',
alias: 'widget.pvePoolConfig',
initComponent: function() {
var me = this;
var pool = me.pveSelNode.data.pool;
if (!pool) {
throw "no pool specified";
}
Ext.apply(me, {
title: Ext.String.format(gettext("Resource Pool") + ': ' + pool),
hstateid: 'pooltab',
items: [
{
title: gettext('Summary'),
xtype: 'pvePoolSummary',
itemId: 'summary'
},
{
xtype: 'pveACLView',
title: gettext('Permissions'),
itemId: 'permissions',
path: '/pool/' + pool
}
]
});
me.callParent();
}
});

View File

@ -0,0 +1,31 @@
Ext.define('PVE.pool.StatusView', {
extend: 'PVE.grid.ObjectGrid',
alias: ['widget.pvePoolStatusView'],
initComponent : function() {
var me = this;
var pool = me.pveSelNode.data.pool;
if (!pool) {
throw "no pool specified";
}
var rows = {
comment: {
header: gettext('Comment'),
required: true
}
};
Ext.applyIf(me, {
title: gettext('Status'),
url: "/api2/json/pools/" + pool,
cwidth1: 150,
interval: 30000,
//height: 195,
rows: rows
});
me.callParent();
}
});

View File

@ -0,0 +1,36 @@
Ext.define('PVE.pool.Summary', {
extend: 'Ext.panel.Panel',
alias: 'widget.pvePoolSummary',
initComponent: function() {
var me = this;
var pool = me.pveSelNode.data.pool;
if (!pool) {
throw "no pool specified";
}
var statusview = Ext.create('PVE.pool.StatusView', {
pveSelNode: me.pveSelNode,
style: 'padding-top:0px'
});
var rstore = statusview.rstore;
Ext.apply(me, {
autoScroll: true,
bodyStyle: 'padding:10px',
defaults: {
style: 'padding-top:10px',
width: 800
},
items: [ statusview ]
});
me.on('show', rstore.startUpdate);
me.on('hide', rstore.stopUpdate);
me.on('destroy', rstore.stopUpdate);
me.callParent();
}
});