Compare commits

...

13 Commits

Author SHA1 Message Date
Thomas Lamprecht
aa976ad3e5 eol notice: escalate to warning only shortly before EOL
The EOL message is positioned quite noticeable already in all our
products, being always visible. So use a notice-style for the icon
and its color until three weeks before EOL, when we switch to a
critical warning.

As it can be OK to run a, e.g., PVE 7 setup shortly before its EOL,
if, for example, one plans to replace it completely and decommission
the old one (so upgrade before EOL would be just extra work).

Using three weeks for the cut-off has no in-depth, heavily thought
out Good Reason™, but was rather chosen as it's likely to be noticed
before the actual EOL in somewhat actively maintained setups (e.g.,
admin checking in every week or two) and can give admins further
means to escalate things with higher ups. Also weeks are always 7
days, while months aren't uniform, so the former is easier to
communicate.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-16 12:57:11 +02:00
Thomas Lamprecht
931d9bfdfa eol notice: surpress highlighting if link was visited
add a class to the whole outer div to manage the CSS rules for the
EOL widget and use this to keep the original color for links even if
they got visited already.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-16 12:44:56 +02:00
Thomas Lamprecht
ad53b6dd22 bump version to 3.7.3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-13 12:25:36 +02:00
Fiona Ebner
03f664dd2d apt repositories: avoid potential type error in classifyOrigin helper
with undefined (or otherwise falsy) argument.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
(cherry picked from commit a14bafeca6)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-13 12:25:21 +02:00
Fiona Ebner
13b101437c apt repositories: fix typo for getting the default unknown text
Could lead to a type error with classifyOrigin when there is a
repository that doesn't have an InRelease file and cannot be detected
as Debian/Proxmox origin from its URL. For me, it triggered with the
element.io repository after changing to bookworm (which currently
doesn't exist yet) and running apt update.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
(cherry picked from commit 78be60a079)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-13 12:25:21 +02:00
Thomas Lamprecht
07f7518735 bump version to 3.7.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-09 13:00:47 +02:00
Fiona Ebner
f7b2ed4f3a apt repositories: detect mixed suites before major upgrade
Usually, differing suites already produce warnings/errors, but before
a major upgrade the current and the next suite are both valid. Mixing
them is an issue though.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
(cherry picked from commit e6ed4498cd)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-09 13:00:04 +02:00
Fiona Ebner
083c6f1d1a apt repositories: just ignore unknown info rather than throwing an error
This will avoid breaking older UI when extending the backend.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
(cherry picked from commit b9b1a51a2e)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-09 13:00:04 +02:00
Fiona Ebner
ae66538726 apt repositories: add classifyOrigin helper
to be used again to detect mixed repositories before upgrade.

Needed to convert into an actual function for the 'this' usage.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 3d6b76ee2b)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-09 13:00:04 +02:00
Fiona Ebner
a5106662fb apt repositories: actually ignore ignore-pre-upgrade-warning
when upgrading is possible rather than throwing an error by reaching
the else branch.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit fd468868dd)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-09 13:00:04 +02:00
Thomas Lamprecht
62de2763ed bump version to 3.7.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-07 17:26:01 +02:00
Fiona Ebner
622ba1f9e2 apt repositoires: allow major upgrade
Currently, all this does is silence warnings when the suite after the
current one is configured as well as enabling the check for mixed
repositiories.

Since there is no API call as mentioned in the comment yet, just set
it manually.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-06-07 17:22:28 +02:00
Aaron Lauterer
93f8588e41 tfa: paperkey: cleanup iframes for printing after window close
similar as recently done for the PBS storage add/edit window in
pve-manager

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
[ TL: refer to same change as done in pve-manager ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-28 19:34:32 +02:00
5 changed files with 100 additions and 15 deletions

28
debian/changelog vendored
View File

@ -1,3 +1,31 @@
proxmox-widget-toolkit (3.7.3) bullseye; urgency=medium
* apt repositories: fix typo for getting the default unknown text
* apt repositories: avoid potential type error in classifyOrigin helper
-- Proxmox Support Team <support@proxmox.com> Tue, 13 Jun 2023 12:25:28 +0200
proxmox-widget-toolkit (3.7.2) bullseye; urgency=medium
* apt repositories: actually ignore ignore-pre-upgrade-warning
* apt repositories: add classifyOrigin helper
* apt repositories: just ignore unknown info rather than throwing an error
* apt repositories: detect mixed suites before major upgrade
-- Proxmox Support Team <support@proxmox.com> Fri, 09 Jun 2023 13:00:41 +0200
proxmox-widget-toolkit (3.7.1) bullseye; urgency=medium
* tfa: paperkey: cleanup iframes for printing after window close
* apt repositoires: allow major upgrade
-- Proxmox Support Team <support@proxmox.com> Wed, 07 Jun 2023 17:25:57 +0200
proxmox-widget-toolkit (3.7.0) bullseye; urgency=medium
* dark-mode:

View File

@ -113,12 +113,14 @@
color: #3892d4;
}
.pwt-eol-icon {
.eol-notice a:visited {
color: inherit;
}
.eol-notice > i.fa {
position: relative;
float: left;
margin-right: 5px;
font-size: 1.3em;
color: #FF6C59;
}
/* reduce chart legend space usage to something more sane */

View File

@ -343,14 +343,15 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
header: gettext('Origin'),
dataIndex: 'Origin',
width: 120,
renderer: (value, meta, rec) => {
renderer: function(value, meta, rec) {
if (typeof value !== 'string' || value.length === 0) {
value = gettext('Other');
}
let cls = 'fa fa-fw fa-question-circle-o';
if (value.match(/^\s*Proxmox\s*$/i)) {
let originType = this.up('proxmoxNodeAPTRepositories').classifyOrigin(value);
if (originType === 'Proxmox') {
cls = 'pmx-itype-icon pmx-itype-icon-proxmox-x';
} else if (value.match(/^\s*Debian\s*(:?Backports)?$/i)) {
} else if (originType === 'Debian') {
cls = 'pmx-itype-icon pmx-itype-icon-debian-swirl';
}
return `<i class='${cls}'></i> ${value}`;
@ -404,6 +405,16 @@ Ext.define('Proxmox.node.APTRepositories', {
product: 'Proxmox VE', // default
classifyOrigin: function(origin) {
origin ||= '';
if (origin.match(/^\s*Proxmox\s*$/i)) {
return 'Proxmox';
} else if (origin.match(/^\s*Debian\s*(:?Backports)?$/i)) {
return 'Debian';
}
return 'Other';
},
controller: {
xclass: 'Ext.app.ViewController',
@ -450,6 +461,7 @@ Ext.define('Proxmox.node.APTRepositories', {
let nosubscription = vm.get('noSubscriptionRepo');
let test = vm.get('testRepo');
let wrongSuites = vm.get('suitesWarning');
let mixedSuites = vm.get('mixedSuites');
if (!enterprise && !nosubscription && !test) {
addCritical(
@ -467,6 +479,10 @@ Ext.define('Proxmox.node.APTRepositories', {
addWarn(gettext('Some suites are misconfigured'));
}
if (mixedSuites) {
addWarn(gettext('Detected mixed suites before upgrade'));
}
if (!activeSubscription && enterprise) {
addWarn(gettext('The enterprise repository is enabled, but there is no active subscription!'));
}
@ -497,6 +513,7 @@ Ext.define('Proxmox.node.APTRepositories', {
product: 'Proxmox VE', // default
errors: [],
suitesWarning: false,
mixedSuites: false, // used before major upgrade
subscriptionActive: '',
noSubscriptionRepo: '',
enterpriseRepo: '',
@ -569,7 +586,7 @@ Ext.define('Proxmox.node.APTRepositories', {
nodename: '{nodename}',
onlineHelp: '{onlineHelp}',
},
majorUpgradeAllowed: false, // TODO get release information from an API call?
majorUpgradeAllowed: true, // TODO get release information from an API call?
listeners: {
selectionchange: 'selectionChange',
},
@ -631,6 +648,11 @@ Ext.define('Proxmox.node.APTRepositories', {
let digest;
let suitesWarning = false;
// Usually different suites will give errors anyways, but before a major upgrade the
// current and the next suite are allowed, so it makes sense to check for mixed suites.
let checkMixedSuites = false;
let mixedSuites = false;
if (success && records.length > 0) {
let data = records[0].data;
let files = data.files;
@ -649,17 +671,23 @@ Ext.define('Proxmox.node.APTRepositories', {
infos[path][idx] = {
origin: '',
warnings: [],
// Used as a heuristic to detect mixed repositories pre-upgrade. The
// warning is set on all repositories that do configure the next suite.
gotIgnorePreUpgradeWarning: false,
};
}
if (info.kind === 'origin') {
infos[path][idx].origin = info.message;
} else if (info.kind === 'warning' ||
(info.kind === 'ignore-pre-upgrade-warning' && !repoGrid.majorUpgradeAllowed)
) {
} else if (info.kind === 'warning') {
infos[path][idx].warnings.push(info);
} else {
throw 'unknown info';
} else if (info.kind === 'ignore-pre-upgrade-warning') {
infos[path][idx].gotIgnorePreUpgradeWarning = true;
if (!repoGrid.majorUpgradeAllowed) {
infos[path][idx].warnings.push(info);
} else {
checkMixedSuites = true;
}
}
}
@ -670,11 +698,24 @@ Ext.define('Proxmox.node.APTRepositories', {
repo.Path = file.path;
repo.Index = n;
if (infos[file.path] && infos[file.path][n]) {
repo.Origin = infos[file.path][n].origin || Proxmox.Utils.UnknownText;
repo.Origin = infos[file.path][n].origin || Proxmox.Utils.unknownText;
repo.warnings = infos[file.path][n].warnings || [];
if (repo.Enabled && repo.warnings.some(w => w.property === 'Suites')) {
suitesWarning = true;
if (repo.Enabled) {
if (repo.warnings.some(w => w.property === 'Suites')) {
suitesWarning = true;
}
let originType = me.classifyOrigin(repo.Origin);
// Only Proxmox and Debian repositories checked here, because the
// warning can be missing for others for a different reason (e.g.
// using 'stable' or non-Debian code names).
if (checkMixedSuites && repo.Types.includes('deb') &&
(originType === 'Proxmox' || originType === 'Debian') &&
!infos[file.path][n].gotIgnorePreUpgradeWarning
) {
mixedSuites = true;
}
}
}
gridData.push(repo);
@ -690,6 +731,7 @@ Ext.define('Proxmox.node.APTRepositories', {
vm.set('errors', errors);
vm.set('suitesWarning', suitesWarning);
vm.set('mixedSuites', mixedSuites);
me.getController().updateState();
});

View File

@ -3,6 +3,7 @@ Ext.define('Proxmox.EOLNotice', {
extend: 'Ext.Component',
alias: 'widget.proxmoxEOLNotice',
userCls: 'eol-notice',
padding: '0 5',
config: {
@ -17,14 +18,25 @@ Ext.define('Proxmox.EOLNotice', {
'data-qtip': gettext("You won't get any security fixes after the End-Of-Life date. Please consider upgrading."),
},
getIconCls: function() {
let me = this;
const now = new Date();
const eolDate = new Date(me.eolDate);
const warningCutoff = new Date(eolDate.getTime() - (21 * 24 * 60 * 60 * 1000)); // 3 weeks
return now > warningCutoff ? 'critical fa-exclamation-triangle' : 'info-blue fa-info-circle';
},
initComponent: function() {
let me = this;
let iconCls = me.getIconCls();
let href = me.href.startsWith('http') ? me.href : `https://${me.href}`;
let message = Ext.String.format(
gettext('Support for {0} {1} ends on {2}'), me.product, me.version, me.eolDate);
me.html = `<i class="fa pwt-eol-icon fa-exclamation-triangle"></i>
me.html = `<i class="fa ${iconCls}"></i>
<a href="${href}" target="_blank">${message} <i class="fa fa-external-link"></i></a>
`;

View File

@ -220,5 +220,6 @@ ${keyString}
printFrame.src = "data:text/html;base64," + btoa(html);
document.body.appendChild(printFrame);
me.on('destroy', () => document.body.removeChild(printFrame));
},
});