[pbs-devel] [PATCH proxmox-backup] prune sim: make numberfields more similar to PBS's

Fabian Ebner f.ebner at proxmox.com
Wed Nov 11 10:07:03 CET 2020


by creating a new class that adds a clear trigger and also uses the
clear-trigger image. Code was taken from the one in PBS's prune window,
but we have default values here, so a bit of adapting was necessary. For
example, we don't want to reset to the original value (which might have
been one of the defaults) when clearing, but always to 'null'.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 docs/Makefile                           |   1 +
 docs/prune-simulator/clear-trigger.png  | Bin 0 -> 11118 bytes
 docs/prune-simulator/index.html         |   3 ++
 docs/prune-simulator/prune-simulator.js |  61 +++++++++++++-----------
 4 files changed, 38 insertions(+), 27 deletions(-)
 create mode 100644 docs/prune-simulator/clear-trigger.png

diff --git a/docs/Makefile b/docs/Makefile
index 0352c612..4c1d2b26 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -17,6 +17,7 @@ MANUAL_PAGES := 			\
 PRUNE_SIMULATOR_FILES := 					\
 	prune-simulator/index.html				\
 	prune-simulator/documentation.html			\
+	prune-simulator/clear-trigger.png			\
 	prune-simulator/prune-simulator.js
 
 # Sphinx documentation setup
diff --git a/docs/prune-simulator/clear-trigger.png b/docs/prune-simulator/clear-trigger.png
new file mode 100644
index 0000000000000000000000000000000000000000..cc374cf277060fbf6fee551c62927d4466609c80
GIT binary patch
literal 11118
zcmeHt2{_bi`~RSjC6pyZ(@2ppi)Bp4He(IhDm!Bg#xkRsVaS>#yFw@;ZA!@!vQybA
zS+YlnWKFV@=r`z8=e*}V at 9$jy|NFnL|8*TR-!I?izVFZd+{<%6_cJ5HKwp!cMSukW
z0I+Lop^a$23ABrsnUQuscr at z_0KnpM&cu{rgrNf6Nkj*{D-KBUcE<s6UU&xpz^nJ+
z6&KG##|a_d#*S9(r~<?{9%P=|KVzFT!;v-l=|R=BLi((U_Ngr2_;3}pLCb1Gz~ET5
z7f;#;d|Q})XYGR~xkfwe?cDBes{Zu4ugy87hPmbSlU*(6pXI!yuKTN6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cbex71na9
zgy2_M*>XR3`pARpy<Z-#^)b0JB8WW$;{uilFVE-r at n?F=sma9Ew`Kl5Z>FCfZ=886
z6w5DM+E{hmTY7Pzam{Rb?0~CRxWDOFtx3ZV*gFl2%2Vra5q3zDLx*4CjP`f}6E-`4
ztlEBK4pZ at 2d=>v8WD?zedv#<&yd_Jp<+P$;K>Dn&f7$q%37h50R=?RAVsrIk6S_IN
zdZgNNrE($h*@K!~NgHYlW0R79!jgl3&dS4QeIhgaX3h<2R$RZ*vJtp$uxL1g?LJa{
zl7p{}mv>_)!<G53qEucF+V|Rwb|*B^fNz_xjLN$Sw2 at uzT4rPbfOYTYMF&W^wvRT*
zMA6n$XL`@X$9_zBoUP~(06-U~jaD^r8kkO2jSW)aR1fI1WVag@<|`2y$k2XuO(kZC
zv0hYal%8#W#BoZKT`fKoJrT<<v$#j at n9}txR;K`BkvBKrI${e_(jd@#>uckF#<KN=
z^;cGw{L{zcAeoE213FP at 3zYmgW(#~}aN~X62QyWK)9TOfpGLP@<ytdUiKNksS+#qo
zYl292qd1l8cR4Sg$&}x7-aY7vO|p1s;@r`S>`1^hKsg({CgA}C(!JLXAR2f%{5Gt7
zaAqpQb3mI-b(b0oYw4Bs+r7o_!<kL}8uE<NQI}6RHF!^Z_VySm6d_uf+id_(UPaj!
z<lxsHu-Xm at _MUQA;TtgPmU6$=UF_59*r1oSTXBiM%ls+KR#AKTy?EI-D<)wGD1QFb
zZb|1EuBTd0w9XX_Bv%_=4HTc4R{X|Mq}_S`K-!eLp$zSfib6Q$<YqlhNqMS1eZV}j
zCi^L-i_Jf8B~0!r;_XyP)SFKiTzbFVZG`j<r7We}=sO7!yf$=mc7I{mxC!QF*Ei%=
eH{=$*e88<1dHdrs+hJO~0NU#M=o~fMp#K5RF(lFe

literal 0
HcmV?d00001

diff --git a/docs/prune-simulator/index.html b/docs/prune-simulator/index.html
index 641ef435..861d560b 100644
--- a/docs/prune-simulator/index.html
+++ b/docs/prune-simulator/index.html
@@ -33,6 +33,9 @@
         .first-of-month {
             border-right: dashed black 4px;
         }
+        .clear-trigger {
+            background-image: url(./clear-trigger.png);
+        }
     </style>
 
     <script type="text/javascript" src="extjs/ext-all.js"></script>
diff --git a/docs/prune-simulator/prune-simulator.js b/docs/prune-simulator/prune-simulator.js
index 48c0a968..5533c2d6 100644
--- a/docs/prune-simulator/prune-simulator.js
+++ b/docs/prune-simulator/prune-simulator.js
@@ -265,6 +265,34 @@ Ext.onReady(function() {
 	},
     });
 
+    Ext.define('PBS.PruneSimulatorKeepInput', {
+	extend: 'Ext.form.field.Number',
+	alias: 'widget.prunesimulatorKeepInput',
+
+	allowBlank: true,
+	fieldGroup: 'keep',
+	minValue: 1,
+
+	listeners: {
+	    afterrender: function(field) {
+		this.triggers.clear.setVisible(field.value !== null);
+	    },
+	    change: function(field, newValue, oldValue) {
+		this.triggers.clear.setVisible(newValue !== null);
+	    },
+	},
+	triggers: {
+	    clear: {
+		cls: 'clear-trigger',
+		weight: -1,
+		handler: function() {
+		    this.triggers.clear.setVisible(false);
+		    this.setValue(null);
+		},
+	    },
+	},
+    });
+
     Ext.define('PBS.PruneSimulatorPanel', {
 	extend: 'Ext.panel.Panel',
 	alias: 'widget.prunesimulatorPanel',
@@ -560,58 +588,37 @@ Ext.onReady(function() {
 
 	keepItems: [
 	    {
-		xtype: 'numberfield',
+		xtype: 'prunesimulatorKeepInput',
 		name: 'keep-last',
-		allowBlank: true,
 		fieldLabel: 'keep-last',
-		minValue: 0,
 		value: 4,
-		fieldGroup: 'keep',
 	    },
 	    {
-		xtype: 'numberfield',
+		xtype: 'prunesimulatorKeepInput',
 		name: 'keep-hourly',
-		allowBlank: true,
 		fieldLabel: 'keep-hourly',
-		minValue: 0,
-		value: 0,
-		fieldGroup: 'keep',
 	    },
 	    {
-		xtype: 'numberfield',
+		xtype: 'prunesimulatorKeepInput',
 		name: 'keep-daily',
-		allowBlank: true,
 		fieldLabel: 'keep-daily',
-		minValue: 0,
 		value: 5,
-		fieldGroup: 'keep',
 	    },
 	    {
-		xtype: 'numberfield',
+		xtype: 'prunesimulatorKeepInput',
 		name: 'keep-weekly',
-		allowBlank: true,
 		fieldLabel: 'keep-weekly',
-		minValue: 0,
 		value: 2,
-		fieldGroup: 'keep',
 	    },
 	    {
-		xtype: 'numberfield',
+		xtype: 'prunesimulatorKeepInput',
 		name: 'keep-monthly',
-		allowBlank: true,
 		fieldLabel: 'keep-monthly',
-		minValue: 0,
-		value: 0,
-		fieldGroup: 'keep',
 	    },
 	    {
-		xtype: 'numberfield',
+		xtype: 'prunesimulatorKeepInput',
 		name: 'keep-yearly',
-		allowBlank: true,
 		fieldLabel: 'keep-yearly',
-		minValue: 0,
-		value: 0,
-		fieldGroup: 'keep',
 	    },
 	],
 
-- 
2.20.1






More information about the pbs-devel mailing list