apt repos: code/format cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
d76eedb46f
commit
af48de6bf8
@ -33,10 +33,7 @@ Ext.define('Proxmox.node.APTRepositoriesErrors', {
|
|||||||
{
|
{
|
||||||
header: gettext('File'),
|
header: gettext('File'),
|
||||||
dataIndex: 'path',
|
dataIndex: 'path',
|
||||||
renderer: function(value, cell, record) {
|
renderer: value => `<i class='pve-grid-fa fa fa-fw fa-exclamation-triangle'></i>${value}`,
|
||||||
return "<i class='pve-grid-fa fa fa-fw " +
|
|
||||||
"fa-exclamation-triangle'></i>" + value;
|
|
||||||
},
|
|
||||||
width: 350,
|
width: 350,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -49,7 +46,6 @@ Ext.define('Proxmox.node.APTRepositoriesErrors', {
|
|||||||
|
|
||||||
Ext.define('Proxmox.node.APTRepositoriesGrid', {
|
Ext.define('Proxmox.node.APTRepositoriesGrid', {
|
||||||
extend: 'Ext.grid.GridPanel',
|
extend: 'Ext.grid.GridPanel',
|
||||||
|
|
||||||
xtype: 'proxmoxNodeAPTRepositoriesGrid',
|
xtype: 'proxmoxNodeAPTRepositoriesGrid',
|
||||||
|
|
||||||
title: gettext('APT Repositories'),
|
title: gettext('APT Repositories'),
|
||||||
@ -71,6 +67,7 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
|
|||||||
items: [],
|
items: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'-',
|
||||||
{
|
{
|
||||||
xtype: 'proxmoxButton',
|
xtype: 'proxmoxButton',
|
||||||
text: gettext('Enable') + '/' + gettext('Disable'),
|
text: gettext('Enable') + '/' + gettext('Disable'),
|
||||||
@ -216,7 +213,8 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
|
|||||||
for (const info of infos) {
|
for (const info of infos) {
|
||||||
const key = `${info.path}:${info.index}`;
|
const key = `${info.path}:${info.index}`;
|
||||||
if (info.kind === 'warning' ||
|
if (info.kind === 'warning' ||
|
||||||
(info.kind === 'ignore-pre-upgrade-warning' && !me.majorUpgradeAllowed)) {
|
(info.kind === 'ignore-pre-upgrade-warning' && !me.majorUpgradeAllowed)
|
||||||
|
) {
|
||||||
addLine(warnings, key, gettext('Warning') + ": " + info.message);
|
addLine(warnings, key, gettext('Warning') + ": " + info.message);
|
||||||
} else if (info.kind === 'badge' && info.message === 'official host name') {
|
} else if (info.kind === 'badge' && info.message === 'official host name') {
|
||||||
officialHosts[key] = true;
|
officialHosts[key] = true;
|
||||||
@ -285,7 +283,6 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
|
|||||||
|
|
||||||
Ext.define('Proxmox.node.APTRepositories', {
|
Ext.define('Proxmox.node.APTRepositories', {
|
||||||
extend: 'Ext.panel.Panel',
|
extend: 'Ext.panel.Panel',
|
||||||
|
|
||||||
xtype: 'proxmoxNodeAPTRepositories',
|
xtype: 'proxmoxNodeAPTRepositories',
|
||||||
mixins: ['Proxmox.Mixin.CBind'],
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
@ -364,13 +361,10 @@ Ext.define('Proxmox.node.APTRepositories', {
|
|||||||
Proxmox.Utils.API2Request({
|
Proxmox.Utils.API2Request({
|
||||||
url: `/nodes/${me.nodename}/subscription`,
|
url: `/nodes/${me.nodename}/subscription`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
failure: function(response, opts) {
|
failure: (response, opts) => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
|
||||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
|
||||||
},
|
|
||||||
success: function(response, opts) {
|
success: function(response, opts) {
|
||||||
const res = response.result;
|
const res = response.result;
|
||||||
const subscription = !(res === null || res === undefined ||
|
const subscription = !(!res || !res.data || res.data.status.toLowerCase() !== 'active');
|
||||||
!res || res.data.status.toLowerCase() !== 'active');
|
|
||||||
vm.set('subscriptionActive', subscription);
|
vm.set('subscriptionActive', subscription);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user