[pve-devel] [PATCH v2 manager 3/3] Code cleanup in Backup

Stefan Reiter s.reiter at proxmox.com
Mon Aug 5 16:58:07 CEST 2019


Whitespace removal and consolidating VZDump's job id format into a
local variable.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 PVE/API2/Backup.pm        | 25 +++++++++----------------
 www/manager6/dc/Backup.js | 10 +++++-----
 2 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/PVE/API2/Backup.pm b/PVE/API2/Backup.pm
index ec6b4541..8bf3895f 100644
--- a/PVE/API2/Backup.pm
+++ b/PVE/API2/Backup.pm
@@ -31,6 +31,11 @@ sub verify_day_of_week {
     die "invalid day '$value'\n";
 }
 
+my $vzdump_job_id_prop = {
+    type => 'string',
+    description => "The job ID.",
+    maxLength => 50
+};
 
 my $dowhash_to_dow = sub {
     my ($d, $num) = @_;
@@ -207,7 +212,7 @@ __PACKAGE__->register_method({
 	items => {
 	    type => "object",
 	    properties => {
-		id => { type => 'string' },
+		id => $vzdump_job_id_prop
 	    },
 	},
 	links => [ { rel => 'child', href => "{id}" } ],
@@ -304,11 +309,7 @@ __PACKAGE__->register_method({
     parameters => {
     	additionalProperties => 0,
 	properties => {
-	    id => {
-		type => 'string',
-		description => "The job ID.",
-		maxLength => 50,
-	    }
+	    id => $vzdump_job_id_prop
 	},
     },
     returns => {
@@ -344,11 +345,7 @@ __PACKAGE__->register_method({
     parameters => {
     	additionalProperties => 0,
 	properties => {
-	    id => {
-		type => 'string',
-		description => "The job ID.",
-		maxLength => 50,
-	    },
+	    id => $vzdump_job_id_prop
 	},
     },
     returns => { type => 'null' },
@@ -397,11 +394,7 @@ __PACKAGE__->register_method({
     parameters => {
     	additionalProperties => 0,
 	properties => PVE::VZDump::json_config_properties({
-	    id => {
-		type => 'string',
-		description => "The job ID.",
-		maxLength => 50,
-	    },
+	    id => $vzdump_job_id_prop,
 	    starttime => {
 		type => 'string',
 		description => "Job Start time.",
diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index a26ea63d..7c6b15cc 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -412,11 +412,11 @@ Ext.define('PVE.dc.BackupView', {
 		return;
 	    }
 
-            var win = Ext.create('PVE.dc.BackupEdit',{
-                jobid: rec.data.id
-            });
-            win.on('destroy', reload);
-            win.show();
+	    var win = Ext.create('PVE.dc.BackupEdit', {
+		jobid: rec.data.id
+	    });
+	    win.on('destroy', reload);
+	    win.show();
 	};
 
 	var run_now_finished = function(errors) {
-- 
2.20.1





More information about the pve-devel mailing list