mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-27 15:21:28 +00:00
add ha resource panel
This commit is contained in:
parent
2904aaf98f
commit
02d79a0cc0
@ -166,6 +166,7 @@ JSSRC= \
|
|||||||
storage/ZFSEdit.js \
|
storage/ZFSEdit.js \
|
||||||
storage/ZFSPoolEdit.js \
|
storage/ZFSPoolEdit.js \
|
||||||
ha/StatusView.js \
|
ha/StatusView.js \
|
||||||
|
ha/Resources.js \
|
||||||
ha/Config.js \
|
ha/Config.js \
|
||||||
dc/Summary.js \
|
dc/Summary.js \
|
||||||
dc/OptionView.js \
|
dc/OptionView.js \
|
||||||
|
79
www/manager/ha/Resources.js
Normal file
79
www/manager/ha/Resources.js
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
Ext.define('PVE.ha.ResourcesView', {
|
||||||
|
extend: 'Ext.grid.GridPanel',
|
||||||
|
alias: ['widget.pveHAResourcesView'],
|
||||||
|
|
||||||
|
initComponent : function() {
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
var store = new Ext.data.Store({
|
||||||
|
model: 'pve-ha-resources',
|
||||||
|
proxy: {
|
||||||
|
type: 'pve',
|
||||||
|
url: "/api2/json/cluster/ha/resources"
|
||||||
|
},
|
||||||
|
sorters: {
|
||||||
|
property: 'sid',
|
||||||
|
order: 'DESC'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var reload = function() {
|
||||||
|
store.load();
|
||||||
|
};
|
||||||
|
|
||||||
|
var sm = Ext.create('Ext.selection.RowModel', {});
|
||||||
|
|
||||||
|
Ext.apply(me, {
|
||||||
|
store: store,
|
||||||
|
selModel: sm,
|
||||||
|
stateful: false,
|
||||||
|
viewConfig: {
|
||||||
|
trackOver: false
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
header: 'ID',
|
||||||
|
width: 100,
|
||||||
|
sortable: true,
|
||||||
|
dataIndex: 'sid'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: gettext('State'),
|
||||||
|
width: 100,
|
||||||
|
sortable: true,
|
||||||
|
renderer: function(v) {
|
||||||
|
return v ? v : 'enabled';
|
||||||
|
},
|
||||||
|
dataIndex: 'state'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: gettext('Group'),
|
||||||
|
width: 200,
|
||||||
|
sortable: true,
|
||||||
|
dataIndex: 'group'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: gettext('Description'),
|
||||||
|
flex: 1,
|
||||||
|
dataIndex: 'comment'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
listeners: {
|
||||||
|
show: reload
|
||||||
|
// itemdblclick: run_editor
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
me.callParent();
|
||||||
|
}
|
||||||
|
}, function() {
|
||||||
|
|
||||||
|
Ext.define('pve-ha-resources', {
|
||||||
|
extend: 'Ext.data.Model',
|
||||||
|
fields: [
|
||||||
|
'sid', 'type', 'state', 'digest', 'group', 'comment'
|
||||||
|
],
|
||||||
|
idProperty: 'sid'
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user