Partitial revert back to 5d24b7d37e (APT web-interface restored)

This commit is contained in:
Сергей Конев 2024-10-31 16:41:02 +03:00
parent 31153c3897
commit 067f72e431
3 changed files with 58 additions and 1 deletions

View File

@ -252,6 +252,36 @@ Ext.define('PVE.node.Config', {
itemId: 'syslog',
url: "/api2/extjs/nodes/" + nodename + "/journal",
});
if (caps.nodes['Sys.Modify']) {
me.items.push({
xtype: 'proxmoxNodeAPT',
title: gettext('Updates'),
iconCls: 'fa fa-refresh',
expandedOnInit: true,
disabled: !caps.nodes['Sys.Console'],
// do we want to link to system updates instead?
itemId: 'apt',
upgradeBtn: {
xtype: 'pveConsoleButton',
disabled: Proxmox.UserName !== 'root@pam',
text: gettext('Upgrade'),
consoleType: 'upgrade',
nodename: nodename,
},
nodename: nodename,
});
me.items.push({
xtype: 'proxmoxNodeAPTRepositories',
title: gettext('Repositories'),
iconCls: 'fa fa-files-o',
itemId: 'aptrepositories',
nodename: nodename,
onlineHelp: 'sysadmin_package_repositories',
groups: ['apt'],
});
}
}
if (caps.nodes['Sys.Audit']) {

View File

@ -145,4 +145,24 @@ Ext.define('PVE.node.StatusView', {
me.setTitle(me.pveSelNode.data.node + ' (' + gettext('Uptime') + ': ' + uptime + ')');
},
initComponent: function() {
let me = this;
let stateProvider = Ext.state.Manager.getProvider();
let repoLink = stateProvider.encodeHToken({
view: "server",
rid: `node/${me.pveSelNode.data.node}`,
ltab: "tasks",
nodetab: "aptrepositories",
});
me.items.push({
xtype: 'pmxNodeInfoRepoStatus',
itemId: 'repositoryStatus',
product: 'Proxmox VE',
repoLink: `#${repoLink}`,
});
me.callParent();
},
});

View File

@ -121,6 +121,13 @@ Ext.define('PVE.node.Summary', {
var rstore = me.statusStore;
var version_btn = new Ext.Button({
text: gettext('Package versions'),
handler: function() {
Proxmox.Utils.checked_command(function() { me.showVersions(); });
},
});
var rrdstore = Ext.create('Proxmox.data.RRDStore', {
rrdurl: "/api2/json/nodes/" + nodename + "/rrddata",
model: 'pve-rrd-node',
@ -134,7 +141,7 @@ Ext.define('PVE.node.Summary', {
});
Ext.apply(me, {
tbar: ['->', { xtype: 'proxmoxRRDTypeSelector' }],
tbar: [version_btn, '->', { xtype: 'proxmoxRRDTypeSelector' }],
nodeStatus: nodeStatus,
items: [
{