]> git.proxmox.com Git - pve-manager.git/commitdiff
replication GUI: add schedule now Button
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 28 Jun 2017 06:35:02 +0000 (08:35 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 28 Jun 2017 10:25:13 +0000 (12:25 +0200)
www/manager6/grid/Replication.js

index 2fd6fb75fb15c2da42c401b390da3c6b566e9420..d9498eccc465e1c636fa58725c124126020f2d46 100644 (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) {
            var me = this.getView();
            var controller = this;
@@ -256,6 +271,13 @@ Ext.define('PVE.grid.ReplicaView', {
            itemId: 'logButton',
            handler: 'showLog',
            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();
 
-       // 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
        if (mode === 'dc') {
            me.down('#logButton').setHidden(true);
+           me.down('#scheduleNowButton').setHidden(true);
        }
 
        // if we set the warning mask, we do not want to load