Re: [Yxa-devel] [patch] Yaws node info page is broken

2009-11-30 Thread Fredrik Thulin
On Sat, 2009-11-28 at 13:39 +0100, Mikael Magnusson wrote:
> On Sat, 2009-11-28 at 12:40 +0100, Mikael Magnusson wrote:
> > The yaws node info page (node_info.yaws) broke when the transactionstate
> > record was removed from transactionstatelist.hrl. See patch.
> > 
> > /Mikael
> 
> Patch...

Applied, thanks! r1751.

I'm making a mental note to run Dialyzer on all of trunk/ - not just
trunk/src/.

/Fredrik


___
Yxa-devel mailing list
Yxa-devel@lists.su.se
https://lists.su.se/mailman/listinfo/yxa-devel


Re: [Yxa-devel] [patch] Yaws node info page is broken

2009-11-28 Thread Mikael Magnusson
On Sat, 2009-11-28 at 12:40 +0100, Mikael Magnusson wrote:
> The yaws node info page (node_info.yaws) broke when the transactionstate
> record was removed from transactionstatelist.hrl. See patch.
> 
> /Mikael

Patch...
diff --git a/src/transactionlayer/transactionstatelist.erl b/src/transactionlayer/transactionstatelist.erl
index 68a6f04..dd9d436 100644
--- a/src/transactionlayer/transactionstatelist.erl
+++ b/src/transactionlayer/transactionstatelist.erl
@@ -522,7 +522,12 @@ extract([pid | T], TState, Res) when is_record(TState, transactionstate) ->
 extract([appdata | T], TState, Res) when is_record(TState, transactionstate) ->
 extract(T, TState, lists:append(Res, [TState#transactionstate.appdata]));
 extract([response_to_tag | T], TState, Res) when is_record(TState, transactionstate) ->
-extract(T, TState, lists:append(Res, [TState#transactionstate.response_to_tag])).
+extract(T, TState, lists:append(Res, [TState#transactionstate.response_to_tag]));
+extract([description | T], TState, Res) when is_record(TState, transactionstate) ->
+extract(T, TState, lists:append(Res, [TState#transactionstate.description]));
+extract([result | T], TState, Res) when is_record(TState, transactionstate) ->
+extract(T, TState, lists:append(Res, [TState#transactionstate.result])).
+
 
 %%
 %% @spec(TState, Value) ->
diff --git a/yaws/docroot/node_info.yaws b/yaws/docroot/node_info.yaws
index a9a71f8..9e007cc 100644
--- a/yaws/docroot/node_info.yaws
+++ b/yaws/docroot/node_info.yaws
@@ -10,7 +10,6 @@
 %%
 %% Include files
 %%
--include("transactionstatelist.hrl").
 
 %%
 %% Macros
@@ -199,7 +198,7 @@ transactionlayer(A, Node, Statistics) when is_list(Statistics) ->
 %%
 get_transactionlist(Node) ->
 {ok, TL} = rpc:call(Node, gen_server, call, [transactionlayer, {monitor_get_transactionlist}]),
-Content = case print_transactionlist(TL, []) of
+Content = case print_transactionlist(Node, TL, []) of
 		  [] ->
 		  {tr, [], [
 {td, [{colspan, 2}], ["None right now"]}
@@ -218,26 +217,30 @@ get_transactionlist(Node) ->
 
 
 %%
-%% Function: print_transactionlist(TL, [])
+%% Function: print_transactionlist(Node, TL, [])
+%%   Node = atom(), node we are to talk with
 %%   TL = list() of transactionstate record()
 %% Descrip.: Format list of transactions.
 %% Returns : HTML = term(), Yaws html data
 %%
-print_transactionlist(none, []) ->
+print_transactionlist(_Node, none, []) ->
 [];
-print_transactionlist([H | T], Res) when is_record(H, transactionstate) ->
+print_transactionlist(Node, [H | T], Res) when is_tuple(H) ->
+[Descr0, Result0] =
+rpc:call(Node, transactionstatelist, extract,
+ [[description, result], H]),
 This = {tr, [], [
-		 {td, [], case H#transactionstate.description of
+		 {td, [], case Descr0 of
  [] -> "empty";
  Descr -> Descr
 			  end},
-		 {td, [], case H#transactionstate.result of
+		 {td, [], case Result0 of
  none -> "none yet";
  Result -> Result
 			  end}
 		]},
-print_transactionlist(T, [This | Res]);
-print_transactionlist([], Res) ->
+print_transactionlist(Node, T, [This | Res]);
+print_transactionlist(_Node, [], Res) ->
 lists:reverse(Res).
 
 
___
Yxa-devel mailing list
Yxa-devel@lists.su.se
https://lists.su.se/mailman/listinfo/yxa-devel