* [pve-devel] [PATCH widget-toolkit] window: ACMEDomains: show error dialog on domain limit
@ 2025-01-29 11:26 Christoph Heiss
0 siblings, 0 replies; only message in thread
From: Christoph Heiss @ 2025-01-29 11:26 UTC (permalink / raw)
To: pve-devel
Currently, this just fails silently for users and only logs an error to
the console. Improve the error message & show an alert dialog on
failure.
This affects PMG & BS, as they use the exact same codepath/panel.
Originally reported in the forum [0].
[0] https://forum.proxmox.com/threads/acme-max-certificate.161400/
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
src/window/ACMEDomains.js | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/window/ACMEDomains.js b/src/window/ACMEDomains.js
index 1fcc784..067cbc9 100644
--- a/src/window/ACMEDomains.js
+++ b/src/window/ACMEDomains.js
@@ -49,13 +49,21 @@ Ext.define('Proxmox.window.ACMEDomainEdit', {
return `acmedomain${i}`;
}
}
- throw "too many domains configured";
+ throw Ext.String.format(
+ gettext('Cannot create more than {0} ACME domains.'),
+ Proxmox.Utils.acmedomain_count,
+ );
};
// If we have a 'usage' property (pmg), we only use the `acmedomainX` config keys.
if (win.separateDomainEntries || win.domainUsages) {
if (!configkey || configkey === 'acme') {
- configkey = find_free_slot();
+ try {
+ configkey = find_free_slot();
+ } catch (e) {
+ Ext.Msg.alert(gettext('Error'), e);
+ throw e;
+ }
}
delete values.type;
params[configkey] = Proxmox.Utils.printPropertyString(values, 'domain');
@@ -68,7 +76,12 @@ Ext.define('Proxmox.window.ACMEDomainEdit', {
// Then insert the domain depending on its type:
if (values.type === 'dns') {
if (!olddomain.configkey || olddomain.configkey === 'acme') {
- configkey = find_free_slot();
+ try {
+ configkey = find_free_slot();
+ } catch (e) {
+ Ext.Msg.alert(gettext('Error'), e);
+ throw e;
+ }
if (olddomain.domain) {
// we have to remove the domain from the acme domainlist
Proxmox.Utils.remove_domain_from_acme(acmeObj, olddomain.domain);
--
2.47.0
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-01-29 11:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-29 11:26 [pve-devel] [PATCH widget-toolkit] window: ACMEDomains: show error dialog on domain limit Christoph Heiss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox