ui: add RunningTasksStore
so that we have a global store for running tasks Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
bf7e2a4648
commit
cc83c13660
@ -133,6 +133,7 @@ Ext.define('PBS.MainView', {
|
|||||||
init: function(view) {
|
init: function(view) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
PBS.data.RunningTasksStore.startUpdate();
|
||||||
me.lookupReference('usernameinfo').update({username:Proxmox.UserName});
|
me.lookupReference('usernameinfo').update({username:Proxmox.UserName});
|
||||||
|
|
||||||
// show login on requestexception
|
// show login on requestexception
|
||||||
|
@ -8,6 +8,7 @@ JSSRC= \
|
|||||||
form/UserSelector.js \
|
form/UserSelector.js \
|
||||||
form/RemoteSelector.js \
|
form/RemoteSelector.js \
|
||||||
form/DataStoreSelector.js \
|
form/DataStoreSelector.js \
|
||||||
|
data/RunningTasksStore.js \
|
||||||
config/UserView.js \
|
config/UserView.js \
|
||||||
config/RemoteView.js \
|
config/RemoteView.js \
|
||||||
config/ACLView.js \
|
config/ACLView.js \
|
||||||
|
@ -54,20 +54,8 @@ Ext.define('PBS.RunningTasks', {
|
|||||||
store: {
|
store: {
|
||||||
type: 'diff',
|
type: 'diff',
|
||||||
autoDestroy: true,
|
autoDestroy: true,
|
||||||
autoDestroyRstore: true,
|
|
||||||
sorters: 'starttime',
|
sorters: 'starttime',
|
||||||
rstore: {
|
rstore: PBS.data.RunningTasksStore,
|
||||||
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'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
columns: [
|
columns: [
|
||||||
|
21
www/data/RunningTasksStore.js
Normal file
21
www/data/RunningTasksStore.js
Normal file
@ -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]);
|
||||||
|
},
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user