Commit 707a1ea3 authored by Bas Lijnse's avatar Bas Lijnse

Fixed session id communication for the debug panels

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@290 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent eabc740c
......@@ -88,13 +88,13 @@ itasks.ApplicationPanel = Ext.extend(Ext.Panel, {
newtab.refresh();
});
debugpanel.getTaskForestButton().on('click',function() {
worktabs.openTaskForestTab();
worktabs.openTaskForestTab(apppanel);
});
debugpanel.getThreadTableButton().on('click',function() {
worktabs.openThreadTableTab();
worktabs.openThreadTableTab(apppanel);
});
debugpanel.getProcessTableButton().on('click',function() {
worktabs.openProcessTableTab();
worktabs.openProcessTableTab(apppanel);
});
},
getSessionId: function() {
......
......@@ -6,19 +6,23 @@ Ext.ns('itasks');
itasks.ProcessTableTabPanel = Ext.extend(Ext.Panel, {
applicationPanel: undefined,
initComponent: function () {
Ext.apply(this, {
title: 'Process table',
closable: true,
autoScroll: true,
cls: 'worktab-container',
autoLoad: {
url: 'handlers/processtable',
method: 'GET'
}
cls: 'worktab-container'
});
itasks.ProcessTableTabPanel.superclass.initComponent.apply(this, arguments);
},
setApplicationPanel: function(panel) {
this.applicationPanel = panel;
},
refresh: function() {
this.load({method: 'GET', url: 'handlers/processtable?session=' + this.applicationPanel.getSessionId()});
}
});
......
......@@ -6,19 +6,23 @@ Ext.ns('itasks');
itasks.TaskForestTabPanel = Ext.extend(Ext.Panel, {
applicationPanel: undefined,
initComponent: function () {
Ext.apply(this, {
title: 'Task forest',
closable: true,
autoScroll: true,
cls: 'worktab-container',
autoLoad: {
url: 'handlers/tasktreeforest',
method: 'GET'
}
cls: 'worktab-container'
});
itasks.TaskForestTabPanel.superclass.initComponent.apply(this, arguments);
},
setApplicationPanel: function (panel) {
this.applicationPanel = panel;
},
refresh: function() {
this.load({method: 'GET', url: 'handlers/tasktreeforest?session=' + this.applicationPanel.getSessionId()});
}
});
......
......@@ -6,19 +6,23 @@ Ext.ns('itasks');
itasks.ThreadTableTabPanel = Ext.extend(Ext.Panel, {
applicationPanel: undefined,
initComponent: function () {
Ext.apply(this, {
title: 'Thread table',
closable: true,
autoScroll: true,
cls: 'worktab-container',
autoLoad: {
url: 'handlers/threadtable',
method: 'GET'
}
cls: 'worktab-container'
});
itasks.ThreadTableTabPanel.superclass.initComponent.apply(this, arguments);
},
setApplicationPanel: function(panel) {
this.applicationPanel = panel;
},
refresh: function() {
this.load({method: 'GET', url: 'handlers/threadtable?session=' + this.applicationPanel.getSessionId()});
}
});
......
......@@ -37,37 +37,44 @@ itasks.WorkTabsPanel = Ext.extend(Ext.TabPanel, {
/**
* Opens the TaskForestTabPanel
*/
openTaskForestTab: function () {
openTaskForestTab: function (appPanel) {
var tab = this.getComponent("taskforesttab");
if(tab == undefined) {
tab = new itasks.TaskForestTabPanel({id: "taskforesttab"});
tab.setApplicationPanel(appPanel);
this.add(tab);
}
this.activate(tab);
tab.refresh();
return tab;
},
/**
* Opens the ThreadTableTabPanel
*/
openThreadTableTab: function () {
openThreadTableTab: function (appPanel) {
var tab = this.getComponent("threadtabletab");
if(tab == undefined) {
tab = new itasks.ThreadTableTabPanel({id: "threadtabletab"});
tab.setApplicationPanel(appPanel);
this.add(tab);
}
this.activate(tab);
tab.refresh();
return tab;
},
/**
* Opens the ProcessTableTabPanel
*/
openProcessTableTab: function () {
openProcessTableTab: function (appPanel) {
var tab = this.getComponent("processtabletab");
if(tab == undefined) {
tab = new itasks.ProcessTableTabPanel({id: "processtabletab"});
tab.setApplicationPanel(appPanel);
this.add(tab);
}
this.activate(tab);
tab.refresh();
return tab;
}
});
......
......@@ -54,8 +54,8 @@ handleWorkTabRequest mainTask request session hst
, stateTrace = stateTrace
, updateTrace = updateTrace
, subtreeTrace = subTreeTrace
} // create tab data record
= ({http_emptyResponse & rsp_data = toJSON content}, {hst & states = states, world = world}) // create the http response
} // create tab data record
= ({http_emptyResponse & rsp_data = toJSON content}, {hst & states = states, world = world}) // create the http response
where
mbStateTrace req states
......
......@@ -12,52 +12,51 @@ import InternaliTasksCommon, iTasksHtmlSupport
collectTaskList :: !(TaskDescription -> Bool) !HtmlTree -> [TaskDescription] // returns who created the task, the tasknr, and taskname
collectTaskList pred (taskdescr @@: tree)
# collected = collectTaskList pred tree
| pred taskdescr = [taskdescr:collected]
= collected
# collected = collectTaskList pred tree
| pred taskdescr = [taskdescr:collected]
= collected
collectTaskList pred (ntaskuser -@: tree)
= collectTaskList pred tree
= collectTaskList pred tree
collectTaskList pred (tree1 +|+ tree2)
# collection1 = collectTaskList pred tree1
# collection2 = collectTaskList pred tree2
= collection1 ++ collection2
# collection1 = collectTaskList pred tree1
# collection2 = collectTaskList pred tree2
= collection1 ++ collection2
collectTaskList pred (tree1 +-+ tree2)
# collection1 = collectTaskList pred tree1
# collection2 = collectTaskList pred tree2
= collection1 ++ collection2
# collection1 = collectTaskList pred tree1
# collection2 = collectTaskList pred tree2
= collection1 ++ collection2
collectTaskList pred (BT bdtg inputs)
= []
= []
collectTaskList pred (DivCode id tree)
= collectTaskList pred tree
= collectTaskList pred tree
determineTaskForTab :: !UserId !TaskNrId !HtmlTree !*HSt -> (!Bool,![HtmlTag],![InputId],!*HSt)
determineTaskForTab thisuser thistaskid tree hst
# mytree = determineTaskTree thisuser thistaskid tree
| isNothing mytree = (True,[],[],hst)
# (threadcode,taskname,mainbuts,subbuts,seltask,inputs,hst) = Filter True thisuser thisuser (fromJust mytree) hst
| isEmpty threadcode = (False,seltask, inputs, hst)
= (False,threadcode, inputs, hst)
| isEmpty threadcode = (False, seltask, inputs, hst)
= (False, threadcode, inputs, hst)
determineTaskTree :: !UserId !TaskNrId !HtmlTree -> Maybe HtmlTree
determineTaskTree thisuser thistaskid (taskdescr @@: tree)
| taskdescr.taskNrId == thistaskid = Just tree
= determineTaskTree thisuser thistaskid tree
| taskdescr.taskNrId == thistaskid = Just tree
= determineTaskTree thisuser thistaskid tree
determineTaskTree thisuser thistaskid (ntaskuser -@: tree)
| thisuser == ntaskuser = Nothing
= determineTaskTree thisuser thistaskid tree
| thisuser == ntaskuser = Nothing
= determineTaskTree thisuser thistaskid tree
determineTaskTree thisuser thistaskid (tree1 +|+ tree2)
# ntree1 = determineTaskTree thisuser thistaskid tree1
| isJust ntree1 = ntree1
= determineTaskTree thisuser thistaskid tree2
# ntree1 = determineTaskTree thisuser thistaskid tree1
| isJust ntree1 = ntree1
= determineTaskTree thisuser thistaskid tree2
determineTaskTree thisuser thistaskid (tree1 +-+ tree2)
# ntree1 = determineTaskTree thisuser thistaskid tree1
| isJust ntree1 = ntree1
= determineTaskTree thisuser thistaskid tree2
# ntree1 = determineTaskTree thisuser thistaskid tree1
| isJust ntree1 = ntree1
= determineTaskTree thisuser thistaskid tree2
determineTaskTree thisuser thistaskid (BT bdtg inputs)
= Nothing
= Nothing
determineTaskTree thisuser thistaskid (DivCode id tree)
= determineTaskTree thisuser thistaskid tree
= determineTaskTree thisuser thistaskid tree
noFilter :: !HtmlTree -> [HtmlTag]
noFilter (BT body inputs) = body
......@@ -99,7 +98,6 @@ where
, taskmode = Edit
, gc = Collect
}
initialTaskDescription
= { delegatorId = 0 // id of the work delegator
, taskWorkerId = 0 // id of worker on the task
......
......@@ -7,12 +7,12 @@ derive gForm []
derive gUpd []
Start :: *World -> *World
Start world = startTaskEngine (foreverTask myTask) world
Start world = startTaskEngine myTask world
myTask :: Task Void
myTask =
2 @:: editTask "Get Started" Void #>>
3 @:: ([Text "What do you want to tell your boss?"] ?>> editTask "Shout" "") =>> \msg ->
2 @:: ([Text "What do you want to tell your boss?"] ?>> editTask "Shout" "") =>> \msg ->
2 @:: ([Text "Worker says: ",Text msg] ?>> editTask "Ok" Void)
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment