apt repos: move Official to the right & use checkbox to render enabled

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-06-23 19:57:30 +02:00
parent 3fc020f417
commit 03c4c65bab

View File

@ -123,27 +123,12 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
columns: [
{
header: gettext('Official'),
dataIndex: 'OfficialHost',
renderer: function(value, cell, record) {
let icon = (cls) => `<i class="fa fa-fw ${cls}"></i>`;
const enabled = record.data.Enabled;
if (value === undefined || value === null) {
return icon('fa-question-circle-o');
}
if (!value) {
return icon('fa-times ' + (enabled ? 'critical' : 'faded'));
}
return icon('fa-check ' + (enabled ? 'good' : 'faded'));
},
width: 70,
},
{
xtype: 'checkcolumn',
header: gettext('Enabled'),
dataIndex: 'Enabled',
renderer: Proxmox.Utils.format_enabled_toggle,
listeners: {
beforecheckchange: () => false, // veto, we don't want to allow inline change - to subtle
},
width: 90,
},
{
@ -205,6 +190,23 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
},
flex: 1,
},
{
header: gettext('Official'),
dataIndex: 'OfficialHost',
renderer: function(value, cell, record) {
let icon = (cls) => `<i class="fa fa-fw ${cls}"></i>`;
if (value === undefined || value === null) {
return icon('fa-question-circle-o');
}
const enabled = record.data.Enabled;
if (!value) {
return icon('fa-question ' + (enabled ? 'warning' : 'faded'));
}
return icon('fa-check ' + (enabled ? 'good' : 'faded'));
},
width: 70,
},
{
header: gettext('Comment'),
dataIndex: 'Comment',