mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-22 22:00:18 +00:00
notification ui: add column for 'origin'
This column shows whether a matcher/target was provided as a built-in default config or if it was created by the user. For built-ins, it also shows whether the built-in settings have been changed. To reset a built-in entry to its defaults, one can simply delete it. For best UX, the 'delete' button should change its text to 'reset defaults' when a built-in target/matcher is selected. This will be added in another patch. Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
parent
5f7b28cb19
commit
6a0b0b376c
@ -1,6 +1,6 @@
|
|||||||
Ext.define('proxmox-notification-endpoints', {
|
Ext.define('proxmox-notification-endpoints', {
|
||||||
extend: 'Ext.data.Model',
|
extend: 'Ext.data.Model',
|
||||||
fields: ['name', 'type', 'comment', 'disable'],
|
fields: ['name', 'type', 'comment', 'disable', 'origin'],
|
||||||
proxy: {
|
proxy: {
|
||||||
type: 'proxmox',
|
type: 'proxmox',
|
||||||
},
|
},
|
||||||
@ -9,7 +9,7 @@ Ext.define('proxmox-notification-endpoints', {
|
|||||||
|
|
||||||
Ext.define('proxmox-notification-matchers', {
|
Ext.define('proxmox-notification-matchers', {
|
||||||
extend: 'Ext.data.Model',
|
extend: 'Ext.data.Model',
|
||||||
fields: ['name', 'comment', 'disable'],
|
fields: ['name', 'comment', 'disable', 'origin'],
|
||||||
proxy: {
|
proxy: {
|
||||||
type: 'proxmox',
|
type: 'proxmox',
|
||||||
},
|
},
|
||||||
|
@ -129,7 +129,7 @@ Ext.define('Proxmox.panel.NotificationEndpointView', {
|
|||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
text: gettext('Target Name'),
|
text: gettext('Target Name'),
|
||||||
renderer: Ext.String.htmlEncode,
|
renderer: Ext.String.htmlEncode,
|
||||||
flex: 1,
|
flex: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'type',
|
dataIndex: 'type',
|
||||||
@ -141,7 +141,21 @@ Ext.define('Proxmox.panel.NotificationEndpointView', {
|
|||||||
dataIndex: 'comment',
|
dataIndex: 'comment',
|
||||||
text: gettext('Comment'),
|
text: gettext('Comment'),
|
||||||
renderer: Ext.String.htmlEncode,
|
renderer: Ext.String.htmlEncode,
|
||||||
flex: 1,
|
flex: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'origin',
|
||||||
|
text: gettext('Origin'),
|
||||||
|
renderer: (origin) => {
|
||||||
|
switch (origin) {
|
||||||
|
case 'user-created': return gettext('Custom');
|
||||||
|
case 'modified-builtin': return gettext('Built-In (modified)');
|
||||||
|
case 'builtin': return gettext('Built-In');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Should not happen...
|
||||||
|
return 'unknown';
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
@ -274,6 +288,20 @@ Ext.define('Proxmox.panel.NotificationMatcherView', {
|
|||||||
renderer: Ext.String.htmlEncode,
|
renderer: Ext.String.htmlEncode,
|
||||||
flex: 2,
|
flex: 2,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'origin',
|
||||||
|
text: gettext('Origin'),
|
||||||
|
renderer: (origin) => {
|
||||||
|
switch (origin) {
|
||||||
|
case 'user-created': return gettext('Custom');
|
||||||
|
case 'modified-builtin': return gettext('Built-In (modified)');
|
||||||
|
case 'builtin': return gettext('Built-In');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Should not happen...
|
||||||
|
return 'unknown';
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
store: {
|
store: {
|
||||||
|
Loading…
Reference in New Issue
Block a user