diff --git a/www/MainView.js b/www/MainView.js index 062d78e0..cb7a81df 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 29a35619..b205f677 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 9b53d1be..e31218ef 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 00000000..d78c44e0 --- /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]); + }, +});