]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
notification: add gui for gotify notification endpoints
authorLukas Wagner <l.wagner@proxmox.com>
Thu, 3 Aug 2023 12:17:15 +0000 (14:17 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 16 Aug 2023 08:37:31 +0000 (10:37 +0200)
The GUI is based on the 'plugin-based' dialog window EndpointEditBase
that was introduced in an earlier commit.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
src/Makefile
src/Schema.js
src/panel/GotifyEditPanel.js [new file with mode: 0644]

index e83038f72846114bf9d37cd6f114ab8a6760bb77..2e620e344f374b62310acd155bc69bbf0726ec94 100644 (file)
@@ -66,6 +66,7 @@ JSSRC=                                        \
        panel/PruneKeepPanel.js         \
        panel/RRDChart.js               \
        panel/GaugeWidget.js            \
+       panel/GotifyEditPanel.js        \
        panel/Certificates.js           \
        panel/ACMEAccount.js            \
        panel/ACMEPlugin.js             \
index 99bb3fa68f566893987dd79495912e47a8da3820..37ecd884e457203b3422ecdf0f23d351c9599a4d 100644 (file)
@@ -43,6 +43,11 @@ Ext.define('Proxmox.Schema', { // a singleton
            ipanel: 'pmxSendmailEditPanel',
            iconCls: 'fa-envelope-o',
        },
+       gotify: {
+           name: gettext('Gotify'),
+           ipanel: 'pmxGotifyEditPanel',
+           iconCls: 'fa-bell-o',
+       },
     },
 
     pxarFileTypes: {
diff --git a/src/panel/GotifyEditPanel.js b/src/panel/GotifyEditPanel.js
new file mode 100644 (file)
index 0000000..5d814e5
--- /dev/null
@@ -0,0 +1,44 @@
+Ext.define('Proxmox.panel.GotifyEditPanel', {
+    extend: 'Proxmox.panel.InputPanel',
+    xtype: 'pmxGotifyEditPanel',
+    mixins: ['Proxmox.Mixin.CBind'],
+
+    type: 'gotify',
+
+    items: [
+       {
+           xtype: 'pmxDisplayEditField',
+           name: 'name',
+           cbind: {
+               value: '{name}',
+               editable: '{isCreate}',
+           },
+           fieldLabel: gettext('Endpoint Name'),
+           allowBlank: false,
+       },
+       {
+           xtype: 'proxmoxtextfield',
+           fieldLabel: gettext('Server URL'),
+           name: 'server',
+           allowBlank: false,
+       },
+       {
+           xtype: 'proxmoxtextfield',
+           inputType: 'password',
+           fieldLabel: gettext('API Token'),
+           name: 'token',
+           cbind: {
+               emptyText: get => !get('isCreate') ? gettext('Unchanged') : '',
+               allowBlank: '{!isCreate}',
+           },
+       },
+       {
+           xtype: 'proxmoxtextfield',
+           name: 'comment',
+           fieldLabel: gettext('Comment'),
+           cbind: {
+               deleteEmpty: '{!isCreate}',
+           },
+       },
+    ],
+});