Commit 274443a1 authored by Bas Lijnse's avatar Bas Lijnse

Trace interface reduced to just one checkbox

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@317 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent ba2680fc
......@@ -39,36 +39,24 @@ itasks.DebugPanel = Ext.extend(Ext.form.FormPanel, {
iconCls: 'icon-process-table'
}]
},{
id: 'tracing',
id: 'options',
xtype: 'fieldset',
title: 'Tracing',
title: 'Options',
defaultType: 'checkbox',
hideLabels: true,
autoHeight: true,
layout: 'form',
items: [{
id: 'traceStates',
boxLabel: 'State information'
},{
id: 'traceUpdates',
boxLabel: 'Form updates'
},{
id: 'traceSubTrees',
boxLabel: 'Task sub-trees'
id: 'trace',
boxLabel: 'Enable trace'
}]
}]
});
itasks.DebugPanel.superclass.initComponent.apply(this,arguments);
},
traceStates: function () {
return this.getComponent('tracing').getComponent('traceStates').getValue();
},
traceUpdates: function () {
return this.getComponent('tracing').getComponent('traceUpdates').getValue();
},
traceSubTrees: function () {
return this.getComponent('tracing').getComponent('traceSubTrees').getValue();
traceEnabled: function() {
return this.getComponent('options').getComponent('trace').getValue();
},
getTaskForestButton: function() {
return this.getComponent(0).getComponent(0);
......
......@@ -280,16 +280,8 @@ itasks.WorkTabPanel = Ext.extend(Ext.Panel, {
params['state'] = Ext.encode(this.state);
//Check if we need to request trace info
if (this.debugPanel != undefined) {
if(this.debugPanel.traceStates()) {
params['traceStates'] = 1;
}
if(this.debugPanel.traceUpdates()) {
params['traceUpdates'] = 1;
}
if(this.debugPanel.traceSubTrees()) {
params['traceSubTrees'] = 1;
}
if (this.debugPanel != undefined && this.debugPanel.traceEnabled()) {
params['trace'] = 1;
}
//Add the session id
params = this.applicationPanel.addSessionParam(params);
......
......@@ -25,10 +25,7 @@ derive JSONEncode TabContent, TaskStatus, InputId, UpdateEvent, HtmlState, Stora
*/
handleWorkTabRequest :: !(Task a) !HTTPRequest !Session *HSt -> (!HTTPResponse, !*HSt) | iData a
handleWorkTabRequest mainTask request session hst
# thisUserId = session.Session.userId // fetch user id from the session
# taskId = http_getValue "taskid" request.arg_get "error" // fetch task id of the tab selecetd
# (toServer, htmlTree, maybeError, _, _, hst)
= calculateTaskTree thisUserId traceOn False False mainTask hst // calculate the TaskTree given the id of the current user
# (toServer, htmlTree, maybeError, _, _, hst) = calculateTaskTree thisUserId traceOn False False mainTask hst // calculate the TaskTree given the id of the current user
# (taskStatus,html,inputs) = determineTaskForTab thisUserId taskId htmlTree // filter out the code and inputs to display in this tab
# (htmlstates,hst) = getPageStates hst // Collect states that must be temporarily stored in the browser
# hst =: {states} = storeStates hst // Write states that are stored on the server
......@@ -44,10 +41,9 @@ handleWorkTabRequest mainTask request session hst
])
Nothing
# tempMessage = case taskStatus of
TaskFinished -> "TaskFinished"
TaskDeleted -> "TaskDeleted"
TaskActivated -> "TaskActivated"
TaskFinished -> "TaskFinished"
TaskDeleted -> "TaskDeleted"
TaskActivated -> "TaskActivated"
# content =
{TabContent
| status = taskStatus
......@@ -63,11 +59,9 @@ handleWorkTabRequest mainTask request session hst
= ({http_emptyResponse & rsp_data = toJSON content}, {hst & states = states}) // create the http response
where
traceOn = http_getValue "traceStates" request.arg_post "" == "1"
traceUpdatesOn = http_getValue "traceUpdates" request.arg_post "" == "1"
traceSubTreesOn = http_getValue "traceSubTrees" request.arg_post "" == "1"
thisUserId = session.Session.userId // fetch user id from the session
taskId = http_getValue "taskid" request.arg_get "error" // fetch task id of the tab selecetd
traceOn = http_getValue "trace" request.arg_post "" == "1"
mbStateTrace req states
| traceOn
......@@ -77,13 +71,13 @@ where
| otherwise
= (Nothing, states)
mbUpdateTrace req states
| traceUpdatesOn
| traceOn
# (trace,states) = traceUpdates states
= (Just (toString trace), states)
| otherwise
= (Nothing, states)
mbSubTreeTrace req thisUserId taskId htmlTree
| traceSubTreesOn
| traceOn
= Just (toString (getTraceFromTaskTree thisUserId taskId htmlTree))
| otherwise
= Nothing
......
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