mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-11 20:17:19 +00:00
ui: Replication: use render_duration from widget-toolkit
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
1a664b0f9d
commit
1081c005f2
@ -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 ||
|
||||||
|
@ -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'),
|
||||||
|
Loading…
Reference in New Issue
Block a user