mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-08-04 23:58:37 +00:00
window: task viewer: code refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
53dc88d409
commit
5dc3b0fa00
@ -4,6 +4,11 @@ Ext.define('Proxmox.window.TaskProgress', {
|
||||
|
||||
taskDone: Ext.emptyFn,
|
||||
|
||||
width: 300,
|
||||
layout: 'auto',
|
||||
modal: true,
|
||||
bodyPadding: 5,
|
||||
|
||||
initComponent: function() {
|
||||
let me = this;
|
||||
|
||||
@ -14,7 +19,7 @@ Ext.define('Proxmox.window.TaskProgress', {
|
||||
let task = Proxmox.Utils.parse_task_upid(me.upid);
|
||||
|
||||
let statstore = Ext.create('Proxmox.data.ObjectStore', {
|
||||
url: "/api2/json/nodes/" + task.node + "/tasks/" + encodeURIComponent(me.upid) + "/status",
|
||||
url: `/api2/json/nodes/${task.node}/tasks/${encodeURIComponent(me.upid)}/status`,
|
||||
interval: 1000,
|
||||
rows: {
|
||||
status: { defaultValue: 'unknown' },
|
||||
@ -54,20 +59,16 @@ Ext.define('Proxmox.window.TaskProgress', {
|
||||
|
||||
Ext.apply(me, {
|
||||
title: gettext('Task') + ': ' + descr,
|
||||
width: 300,
|
||||
layout: 'auto',
|
||||
modal: true,
|
||||
bodyPadding: 5,
|
||||
items: pbar,
|
||||
buttons: [
|
||||
{
|
||||
text: gettext('Details'),
|
||||
handler: function() {
|
||||
let win = Ext.create('Proxmox.window.TaskViewer', {
|
||||
Ext.create('Proxmox.window.TaskViewer', {
|
||||
autoShow: true,
|
||||
taskDone: me.taskDone,
|
||||
upid: me.upid,
|
||||
});
|
||||
win.show();
|
||||
me.close();
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user