[PATCH proxmox-backup v6 16/22] ui: add notification thresholds edit window

Christian Ebner
2026-03-19T09:51:12Z

Allows setting the notification thresholds via the datastore options.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
www/Makefile | 1 +
www/datastore/OptionView.js | 9 +++
www/window/NotificationThresholds.js | 113 +++++++++++++++++++++++++++
3 files changed, 123 insertions(+)
create mode 100644 www/window/NotificationThresholds.js

diff --git a/www/Makefile b/www/Makefile
index 9ebf0445f..5002bae90 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -81,6 +81,7 @@ JSSRC= \
window/NamespaceEdit.js \
window/MaintenanceOptions.js \
window/NotesEdit.js \
+ window/NotificationThresholds.js \
window/RemoteEdit.js \
window/TrafficControlEdit.js \
window/NotifyOptions.js \
diff --git a/www/datastore/OptionView.js b/www/datastore/OptionView.js
index 7854e64d7..f800c167f 100644
--- a/www/datastore/OptionView.js
+++ b/www/datastore/OptionView.js
@@ -334,5 +334,14 @@ Ext.define('PBS.Datastore.Options', {
},
},
},
+ 'notification-thresholds': {
+ required: true,
+ header: gettext('Notification Thresholds'),
+ renderer: (v) =>
+ PBS.Utils.render_notification_thresholds(PBS.Utils.parsePropertyString(v)),
+ editor: {
+ xtype: 'pbsNotificationThresholdsEdit',
+ },
+ },
},
});
diff --git a/www/window/NotificationThresholds.js b/www/window/NotificationThresholds.js
new file mode 100644
index 000000000..19b3598e6
--- /dev/null
+++ b/www/window/NotificationThresholds.js
@@ -0,0 +1,113 @@
+Ext.define('PBS.window.NotificationThresholds', {
+ extend: 'Proxmox.window.Edit',
+ xtype: 'pbsNotificationThresholdsEdit',
+ mixins: ['Proxmox.Mixin.CBind'],
+
+ subject: gettext('Notification Thresholds'),
+
+ width: 500,
+ fieldDefaults: {
+ labelWidth: 120,
+ },
+
+ items: {
+ xtype: 'inputpanel',
+ onGetValues: function (values) {
+ if (!Ext.isArray(values.delete ?? [])) {
+ values.delete = [values.delete];
+ }
+ for (const k of values.delete ?? []) {
+ delete values[k];
+ }
+ delete values.delete;
+ let notificationThresholds = PBS.Utils.printPropertyString(values);
+ if (!notificationThresholds) {
+ return { delete: 'notification-thresholds' };
+ }
+ return { 'notification-thresholds': notificationThresholds };
+ },
+ onSetValues: function (values) {
+ if (values['notification-thresholds']) {
+ return PBS.Utils.parsePropertyString(values['notification-thresholds']);
+ }
+ },
+ items: [
+ {
+ xtype: 'box',
+ html: `${gettext('S3 requests count:')}`,
+ padding: '10 0 5 0',
+ },
+ {
+ xtype: 'proxmoxintegerfield',
+ name: 's3-get',
+ fieldLabel: gettext('GET'),
+ emptyText: gettext('none'),
+ fieldStyle: 'text-align: right',
+ minValue: 0,
+ deleteEmpty: true,
+ },
+ {
+ xtype: 'proxmoxintegerfield',
+ name: 's3-put',
+ fieldLabel: gettext('PUT'),
+ emptyText: gettext('none'),
+ fieldStyle: 'text-align: right',
+ minValue: 0,
+ deleteEmpty: true,
+ },
+ {
+ xtype: 'proxmoxintegerfield',
+ name: 's3-post',
+ fieldLabel: gettext('POST'),
+ emptyText: gettext('none'),
+ fieldStyle: 'text-align: right',
+ minValue: 0,
+ deleteEmpty: true,
+ },
+ {
+ xtype: 'proxmoxintegerfield',
+ name: 's3-head',
+ fieldLabel: gettext('HEAD'),
+ emptyText: gettext('none'),
+ fieldStyle: 'text-align: right',
+ minValue: 0,
+ deleteEmpty: true,
+ },
+ {
+ xtype: 'proxmoxintegerfield',
+ name: 's3-delete',
+ fieldLabel: gettext('DELETE'),
+ emptyText: gettext('none'),
+ fieldStyle: 'text-align: right',
+ minValue: 0,
+ deleteEmpty: true,
+ },
+ {
+ xtype: 'menuseparator',
+ },
+ {
+ xtype: 'box',
+ html: `${gettext('S3 traffic volume:')}`,
+ padding: '10 0 5 0',
+ },
+ {
+ xtype: 'pmxSizeField',
+ name: 's3-upload',
+ fieldLabel: gettext('Upload'),
+ unit: 'GiB',
+ submitAutoScaledSizeUnit: true,
+ allowZero: false,
+ emptyText: gettext('none'),
+ },
+ {
+ xtype: 'pmxSizeField',
+ name: 's3-download',
+ fieldLabel: gettext('Download'),
+ unit: 'GiB',
+ submitAutoScaledSizeUnit: true,
+ allowZero: false,
+ emptyText: gettext('none'),
+ },
+ ],
+ },
+});
--
2.47.3