]>
git.proxmox.com Git - proxmox-backup.git/blob - www/dashboard/RunningTasks.js
1 Ext
.define('PBS.RunningTasks', {
2 extend
: 'Ext.grid.Panel',
3 alias
: 'widget.pbsRunningTasks',
5 title
: gettext('Running Tasks'),
6 emptyText
: gettext('No running tasks'),
12 xclass
: 'Ext.app.ViewController',
14 openTask: function(record
) {
16 let view
= me
.getView();
17 Ext
.create('Proxmox.window.TaskViewer', {
18 upid
: record
.data
.upid
,
19 endtime
: record
.data
.endtime
,
22 view
.fireEvent('taskopened', view
, record
.data
.upid
);
25 openTaskItemDblClick: function(grid
, record
) {
26 this.openTask(record
);
29 openTaskActionColumn: function(grid
, rowIndex
) {
30 this.openTask(grid
.getStore().getAt(rowIndex
));
33 render_status: function(value
) {
34 let cls
= 'times-circle critical';
36 cls
= 'check-circle good';
37 } else if (value
.startsWith('WARNINGS:')) {
38 cls
= 'exclamation-circle warning';
39 } else if (value
=== 'unknown') {
40 cls
= 'question-circle faded';
43 return `<i class="fa fa-${cls}"></i>`;
47 updateTasks: function(data
) {
49 me
.getStore().setData(data
);
53 itemdblclick
: 'openTaskItemDblClick',
60 rstore
: PBS
.data
.RunningTasksStore
,
67 renderer
: Proxmox
.Utils
.render_upid
,
72 dataIndex
: 'starttime',
73 renderer: function(value
) {
74 return Ext
.Date
.format(value
, "Y-m-d H:i:s");
80 dataIndex
: 'duration',
81 renderer: function(value
, md
, record
) {
82 return Proxmox
.Utils
.format_duration_human((Date
.now() - record
.data
.starttime
)/1000);
86 xtype
: 'actioncolumn',
90 iconCls
: 'fa fa-chevron-right',
91 tooltip
: gettext('Open Task'),
92 handler
: 'openTaskActionColumn',