xtype: (me.isCreate && !vmid)?'pveGuestIDSelector':'displayfield',
name: 'guest',
fieldLabel: 'CT/VM ID',
- value: vmid || ''
+ value: vmid || '',
});
items.push(
disallowedNodes: [nodename],
allowBlank: false,
onlineValidator: true,
- fieldLabel: gettext("Target")
+ fieldLabel: gettext("Target"),
},
{
xtype: 'pveCalendarEvent',
fieldLabel: gettext('Schedule'),
emptyText: '*/15 - ' + Ext.String.format(gettext('Every {0} minutes'), 15),
- name: 'schedule'
+ name: 'schedule',
},
{
xtype: 'numberfield',
step: 1,
minValue: 1,
emptyText: gettext('unlimited'),
- name: 'rate'
+ name: 'rate',
},
{
xtype: 'textfield',
fieldLabel: gettext('Comment'),
- name: 'comment'
+ name: 'comment',
},
{
xtype: 'proxmoxcheckbox',
name: 'enabled',
defaultValue: 'on',
checked: true,
- fieldLabel: gettext('Enabled')
- }
+ fieldLabel: gettext('Enabled'),
+ },
);
me.items = [
}
return values;
},
- items: items
- }
+ items: items,
+ },
];
me.callParent();
Ext.Array.forEach(jobs, function(job) {
var match = /^([0-9]+)\-([0-9]+)$/.exec(job.id);
if (match) {
- var vmid = parseInt(match[1],10);
- var id = parseInt(match[2],10);
+ var vmid = parseInt(match[1], 10);
+ var id = parseInt(match[2], 10);
if (highestids[vmid] < id ||
highestids[vmid] === undefined) {
highestids[vmid] = id;
});
me.highestids = highestids;
- }
+ },
});
} else {
response.result.data.enabled = !response.result.data.disable;
me.setValues(response.result.data);
me.digest = response.result.data.digest;
- }
+ },
});
}
- }
+ },
});
-/*jslint confusion: true */
/* callback is a function and string */
Ext.define('PVE.grid.ReplicaView', {
extend: 'Ext.grid.Panel',
controller: {
xclass: 'Ext.app.ViewController',
- addJob: function(button,event,rec) {
+ addJob: function(button, event, rec) {
var me = this.getView();
var controller = this;
var win = Ext.create('PVE.window.ReplicaEdit', {
isCreate: true,
method: 'POST',
- pveSelNode: me.pveSelNode
+ pveSelNode: me.pveSelNode,
});
win.on('destroy', function() { controller.reload(); });
win.show();
},
- editJob: function(button,event,rec) {
+ editJob: function(button, event, rec) {
var me = this.getView();
var controller = this;
var data = rec.data;
var win = Ext.create('PVE.window.ReplicaEdit', {
url: '/cluster/replication/' + data.id,
method: 'PUT',
- pveSelNode: me.pveSelNode
+ pveSelNode: me.pveSelNode,
});
win.on('destroy', function() { controller.reload(); });
win.show();
},
- scheduleJobNow: function(button,event,rec) {
+ scheduleJobNow: function(button, event, rec) {
var me = this.getView();
var controller = this;
callback: function() { controller.reload(); },
failure: function (response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
- }
+ },
});
},
var controller = this;
var logView = Ext.create('Proxmox.panel.LogView', {
border: false,
- url: "/api2/extjs/nodes/" + me.nodename + "/replication/" + rec.data.id + "/log"
+ url: "/api2/extjs/nodes/" + me.nodename + "/replication/" + rec.data.id + "/log",
});
var win = Ext.create('Ext.window.Window', {
items: [ logView ],
width: 800,
height: 400,
modal: true,
- title: gettext("Replication Log")
+ title: gettext("Replication Log"),
});
var task = {
run: function() {
logView.requestUpdate();
},
- interval: 1000
+ interval: 1000,
};
Ext.TaskManager.start(task);
win.on('destroy', function() {
control: {
'#': {
itemdblclick: 'dblClick',
- afterlayout: 'checkPrerequisites'
- }
- }
+ afterlayout: 'checkPrerequisites',
+ },
+ },
},
tbar: [
{
text: gettext('Add'),
itemId: 'addButton',
- handler: 'addJob'
+ handler: 'addJob',
},
{
xtype: 'proxmoxButton',
text: gettext('Edit'),
itemId: 'editButton',
handler: 'editJob',
- disabled: true
+ disabled: true,
},
{
xtype: 'proxmoxStdRemoveButton',
itemId: 'removeButton',
baseurl: '/api2/extjs/cluster/replication/',
dangerous: true,
- callback: 'reload'
+ callback: 'reload',
},
{
xtype: 'proxmoxButton',
text: gettext('Log'),
itemId: 'logButton',
handler: 'showLog',
- disabled: true
+ disabled: true,
},
{
xtype: 'proxmoxButton',
text: gettext('Schedule now'),
itemId: 'scheduleNowButton',
handler: 'scheduleJobNow',
- disabled: true
- }
+ disabled: true,
+ },
],
initComponent: function() {
dataIndex: 'enabled',
xtype: 'checkcolumn',
sortable: true,
- disabled: true
+ disabled: true,
},
{
text: 'ID',
dataIndex: 'id',
width: 60,
- hidden: true
+ hidden: true,
},
{
text: gettext('Guest'),
dataIndex: 'guest',
- width: 75
+ width: 75,
},
{
text: gettext('Job'),
dataIndex: 'jobnum',
- width: 60
+ width: 60,
},
{
text: gettext('Target'),
- dataIndex: 'target'
- }
+ dataIndex: 'target',
+ },
];
if (!me.nodename) {
}
return icons.join(',') + ' ' + states.join(',');
- }
+ },
},
{
text: gettext('Last Sync'),
}
return Proxmox.Utils.render_timestamp(value);
- }
+ },
},
{
text: gettext('Duration'),
dataIndex: 'duration',
width: 60,
- renderer: Proxmox.Utils.render_duration
+ renderer: Proxmox.Utils.render_duration,
},
{
text: gettext('Next Sync'),
}
return Proxmox.Utils.render_timestamp(value);
- }
- }
+ },
+ },
);
}
{
text: gettext('Schedule'),
width: 75,
- dataIndex: 'schedule'
+ dataIndex: 'schedule',
},
{
text: gettext('Rate limit'),
return value.toString() + ' MB/s';
},
- hidden: true
+ hidden: true,
},
{
text: gettext('Comment'),
dataIndex: 'comment',
- renderer: Ext.htmlEncode
- }
+ renderer: Ext.htmlEncode,
+ },
);
me.rstore = Ext.create('Proxmox.data.UpdateStore', {
interval: 3000,
proxy: {
type: 'proxmox',
- url: "/api2/json" + url
- }
+ url: "/api2/json" + url,
+ },
});
me.store = Ext.create('Proxmox.data.DiffStore', {
rstore: me.rstore,
sorters: [
{
- property: 'guest'
+ property: 'guest',
},
{
- property: 'jobnum'
- }
- ]
+ property: 'jobnum',
+ },
+ ],
});
me.callParent();
me.on('destroy', me.rstore.stopUpdate);
me.rstore.startUpdate();
- }
+ },
}, function() {
Ext.define('pve-replication', {
{ name: 'jobnum', type: 'integer' },
{ name: 'schedule', defaultValue: '*/15' },
{ name: 'disable', defaultValue: '' },
- { name: 'enabled', calculate: function(data) { return !data.disable; } }
- ]
+ { name: 'enabled', calculate: function(data) { return !data.disable; } },
+ ],
});
Ext.define('pve-replication-state', {
extend: 'pve-replication',
fields: [
'last_sync', 'next_sync', 'error', 'duration', 'state',
- 'fail_count', 'remove_job', 'pid'
- ]
+ 'fail_count', 'remove_job', 'pid',
+ ],
});
});