Commit 61a5235c authored by Dietmar Maurer's avatar Dietmar Maurer

add package update grid panel to GUI (apt)

parent 8863ae95
......@@ -84,6 +84,7 @@ JSSRC= \
node/NetworkView.js \
node/Tasks.js \
node/Subscription.js \
node/APT.js \
node/Config.js \
qemu/StatusView.js \
window/Migrate.js \
......
Ext.define('PVE.node.APT', {
extend: 'Ext.grid.GridPanel',
alias: ['widget.pveNodeAPT'],
initComponent : function() {
var me = this;
var nodename = me.pveSelNode.data.node;
if (!nodename) {
throw "no node name specified";
}
var store = Ext.create('Ext.data.Store', {
model: 'apt-pkglist',
groupField: 'Section',
proxy: {
type: 'pve',
url: "/api2/json/nodes/" + nodename + "/apt/update"
},
sorters: [
{
property : 'Package',
direction: 'ASC'
}
]
});
var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
groupHeaderTpl: '{[ "Section: " + values.name ]} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'
});
var reload = function() {
store.load();
};
PVE.Utils.monStoreErrors(me, store);
Ext.apply(me, {
store: store,
stateful: false,
//tbar: [ start_btn, stop_btn, restart_btn ],
features: [ groupingFeature ],
columns: [
{
header: gettext('Package'),
width: 200,
sortable: true,
dataIndex: 'Package'
},
{
header: gettext('Version'),
width: 100,
sortable: false,
dataIndex: 'Version'
},
{
header: gettext('Description'),
sortable: false,
dataIndex: 'Title',
flex: 1
}
],
listeners: {
show: function() {
// only load once (because this takes several seconds)
if (!me.alreadyLoaded) {
reload();
me.alreadyLoaded = true;
}
}
}
});
me.callParent();
}
}, function() {
Ext.define('apt-pkglist', {
extend: 'Ext.data.Model',
fields: [ 'Package', 'Title', 'Description', 'Section', 'Arch',
'Priority', 'Version' ],
idProperty: 'Package'
});
});
......@@ -144,6 +144,12 @@ Ext.define('PVE.node.Config', {
itemId: 'support',
xtype: 'pveNodeSubscription',
nodename: nodename
},
{
title: gettext('Updates'),
itemId: 'apt',
xtype: 'pveNodeAPT',
nodename: nodename
}
]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment