]>
git.proxmox.com Git - proxmox-backup.git/blob - www/dashboard/LongestTasks.js
1 Ext
.define('PBS.LongestTasks', {
2 extend
: 'Ext.grid.Panel',
3 alias
: 'widget.pbsLongestTasks',
5 title
: gettext('Longest Tasks (last Month)'),
10 emptyText
: gettext('No Tasks'),
13 xclass
: 'Ext.app.ViewController',
15 openTask: function(record
) {
17 let view
= me
.getView();
18 Ext
.create('Proxmox.window.TaskViewer', {
19 upid
: record
.data
.upid
,
20 endtime
: record
.data
.endtime
,
24 openTaskItemDblClick: function(grid
, record
) {
25 this.openTask(record
);
28 openTaskActionColumn: function(grid
, rowIndex
) {
29 this.openTask(grid
.getStore().getAt(rowIndex
));
32 render_status: function(value
) {
33 let cls
= 'times-circle critical';
35 cls
= 'check-circle good';
36 } else if (value
.startsWith('WARNINGS:')) {
37 cls
= 'exclamation-circle warning';
38 } else if (value
=== 'unknown') {
39 cls
= 'question-circle faded';
42 return `<i class="fa fa-${cls}"></i>`;
46 updateTasks: function(data
) {
48 me
.getStore().setData(data
);
52 itemdblclick
: 'openTaskItemDblClick',
58 autoDestroyRstore
: true,
70 storeid
: 'proxmox-tasks-dash',
72 model
: 'proxmox-tasks',
81 text
: gettext('Task'),
83 renderer
: Proxmox
.Utils
.render_upid
,
87 text
: gettext('Duration'),
88 dataIndex
: 'duration',
89 renderer
: Proxmox
.Utils
.format_duration_human
,
92 text
: gettext('Status'),
96 renderer
: 'render_status',
99 xtype
: 'actioncolumn',
103 iconCls
: 'fa fa-chevron-right',
104 tooltip
: gettext('Open Task'),
105 handler
: 'openTaskActionColumn',