replication GUI: add schedule now Button

This commit is contained in:
Dietmar Maurer 2017-06-28 08:35:02 +02:00
parent 88ea8e67d3
commit 85167e5edf

View File

@ -168,6 +168,21 @@ Ext.define('PVE.grid.ReplicaView', {
}); });
}, },
scheduleJobNow: function(button,event,rec) {
var me = this.getView();
var controller = this;
PVE.Utils.API2Request({
url: "/api2/extjs/nodes/" + me.nodename + "/replication/" + rec.data.id + "/schedule_now",
method: 'POST',
waitMsgTarget: me,
callback: function() { controller.reload(); },
failure: function (response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
}
});
},
showLog: function(button, event, rec) { showLog: function(button, event, rec) {
var me = this.getView(); var me = this.getView();
var controller = this; var controller = this;
@ -256,6 +271,13 @@ Ext.define('PVE.grid.ReplicaView', {
itemId: 'logButton', itemId: 'logButton',
handler: 'showLog', handler: 'showLog',
disabled: true disabled: true
},
{
xtype: 'pveButton',
text: gettext('Schedule now'),
itemId: 'scheduleNowButton',
handler: 'scheduleJobNow',
disabled: true
} }
], ],
@ -449,10 +471,12 @@ Ext.define('PVE.grid.ReplicaView', {
me.callParent(); me.callParent();
// we cannot access the log in the datacenter, because // we cannot access the log and scheduleNow button
// in the datacenter, because
// we do not know where/if the jobs runs // we do not know where/if the jobs runs
if (mode === 'dc') { if (mode === 'dc') {
me.down('#logButton').setHidden(true); me.down('#logButton').setHidden(true);
me.down('#scheduleNowButton').setHidden(true);
} }
// if we set the warning mask, we do not want to load // if we set the warning mask, we do not want to load