ui: Replication: use render_duration from widget-toolkit

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-05-28 13:02:52 +02:00 committed by Thomas Lamprecht
parent 1a664b0f9d
commit 1081c005f2
2 changed files with 1 additions and 28 deletions

View File

@ -536,26 +536,6 @@ Ext.define('PVE.Utils', { utilities: {
return msg; return msg;
}, },
format_duration_short: function(ut) {
if (ut < 60) {
return ut.toFixed(1) + 's';
}
if (ut < 3600) {
var mins = ut / 60;
return mins.toFixed(1) + 'm';
}
if (ut < 86400) {
var hours = ut / 3600;
return hours.toFixed(1) + 'h';
}
var days = ut / 86400;
return days.toFixed(1) + 'd';
},
contentTypes: { contentTypes: {
'images': gettext('Disk image'), 'images': gettext('Disk image'),
'backup': gettext('VZDump backup file'), 'backup': gettext('VZDump backup file'),
@ -836,13 +816,6 @@ Ext.define('PVE.Utils', { utilities: {
return Ext.Date.format(new Date(value * 1000), 'l d F Y H:i:s'); return Ext.Date.format(new Date(value * 1000), 'l d F Y H:i:s');
}, },
render_duration: function(value) {
if (value === undefined) {
return '-';
}
return PVE.Utils.format_duration_short(value);
},
calculate_mem_usage: function(data) { calculate_mem_usage: function(data) {
if (!Ext.isNumeric(data.mem) || if (!Ext.isNumeric(data.mem) ||
data.maxmem === 0 || data.maxmem === 0 ||

View File

@ -382,7 +382,7 @@ Ext.define('PVE.grid.ReplicaView', {
text: gettext('Duration'), text: gettext('Duration'),
dataIndex: 'duration', dataIndex: 'duration',
width: 60, width: 60,
renderer: PVE.Utils.render_duration renderer: Proxmox.Utils.render_duration
}, },
{ {
text: gettext('Next Sync'), text: gettext('Next Sync'),