]>
git.proxmox.com Git - proxmox-backup.git/blob - www/dashboard/RunningTasks.js
e31218efaf4bce3f80d4f1aceec2a38fce3655e3
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
,
23 openTaskItemDblClick: function(grid
, record
) {
24 this.openTask(record
);
27 openTaskActionColumn: function(grid
, rowIndex
) {
28 this.openTask(grid
.getStore().getAt(rowIndex
));
31 render_status: function(value
) {
32 let cls
= 'times-circle critical';
34 cls
= 'check-circle good';
35 } else if (value
.startsWith('WARNINGS:')) {
36 cls
= 'exclamation-circle warning';
37 } else if (value
=== 'unknown') {
38 cls
= 'question-circle faded';
41 return `<i class="fa fa-${cls}"></i>`;
45 updateTasks: function(data
) {
47 me
.getStore().setData(data
);
51 itemdblclick
: 'openTaskItemDblClick',
58 rstore
: PBS
.data
.RunningTasksStore
,
65 renderer
: Proxmox
.Utils
.render_upid
,
70 dataIndex
: 'starttime',
71 renderer: function(value
) {
72 return Ext
.Date
.format(value
, "Y-m-d H:i:s");
78 dataIndex
: 'duration',
79 renderer: function(value
, md
, record
) {
80 return Proxmox
.Utils
.format_duration_human((Date
.now() - record
.data
.starttime
)/1000);
84 xtype
: 'actioncolumn',
88 iconCls
: 'fa fa-chevron-right',
89 tooltip
: gettext('Open Task'),
90 handler
: 'openTaskActionColumn',