mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-11 05:15:29 +00:00
ui: metrics: add server base edit window
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
f257dcec26
commit
71f5bf0a45
@ -143,23 +143,44 @@ Ext.define('PVE.dc.MetricServerView', {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.dc.InfluxDBEdit', {
|
Ext.define('PVE.dc.MetricServerBaseEdit', {
|
||||||
extend: 'Proxmox.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
mixins: ['Proxmox.Mixin.CBind'],
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
subject: 'InfluxDB',
|
|
||||||
|
|
||||||
cbindData: function() {
|
cbindData: function() {
|
||||||
let me = this;
|
let me = this;
|
||||||
me.isCreate = !me.serverid;
|
me.isCreate = !me.serverid;
|
||||||
me.serverid = me.serverid || "";
|
me.serverid = me.serverid || "";
|
||||||
me.method = me.isCreate ? 'POST' : 'PUT';
|
me.method = me.isCreate ? 'POST' : 'PUT';
|
||||||
if (!me.isCreate) {
|
if (!me.isCreate) {
|
||||||
me.subject = `InfluxDB: ${me.serverid}`;
|
me.subject = `${me.subject}: ${me.serverid}`;
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
initComponent: function() {
|
||||||
|
let me = this;
|
||||||
|
|
||||||
|
me.callParent();
|
||||||
|
|
||||||
|
if (me.serverid) {
|
||||||
|
me.load({
|
||||||
|
success: function(response, options) {
|
||||||
|
let values = response.result.data;
|
||||||
|
values.enable = !values.disable;
|
||||||
|
me.down('inputpanel').setValues(values);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
Ext.define('PVE.dc.InfluxDBEdit', {
|
||||||
|
extend: 'PVE.dc.MetricServerBaseEdit',
|
||||||
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
|
subject: 'InfluxDB',
|
||||||
|
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
xtype: 'inputpanel',
|
xtype: 'inputpanel',
|
||||||
@ -233,39 +254,14 @@ Ext.define('PVE.dc.InfluxDBEdit', {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
initComponent: function() {
|
|
||||||
let me = this;
|
|
||||||
me.callParent();
|
|
||||||
if (!me.serverid) { return; }
|
|
||||||
|
|
||||||
me.load({
|
|
||||||
success: function(response, options) {
|
|
||||||
let values = response.result.data;
|
|
||||||
values.enable = !values.disable;
|
|
||||||
me.down('inputpanel').setValues(values);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.dc.GraphiteEdit', {
|
Ext.define('PVE.dc.GraphiteEdit', {
|
||||||
extend: 'Proxmox.window.Edit',
|
extend: 'PVE.dc.MetricServerBaseEdit',
|
||||||
mixins: ['Proxmox.Mixin.CBind'],
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
subject: 'Graphite',
|
subject: 'Graphite',
|
||||||
|
|
||||||
cbindData: function() {
|
|
||||||
let me = this;
|
|
||||||
me.isCreate = !me.serverid;
|
|
||||||
me.serverid = me.serverid || "";
|
|
||||||
me.method = me.isCreate ? 'POST' : 'PUT';
|
|
||||||
if (!me.isCreate) {
|
|
||||||
me.subject = `Graphite: ${me.serverid}`;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
|
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
xtype: 'inputpanel',
|
xtype: 'inputpanel',
|
||||||
@ -380,18 +376,4 @@ Ext.define('PVE.dc.GraphiteEdit', {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
initComponent: function() {
|
|
||||||
let me = this;
|
|
||||||
me.callParent();
|
|
||||||
if (!me.serverid) { return; }
|
|
||||||
|
|
||||||
me.load({
|
|
||||||
success: function(response, options) {
|
|
||||||
let values = response.result.data;
|
|
||||||
values.enable = !values.disable;
|
|
||||||
me.down('inputpanel').setValues(values);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user