From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A13E8616FA for ; Thu, 9 Jul 2020 14:30:43 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9737C12433 for ; Thu, 9 Jul 2020 14:30:13 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id AE27812426 for ; Thu, 9 Jul 2020 14:30:12 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 797A842F94 for ; Thu, 9 Jul 2020 14:30:12 +0200 (CEST) Date: Thu, 9 Jul 2020 14:30:02 +0200 (CEST) From: Dietmar Maurer To: Proxmox Backup Server development discussion , Dominik Csapak Message-ID: <3550210.377.1594297803141@webmail.proxmox.com> In-Reply-To: <20200709113821.9152-1-d.csapak@proxmox.com> References: <20200709113821.9152-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.3-Rev15 X-Originating-Client: open-xchange-appsuite X-SPAM-LEVEL: Spam detection results: 0 AWL 0.025 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] applied: [PATCH proxmox-backup 1/2] ui: add RunningTasksStore X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2020 12:30:43 -0000 applied both patches > On 07/09/2020 1:38 PM Dominik Csapak wrote: > > > so that we have a global store for running tasks > > Signed-off-by: Dominik Csapak > --- > www/MainView.js | 1 + > www/Makefile | 1 + > www/dashboard/RunningTasks.js | 14 +------------- > www/data/RunningTasksStore.js | 21 +++++++++++++++++++++ > 4 files changed, 24 insertions(+), 13 deletions(-) > create mode 100644 www/data/RunningTasksStore.js > > diff --git a/www/MainView.js b/www/MainView.js > index 062d78e..cb7a81d 100644 > --- a/www/MainView.js > +++ b/www/MainView.js > @@ -133,6 +133,7 @@ Ext.define('PBS.MainView', { > init: function(view) { > var me = this; > > + PBS.data.RunningTasksStore.startUpdate(); > me.lookupReference('usernameinfo').update({username:Proxmox.UserName}); > > // show login on requestexception > diff --git a/www/Makefile b/www/Makefile > index 29a3561..b205f67 100644 > --- a/www/Makefile > +++ b/www/Makefile > @@ -8,6 +8,7 @@ JSSRC= \ > form/UserSelector.js \ > form/RemoteSelector.js \ > form/DataStoreSelector.js \ > + data/RunningTasksStore.js \ > config/UserView.js \ > config/RemoteView.js \ > config/ACLView.js \ > diff --git a/www/dashboard/RunningTasks.js b/www/dashboard/RunningTasks.js > index 9b53d1b..e31218e 100644 > --- a/www/dashboard/RunningTasks.js > +++ b/www/dashboard/RunningTasks.js > @@ -54,20 +54,8 @@ Ext.define('PBS.RunningTasks', { > store: { > type: 'diff', > autoDestroy: true, > - autoDestroyRstore: true, > sorters: 'starttime', > - rstore: { > - type: 'update', > - autoStart: true, > - interval: 3000, > - storeid: 'pbs-running-tasks-dash', > - model: 'proxmox-tasks', > - proxy: { > - type: 'proxmox', > - // maybe separate api call? > - url: '/api2/json/nodes/localhost/tasks?running=1' > - }, > - }, > + rstore: PBS.data.RunningTasksStore, > }, > > columns: [ > diff --git a/www/data/RunningTasksStore.js b/www/data/RunningTasksStore.js > new file mode 100644 > index 0000000..d78c44e > --- /dev/null > +++ b/www/data/RunningTasksStore.js > @@ -0,0 +1,21 @@ > +Ext.define('PBS.data.RunningTasksStore', { > + extend: 'Proxmox.data.UpdateStore', > + > + singleton: true, > + > + constructor: function(config) { > + let me = this; > + config = config || {}; > + Ext.apply(config, { > + interval: 3000, > + storeid: 'pbs-running-tasks-dash', > + model: 'proxmox-tasks', > + proxy: { > + type: 'proxmox', > + // maybe separate api call? > + url: '/api2/json/nodes/localhost/tasks?running=1', > + }, > + }); > + me.callParent([config]); > + }, > +}); > -- > 2.20.1 > > > > _______________________________________________ > pbs-devel mailing list > pbs-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel